upgrader 0.5.1+1 upgrader: ^0.5.1+1 copied to clipboard
Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
/*
* Copyright (c) 2019 Larry Aasen. All rights reserved.
*/
import 'package:flutter/material.dart';
import 'package:upgrader/upgrader.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
MyApp({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
// Setup the Appcast for Android only. On iOS, the default behavior will be
// to use the App Store version of the app.
final String appcastURL =
'https://raw.githubusercontent.com/larryaasen/upgrader/master/test/testappcast.xml';
final cfg = AppcastConfiguration(url: appcastURL, supportedOS: ["android"]);
return MaterialApp(
title: 'Upgrader Example',
home: Scaffold(
appBar: AppBar(
title: Text('Upgrader Example'),
),
body: UpgradeAlert(
appcastConfig: cfg,
child: Center(child: Text('Checking...')),
)),
);
}
}