1
1
import 'package:catalyst_voices/common/ext/brand_ext.dart' ;
2
+ import 'package:catalyst_voices/common/ext/build_context_ext.dart' ;
3
+ import 'package:catalyst_voices/widgets/common/affix_decorator.dart' ;
2
4
import 'package:catalyst_voices/widgets/widgets.dart' ;
3
5
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart' ;
4
6
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart' ;
@@ -20,6 +22,7 @@ class BrandsNavigation extends StatelessWidget {
20
22
padding: const EdgeInsets .symmetric (vertical: 8 ),
21
23
child: Column (
22
24
mainAxisSize: MainAxisSize .max,
25
+ crossAxisAlignment: CrossAxisAlignment .start,
23
26
children: [
24
27
...Brand .values.map (
25
28
(brand) {
@@ -35,59 +38,26 @@ class BrandsNavigation extends StatelessWidget {
35
38
indent: 0 ,
36
39
endIndent: 0 ,
37
40
),
38
- const _SearchTile (),
39
- const _TasksTile (),
41
+ const _SpacesTile (),
42
+ const _OpportunitiesTile (),
40
43
],
41
44
),
42
45
);
43
46
}
44
47
}
45
48
46
- class _BrandTile extends StatelessWidget {
47
- final Brand brand;
48
- final VoidCallback ? onTap;
49
-
50
- const _BrandTile (
51
- this .brand, {
52
- super .key,
53
- this .onTap,
54
- });
55
-
56
- @override
57
- Widget build (BuildContext context) {
58
- final theme = Theme .of (context);
59
- final isCurrent = theme.brandAssets.brand == brand;
60
-
61
- return _BrandsNavigationTile (
62
- onTap: onTap,
63
- isSelected: isCurrent,
64
- leading: brand.logoIcon (context).buildIcon (allowColorFilter: false ),
65
- content: Text (brand.localizedName (context.l10n)),
66
- );
67
- }
68
- }
49
+ final class _BackgroundColor implements WidgetStateProperty <Color ?> {
50
+ final VoicesColorScheme colors;
69
51
70
- class _SearchTile extends StatelessWidget {
71
- const _SearchTile ();
52
+ _BackgroundColor (this .colors);
72
53
73
54
@override
74
- Widget build (BuildContext context) {
75
- return _BrandsNavigationTile (
76
- leading: VoicesAssets .icons.search.buildIcon (),
77
- content: Text (context.l10n.overallSpacesSearchBrands),
78
- );
79
- }
80
- }
81
-
82
- class _TasksTile extends StatelessWidget {
83
- const _TasksTile ();
55
+ Color ? resolve (Set <WidgetState > states) {
56
+ if (states.contains (WidgetState .selected)) {
57
+ return colors.onSurfacePrimaryContainer.withValues (alpha: 0.12 );
58
+ }
84
59
85
- @override
86
- Widget build (BuildContext context) {
87
- return _BrandsNavigationTile (
88
- leading: VoicesAssets .icons.collection.buildIcon (),
89
- content: Text (context.l10n.overallSpacesTasks),
90
- );
60
+ return Colors .transparent;
91
61
}
92
62
}
93
63
@@ -158,18 +128,32 @@ class _BrandsNavigationTile extends StatelessWidget {
158
128
}
159
129
}
160
130
161
- final class _BackgroundColor implements WidgetStateProperty <Color ?> {
162
- final VoicesColorScheme colors;
131
+ class _BrandTile extends StatelessWidget {
132
+ final Brand brand;
133
+ final VoidCallback ? onTap;
163
134
164
- _BackgroundColor (this .colors);
135
+ const _BrandTile (
136
+ this .brand, {
137
+ super .key,
138
+ this .onTap,
139
+ });
165
140
166
141
@override
167
- Color ? resolve (Set <WidgetState > states) {
168
- if (states.contains (WidgetState .selected)) {
169
- return colors.onSurfacePrimaryContainer.withValues (alpha: 0.12 );
170
- }
171
-
172
- return Colors .transparent;
142
+ Widget build (BuildContext context) {
143
+ return Padding (
144
+ padding: const EdgeInsets .symmetric (
145
+ horizontal: 12 ,
146
+ vertical: 8 ,
147
+ ),
148
+ child: AffixDecorator (
149
+ prefix: brand.logoIcon (context).buildIcon (allowColorFilter: false ),
150
+ child: Text (
151
+ brand.localizedName (context.l10n),
152
+ style: context.textTheme.titleMedium
153
+ ? .copyWith (color: context.colorScheme.primary),
154
+ ),
155
+ ),
156
+ );
173
157
}
174
158
}
175
159
@@ -187,3 +171,29 @@ final class _ForegroundColor implements WidgetStateProperty<Color?> {
187
171
return colors.textOnPrimaryLevel0;
188
172
}
189
173
}
174
+
175
+ class _OpportunitiesTile extends StatelessWidget {
176
+ const _OpportunitiesTile ();
177
+
178
+ @override
179
+ Widget build (BuildContext context) {
180
+ return _BrandsNavigationTile (
181
+ leading: VoicesAssets .icons.collection.buildIcon (),
182
+ content: Text (context.l10n.opportunities),
183
+ );
184
+ }
185
+ }
186
+
187
+ class _SpacesTile extends StatelessWidget {
188
+ const _SpacesTile ();
189
+
190
+ @override
191
+ Widget build (BuildContext context) {
192
+ return _BrandsNavigationTile (
193
+ isSelected: true ,
194
+ leading: VoicesAssets .icons.viewGrid.buildIcon (),
195
+ content: Text (context.l10n.spaces),
196
+ onTap: () {},
197
+ );
198
+ }
199
+ }
0 commit comments