-
-
Notifications
You must be signed in to change notification settings - Fork 332
Expand file tree
/
Copy pathmain_card_theme.dart
More file actions
64 lines (55 loc) · 1.62 KB
/
main_card_theme.dart
File metadata and controls
64 lines (55 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// 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 {
MyApp({super.key});
final dark = ThemeData.dark(useMaterial3: true);
final light = ThemeData(
cardTheme: const CardThemeData(color: Colors.greenAccent),
// Change the text buttons.
textButtonTheme: const TextButtonThemeData(
style: ButtonStyle(
// Change the color of the text buttons.
foregroundColor: WidgetStatePropertyAll(Colors.orange),
),
),
);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Upgrader Card Example',
home: Scaffold(
appBar: AppBar(title: const Text('Upgrader Card Theme Example')),
body: Container(
margin: const 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 => const Card(
child: SizedBox(
width: 200,
height: 50,
child: Center(child: Text('Card')),
),
);
}