-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #312 when multiple instances of UpgradeAlert or UpgradeCa…
…rd were used and the stream had already been listened to.
- Loading branch information
1 parent
db563d2
commit 6bd0a4b
Showing
5 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2023 Larry Aasen. All rights reserved. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:upgrader/upgrader.dart'; | ||
|
||
void main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
|
||
// Only call clearSavedSettings() during testing to reset internal values. | ||
await Upgrader.clearSavedSettings(); // REMOVE this for release builds | ||
|
||
runApp(MyApp()); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
const MyApp({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Upgrader Example - Multiple', | ||
home: UpgradeAlert( | ||
child: Scaffold( | ||
appBar: AppBar(title: Text('Upgrader Example - Multiple')), | ||
body: Center(child: UpgradeAlert(child: Text('Checking...'))), | ||
)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters