leap_creator 0.0.14
leap_creator: ^0.0.14 copied to clipboard
The Leap Creator Flutter plugin enables you to create in-app experiences using the Leap Mobile Studio by integrating the Leap Mobile Creator SDK. Activate Creator mode in your app to design interactiv [...]
example/lib/main.dart
import 'dart:io';
import 'package:flutter/material.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 LeapCreator.start("<API-KEY>");
}
if (Platform.isIOS) {
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 Creator Flutter'),
),
body: const Center(
key: Key('DAP-KEY-5'),
child: Text(key: Key('DAP-KEY-5'), 'Welcome to Whatfix Mobile'),
),
),
);
}
}