purplepro 0.0.1 purplepro: ^0.0.1 copied to clipboard
Launch your own loyalty club in 2 clicks, increase user engagement with gamification & reward them with dynamic earn & burn rules.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:purplepro/purplepro.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
final _purpleproPlugin = Purplepro();
@override
void initState() {
super.initState();
initPurpleProPlugin();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPurpleProPlugin() async {
_purpleproPlugin.setPartnerIdAndUserId(partnerId: "77010207011", userId: "5842918d-7d0f-4091-ab8b-4a6abfb5bf22");
}
Future<void> startPurplepro() async {
_purpleproPlugin.startBluePine(darkMode: false);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
ElevatedButton(
onPressed: () {
startPurplepro();
},
child: const Text('Enabled'),
),
],
),
),
),
);
}
}