trsurveys 1.0.0 copy "trsurveys: ^1.0.0" to clipboard
trsurveys: ^1.0.0 copied to clipboard

unlistedoutdated

A plugin for TheoremReach Surveys SDK for both Android & iOS

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:trsurveys/trsurveys.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    TheoremReach()
        .init(apiToken: 'apiToken', userId: 'userId', listener: trListener);
    super.initState();
  }

  trListener(TheoremReachListener event) {
    if (event == TheoremReachListener.theoremReachSurveyAvailable) {
      print('survey available');
    } else if (event == TheoremReachListener.onReward) {
      print('on reward');
    } else if (event == TheoremReachListener.onRewardCenterClosed) {
      print('on closed');
    } else if (event == TheoremReachListener.onRewardCenterOpened) {
      print('on opened');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: RaisedButton(
          child: Text("Launch TheoremReach"),
          onPressed: () => TheoremReach().show(),
        )),
      ),
    );
  }
}
2
likes
0
points
54
downloads

Publisher

verified publisheranavrinapps.com

Weekly Downloads

A plugin for TheoremReach Surveys SDK for both Android & iOS

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on trsurveys

Packages that implement trsurveys