Appfigurate™️
HomeDocumentation
  • Introducing Appfigurate™️ 3
  • Getting Started
    • Getting Started
    • Examples
    • Upgrade guide
      • v1.4.0 to v2.2.0
      • v2.1.1 to v2.2.0
      • v2.2.1 to v3.0.0
      • v3.2.1 to v4.0.0
    • iOS native app integration
      • iOS app extension integration
    • watchOS app integration
      • watchOS app extension integration
    • Android native app integration
    • Mobile Flutter integration
      • Flutter iOS
      • Flutter Android
    • React Native integration
      • iOS native module integration
      • Android native module integration
      • JavaScript integration
    • Third party remote configuration providers
      • Firebase Remote Config
      • Launch Darkly
      • Other third party remote configuration providers
  • Configuration subclasses
    • Supported property types
      • Boolean
      • Integer
      • Float
      • Double
      • Plain String
      • Encrypted String
    • Custom executable actions
    • Slider icon types
  • Additional reading
    • Info.plist options
    • AndroidManifest.xml options
    • Displaying overridden configuration
    • Security
      • Best practice
      • Encryption
      • Export compliance
      • App Store compliance
      • PrivacyInfo.xcprivacy
      • Rotating your private key
  • Automation testing
    • iOS native app automation testing
    • Android native automation testing
  • API
    • iOS and watchOS API
    • Android API
    • Mobile Flutter API
    • React Native API
  • Appfigurate User Guide
    • Introduction
    • Main menu
    • Select app
    • Add app
    • Import app
    • Install example apps
    • Settings
      • Passcode Lock
      • Restore
      • Backup
      • Delete all apps and Settings
      • Analytics
    • Edit app
    • Configure app
    • Permissions
  • Appfigurate SE user guide
    • Introduction
    • Manual encryption
      • ENCRYPTED_STRING macro/function
      • ENCRYPTED_STRING_IOS_WATCHOS macro/function
    • Setup iOS Simulator app
    • Setup Android Emulator app
    • Xcode source editor extension
      • Troubleshooting
    • Real device cloud testing services
      • BrowserStack
  • LEGAL
    • License Agreement
    • Privacy Policy
    • Release History
    • Third party notices
Powered by GitBook
On this page
  • Prerequisites
  • Modify pubspec.yaml
  • Update main.dart
  • Create Dart APLNativeConfiguration subclass
  1. Getting Started

Mobile Flutter integration

Integrating Appfigurate Library into a Mobile Flutter app

PreviousAndroid native app integrationNextFlutter iOS

Last updated 5 months ago

For simplicity, this guide will assume your Mobile Flutter app deploys to both iOS (Swift) and Android (Kotlin).

Prerequisites

You must have the following installed:

  • Android Studio, IntelliJ or Visual Studio Code.

  • Flutter 3.10.0+ SDK

  • Xcode 15.2+

  • iOS SDKs and associated Simulators.

  • Android SDKs and associated Emulators.

  • AppfigurateSE macOS or Windows app.

  • Appfigurate Simulator app installed into one or more iOS Simulators (use the app for easy 1 click installation).

  • Appfigurate Emulator app installed into one or more Android Emulators (use the for easy 1 click installation).

  • Your iOS app must target iOS 13.0+ in order to include Appfigurate Flutter Plugin.

  • Your Android app must have a minimum API level 26 (Android 8.0 Oreo) in order to include Appfigurate Flutter Plugin.

Modify pubspec.yaml

In your app's pubspec.yaml add the following to the dependencies section:

appfigurateflutter: ^3.2.1

Perform a pub get to ensure the Appfigurate Flutter Plugin is successfully installed.

Update main.dart

In your apps main.dart file, initialize the Appfigurate Flutter Plugin:

main.dart initialization example

import 'package:appfigurateflutter/appfigurateflutter.dart';

void main() async {  
    await AppfigurateLibrary.initialize();
    ...

Create Dart APLNativeConfiguration subclass

In your app, add a new Dart class named Configuration.dart. Paste the following code:

Dart Configuration example

import 'package:appfigurateflutter/appfigurateflutter.dart';

class Configuration extends APLNativeConfiguration { 
    factory Configuration() => _instance;
    
    static Configuration _instance = Configuration._internal();

    Configuration._internal();

    bool get debugLogging => nativeBool("debugLogging");
    String get serverUrl => nativeString("serverURL");
}

You can now use the Configuration class throughout your Flutter app as follows:

if (Configuration().debugLogging) ...

Now jump to .

AppfigurateSE macOS
AppfigurateSE macOS or Windows app
Flutter iOS