Browse Source

neon, neon_news, neon_notifications: use error color of the theme

pull/425/head
Nikolas Rimikis 2 years ago
parent
commit
b0aafd0f48
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 6
      packages/neon/neon/lib/src/pages/home.dart
  2. 4
      packages/neon/neon/lib/src/pages/settings.dart
  3. 2
      packages/neon/neon/lib/src/widgets/cached_image.dart
  4. 4
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  5. 6
      packages/neon/neon_notifications/lib/pages/main.dart

6
packages/neon/neon/lib/src/pages/home.dart

@ -77,6 +77,8 @@ class _HomePageState extends State<HomePage> {
} }
Future _showProblem(final String title) async { Future _showProblem(final String title) async {
final colorScheme = Theme.of(context).colorScheme;
await showDialog( await showDialog(
context: context, context: context,
builder: (final context) => AlertDialog( builder: (final context) => AlertDialog(
@ -84,8 +86,8 @@ class _HomePageState extends State<HomePage> {
actions: [ actions: [
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.red, backgroundColor: colorScheme.error,
foregroundColor: Theme.of(context).colorScheme.onPrimary, foregroundColor: colorScheme.onError,
), ),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();

4
packages/neon/neon/lib/src/pages/settings.dart

@ -118,10 +118,10 @@ class _SettingsPageState extends State<SettingsPage> {
!pushNotificationsEnabledEnabledSnapshot.requireData) ...[ !pushNotificationsEnabledEnabledSnapshot.requireData) ...[
NeonTextSettingsTile( NeonTextSettingsTile(
text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice, text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice,
style: const TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
color: Colors.red, color: Theme.of(context).colorScheme.error,
), ),
), ),
], ],

2
packages/neon/neon/lib/src/widgets/cached_image.dart

@ -71,7 +71,7 @@ class _NeonCachedImageState extends State<NeonCachedImage> {
}, },
onlyIcon: true, onlyIcon: true,
iconSize: widget.size?.shortestSide, iconSize: widget.size?.shortestSide,
color: widget.iconColor ?? Colors.red, color: widget.iconColor ?? Theme.of(context).colorScheme.error,
); );
} }
return SizedBox( return SizedBox(

4
packages/neon/neon_news/lib/widgets/feeds_view.dart

@ -74,8 +74,8 @@ class NewsFeedsView extends StatelessWidget {
iconSize: 30, iconSize: 30,
icon: Text( icon: Text(
feed.updateErrorCount.toString(), feed.updateErrorCount.toString(),
style: const TextStyle( style: TextStyle(
color: Colors.red, color: Theme.of(context).colorScheme.error,
), ),
), ),
), ),

6
packages/neon/neon_notifications/lib/pages/main.dart

@ -92,6 +92,8 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
final accountsBloc = Provider.of<AccountsBloc>(context, listen: false); final accountsBloc = Provider.of<AccountsBloc>(context, listen: false);
await accountsBloc.activeAppsBloc.setActiveApp(app.id); await accountsBloc.activeAppsBloc.setActiveApp(app.id);
} else { } else {
final colorScheme = Theme.of(context).colorScheme;
await showDialog( await showDialog(
context: context, context: context,
builder: (final context) => AlertDialog( builder: (final context) => AlertDialog(
@ -99,8 +101,8 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
actions: [ actions: [
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.red, backgroundColor: colorScheme.error,
foregroundColor: Theme.of(context).colorScheme.onPrimary, foregroundColor: colorScheme.onError,
), ),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();

Loading…
Cancel
Save