Skip to content

Commit

Permalink
deps: zeta_flutter 0.10.0 (#25)
Browse files Browse the repository at this point in the history
fix: Updated zetaColors.
  • Loading branch information
thelukewalton authored May 24, 2024
1 parent bceb856 commit 2f49efb
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 37 deletions.
8 changes: 4 additions & 4 deletions example/lib/pages/theme/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,22 @@ class ColorsDemo extends StatelessWidget {
];
final alertColors = [
{
'color': Zeta.of(context).colors.positive,
'color': Zeta.of(context).colors.surfacePositive,
'name': 'Positive',
'subtitle': 'Zeta.of(context).colors.positive',
},
{
'color': Zeta.of(context).colors.negative,
'color': Zeta.of(context).colors.surfaceNegative,
'name': 'Negative',
'subtitle': 'Zeta.of(context).colors.negative',
},
{
'color': Zeta.of(context).colors.warning,
'color': Zeta.of(context).colors.surfaceWarning,
'name': 'Warning',
'subtitle': 'Zeta.of(context).colors.warning',
},
{
'color': Zeta.of(context).colors.info,
'color': Zeta.of(context).colors.surfaceInfo,
'name': 'Info',
'subtitle': 'Zeta.of(context).colors.info',
},
Expand Down
9 changes: 8 additions & 1 deletion example/lib/pages/utils/theme_color_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@ class ZetaThemeColorSwitch extends StatelessWidget {
ZetaThemeColorSwitch({super.key});

late final _themes = {
"default": ZetaThemeData(),
"default": ZetaThemeData(
primary: ZetaColorBase.blue,
secondary: ZetaColorBase.blue,
),
"teal": ZetaThemeData(
identifier: 'teal',
primary: ZetaColorBase.teal,
secondary: ZetaColorBase.teal,
),
"yellow": ZetaThemeData(
identifier: 'yellow',
primary: ZetaColorBase.yellow,
secondary: ZetaColorBase.yellow,
),
"red": ZetaThemeData(
identifier: 'red',
primary: ZetaColorBase.red,
secondary: ZetaColorBase.red,
),
"purple": ZetaThemeData(
identifier: 'purple',
primary: ZetaColorBase.purple,
secondary: ZetaColorBase.purple,
),
};

Expand Down
2 changes: 1 addition & 1 deletion example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 813f07c89880cd0ec4c0da55108415b820f8783a

COCOAPODS: 1.15.1
COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion lib/src/components/atoms/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class ZdsButton extends StatelessWidget {
final EdgeInsetsGeometry tp = textPadding ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 6);

// Determine the default background color.
final Color defaultBackground = customColor ?? (isDangerButton ? zetaColors.negative : zetaColors.secondary);
final Color defaultBackground = customColor ?? (isDangerButton ? zetaColors.surfaceNegative : zetaColors.secondary);

// Common textStyle for all variants.
final textStyle = WidgetStateProperty.all(textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w500));
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/atoms/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ZdsCard extends StatelessWidget {
wrapperBuilder: (child) {
return InkWell(
splashColor: zetaColors.surfaceSelected,
hoverColor: zetaColors.surfaceSelectedHovered,
hoverColor: zetaColors.surfaceSelectedHover.withOpacity(0.1),
onTap: onTap,
child: child,
);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/atoms/circle_icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ extension on CircleButtonType {
ZetaColorSwatch color(ZetaColors colors) {
switch (this) {
case CircleButtonType.positive:
return colors.positive;
return colors.surfacePositive;
case CircleButtonType.negative:
return colors.negative;
return colors.surfaceNegative;
case CircleButtonType.alert:
return ZetaColorSwatch.fromColor(Colors.white);
case CircleButtonType.base:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/atoms/icon_text_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ZdsIconTextButton extends StatelessWidget with Diagnosticable {
borderRadius: borderRadius,
color: backgroundColor ?? zetaColors.primary,
boxShadow: <BoxShadow>[
BoxShadow(blurRadius: 4, color: zetaColors.shadow.withOpacity(0.5)),
BoxShadow(blurRadius: 4, color: Theme.of(context).colorScheme.shadow),
],
),
child: Material(
Expand Down
4 changes: 3 additions & 1 deletion lib/src/components/molecules/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ class _BottomSheetHeader extends StatelessWidget implements PreferredSizeWidget
final zetaColors = Zeta.of(context).colors;
return DecoratedBox(
decoration: BoxDecoration(
border: bottom != null ? Border(bottom: BorderSide(color: zetaColors.shadow)) : null,
border: bottom != null
? Border(bottom: BorderSide(color: Theme.of(context).colorScheme.shadow.withOpacity(0.1)))
: null,
),
child: Column(
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/date_time_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class ZdsDateTimePickerState extends State<ZdsDateTimePicker> {
color: Colors.transparent,
child: InkWell(
splashColor: zetaColors.surfaceSelected,
hoverColor: zetaColors.surfaceSelectedHovered,
hoverColor: zetaColors.surfaceSelectedHover,
radius: MediaQuery.of(context).size.width,
onTap: () {
if (!widget.readOnly) unawaited(onShowPicker(context, _dateTime));
Expand Down
14 changes: 7 additions & 7 deletions lib/src/components/molecules/information_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,23 @@ Color _getBarColor(ZdsInformationBarTheme color, ZetaColors colors) {
case ZdsInformationBarTheme.neutral:
return colors.cool.surface;
case ZdsInformationBarTheme.positive:
return colors.green.surface;
return colors.surfacePositiveSubtle;
case ZdsInformationBarTheme.inProgress:
return colors.secondary.surface;
return colors.surfaceSecondarySubtle;
case ZdsInformationBarTheme.negative:
return colors.negative.surface;
return colors.surfaceNegativeSubtle;
}
}

Color _getIconColor(ZdsInformationBarTheme color, ZetaColors colors) {
switch (color) {
case ZdsInformationBarTheme.neutral:
return colors.cool.icon;
return colors.iconDefault;
case ZdsInformationBarTheme.positive:
return colors.green.icon;
return colors.borderPositive;
case ZdsInformationBarTheme.inProgress:
return colors.secondary.icon;
return colors.surfaceSecondary;
case ZdsInformationBarTheme.negative:
return colors.negative.icon;
return colors.surfaceNegative;
}
}
6 changes: 3 additions & 3 deletions lib/src/components/molecules/tag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ class ZdsTag extends StatelessWidget {
Color _resolveFgColor(ZetaColors zetaColors, ZdsTagColor tagColor) {
switch (tagColor) {
case ZdsTagColor.error:
return zetaColors.negative;
return zetaColors.surfaceNegative;
case ZdsTagColor.alert:
return zetaColors.warning;
return zetaColors.surfaceWarning;
case ZdsTagColor.primary:
return zetaColors.primary;
case ZdsTagColor.secondary:
return zetaColors.secondary;
case ZdsTagColor.success:
return zetaColors.positive;
return zetaColors.surfacePositive;
case ZdsTagColor.basic:
return zetaColors.warm.shade80;
}
Expand Down
12 changes: 6 additions & 6 deletions lib/src/components/molecules/toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ class ZdsToast extends StatelessWidget implements PreferredSizeWidget {
Color _backgroundColor(ZetaColors colors, ZdsToastColors toastColor) {
switch (toastColor) {
case ZdsToastColors.success:
return colors.positive.shade10;
return colors.surfacePositiveSubtle;
case ZdsToastColors.warning:
return colors.warning.shade10;
return colors.surfaceWarningSubtle;
case ZdsToastColors.info:
return colors.info.shade10;
return colors.surfaceInfoSubtle;
case ZdsToastColors.error:
return colors.error.shade10;
return colors.surfaceNegativeSubtle;
case ZdsToastColors.primary:
return colors.primary.shade10;
return colors.surfacePrimarySubtle;
case ZdsToastColors.dark:
return colors.textDefault;
}
Expand All @@ -121,7 +121,7 @@ class ZdsToast extends StatelessWidget implements PreferredSizeWidget {
case ZdsToastColors.warning:
return colors.orange.shade60;
case ZdsToastColors.info:
return colors.info.shade60;
return colors.purple.shade60;
case ZdsToastColors.error:
return colors.error.shade60;
case ZdsToastColors.primary:
Expand Down
16 changes: 14 additions & 2 deletions lib/src/components/organisms/chat/message_body/reacts_tags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ class _ChatReactionsPill extends StatelessWidget {
child: DecoratedBox(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(10)),
boxShadow: [BoxShadow(color: zetaColors.shadow, blurRadius: 1, offset: const Offset(0, 1))],
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.shadow.withOpacity(0.1),
blurRadius: 1,
offset: const Offset(0, 1),
),
],
color: zetaColors.surfacePrimary,
border: Border.all(color: zetaColors.borderSubtle),
),
Expand Down Expand Up @@ -209,7 +215,13 @@ class _ChatTagsPill extends StatelessWidget {
decoration: BoxDecoration(
border: Border.all(width: 2, color: zetaColors.surfacePrimary),
borderRadius: const BorderRadius.all(Radius.circular(10)),
boxShadow: [BoxShadow(color: zetaColors.shadow, blurRadius: 1, offset: const Offset(0, 1))],
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.shadow.withOpacity(0.1),
blurRadius: 1,
offset: const Offset(0, 1),
),
],
color: zetaColors.secondary,
),
child: Padding(
Expand Down
5 changes: 4 additions & 1 deletion lib/src/components/organisms/chat/message_body/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class ZdsChatTextMessage extends StatelessWidget {
final zetaColors = Zeta.of(context).colors;
final wordsMapping = Map<String, HighlightedWord>.fromEntries(
[...urls].map((e) {
return MapEntry(e, HighlightedWord(textStyle: textStyle?.apply(color: zetaColors.link), onTap: onLinkTapped));
return MapEntry(
e,
HighlightedWord(textStyle: textStyle?.apply(color: zetaColors.blue.shade70), onTap: onLinkTapped),
);
}),
);

Expand Down
6 changes: 5 additions & 1 deletion lib/src/components/organisms/chat/message_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ class ZdsMessageInputState extends State<ZdsMessageInput> with SingleTickerProvi
constraints: const BoxConstraints(minHeight: 72, maxHeight: 150),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(offset: const Offset(0, -1), color: zetaColors.shadow, blurRadius: 2),
BoxShadow(
offset: const Offset(0, -1),
color: Theme.of(context).colorScheme.shadow.withOpacity(0.1),
blurRadius: 2,
),
BoxShadow(offset: const Offset(0, 1), color: zetaColors.surfacePrimary, blurRadius: 2),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/organisms/list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ZdsListTile extends StatelessWidget {
tile = InkWell(
onTap: onTap,
splashColor: zetaColors.surfaceSelected,
hoverColor: zetaColors.surfaceHovered,
hoverColor: zetaColors.surfaceHover,
child: (bottom != null)
? Column(
mainAxisSize: MainAxisSize.min,
Expand Down
5 changes: 3 additions & 2 deletions lib/src/utils/theme/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _ZdsBaseColors {

var error = (json?['error'] as String?)?.toColor();
if (error == null && isShadeOfRed(primary)) {
error = ZetaColorBase.greyWarm;
error = ZetaColorBase.warm;
} else {
error = ZetaColorBase.red;
}
Expand Down Expand Up @@ -188,7 +188,8 @@ class ZdsThemeData {
///
/// Returns a new [ZdsThemeData] object from JSON data.
factory ZdsThemeData.fromJsonString(String json) {
return ZdsThemeData.fromJson(_parseJson(json));
final x = ZdsThemeData.fromJson(_parseJson(json));
return x;
}

/// Asynchronously creates an instance of [ZdsThemeData] from the JSON file at the given [path].
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies:
video_compress: ^3.1.2
video_player: ^2.8.6
vsc_quill_delta_to_html: ^1.0.4
zeta_flutter: ^0.9.1
zeta_flutter: ^0.10.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 2f49efb

Please sign in to comment.