update_helper 0.0.2 update_helper: ^0.0.2 copied to clipboard
Help you easier to control the update dialog. It also supports the feature that forces the app to update to continue using.
import 'package:flutter/material.dart';
import 'package:update_helper/update_helper.dart';
void main() {
runApp(const MaterialApp(home: MyApp()));
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
UpdateHelper.initial(
context: context,
updateConfig: UpdateConfig(
ios: UpdatePlatformConfig(latestVersion: '3.0.0'),
),
forceUpdate: true,
changelogs: [
'Bugs fix and improve performances',
'New feature: Add update dialog',
],
);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: const Center(
child: Text(''),
),
);
}
}