leap_aui 0.0.3
leap_aui: ^0.0.3 copied to clipboard
Whatfix Mobile SDK is a Flutter package designed to create engaging in-app experiences for your end users. This SDK enables seamless integration with your mobile app's source code, allowing developers [...]
example/lib/main.dart
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:leap_aui/leap_aui.dart';
import 'package:leap_creator/leap_creator.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
await initLeap();
}
Future<void> initLeap() async {
if (Platform.isAndroid) {
await Future.delayed(const Duration(seconds: 5));
await LeapAui.start("b4109b27-c1a7-4f42-9086-a5694f131d43");
await LeapCreator.start("b4109b27-c1a7-4f42-9086-a5694f131d43");
}
if (Platform.isIOS) {
await LeapAui.start("<API-KEY>");
await LeapCreator.start("<API-KEY>");
}
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
key: const Key('DAP-KEY-1'),
home: Scaffold(
key: const Key('DAP-KEY-2'),
appBar: AppBar(
key: const Key('DAP-KEY-3'),
title:
const Text(key: const Key('DAP-KEY-4'), 'Leap AUI Flutter'),
),
body: Center(
key: const Key('DAP-KEY-5'),
child: ElevatedButton(key: const Key('DAP-KEY-5'), child: const Text('Welcome to Whatfix Mobile') , onPressed: (){
LeapAui.flush(Map.of({'age':10}));
},),
),
),
);
}
}