mindbox 2.11.0 mindbox: ^2.11.0 copied to clipboard
Flutter Mindbox SDK. Plugin wrapper over of Mindbox iOS/Android SDK.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:mindbox/mindbox.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _sdkVersion = "";
@override
void initState() {
super.initState();
getSdkVersion();
}
Future<void> getSdkVersion() async {
String sdkVersion = await Mindbox.instance.nativeSdkVersion;
if (!mounted) return;
setState(() {
_sdkVersion = sdkVersion;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Mindbox SDK example app'),
),
body: Center(
child: Text('Running on: $_sdkVersion'),
),
),
);
}
}