### Running Project Setup Script (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Execute the project's setup script, likely performing additional configuration or tasks. ```Shell $ ./setup.sh ``` -------------------------------- ### Example JSON Schema Parser Command (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md An example command demonstrating how to use the `JsonSchemaParser` tool with specific input files. ```Shell $ flutter pub run lib/tools/parser.dart active_symbols_receive.json ActiveSymbols ``` -------------------------------- ### Getting Flutter Project Dependencies (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Fetch all required dependencies for the Flutter project using `flutter pub get`. ```Shell $ flutter pub get ``` -------------------------------- ### Initializing Git Submodules (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Initialize the Git submodules configured in the repository. ```Shell $ git submodule init ``` -------------------------------- ### Initializing Flutter Deriv API (Dart) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Use `APIInitializer` to prepare the API instance for dependency injection. The `isMock` parameter can be set to `true` for testing purposes. ```Dart APIInitializer().initialize(); ``` -------------------------------- ### Running Flutter Project Tests (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Execute the test suite for the Flutter project using the `flutter test` command. ```Shell $ flutter test ``` -------------------------------- ### Generating Dart Documentation (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Generate API documentation for the Dart project using the `dartdoc` tool. ```Shell $ dartdoc ``` -------------------------------- ### Navigating into Repository Directory (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Change the current directory to the cloned `flutter-deriv-api` repository directory. ```Shell $ cd flutter-deriv-api ``` -------------------------------- ### Cloning Flutter Deriv API Repository (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Clone the Flutter Deriv API repository from GitHub using the `git clone` command. ```Shell $ git clone https://github.com/regentmarkets/flutter-deriv-api.git ``` -------------------------------- ### Opening Xcode Workspace (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md This command opens the Xcode workspace for the iOS part of the Flutter project, allowing access to project settings and assets like the launch screen images. ```Shell open ios/Runner.xcworkspace ``` -------------------------------- ### Adding Flutter Deriv API as Git Submodule (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Add the Flutter Deriv API repository as a Git submodule to your project. ```Shell $ git submodule add https://github.com/regentmarkets/flutter-deriv-api.git ``` -------------------------------- ### Adding Flutter Deriv API as Git Library (YAML) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Include the Flutter Deriv API package in your project's `pubspec.yaml` file by referencing its Git repository URL and branch (`master`). ```YAML dependencies: ... flutter_deriv_api: git: url: https://github.com/regentmarkets/flutter-deriv-api.git ref: master ``` -------------------------------- ### Running JSON Schema Parser Tool (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Execute the `JsonSchemaParser` tool provided with the library, specifying the path to a JSON schema file and the desired main class name. ```Shell $ flutter pub run lib/tools/parser.dart ``` -------------------------------- ### Running Dart Build Runner (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Execute the Dart build runner to generate necessary files (e.g., for serialization, dependency injection) with the option to delete conflicting outputs. ```Shell $ dart run build_runner build --delete-conflicting-outputs ``` -------------------------------- ### Adding Flutter Deriv API as Path Dependency (YAML) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Include the Flutter Deriv API package in your project's `pubspec.yaml` file by referencing its local path relative to your project root, typically used when added as a submodule. ```YAML dependencies: ... flutter_deriv_api: path: ./flutter-deriv-api/ ``` -------------------------------- ### Connecting to Deriv WebSocket (Dart) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Establish a connection to the WebSocket using the `connect` method of the `BaseAPI` instance. Requires a `ConnectionInformation` object with application details and optional callbacks for connection events. ```Dart final BaseAPI api = Injector()(); api.connect( ConnectionInformation( appId: ..., brand: ..., endpoint: ..., language: ..., ), onDone: () async { ... }, onOpen: () async { ... }, printResponse: true, ); ``` -------------------------------- ### Calling Deriv API via Abstraction Layer (Dart) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Invoke API calls using the provided abstraction layer classes like `Ping`. This method simplifies common API requests. ```Dart final Ping ping = await Ping.ping(); print(ping.succeeded); ``` -------------------------------- ### Defining Subscription Compare Predicate (Dart) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Define a custom comparison function (`Compare Predicate`) to control how the `Subscription Manager` checks for duplicate subscription requests, overriding the default `Equatable` comparison. ```Dart bool getComparePredicate({ bool equatableResult, PendingRequest pendingRequest, Request request, }) { SomeRequest otherRequest = pendingRequest.request as SomeRequest; SomeRequest currentRequest = request as SomeRequest; return equatableResult && otherRequest.param01 == currentRequest.param01 && ...; } ``` -------------------------------- ### Calling Deriv API Directly via BaseAPI (Dart) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Make API calls directly using the `call` method of the `BaseAPI` instance. This requires passing a specific request object like `PingRequest`. ```Dart final BaseAPI api = Injector()(); final PingResponse response = await api.call(request: const PingRequest()); print(response.ping); ``` -------------------------------- ### Updating Git Submodules (Shell) Source: https://github.com/deriv-com/flutter-deriv-api/blob/master/README.md Update the Git submodules to their latest commits as specified by the parent repository or the remote branch. ```Shell $ git submodule update --remote ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.