userleap_flutter

pub package

A Flutter plugin integrating the official android and ios SDK for Userleap Survey Platform

Screenshot

Usage

Import package:userleap_flutter/userleap_flutter.dart and use the methods in UserleapFlutter class.

Example:

import 'package:userleap_flutter/userleap_flutter.dart';

void main() async {
    UserleapFlutter.configure('ENVIRONMENT_ID');
    runApp(App());
}

class App extends StatelessWidget {

    @override
    Widget build(BuildContext context) {
        return Center(
            child: FlatButton(
                onPressed: () {
                UserleapFlutter.presentDebugSurvey()
                .then((value) => print(value));
            },
            child: Text('Present Debug Survey'),
        ));
    }
}

See Userleap Android and iOS package documentation for more information. USerleap docs

Userleap requires a Fragment Activity for the android implementation to work, im your MainActivity.kt, you can change FlutterActivity to FlutterFragmentActivity.

import android.os.Bundle
import androidx.annotation.NonNull
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.plugins.GeneratedPluginRegistrant


class MainActivity: FlutterFragmentActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine)
    }

}

checkout the example project for full implementation

Libraries

channels
userleap_flutter