Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions lib/commons/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class Default {
// (FloatingAction)Button Foreground Selected / Account Background, Border, Text
static Color onPrimary = Colors.grey.shade100;

// FloatingActionButton Background Unselected
// FloatingActionButton Background Unselected / Marker Background
static Color primaryContainerLight = Colors.grey.shade100;
static const Color primaryContainerDark = Color(0xFF002020);

// (FloatingAction)Button Foreground Unselected
// (FloatingAction)Button Foreground Unselected / Marker Foreground
static Color onPrimaryContainerLight = Colors.grey.shade900;
static Color onPrimaryContainerDark = Colors.grey.shade50;

Expand Down Expand Up @@ -164,18 +164,51 @@ final ThemeData darkTheme = ThemeData(
scaffoldBackgroundColor: Default.surfaceDark,
);

final ThemeData highContrastDarkTheme = ThemeData.dark().copyWith(
colorScheme: const ColorScheme.highContrastDark(),
final ThemeData highContrastDarkTheme = ThemeData(
colorScheme: ThemeData.dark().colorScheme.copyWith(
primary: Default.primary,
onPrimary: Colors.black,
primaryContainer: Colors.white,
onPrimaryContainer: Colors.black,
surface: Colors.black,
tertiary: Colors.black,
onTertiary: Colors.white,
error: Colors.orange,
),
appBarTheme: defaultTheme.appBarTheme.copyWith(
foregroundColor: Colors.black,
),
floatingActionButtonTheme: defaultTheme.floatingActionButtonTheme,
outlinedButtonTheme: defaultTheme.outlinedButtonTheme,
iconButtonTheme: defaultTheme.iconButtonTheme,
inputDecorationTheme: defaultTheme.inputDecorationTheme,
);

final ThemeData highContrastLightTheme = ThemeData.light().copyWith(
colorScheme: const ColorScheme.highContrastLight(),
final ThemeData highContrastLightTheme = ThemeData(
colorScheme: ThemeData.light().colorScheme.copyWith(
primary: Default.primary,
onPrimary: Colors.black,
primaryContainer: Colors.black,
onPrimaryContainer: Colors.white,
surface: Colors.white,
tertiary: Colors.white,
onTertiary: Colors.black,
error: Colors.purple.shade600,
),
appBarTheme: defaultTheme.appBarTheme.copyWith(
foregroundColor: Colors.black,
),
floatingActionButtonTheme: defaultTheme.floatingActionButtonTheme,
outlinedButtonTheme: defaultTheme.outlinedButtonTheme,
outlinedButtonTheme: OutlinedButtonThemeData(
style: defaultTheme.outlinedButtonTheme.style?.copyWith(
foregroundColor: WidgetStateProperty.all(Colors.black),
),
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
foregroundColor: WidgetStateProperty.all(Colors.black),
),
),
iconButtonTheme: defaultTheme.iconButtonTheme,
inputDecorationTheme: defaultTheme.inputDecorationTheme,
);
4 changes: 2 additions & 2 deletions lib/widgets/completed_area_layer/completed_area_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _CheckMarkState extends State<CheckMark> with SingleTickerProviderStateMix
color: const Color(0xFF8ccf73),
shape: BoxShape.circle,
border: Border.all(
color: Colors.white,
color: Theme.of(context).colorScheme.primaryContainer,
width: 3.0,
),
),
Expand All @@ -80,7 +80,7 @@ class _CheckMarkState extends State<CheckMark> with SingleTickerProviderStateMix
child: AnimatedPath(
animation: _animation,
strokeWidth: 5,
color: Colors.white,
color: Theme.of(context).colorScheme.onPrimary,
pathBuilder: (size) {
return Path()
..moveTo(0.270 * size.width, 0.541 * size.height)
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/osm_element_layer/osm_element_marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class _OsmElementMarkerState extends State<OsmElementMarker> with SingleTickerPr
child: AnimatedBuilder(
animation: _animation,
builder: (_, _) => MarkerBubble(
color: Theme.of(context).colorScheme.primaryContainer,
shadowColor: Theme.of(context).colorScheme.shadow.withValues(alpha: 0.4),
elevation: _animation.value * 2,
child: Padding(
Expand All @@ -90,7 +91,7 @@ class _OsmElementMarkerState extends State<OsmElementMarker> with SingleTickerPr
padding: const EdgeInsets.all(7),
child: Icon(
widget.icon,
color: Colors.white,
color: Theme.of(context).colorScheme.onPrimary,
shadows: const [
Shadow(
color: Colors.black12,
Expand Down Expand Up @@ -119,7 +120,7 @@ class _OsmElementMarkerState extends State<OsmElementMarker> with SingleTickerPr
softWrap: true,
maxLines: 2,
style: TextStyle(
color: Colors.grey.shade900,
color: Theme.of(context).colorScheme.onPrimaryContainer,
fontSize: 16,
overflow: TextOverflow.ellipsis,
),
Expand Down
5 changes: 4 additions & 1 deletion lib/widgets/question_inputs/bool_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class BoolInput extends QuestionInputWidget<BoolAnswerDefinition, BoolAnswer> {
Widget build(BuildContext context) {
final theme = Theme.of(context);
final appLocale = AppLocalizations.of(context)!;
final isHighContrast = MediaQuery.highContrastOf(context);

return SizedBox(
width: double.infinity,
Expand All @@ -39,7 +40,9 @@ class BoolInput extends QuestionInputWidget<BoolAnswerDefinition, BoolAnswer> {
active: controller.answer?.value == state,
backgroundColor: theme.colorScheme.primary.withValues(alpha: 0.0),
activeBackgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.primary,
foregroundColor: isHighContrast && theme.brightness == Brightness.light
? Colors.black
: theme.colorScheme.primary,
activeForegroundColor: theme.colorScheme.onPrimary,
),
);
Expand Down
Loading