rast_force_update 0.0.1 rast_force_update: ^0.0.1 copied to clipboard
A Flutter package to force update your app.
import 'package:flutter/material.dart';
import 'package:rast_force_update/rast_force_update.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: SplashScreen(),
);
}
}
class SplashScreen extends StatefulWidget {
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
String latestVersion = "2.0.0";
bool isForceUpdate = true;
String updateMessage =
"A new version of the app is available. Please update to continue.";
@override
void initState() {
// TODO: implement initState
super.initState();
RastForceUpdate(
context: context,
latestVersion: latestVersion,
isForceUpdate: isForceUpdate,
updateMessage: updateMessage,
).checkForUpdate();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text('Splash Screen'),
),
);
}
}