userleap_flutter 0.1.0
userleap_flutter: ^0.1.0 copied to clipboard
A flutter plugin for userleap https://app.userleap.com/. UserLeap is a micro-survey automation platform that helps you gain valuable insights into how your customers experience your service.
userleap_flutter #
A Flutter plugin integrating the official android and ios SDK for Userleap Survey Platform
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)
}
}
Add Java 8 support to your project (if not added already)
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin projects
kotlinOptions {
jvmTarget = "1.8"
}
}
checkout the example project for full implementation