check_app_version 0.1.0 check_app_version: ^0.1.0 copied to clipboard
The plugin verifies that the version of the installed app is the most up-to-date, if not, it invites the user to update.
import 'package:check_app_version/show_dialog.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Check App Version',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Check App Version'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
ShowDialog(
context: context,
jsonUrl: 'https://besimsoft.com/example.json',
updateButtonColor: Colors.blue,
laterButtonEnable: true)
.checkVersion();
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(),
);
}
}