--- title: "Implement Flutter SDK" url: https://docs.catalyst.zoho.com/en/sdk/flutter/v2/implement-flutter-sdk/ description: "After setting up the working environment for developing the Flutter app in Android or iOS, you must install, import, and initialize Flutter SDK in your project." last_updated: 2025-11-19T15:07:41Z service: All Services type: general related_links: - name: "Environments" url: /en/deployment-and-billing/environments/introduction/#introduction --- # Implement Flutter SDK in your Project After setting up the working environment for developing the Flutter app primarily in Android or iOS and creating the Flutter project in the IDE, you can now proceed to implement the Catalyst Flutter SDK in your Flutter project. When you create a Flutter project, a basic [`pubspec.yaml`](https://docs.flutter.dev/tools/pubspec) file is generated and located at the top of the project tree. This file contains the metadata about the project and specifies the dependencies that the project requires. ### Install the SDK You will need to add the following configurations to implement the Catalyst Flutter SDK to the `pubspec.yaml` of your Flutter project: ```bash dependencies: zcatalyst_sdk: ^2.2.1 ``` To install the Flutter SDK in your project, you will need to execute the following command from your IDE's terminal: ```bash flutter pub get ``` > **Note**: You can also get this package in the following ways in your IDE: * VS Code: Click **Get Packages** located in right side of the action ribbon at the top of `pubspec.yaml` indicated by the Download icon. * Android Studio/IntelliJ: Click **Pub get** in the action ribbon at the top of `pubspec.yaml`. #### Alternate Method to install the SDK: You can execute the following command directly from your IDE's terminal in your Flutter project's directory to install the Flutter SDK, instead of adding the configurations in the `pubspec.yaml` file as mentioned above: ```bash flutter pub add zcatalyst_sdk ``` ### Import the SDK To import the SDK in the Dart code, you will need to add the following line of code in the the `lib`/`main.dart` file in your Flutter project directory: ```bash import 'package:zcatalyst_sdk/zcatalyst_sdk.dart'; ``` ### Initialize the SDK You must initialize the Catalyst SDK to enable the functioning of the methods and features defined in the SDK package. Therefore, before you configure your app to consume the SDK methods, you must initialize the SDK in your `main()` function using the `ZCatalystApp.init()` method in any one of the following methods: #### 1. Using the Catalyst Configuration File: The configuration function that you downloaded previously for [Android](https://docs.catalyst.zoho.com/en/sdk/flutter/v2/setup-for-android/#step-1-register-your-android-app-with-catalyst) or [iOS](https://docs.catalyst.zoho.com/en/sdk/flutter/v2/setup-for-ios/#step-1-register-your-ios-app-with-catalyst) will indicate the environment of the app. Similar to including the appropriate configuration file (`app_configuration_development.properties` / `app_configuration_production.properties` for Android and `AppConfigurationDevelopment.plist` / `AppConfigurationProduction.plist` for iOS) based on the [environment](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/introduction) in your app's project, you must initialize the SDK for the appropriate environment. **By specifying the environment:** In this method, you must set the required configuration and specify the `environment` of your app as either `DEVELOPMENT` or `PRODUCTION`, and pass it to the `init()` method through the `ZCatalystApp` class as shown below: ```bash ZCatalystApp.init({ ZCatalystEnvironment? environment, }); ``` A sample code snippet is shown below: ```bash void main() async { try { await ZCatalystApp.init(environment: ZCatalystEnvironment.DEVELOPMENT); } on ZCatalystException catch (ex) { print('Initialized Failed: ${ex.toString()}'); } } ``` **Without specifying the environment:** If the `environment` is not specified in the SDK initialization, it would be considered as `PRODUCTION` by default. Therefore, if your app is operating in the Production environment, you can initialize the SDK directly in the following way: ```bash await ZCatalystApp.init(); ``` A sample code snippet is shown below: ```bash void main() async { try { await ZCatalystApp.init(); } on ZCatalystException catch (ex) { print('Initialized Failed: ${ex.toString()}'); } } ``` > **Note**: If you make any changes to the Android or iOS configuration file, you must reinitialize the SDK. #### 2. By passing the custom SDK Configuration Object: Alternatively, you can initialize the Flutter SDK by building a custom `ZCatalystSDKConfigs` object that you can pass using the `ZCatalystSDKConfigsBuilder` class. **ZCatalystSDKConfigs Object** The `ZCatalystSDKConfigsBuilder` class has the following configuration properties:
Properties Datatype Description
`environment` `ZCatalystEnvironment` The [environment](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/introduction) under which the app is currently running
`apiBaseURL` String The URL of the Catalyst server through which the internal API is called. You must use the appropriate URL ([development URL](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/development-environment/#function-url-and-web-app-url-in-the-development-environment) or [production URL](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/production-environment/#function-url-and-web-app-url-in-the-production-environment)), based on the environment you are working in.
`clientID` String Unique identifier of your app client registered in Catalyst. This is received in the configuration file.
`clientSecret` String Secret value generated for a specific `clientID`, which is passed along with the API hits. This is received in the configuration file.
`projectID` int The [unique ID](https://docs.catalyst.zoho.com/en/getting-started/set-up-a-catalyst-project/general-settings/) of your Catalyst Project
`redirectURL` String The callback URL of your app that you provided while creating a package for [Android](https://docs.catalyst.zoho.com/en/sdk/flutter/v2/setup-for-android/) or [iOS](https://docs.catalyst.zoho.com/en/sdk/flutter/v2/setup-for-ios/) in the console
`portalID` String Unique identifier received in the configuration file while setting up the Android or iOS app
`oauthScopes` String The scopes that would be used by the app to access the Catalyst APIs from your project. You can find the available OAuth scopes [here](https://docs.catalyst.zoho.com/en/api/oauth2/scopes/#Scopes).
`JWTClientID` String The client ID property of the custom server token (JSON Web Token token) generated for third-party authentication to be passed to the client
`JWTClientSecret` String The client secret property of the custom server token (JSON Web Token token) generated for third-party authentication to be passed to the client
This `ZCatalystSDKConfigs` object can now be passed using the `ZCatalystSDKConfigsBuilder` class as shown below: ```bash ZCatalystSDKConfigs sdkConfigs = ZCatalystSDKConfigsBuilder( apiBaseURL: 'https://api.catalyst.zoho.com', accountsPortalBaseURL: 'https://accounts.zoho.com', clientID: '100****************************FX', clientSecret: '19ed***************************2s', environment: ZCatalystEnvironment.DEVELOPMENT, oauthScopes: 'ZOHOCATALYST.tables.rows.ALL, ZOHOCATALYST.tables.columns.ALL', portalID: '10******79', projectID: 28*******90, redirectURL: '*****') .setUserAgent("ZCatalyst Sample App") .build(); try { await ZCatalystApp.init(sdkConfigs: sdkConfigs); } on ZCatalystException catch (ex) { print('Initialized Failed: ${ex.toString()}'); } ``` If the SDK is successfully initialized, the app will invoke the component methods and function as intended.