From b0aafd0f48e978b3fb22939e379cb80bb05bd839 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Mon, 26 Jun 2023 17:51:42 +0200 Subject: [PATCH] neon, neon_news, neon_notifications: use error color of the theme --- packages/neon/neon/lib/src/pages/home.dart | 6 ++++-- packages/neon/neon/lib/src/pages/settings.dart | 4 ++-- packages/neon/neon/lib/src/widgets/cached_image.dart | 2 +- packages/neon/neon_news/lib/widgets/feeds_view.dart | 4 ++-- packages/neon/neon_notifications/lib/pages/main.dart | 6 ++++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index 6b3bbf3c..0994b71b 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -77,6 +77,8 @@ class _HomePageState extends State { } Future _showProblem(final String title) async { + final colorScheme = Theme.of(context).colorScheme; + await showDialog( context: context, builder: (final context) => AlertDialog( @@ -84,8 +86,8 @@ class _HomePageState extends State { actions: [ ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.red, - foregroundColor: Theme.of(context).colorScheme.onPrimary, + backgroundColor: colorScheme.error, + foregroundColor: colorScheme.onError, ), onPressed: () { Navigator.of(context).pop(); diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index 050cf8ce..b2c25118 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -118,10 +118,10 @@ class _SettingsPageState extends State { !pushNotificationsEnabledEnabledSnapshot.requireData) ...[ NeonTextSettingsTile( text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice, - style: const TextStyle( + style: TextStyle( fontWeight: FontWeight.w600, fontStyle: FontStyle.italic, - color: Colors.red, + color: Theme.of(context).colorScheme.error, ), ), ], diff --git a/packages/neon/neon/lib/src/widgets/cached_image.dart b/packages/neon/neon/lib/src/widgets/cached_image.dart index 0c6a73cf..43d0331a 100644 --- a/packages/neon/neon/lib/src/widgets/cached_image.dart +++ b/packages/neon/neon/lib/src/widgets/cached_image.dart @@ -71,7 +71,7 @@ class _NeonCachedImageState extends State { }, onlyIcon: true, iconSize: widget.size?.shortestSide, - color: widget.iconColor ?? Colors.red, + color: widget.iconColor ?? Theme.of(context).colorScheme.error, ); } return SizedBox( diff --git a/packages/neon/neon_news/lib/widgets/feeds_view.dart b/packages/neon/neon_news/lib/widgets/feeds_view.dart index a96301ef..028c19de 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -74,8 +74,8 @@ class NewsFeedsView extends StatelessWidget { iconSize: 30, icon: Text( feed.updateErrorCount.toString(), - style: const TextStyle( - color: Colors.red, + style: TextStyle( + color: Theme.of(context).colorScheme.error, ), ), ), diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 976acacf..18c76e3b 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -92,6 +92,8 @@ class _NotificationsMainPageState extends State { final accountsBloc = Provider.of(context, listen: false); await accountsBloc.activeAppsBloc.setActiveApp(app.id); } else { + final colorScheme = Theme.of(context).colorScheme; + await showDialog( context: context, builder: (final context) => AlertDialog( @@ -99,8 +101,8 @@ class _NotificationsMainPageState extends State { actions: [ ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.red, - foregroundColor: Theme.of(context).colorScheme.onPrimary, + backgroundColor: colorScheme.error, + foregroundColor: colorScheme.onError, ), onPressed: () { Navigator.of(context).pop();