Skip to content

Commit d35e84f

Browse files
committed
chore: Organize files
1 parent dfc57d3 commit d35e84f

File tree

290 files changed

+386
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+386
-344
lines changed

example/lib/pages/theme/color_example.dart

Lines changed: 243 additions & 183 deletions
Large diffs are not rendered by default.

example/widgetbook/pages/components/progress_widgetbook.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ Widget progressBarUseCase(BuildContext context) => WidgetbookScaffold(
2727
Widget progressCircleUseCase(BuildContext context) => WidgetbookScaffold(
2828
builder: (context, _) => Column(
2929
children: [
30-
// CircularProgressIndicator(),
3130
ZetaProgressCircle(
32-
// progress: context.knobs.double.slider(label: 'Progress', min: 0, max: 1, initialValue: 0.5).toDouble(),
31+
progress: context.knobs.double.slider(label: 'Progress', min: 0, max: 1, initialValue: 0.5).toDouble(),
3332
size: context.knobs.list(
3433
initialOption: ZetaCircleSizes.xl,
3534
label: 'Size',

example/widgetbook/pages/theme/spacing_widgetbook.dart

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,46 @@ import 'package:path_drawing/path_drawing.dart';
33

44
import 'package:zeta_flutter/zeta_flutter.dart';
55

6-
Widget spacingUseCase(BuildContext context) => SingleChildScrollView(
6+
Widget spacingUseCase(BuildContext context) {
7+
Map<String, double> semanticSpacings = {
8+
'none': Zeta.of(context).spacing.none,
9+
'minimum': Zeta.of(context).spacing.minimum,
10+
'small': Zeta.of(context).spacing.small,
11+
'medium': Zeta.of(context).spacing.medium,
12+
'large': Zeta.of(context).spacing.large,
13+
'xl': Zeta.of(context).spacing.xl,
14+
'2xl': Zeta.of(context).spacing.xl_2,
15+
'3xl': Zeta.of(context).spacing.xl_3,
16+
'4xl': Zeta.of(context).spacing.xl_4,
17+
'5xl': Zeta.of(context).spacing.xl_5,
18+
'6xl': Zeta.of(context).spacing.xl_6,
19+
'7xl': Zeta.of(context).spacing.xl_7,
20+
'8xl': Zeta.of(context).spacing.xl_8,
21+
'9xl': Zeta.of(context).spacing.xl_9,
22+
'10xl': Zeta.of(context).spacing.xl_10,
23+
'11xl': Zeta.of(context).spacing.xl_11,
24+
};
25+
Map<String, double> baseSpacings = {
26+
'x1': Zeta.of(context).spacing.primitives.x1,
27+
'x2': Zeta.of(context).spacing.primitives.x2,
28+
'x3': Zeta.of(context).spacing.primitives.x3,
29+
'x4': Zeta.of(context).spacing.primitives.x4,
30+
'x5': Zeta.of(context).spacing.primitives.x5,
31+
'x6': Zeta.of(context).spacing.primitives.x6,
32+
'x7': Zeta.of(context).spacing.primitives.x7,
33+
'x8': Zeta.of(context).spacing.primitives.x8,
34+
'x9': Zeta.of(context).spacing.primitives.x9,
35+
'x10': Zeta.of(context).spacing.primitives.x10,
36+
'x11': Zeta.of(context).spacing.primitives.x11,
37+
'x12': Zeta.of(context).spacing.primitives.x12,
38+
'x13': Zeta.of(context).spacing.primitives.x13,
39+
'x14': Zeta.of(context).spacing.primitives.x14,
40+
'x15': Zeta.of(context).spacing.primitives.x15,
41+
};
42+
43+
return SingleChildScrollView(
44+
child: SingleChildScrollView(
45+
scrollDirection: Axis.horizontal,
746
child: Row(
847
crossAxisAlignment: CrossAxisAlignment.start,
948
children: [
@@ -17,46 +56,9 @@ Widget spacingUseCase(BuildContext context) => SingleChildScrollView(
1756
)
1857
],
1958
),
20-
);
21-
22-
Map<String, double> semanticSpacings = {
23-
// 'none': Zeta.of(context).spacing.none,
24-
// 'minimum': Zeta.of(context).spacing.minimum,
25-
// 'small': Zeta.of(context).spacing.small,
26-
// 'medium': Zeta.of(context).spacing.medium,
27-
// 'large': Zeta.of(context).spacing.large,
28-
// 'xl': Zeta.of(context).spacing.xl,
29-
// '2xl': Zeta.of(context).spacing.xl_2,
30-
// '3xl': Zeta.of(context).spacing.xl_3,
31-
// '4xl': Zeta.of(context).spacing.xl_4,
32-
// '5xl': Zeta.of(context).spacing.xl_5,
33-
// '6xl': Zeta.of(context).spacing.xl_6,
34-
// '7xl': Zeta.of(context).spacing.xl_7,
35-
// '8xl': Zeta.of(context).spacing.xl_8,
36-
// '9xl': Zeta.of(context).spacing.xl_9,
37-
// '10xl': Zeta.of(context).spacing.xl_10,
38-
// '11xl': Zeta.of(context).spacing.xl_11,
39-
};
40-
Map<String, double> baseSpacings = {
41-
// 'x1': ZetaSpacingBase.x1,
42-
// 'x2': ZetaSpacingBase.x2,
43-
// 'x3': ZetaSpacingBase.x3,
44-
// 'x3.5': ZetaSpacingBase.x3_5,
45-
// 'x4': ZetaSpacingBase.x4,
46-
// 'x5': ZetaSpacingBase.x5,
47-
// 'x6': ZetaSpacingBase.x6,
48-
// 'x7': ZetaSpacingBase.x7,
49-
// 'x8': ZetaSpacingBase.x8,
50-
// 'x9': ZetaSpacingBase.x9,
51-
// 'x10': ZetaSpacingBase.x10,
52-
// 'x11': ZetaSpacingBase.x11,
53-
// 'x12': ZetaSpacingBase.x12,
54-
// 'x13': ZetaSpacingBase.x13,
55-
// 'x14': ZetaSpacingBase.x14,
56-
// 'x15': ZetaSpacingBase.x15,
57-
// 'x30': ZetaSpacingBase.x30,
58-
// 'x50': ZetaSpacingBase.x50,
59-
};
59+
),
60+
);
61+
}
6062

6163
class _SpacingDemo extends StatelessWidget {
6264
final MapEntry<String, double> size;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/generated/generated.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// export 'icons/icons.dart';
1+
export 'icons/icons.dart';
22
export 'tokens/primitives.g.dart';
33
export 'tokens/semantics.g.dart';

lib/src/assets/icons.dart renamed to lib/generated/icons/icons.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
// ignore_for_file: public_member_api_docs, constant_identifier_names
1+
// ignore_for_file: constant_identifier_names
22
import 'package:flutter/material.dart';
33

44
// This file is automatically generated by the zeta-icons repository
55
// DO NOT MODIFY
66

7+
/// Current version of Zeta Icons
78
const zetaIconsVersion = '0.5.3';
89

910
/// Zeta Icons. Full list of icons can be found at [Zeta Icons](https://zeta-icons.web.app/).
1011
/// {@category Assets}
11-
abstract class ZetaIcons {
12+
abstract final class ZetaIcons {
13+
/// Default icon font name
1214
static const String family = 'zeta-icons';
15+
16+
/// Icon font name for round icons
1317
static const String familyRound = 'zeta-icons-round';
18+
19+
/// Icon font name for sharp icons
1420
static const String familySharp = 'zeta-icons-sharp';
21+
22+
/// Package name for zeta flutter
1523
static const String package = 'zeta_flutter';
1624

1725
// Icons

lib/src/assets/assets.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/src/components/avatars/avatar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ extension on ZetaAvatarSize {
323323
case ZetaAvatarSize.xs:
324324
case ZetaAvatarSize.xxs:
325325
case ZetaAvatarSize.xxxs:
326-
return Zeta.of(context).spacing.minimum / 2; //2dp
326+
return ZetaBorders.borderWidth;
327327
}
328328
}
329329

lib/src/components/badges/indicator.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ class ZetaIndicator extends ZetaStatelessWidget {
113113
width: sizePixels + Zeta.of(context).spacing.minimum,
114114
height: sizePixels + Zeta.of(context).spacing.minimum,
115115
decoration: BoxDecoration(
116-
border: Border.fromBorderSide(ZetaBorderTemp.indicatorBorder(context)),
116+
border: Border.all(
117+
width: ZetaBorders.borderWidth,
118+
color: Zeta.of(context).colors.border.pure,
119+
),
117120
color: (inverse ? foregroundColor : Colors.transparent),
118121
borderRadius: Zeta.of(context).radii.full,
119122
),

lib/src/components/badges/priority_pill.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ class ZetaPriorityPill extends ZetaStatelessWidget {
122122
final Color badgeColor = customColor?.shade60 ?? type.badgeColor(context);
123123
final Color lozengeColor = customColor?.shade10 ?? type.lozengeColor(context);
124124

125-
// final ZetaColorSwatch color = customColor ?? type.color(context);
126125
final size = this.size == ZetaPriorityPillSize.small ? Zeta.of(context).spacing.xl : Zeta.of(context).spacing.xl_3;
127126
final label = (this.label ?? priority) ?? type.name.capitalize();
128127
final rounded = context.rounded;

lib/src/components/badges/status_label.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class ZetaStatusLabel extends ZetaStatelessWidget {
3636
Widget build(BuildContext context) {
3737
final colors = Zeta.of(context).colors;
3838

39-
// final Color colors = status.colorSwatch(context);
4039
final Color backgroundColor = status.backgroundColor(colors);
4140
final Color borderColor = status.borderColor(colors);
4241
final Color iconColor = status.foregroundColor(colors);
4342
final Color textColor = colors.main.defaultColor;
43+
4444
return Semantics(
4545
value: semanticLabel ?? label,
4646
child: DecoratedBox(

lib/src/components/breadcrumbs/breadcrumbs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class _BreadCrumbsTruncatedState extends State<_BreadCrumbsTruncated> {
320320
),
321321
side: WidgetStateProperty.resolveWith((states) {
322322
if (states.contains(WidgetState.focused)) {
323-
return ZetaBorderTemp.focusBorder(context);
323+
return ZetaBorders.focusBorder(context);
324324
}
325325
if (states.contains(WidgetState.hovered)) {
326326
return BorderSide(color: colors.border.hover, width: 0.5);

lib/src/components/button_group/button_group.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class _ZetaGroupButtonState extends State<ZetaGroupButton> {
239239
) {
240240
// TODO(UX-1200): Focus border does not work as expected.
241241
if (_controller.value.contains(WidgetState.focused)) {
242-
return ZetaBorderTemp.focusBorder(context);
242+
return ZetaBorders.focusBorder(context);
243243
}
244244
if (_controller.value.contains(WidgetState.disabled)) {
245245
return BorderSide(color: colors.border.disabled);

lib/src/components/buttons/button_style.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ ButtonStyle buttonStyle(
119119
BuildContext context,
120120
) {
121121
final ZetaColorSemantics colors = Zeta.of(context).colors;
122-
// final Color color = backgroundColor != null ? ZetaColorSwatch.fromColor(backgroundColor) : type.color(colors);
123122
final Color backgroundColor = type.backgroundColor(colors);
124123
final Color backgroundColorHover = type.hoverColor(colors);
125124
final Color backgroundColorPressed = type.pressedColor(colors);
@@ -171,7 +170,7 @@ ButtonStyle buttonStyle(
171170
}
172171
// TODO(UX-1134): This removes a defualt border when focused, rather than adding a second border when focused.
173172
if (states.contains(WidgetState.focused)) {
174-
return ZetaBorderTemp.focusBorder(context);
173+
return ZetaBorders.focusBorder(context);
175174
}
176175
if (type.border) {
177176
return BorderSide(

lib/src/components/chips/chip.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class _ZetaChipState extends State<ZetaChip> {
227227
? colors.border.primary
228228
: colors.border.defaultColor,
229229
width: _controller.value.contains(WidgetState.focused)
230-
? ZetaBorderTemp.borderWidth
230+
? ZetaBorders.borderWidth
231231
: !selected
232232
? 1
233233
: 0,

lib/src/components/fabs/fab.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class _ZetaFABState extends State<ZetaFAB> {
140140
(Set<WidgetState> states) {
141141
if (states.contains(WidgetState.focused)) {
142142
// TODO(UX-1134): This removes a defualt border when focused, rather than adding a second border when focused.
143-
return ZetaBorderTemp.focusBorder(context);
143+
return ZetaBorders.focusBorder(context);
144144
}
145145
return null;
146146
},

lib/src/components/navigation_rail/navigation_rail.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,11 @@ class _ZetaNavigationRailItemContent extends ZetaStatelessWidget {
139139
final EdgeInsets? padding;
140140
final bool? wordWrap;
141141

142+
// TODO(UX-1173): No hover state for navigation rail items
142143
@override
143144
Widget build(BuildContext context) {
144145
final zeta = Zeta.of(context);
145146

146-
// TODO(thelukewalton): No hover state for navigation rail items
147-
148147
final Color foregroundColor = disabled
149148
? zeta.colors.main.disabled
150149
: selected

lib/src/components/radio/radio.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class _ZetaRadioState<T> extends State<ZetaRadio<T>> with TickerProviderStateMix
109109
color: states.contains(WidgetState.disabled)
110110
? zetaColors.main.disabled
111111
: zetaColors.main.defaultColor,
112-
height: 1.33,
112+
height: 4 / 3,
113113
),
114114
child: widget.label!,
115115
).paddingEnd(Zeta.of(context).spacing.minimum),
@@ -175,7 +175,7 @@ class _RadioPainter extends ToggleablePainter {
175175
final Paint paint = Paint()
176176
..color = colors.surface.primary
177177
..style = PaintingStyle.stroke
178-
..strokeWidth = Zeta.of(context).spacing.small + ZetaBorderTemp.borderWidth;
178+
..strokeWidth = Zeta.of(context).spacing.small + ZetaBorders.borderWidth;
179179
if (isFocused) canvas.drawCircle(center, _kInnerRadius, paint);
180180

181181
// Outer circle
@@ -186,7 +186,7 @@ class _RadioPainter extends ToggleablePainter {
186186
? inactiveColor
187187
: activeColor
188188
..style = PaintingStyle.stroke
189-
..strokeWidth = ZetaBorderTemp.borderWidth;
189+
..strokeWidth = ZetaBorders.borderWidth;
190190
canvas.drawCircle(center, _kOuterRadius, paint);
191191

192192
// Inner circle

lib/src/components/stepper/stepper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class _ZetaStepperState extends State<ZetaStepper> with TickerProviderStateMixin
309309
right: Zeta.of(context).spacing.large,
310310
left: Zeta.of(context).spacing.large,
311311
),
312-
height: ZetaBorderTemp.borderWidth,
312+
height: ZetaBorders.borderWidth,
313313
decoration: BoxDecoration(
314314
borderRadius: Zeta.of(context).radii.full,
315315
color: getLineColor(index),

lib/src/components/text_input/internal_text_input.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ class InternalTextInputState extends State<InternalTextInput> {
279279
);
280280

281281
OutlineInputBorder _focusedBorder(bool rounded) => _baseBorder(rounded).copyWith(
282-
borderSide: ZetaBorderTemp.focusBorder(context),
282+
borderSide: ZetaBorders.focusBorder(context),
283283
);
284284
OutlineInputBorder _errorBorder(bool rounded) => _baseBorder(rounded).copyWith(
285285
borderSide: BorderSide(
286286
color: _colors.border.negative,
287-
width: ZetaBorderTemp.borderWidth,
287+
width: ZetaBorders.borderWidth,
288288
),
289289
);
290290

lib/src/components/top_app_bar/top_app_bar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class _ZetaTopAppBarState extends State<ZetaTopAppBar> {
182182
if (widget.onSearchMicrophoneIconPressed != null) ...[
183183
SizedBox(
184184
height: Zeta.of(context).spacing.xl_2,
185-
child: VerticalDivider(width: ZetaBorderTemp.borderWidth, color: colors.main.subtle),
185+
child: VerticalDivider(width: ZetaBorders.borderWidth, color: colors.main.subtle),
186186
),
187187
IconButton(
188188
onPressed: widget.onSearchMicrophoneIconPressed,

lib/src/theme/color_swatch.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ class ZetaPureColorSwatch extends ColorSwatch<int> with EquatableMixin {
1616
}) : super(primary, swatch);
1717

1818
/// Lightest shade of the color.
19-
Color get shade0 => this[0]!;
19+
Color get shade0 => this[0] ?? Colors.white;
2020

2121
/// Medium shade of the color.
22-
Color get shade500 => this[0]!;
22+
Color get shade500 => this[500] ?? Colors.grey;
2323

2424
/// Darkest shade of the color.
25-
Color get shade1000 => this[0]!;
25+
Color get shade1000 => this[1000] ?? Colors.white;
2626

2727
@override
2828
List<Object?> get props => [super.value, shade0, shade500, shade1000];

lib/src/theme/tokens.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,13 @@ class ZetaAnimationLength {
313313

314314
/// Temporary class to hold border values.
315315
// TODO(Tokens): Remove this class and design / develop Zeta.of(context).border instead.
316-
class ZetaBorderTemp {
316+
class ZetaBorders {
317317
/// Border width
318318
static double get borderWidth => 2;
319319

320-
/// Indicator Border
321-
static BorderSide indicatorBorder(BuildContext context) => BorderSide(
322-
width: Zeta.of(context).spacing.minimum / 2,
323-
color: Zeta.of(context).colors.border.pure,
324-
);
325-
326320
/// Border applied when the widget is focused.
327321
static BorderSide focusBorder(BuildContext context) => BorderSide(
322+
width: ZetaBorders.borderWidth,
328323
color: Zeta.of(context).colors.border.primary,
329-
width: Zeta.of(context).spacing.minimum / 2,
330324
);
331325
}

lib/src/utils/zeta_provider.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ class ZetaProvider extends StatefulWidget with Diagnosticable {
149149
/// The state associated with [ZetaProvider].
150150
/// {@category Utils}
151151
class ZetaProviderState extends State<ZetaProvider> with Diagnosticable, WidgetsBindingObserver {
152+
bool _gotTheme = false;
153+
152154
// Fields for ZetaThemeManager.
153155

154156
/// Represents the late initialization of the ZetaContrast value.
@@ -223,6 +225,9 @@ class ZetaProviderState extends State<ZetaProvider> with Diagnosticable, Widgets
223225

224226
// Apply the initial contrast to the theme data.
225227
_zetaThemeData = widget.initialZetaThemeData.apply(contrast: _contrast);
228+
229+
// Ensure this is only triggered once.
230+
_gotTheme = true;
226231
}
227232

228233
/// Clean up function to be called when this object is removed from the tree.
@@ -272,7 +277,7 @@ class ZetaProviderState extends State<ZetaProvider> with Diagnosticable, Widgets
272277

273278
@override
274279
Widget build(BuildContext context) {
275-
if (widget.initialContrast != null && widget.initialThemeMode != null) {
280+
if ((widget.initialContrast != null && widget.initialThemeMode != null) || _gotTheme) {
276281
return _getChild();
277282
}
278283
return FutureBuilder<dynamic>(
@@ -282,6 +287,7 @@ class ZetaProviderState extends State<ZetaProvider> with Diagnosticable, Widgets
282287
if (snapshot.connectionState == ConnectionState.waiting) {
283288
return const Center(child: CircularProgressIndicator());
284289
}
290+
285291
return _getChild();
286292
},
287293
);

lib/zeta_flutter.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
library zeta_flutter;
33

44
export 'generated/generated.dart';
5-
export 'src/assets/assets.dart';
65
export 'src/components/components.dart';
76
export 'src/temp_colors.dart';
87
export 'src/theme/theme.dart';

0 commit comments

Comments
 (0)