User Guide: SDKs > Flutter SDK > Configuring the Flutter SDK
Configuring the Flutter SDK
Before using Volt Foundry APIs for Flutter, you must configure Volt MX Flutter SDK into your IDEs, such as Visual Studio Code/Android Studio. Configuring the Volt MX Flutter SDK involves the following steps:
Configuring Flutter SDK for the project
To configure the Flutter SDK for the project, follow these steps:
-
Create a new Flutter Project
flutter create my_voltmx_test_app cd my_voltmx_test_app -
Add Plugin Dependency
-
Extract the downloaded
HCLVoltFoundry-flutter-sdk.zipfile. -
Copy this FlutterSDK into your Flutter project.
-
Add local dependency in pubspec.yaml
# pubspec.yaml dependencies: flutter: sdk: flutter voltmx_sdk_flutter: path: FlutterSDK/ -
-
Install Dependencies
flutter clean flutter pub get -
Configure Platform-Specific Settings
Android Configuration
-
android/app/build.gradle
configurations.configureEach { exclude(group = "com.google.code.gson", module = "gson") } -
android/build.gradle
maven { url = rootProject.projectDir.parentFile .resolve("FlutterSDK/android/local-maven-repo") .toURI() } -
In AndroidManifest.xml
a) Add the code below inside the application tag
tools:replace="android:label"b) All the below permissions
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />c) All the code snippets below
<service android:name="com.kony.sdkcommons.Network.NetworkCore.KNYHttpJobIntentService" android:exported="false" android:permission="android.permission.BIND_JOB_SERVICE" /> <service android:name="com.kony.sdkcommons.Network.NetworkCore.KNYHttpService" android:exported="false" />
-
iOS Configuration (ios/podfile)
platform: ios, '12.0'
# If using Firebase for messaging
pod 'Firebase/Core'
pod 'Firebase/Messaging'
Web Configuration (ios/podfile)
- In the Index.html file, add the following scripts in the body element
<script src="assets/packages/voltmx_sdk_flutter/assets/js/voltmx-sdk.js"></script>
<script src="assets/packages/voltmx_sdk_flutter/assets/js/config.js"></script>
<script src="assets/packages/voltmx_sdk_flutter/assets/js/constants.js"></script>