### Customize Client Information with Decorators (Dart) Source: https://github.com/kent1011/client_information/blob/master/README.md This snippet demonstrates how to use the `decorators` parameter when fetching client information to modify specific values. The example shows how to add a prefix and application name to the `deviceId`. ```Dart var information = await ClientInformation.fetch( // you can pass decorators to decoration the value before it return. decorators: ClientInformationDecorators( deviceId: (oriInfo, value) => 'prefix-$value-${oriInfo.applicationName}', ), ); ``` -------------------------------- ### Decorate Client Information using Extension Method (Dart) Source: https://github.com/kent1011/client_information/blob/master/README.md This example illustrates how to apply decorations to an already fetched `ClientInformation` object using an extension method. It shows how to append a suffix string to the `deviceId`. ```Dart var information = await ClientInformation.fetch(); print('Original DeviceId: ${information.deviceId}'); // Original DeviceId: EA625164-4XXX-XXXX-XXXXXXXXXXXX var decoratedInfo = information.decoration(deviceId: (oriInfo, value) => '$value-some-suffix-string-here'); print('Decorated DeviceId: ${decoratedInfo.deviceId}'); // Decorated DeviceId: EA625164-4XXX-XXXX-XXXXXXXXXXXX-some-suffix-string-here ``` -------------------------------- ### Mock Client Information for Testing (Dart) Source: https://github.com/kent1011/client_information/blob/master/README.md This snippet provides a complete example of how to set up and tear down mock data for `ClientInformation` in a Dart test file. It demonstrates using `ClientInformation.mockOn` to define mock values and `ClientInformation.mockOff` to disable mock mode, ensuring consistent test results. ```Dart setUp(() async { // Change to "MockMode" and set the default data you need. ClientInformation.mockOn( deviceId: 'mock_device_id', osName: 'MyCustomOS'); }); tearDown(() { // Close the "MockMode" in tearDown method ClientInformation.mockOff(); }); // Run your test test('`deviceId` will be "mock_device_id"', () async { ClientInformation info = await ClientInformation.fetch(); expect(info.deviceId, 'mock_device_id'); }); ``` -------------------------------- ### Import client_information Package in Dart Source: https://github.com/kent1011/client_information/blob/master/README.md After adding the dependency, include the `client_information` package in your Dart files to access its classes and functions. ```Dart import 'package:client_information/client_information.dart'; ``` -------------------------------- ### Add client_information Dependency to Flutter Project Source: https://github.com/kent1011/client_information/blob/master/README.md To integrate the `client_information` plugin into your Flutter application, add the specified version as a dependency in your `pubspec.yaml` file. ```YAML dependencies: ... client_information: ^2.2.0 ``` -------------------------------- ### Client Information Attributes Reference Source: https://github.com/kent1011/client_information/blob/master/README.md Comprehensive reference for the attributes provided by the `client_information` plugin, detailing their availability and specific notes across iOS, Android, and Web platforms for each information type. ```APIDOC Application Information: applicationId: String iOS: ⭕ bundleIdentifier Android: ⭕ package name Web: ❌ default: application name applicationType: String (app/web) iOS: ⭕ Android: ⭕ Web: ⭕ applicationName: String iOS: ⭕ Android: ⭕ Web: ⭕ applicationVersion: String iOS: ⭕ Android: ⭕ Web: ⭕ applicationBuildCode: String iOS: ⭕ Android: ⭕ Web: ⭕ Software Information: softwareName: String iOS: ⭕ OS name Android: ⭕ OS name Web: ⭕ Browser name softwareVersion: String iOS: ⭕ OS version Android: ⭕ OS version Web: ⭕ Browser version Operating System Information: osName: String iOS: ⭕ OS name Android: ⭕ OS name Web: ⚠️ OS name (*unknown possible) osVersion: String iOS: ⭕ OS version Android: ⭕ OS version Web: ⚠️ OS Version (*unknown possible) osVersionCode: String iOS: ⭕ iOS version(number) Android: ⭕ Android API level Web: ⚠️ OS Version(number) (*unknown: -1) Device Information: deviceId: String iOS: ⭕ Android: ⭕ Web: ⭕ (Web projects use uuid package to generate unique string and save to browser's cookie) deviceName: String iOS: ⭕ Android: ⭕ Web: ❌ default: osName osVersion / browserName browserVersion (e.g. iOS 14 / Chrome 88.0) ``` -------------------------------- ### Retrieve and Access Client Information in Dart Source: https://github.com/kent1011/client_information/blob/master/README.md Asynchronously fetch client details using `ClientInformation.fetch()`. The returned `ClientInformation` object provides access to various properties like `deviceId` and `osName`. ```Dart // Get client information ClientInformation info = await ClientInformation.fetch(); print(info.deviceId); // EA625164-4XXX-XXXX-XXXXXXXXXXXX print(info.osName); // iOS ``` -------------------------------- ### Open iOS Project in Xcode Source: https://github.com/kent1011/client_information/blob/master/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md This command opens the iOS Runner Xcode workspace for a Flutter project, which is necessary to access and modify project assets like launch screen images within Xcode. ```Shell open ios/Runner.xcworkspace ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.