From 94c5ed47727ed512477bb3ccd6b4b4f3db316523 Mon Sep 17 00:00:00 2001 From: mikecoomber Date: Mon, 9 Sep 2024 15:28:14 +0100 Subject: [PATCH] fix errors --- .../lib/pages/components/notification_list_example.dart | 7 ++++--- test/src/components/chat_item/chat_item_test.dart | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/example/lib/pages/components/notification_list_example.dart b/example/lib/pages/components/notification_list_example.dart index a13ae1ad..3c3a3a92 100644 --- a/example/lib/pages/components/notification_list_example.dart +++ b/example/lib/pages/components/notification_list_example.dart @@ -11,6 +11,7 @@ class NotificationListItemExample extends StatelessWidget { final Image image = Image.network( "https://i.ytimg.com/vi/KItsWUzFUOs/maxresdefault.jpg", ); + final colors = Zeta.of(context).colors; return ExampleScaffold( name: name, @@ -32,7 +33,7 @@ class NotificationListItemExample extends StatelessWidget { avatar: ZetaAvatar.initials( initials: "JS", lowerBadge: ZetaAvatarBadge.icon( - color: ZetaColors().surfacePositive, + color: colors.surfacePositive, icon: Icons.check, ), )), @@ -63,7 +64,7 @@ class NotificationListItemExample extends StatelessWidget { avatar: ZetaAvatar.initials( initials: "JS", lowerBadge: ZetaAvatarBadge.icon( - color: ZetaColors().surfacePositive, + color: colors.surfacePositive, icon: Icons.check, ), )), @@ -87,7 +88,7 @@ class NotificationListItemExample extends StatelessWidget { avatar: ZetaAvatar.initials( initials: "JS", lowerBadge: ZetaAvatarBadge.icon( - color: ZetaColors().surfacePositive, + color: colors.surfacePositive, icon: Icons.check, ), ), diff --git a/test/src/components/chat_item/chat_item_test.dart b/test/src/components/chat_item/chat_item_test.dart index 4f02dcb4..971dec65 100644 --- a/test/src/components/chat_item/chat_item_test.dart +++ b/test/src/components/chat_item/chat_item_test.dart @@ -5,6 +5,7 @@ import 'package:intl/intl.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:path/path.dart'; +import 'package:zeta_flutter/generated/generated.dart'; import 'package:zeta_flutter/zeta_flutter.dart'; import '../../../test_utils/test_app.dart'; @@ -402,12 +403,12 @@ void main() { slidableActions: [ ZetaSlidableAction( onPressed: () {}, - color: ZetaColorBase.orange, + color: const ZetaPrimitivesLight().orange, icon: Icons.star, ), ZetaSlidableAction( onPressed: () {}, - color: ZetaColorBase.red, + color: const ZetaPrimitivesLight().red, icon: Icons.delete, ), ], @@ -487,7 +488,7 @@ void main() { expect(diagnosticsZetaSlidableAction.finder('icon'), 'IconData(U+0E5F9)'); expect(diagnosticsZetaSlidableAction.finder('foregroundColor'), null); expect(diagnosticsZetaSlidableAction.finder('backgroundColor'), null); - expect(diagnosticsZetaSlidableAction.finder('color'), ZetaColorBase.blue.toString()); + expect(diagnosticsZetaSlidableAction.finder('color'), const ZetaPrimitivesLight().blue.toString()); expect(diagnosticsZetaSlidableAction.finder('semanticLabel'), 'null'); expect(diagnosticsZetaSlidableAction.finder('paleColor'), 'false'); });