sk_overlay 0.0.1
sk_overlay: ^0.0.1 copied to clipboard
Plugins used to push each other
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:sk_overlay/sk_overlay.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 _skOverlayPlugin = SkOverlay();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: GestureDetector(
onTap: () async {
try {
await _skOverlayPlugin.displaySKOverlay(
appID: '1581732727',
failCallback: () {
print(111111);
},
startPresentationCallback: () {
print(22222);
},
didFinishPresentationCallback: () {
print(3333);
},
willStartDismissalCallback: () {
print(4444);
},
didFinishDismissalCallback: () {
print(5555);
});
} on PlatformException {}
},
child: SizedBox(
width: 100,
height: 100,
child: Text('Running on: $_platformVersion\n'))),
),
),
);
}
}