-
-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathtypography.dart
More file actions
122 lines (119 loc) · 3.68 KB
/
typography.dart
File metadata and controls
122 lines (119 loc) · 3.68 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import 'package:awesome_flutter_extensions/awesome_flutter_extensions.dart';
import 'package:example/common/base_scaffold.dart';
import 'package:example/common/component_view.dart';
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
// Example of extension on ShadTextTheme with a custom style.
// which can be retrieved with `ShadTheme.of(context).textTheme.myCustomStyle`.
extension CustomStyleExtension on ShadTextTheme {
TextStyle? get myCustomStyle => custom['myCustomStyle'];
}
class TypographyPage extends StatelessWidget {
const TypographyPage({super.key});
@override
Widget build(BuildContext context) {
return BaseScaffold(
appBarTitle: 'Typography',
children: [
ComponentView(
label: 'h1 Large',
child: Text(
'Taxing Laughter: The Joke Tax Chronicles',
style: ShadTheme.of(context).textTheme.h1Large,
),
),
ComponentView(
label: 'h1',
child: Text(
'Taxing Laughter: The Joke Tax Chronicles',
style: ShadTheme.of(context).textTheme.h1,
),
),
ComponentView(
label: 'h2',
child: Text(
'The People of the Kingdom',
style: ShadTheme.of(context).textTheme.h2,
),
),
ComponentView(
label: 'h3',
child: Text(
'The Joke Tax',
style: ShadTheme.of(context).textTheme.h3,
),
),
ComponentView(
label: 'h4',
child: Text(
'People stopped telling jokes',
style: ShadTheme.of(context).textTheme.h4,
),
),
ComponentView(
label: 'p',
child: Text(
'The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax.',
style: ShadTheme.of(context).textTheme.p,
),
),
ComponentView(
label: 'blockquote',
child: Text(
'"After all," he said, "everyone enjoys a good joke, so it\'s only fair that they should pay for the privilege."',
style: ShadTheme.of(context).textTheme.blockquote,
),
),
ComponentView(
label: 'table',
child: Text(
"King's Treasury",
style: ShadTheme.of(context).textTheme.table,
),
),
ComponentView(
label: 'list',
child: Text(
'1st level of puns: 5 gold coins',
style: ShadTheme.of(context).textTheme.list,
),
),
ComponentView(
label: 'lead',
child: Text(
'A modal dialog that interrupts the user with important content and expects a response.',
style: ShadTheme.of(context).textTheme.lead,
),
),
ComponentView(
label: 'large',
child: Text(
'Are you absolutely sure?',
style: ShadTheme.of(context).textTheme.large,
),
),
ComponentView(
label: 'small',
child: Text(
'Email address',
style: ShadTheme.of(context).textTheme.small,
),
),
ComponentView(
label: 'muted',
child: Text(
'Enter your email address.',
style: ShadTheme.of(context).textTheme.muted,
),
),
ComponentView(
label: 'extend with custom style',
child: Text(
'Enter your email address.',
style: ShadTheme.of(context).textTheme.myCustomStyle,
),
),
].separatedBy(const ShadSeparator.horizontal()),
);
}
}