Flutter Integration

You can install Plotline Library via pub.dev.
Plotline currently supports Android SDK 16 (Android Jelly Bean) and above. The plugin operations are currently no-op for iOS. iOS support will be included in a future release.

1. Install Plotline

javascript
flutter pub add plotline

2. Ensure Android Activity is FlutterFragmentActivity

Open MainActivity.kt in the Android portion of your code:
Change FlutterActivity to FlutterFragmentActivity
kotlin
class MainActivity: FlutterFragmentActivity() { ... }
💡
FlutterActivity and FlutterFragmentActivity have the same functionality. The latter provides access to more Android APIs.

3. Import & initialize Plotline SDK

You can access <apiKey> via dashboard. Send a unique <userId> .
dart
import 'package:plotline/plotline.dart'; Plotline.init(<apiKey>, <userId>);

4. Track Events

Events can be to trigger studies and to filter users for displaying the studies.
💡
You can add this line to your existing analytics wrapper for coverage
dart
Plotline.track(<eventName>);
Optionally, you can also pass properties to the track call:
java
Plotline.track(<eventName>, properties: {category: "shopping"});

App size impact

Plotline SDK AAR size is 128KB. Impact on the app bundle is 250KB.

Optional

1. Set Locale

Plotline has the ability to set the locale of a study with the set.Local() function. The following locales are supported:
  • en
  • hi
  • ta
  • bn
  • mr
  • te
  • ka
  • gu
  • pa
dart
Plotline.setLocale(<locale>);

2. Identify Users

Plotline allows you to uniquely identify users and add attributes to them for powerful filtering when you are launching your user research studies. Attributes could be custom key value pairs that you set for each user (eg. age, country, subscriptionStatus)
dart
Plotline.identify({ "attribute1": "value1", "attribute2": "value2" });
Default Attributes
Plotline automatically tracks the following attributes:
  1. App Version
  1. Android Version
  1. SDK Version
  1. OS
  1. Device ID


Powered by Notaku