Skip to content

Commit

Permalink
Invert colors for Cancel/Save buttons in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 10, 2025
1 parent 4251bf3 commit 3827ea6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/smooth_app/lib/widgets/v2/smooth_buttons_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/duration_constants.dart';
import 'package:smooth_app/helpers/keyboard_helper.dart';
import 'package:smooth_app/themes/smooth_theme.dart';
import 'package:smooth_app/themes/smooth_theme_colors.dart';
import 'package:smooth_app/themes/theme_provider.dart';

Expand Down Expand Up @@ -152,13 +153,13 @@ class _SmoothPositiveButton2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
final SmoothColorsThemeExtension colors =
Theme.of(context).extension<SmoothColorsThemeExtension>()!;
context.extension<SmoothColorsThemeExtension>();
final bool lightTheme = context.lightTheme();

return _SmoothBaseButton2(
data: data,
backgroundColor:
context.lightTheme() ? colors.primaryBlack : colors.primaryDark,
foregroundColor: Colors.white,
backgroundColor: lightTheme ? colors.primaryBlack : colors.primaryLight,
foregroundColor: lightTheme ? Colors.white : colors.primaryDark,
);
}
}
Expand All @@ -171,12 +172,15 @@ class _SmoothNegativeButton2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
final SmoothColorsThemeExtension colors =
Theme.of(context).extension<SmoothColorsThemeExtension>()!;
context.extension<SmoothColorsThemeExtension>();

final bool lightTheme = context.lightTheme();

return _SmoothBaseButton2(
data: data,
backgroundColor: colors.primaryMedium,
foregroundColor: colors.primaryDark,
backgroundColor:
lightTheme ? colors.primaryMedium : colors.primaryDark,
foregroundColor: lightTheme ? colors.primaryDark : colors.primaryLight,
);
}
}
Expand Down

0 comments on commit 3827ea6

Please sign in to comment.