Skip to content

Commit 2f9cf4d

Browse files
committed
fix: even smaller desktop icon size, improve fonts view
1 parent 49235be commit 2f9cf4d

File tree

2 files changed

+103
-46
lines changed

2 files changed

+103
-46
lines changed

example/lib/src/fonts/fonts_view.dart

Lines changed: 102 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,127 @@ class FontsView extends StatelessWidget {
77

88
@override
99
Widget build(BuildContext context) {
10+
final theme = Theme.of(context);
11+
1012
return ListView(
1113
padding: const EdgeInsets.all(kWrapSpacing),
1214
children: <Widget>[
13-
Text(
14-
'displayLarge',
15-
style: Theme.of(context).textTheme.displayLarge,
15+
_TextShow(
16+
name: 'displayLarge',
17+
style: theme.textTheme.displayLarge,
1618
),
17-
Text(
18-
'displayMedium',
19-
style: Theme.of(context).textTheme.displayMedium,
19+
_TextShow(
20+
name: 'displayMedium',
21+
style: theme.textTheme.displayMedium,
2022
),
21-
Text(
22-
'displaySmall',
23-
style: Theme.of(context).textTheme.displaySmall,
23+
_TextShow(
24+
name: 'displaySmall',
25+
style: theme.textTheme.displaySmall,
2426
),
25-
Text(
26-
'headlineLarge',
27-
style: Theme.of(context).textTheme.headlineLarge,
27+
_TextShow(
28+
name: 'headlineLarge',
29+
style: theme.textTheme.headlineLarge,
2830
),
29-
Text(
30-
'headlineMedium',
31-
style: Theme.of(context).textTheme.headlineMedium,
31+
_TextShow(
32+
name: 'headlineMedium',
33+
style: theme.textTheme.headlineMedium,
3234
),
33-
Text(
34-
'headlineSmall',
35-
style: Theme.of(context).textTheme.headlineSmall,
35+
_TextShow(
36+
name: 'headlineSmall',
37+
style: theme.textTheme.headlineSmall,
3638
),
37-
Text(
38-
'titleLarge',
39-
style: Theme.of(context).textTheme.titleLarge,
39+
_TextShow(
40+
name: 'titleLarge',
41+
style: theme.textTheme.titleLarge,
4042
),
41-
Text(
42-
'titleMedium',
43-
style: Theme.of(context).textTheme.titleMedium,
43+
_TextShow(
44+
name: 'titleMedium',
45+
style: theme.textTheme.titleMedium,
4446
),
45-
Text(
46-
'titleSmall',
47-
style: Theme.of(context).textTheme.titleSmall,
47+
_TextShow(
48+
name: 'titleSmall',
49+
style: theme.textTheme.titleSmall,
4850
),
49-
Text(
50-
'bodyLarge',
51-
style: Theme.of(context).textTheme.bodyLarge,
51+
_TextShow(
52+
name: 'bodyLarge',
53+
style: theme.textTheme.bodyLarge,
5254
),
53-
Text(
54-
'bodyMedium',
55-
style: Theme.of(context).textTheme.bodyMedium,
55+
_TextShow(
56+
name: 'bodyMedium',
57+
style: theme.textTheme.bodyMedium,
5658
),
57-
Text(
58-
'bodySmall',
59-
style: Theme.of(context).textTheme.bodySmall,
59+
_TextShow(
60+
name: 'bodySmall',
61+
style: theme.textTheme.bodySmall,
6062
),
61-
Text(
62-
'labelLarge',
63-
style: Theme.of(context).textTheme.labelLarge,
63+
_TextShow(
64+
name: 'labelLarge',
65+
style: theme.textTheme.labelLarge,
6466
),
65-
Text(
66-
'labelMedium',
67-
style: Theme.of(context).textTheme.labelMedium,
67+
_TextShow(
68+
name: 'labelMedium',
69+
style: theme.textTheme.labelMedium,
6870
),
69-
Text(
70-
'labelSmall',
71-
style: Theme.of(context).textTheme.labelSmall,
71+
_TextShow(
72+
name: 'labelSmall',
73+
style: theme.textTheme.labelSmall,
7274
),
7375
],
7476
);
7577
}
7678
}
79+
80+
class _TextShow extends StatelessWidget {
81+
const _TextShow({
82+
required this.name,
83+
required this.style,
84+
});
85+
86+
final String name;
87+
final TextStyle? style;
88+
89+
@override
90+
Widget build(BuildContext context) {
91+
final showStyle = TextStyle(
92+
fontSize: 9,
93+
fontWeight: FontWeight.normal,
94+
color: style?.color,
95+
);
96+
return Card(
97+
child: Padding(
98+
padding: const EdgeInsets.all(16.0),
99+
child: Column(
100+
mainAxisAlignment: MainAxisAlignment.start,
101+
crossAxisAlignment: CrossAxisAlignment.start,
102+
children: [
103+
Padding(
104+
padding: const EdgeInsets.symmetric(horizontal: 1),
105+
child: Wrap(
106+
spacing: 10,
107+
runSpacing: 10,
108+
children: [
109+
Text(
110+
'color: ${style?.color.toString().replaceAll('Color(0x', '#').replaceAll(')', '') ?? ''}',
111+
style: showStyle,
112+
),
113+
Text(
114+
style?.fontWeight.toString() ?? '',
115+
style: showStyle,
116+
),
117+
Text(
118+
'size: ${style?.fontSize.toString() ?? ''} ',
119+
style: showStyle,
120+
),
121+
],
122+
),
123+
),
124+
Text(
125+
name,
126+
style: style,
127+
),
128+
],
129+
),
130+
),
131+
);
132+
}
133+
}

lib/src/theme.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ThemeData _phoenixTheme({
5454
Size(buttonHeight ?? _kButtonHeight, buttonHeight ?? _kButtonHeight);
5555

5656
return ThemeData(
57-
iconTheme: isMobile ? null : const IconThemeData(size: 22),
57+
iconTheme: isMobile ? null : const IconThemeData(size: 20),
5858
colorScheme: colorScheme,
5959
scaffoldBackgroundColor: colorScheme.surface,
6060
splashFactory: NoSplash.splashFactory,

0 commit comments

Comments
 (0)