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:
- Place the
hydra_github_cred.env
andsetup_local.sh
files in the same folder. - Open Terminal and change the current working directory to that folder.
- Run the following command:
./setup_local.sh
- 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:
- Set the environment variables listed in
hydra_github_cred.env
. Ensure the variable names and values match exactly what is in the file. - 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:
- Create a folder named
capillary
in the root directory of your Flutter project. - Rename the
hydra-config.json
template file tohydra-config.json
and move the file to thecapillary
folder. - Optionally, change the values in the
hydra-config.json
file as required for your project. - In your pubspec.yaml, add the capillary folder to the assets section as shown below:
assets: - capillary/
- Get the dependencies by running this command in your terminal:
flutter pub get
- 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.
Updated about 24 hours ago