Install Flutter SDK

Obtaining GitHub Access to Hydra SDK

To use the flutter-hydra-lib plugin in your project, you will first need to set up your GitHub access. This involves setting shell environment variables and updating your system's Git configuration. Shell scripts are provided to help you with this process.

Developer system setup

Use the setup_local.sh script to set up your system. To setup the environment follow these steps:

  1. Place the hydra_github_cred.env and setup_local.sh files in the same folder.
  2. Open Terminal and change the current working directory to that folder.
  3. Run the following command:
    ./setup_local.sh
    
  4. After the script finishes, restart your terminal. If you are using VS Code or Android Studio, restart the editor.

Set up Continuous Integration and Continuous Delivery (CI/CD)

To set up CI/CD, follow these steps:

  1. Set the environment variables listed in hydra_github_cred.env. Ensure the variable names and values match exactly what is in the file.
  2. After setting the environment variables, run the setup_cicd.sh script.

Configuring Flutter

You need to add two dependencies to your pubspec.yaml file. The ref parameter specifies a particular version of the dependency. When specifying the version number , ensure you prefix it with "v".

Add the following dependencies to your pubspec.yaml:

capillary_hydra:
 git:
   url: https://github.com/Capillary/flutter-hydra-lib.git
   ref: v1.0.2
   path: capillary_hydra


capillary_hydra_platform_interface:
 git:
   url: https://github.com/Capillary/flutter-hydra-lib.git
   ref: v1.0.2
   path: capillary_hydra_platform_interface

To add a configuration file as an asset in your project, follow these steps:

  1. Create a folder named capillary in the root directory of your Flutter project.
  2. Rename the hydra-config.json template file to hydra-config.json and move the file to the capillary folder.
  3. Optionally, change the values in the hydra-config.json file as required for your project.
  4. In your pubspec.yaml, add the capillary folder to the assets section as shown below:
    assets:
      - capillary/
    
  5. Get the dependencies by running this command in your terminal:
    flutter pub get
    
  6. Invoke initializer for Hydra plugin in main function before runApp using the following:
    WidgetsFlutterBinding.ensureInitialized();
    HydraInitializer.initialize();
    

After configuring Flutter, use the following platform-specific installation.