-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: kuromesi <[email protected]>
- Loading branch information
Showing
7 changed files
with
169 additions
and
67 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
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,42 @@ | ||
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 | ||
|
||
// On Android, the default behavior will be to use the Google Play Store | ||
// version of the app. | ||
// On iOS, the default behavior will be to use the App Store version of | ||
// the app, so update the Bundle Identifier in example/ios/Runner with a | ||
// valid identifier already in the App Store. | ||
runApp(const MyApp()); | ||
} | ||
|
||
const appcastURL = | ||
'https://raw.githubusercontent.com/larryaasen/upgrader/master/test/testappcast.xml'; | ||
final upgrader = Upgrader( | ||
storeController: UpgraderStoreController( | ||
onAndroid: () => UpgraderAppcastStore(appcastURL: appcastURL), | ||
), | ||
); | ||
|
||
class MyApp extends StatelessWidget { | ||
const MyApp({super.key}); | ||
|
||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Upgrader Example', | ||
home: Scaffold( | ||
appBar: AppBar(title: Text('Upgrader Appcast Example')), | ||
body: UpgradeAlert( | ||
upgrader: upgrader, | ||
child: Center(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:upgrader/upgrader.dart'; | ||
|
||
const appcastURL = | ||
'https://raw.githubusercontent.com/kuromesi/landscape-mobile/master/appcast.xml'; | ||
|
||
final upgrader = Upgrader( | ||
storeController: UpgraderStoreController( | ||
onAndroid: () => UpgraderAppcastStore(appcastURL: appcastURL), | ||
), | ||
); |
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 |
---|---|---|
@@ -1,62 +1,2 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
class FullScreenWrapper { | ||
static GestureDetector wrap<T extends Widget>(T obj, BuildContext context, | ||
{List<void Function()> enter = const [], | ||
List<void Function()> exit = const []}) { | ||
return GestureDetector( | ||
onTap: () { | ||
enter.forEach((fn) => fn()); | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => Scaffold( | ||
body: Center( | ||
child: GestureDetector( | ||
onTap: () { | ||
exit.forEach((fn) => fn()); | ||
Navigator.pop( | ||
context, | ||
); | ||
}, | ||
child: Container( | ||
child: obj, | ||
width: double.infinity, | ||
height: double.infinity, | ||
)), | ||
), | ||
)), | ||
); | ||
}, | ||
child: obj); | ||
} | ||
} | ||
|
||
GestureDetector fullScreenWrap<T extends Widget>(T obj, BuildContext context) { | ||
return GestureDetector( | ||
onTap: () { | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => Scaffold( | ||
body: Center( | ||
child: GestureDetector( | ||
onTap: () { | ||
Navigator.pop( | ||
context, | ||
); | ||
}, | ||
child: Container( | ||
child: obj, | ||
width: double.infinity, | ||
height: double.infinity, | ||
)), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
child: obj, | ||
); | ||
} | ||
export 'package:landscape/utils/wrapper.dart'; | ||
export 'package:landscape/utils/upgrader.dart'; |
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,61 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class FullScreenWrapper { | ||
static GestureDetector wrap<T extends Widget>(T obj, BuildContext context, | ||
{List<void Function()> enter = const [], | ||
List<void Function()> exit = const []}) { | ||
return GestureDetector( | ||
onTap: () { | ||
enter.forEach((fn) => fn()); | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => Scaffold( | ||
body: Center( | ||
child: GestureDetector( | ||
onTap: () { | ||
exit.forEach((fn) => fn()); | ||
Navigator.pop( | ||
context, | ||
); | ||
}, | ||
child: Container( | ||
child: obj, | ||
width: double.infinity, | ||
height: double.infinity, | ||
)), | ||
), | ||
)), | ||
); | ||
}, | ||
child: obj); | ||
} | ||
} | ||
|
||
GestureDetector fullScreenWrap<T extends Widget>(T obj, BuildContext context) { | ||
return GestureDetector( | ||
onTap: () { | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => Scaffold( | ||
body: Center( | ||
child: GestureDetector( | ||
onTap: () { | ||
Navigator.pop( | ||
context, | ||
); | ||
}, | ||
child: Container( | ||
child: obj, | ||
width: double.infinity, | ||
height: double.infinity, | ||
)), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
child: obj, | ||
); | ||
} |
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,16 @@ | ||
<!-- appcast_template.xml --> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<channel> | ||
<title>{{APP_NAME}} Changelog</title> | ||
<link>{{APPCAST_URL}}</link> | ||
<description>Most recent changes with links to updates.</description> | ||
<language>en</language> | ||
<item> | ||
<title>Version {{VERSION}}</title> | ||
<pubDate>{{PUB_DATE}}</pubDate> | ||
<description>{{CHANGELOG}}</description> | ||
<enclosure url="{{DOWNLOAD_URL}}" sparkle:version="{{VERSION}}" length="{{FILE_SIZE}}" type="application/octet-stream" /> | ||
</item> | ||
</channel> | ||
</rss> |