Flutter Upgrader is used to show the new version alert message to the user. When new version is available on Google Play Store or App Store we want to inform user to install that new version. In this tutorial we will learn how to inform users, please continue to read the blog.
Update Flutter app Using upgrader package
Its very easy way to inform users to install the new version from the respective platform. For that “upgrader” can be used for that. User will see the update alert like the above image:
Install upgrader
Run the following command in the terminal to add the upgrader package:
flutter pub add upgrader
Supports:
Android, IOS, Linux, MacOS, windows
Use
You have to add its function: UpgradeAlert() into the MaterialApp home like the below example by providing required widgets.
import 'package:upgrader/upgrader.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await UpgradeManager.initialize();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: UpgradeAlert(
dialogStyle: UpgradeDialogStyle.cupertino,
child: HomeScreen(),
),
);
}
}
Before making the release build you can test it by downgrading the version in pubspec.yml and then create a build and test it.
You can see more feature from Here about the upgrader.
Widget of the week
Flutter Isolate With Example | FlutterPoint
GridView in Flutter Full Example
How to show Image in Flutter
Method Channel in Flutter Full Explanation With Examples
Flutter Bloc State Management
GetX State Management in Flutter
State Management In Flutter
Provider in Flutter
Flutter Webview
Top 20 Flutter Interview Questions
Card in Flutter With Full Examples
FutureBuilder In Flutter