-
-
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.
- Loading branch information
1 parent
e654355
commit 0635af7
Showing
6 changed files
with
176 additions
and
68 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,69 @@ | ||
// 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 | ||
|
||
// 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(MyApp()); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
MyApp({super.key}); | ||
|
||
final dark = ThemeData.dark(useMaterial3: true); | ||
|
||
final light = ThemeData( | ||
cardTheme: CardTheme(color: Colors.greenAccent), | ||
// Change the text buttons. | ||
textButtonTheme: const TextButtonThemeData( | ||
style: ButtonStyle( | ||
// Change the color of the text buttons. | ||
foregroundColor: MaterialStatePropertyAll(Colors.orange), | ||
), | ||
), | ||
); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Upgrader Card Example', | ||
home: Scaffold( | ||
appBar: AppBar(title: Text('Upgrader Card Theme Example')), | ||
body: Container( | ||
margin: EdgeInsets.only(left: 12.0, right: 12.0), | ||
child: SingleChildScrollView( | ||
child: Column( | ||
children: [ | ||
_simpleCard, | ||
_simpleCard, | ||
UpgradeCard(), | ||
_simpleCard, | ||
_simpleCard, | ||
], | ||
), | ||
), | ||
), | ||
), | ||
theme: light, | ||
darkTheme: dark, | ||
); | ||
} | ||
|
||
Widget get _simpleCard => Card( | ||
child: SizedBox( | ||
width: 200, | ||
height: 50, | ||
child: Center(child: Text('Card')), | ||
), | ||
); | ||
} |
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