From 36f4311abbe201384adceeb738ace26227748340 Mon Sep 17 00:00:00 2001 From: alexdivadi Date: Wed, 18 Feb 2026 18:13:15 -0600 Subject: [PATCH] refactor: update colors --- lib/core/common/widgets/dropdown_section.dart | 8 +-- .../common/widgets/max_width_container.dart | 2 +- lib/core/config/theme/colors.dart | 10 +-- lib/core/config/theme/theme.dart | 20 ++++-- .../widgets/dashboard_calendar_card.dart | 68 +++++++++++-------- 5 files changed, 64 insertions(+), 44 deletions(-) diff --git a/lib/core/common/widgets/dropdown_section.dart b/lib/core/common/widgets/dropdown_section.dart index c0df20e..08fde0e 100644 --- a/lib/core/common/widgets/dropdown_section.dart +++ b/lib/core/common/widgets/dropdown_section.dart @@ -8,12 +8,14 @@ class DropdownText extends StatefulWidget { required this.content, this.maxLines = 2, this.padding = const EdgeInsets.symmetric(horizontal: AnyStepSpacing.md16), + this.backgroundColor, }); final Widget title; final String content; final int maxLines; final EdgeInsetsGeometry padding; + final Color? backgroundColor; @override State createState() => _DropdownTextState(); @@ -24,6 +26,7 @@ class _DropdownTextState extends State { @override Widget build(BuildContext context) { + final bgColor = widget.backgroundColor ?? Theme.of(context).colorScheme.surfaceContainer; return Padding( padding: widget.padding, child: Column( @@ -62,10 +65,7 @@ class _DropdownTextState extends State { gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [ - Theme.of(context).scaffoldBackgroundColor.withAlpha(0), - Theme.of(context).scaffoldBackgroundColor, - ], + colors: [bgColor.withAlpha(0), bgColor], ), ), ), diff --git a/lib/core/common/widgets/max_width_container.dart b/lib/core/common/widgets/max_width_container.dart index 2407236..897bd75 100644 --- a/lib/core/common/widgets/max_width_container.dart +++ b/lib/core/common/widgets/max_width_container.dart @@ -5,7 +5,7 @@ class MaxWidthContainer extends StatelessWidget { const MaxWidthContainer({ super.key, required this.child, - this.maxWidth = 900, // tweak like Bootstrap's container + this.maxWidth = 720, // tweak like Bootstrap's container this.padding = const .symmetric(horizontal: AnyStepSpacing.md16, vertical: 0), this.alignment = Alignment.topCenter, }); diff --git a/lib/core/config/theme/colors.dart b/lib/core/config/theme/colors.dart index 9182ad2..d5419e9 100644 --- a/lib/core/config/theme/colors.dart +++ b/lib/core/config/theme/colors.dart @@ -1,16 +1,18 @@ import 'dart:ui'; class AnyStepColors { - static const Color black = Color(0xFF000000); + static const Color black = Color(0xFF0C1821); + static const Color pureBlack = Color(0xFF000000); static const Color gray = Color(0xFFB0B0B0); static const Color grayDark = Color(0xFF28262C); static const Color navyDark = Color(0xFF273043); static const Color blueDeep = Color(0xFF14248A); static const Color blueBright = Color(0xFF47A7ED); static const Color blueBright20 = Color.fromRGBO(71, 167, 237, 0.2); - static const Color white = Color(0xFFFFFFFF); - static const Color lightSecondaryContainer = Color(0xFFFFFAFF); - static const Color lightTertiaryContainer = Color(0xFFF9F4F5); + static const Color white = Color(0xFFFFFCF9); + static const Color pureWhite = Color(0xFFFFFFFF); + static const Color lightSecondaryContainer = Color(0xFFF4F3EE); + static const Color lightTertiaryContainer = Color(0xFFEEEDE6); static const Color error = Color(0xFFD62839); static const Color errorDark = Color(0xFFBA1A1A); static const Color success = Color(0xFF2E7D32); diff --git a/lib/core/config/theme/theme.dart b/lib/core/config/theme/theme.dart index 5887da9..94c9e52 100644 --- a/lib/core/config/theme/theme.dart +++ b/lib/core/config/theme/theme.dart @@ -36,6 +36,9 @@ class AnyStepTheme { secondaryContainer: AnyStepColors.blueBright20, onSecondary: AnyStepColors.white, surface: AnyStepColors.white, + onSurface: AnyStepColors.black, + surfaceContainer: AnyStepColors.lightSecondaryContainer, + surfaceContainerHighest: AnyStepColors.lightTertiaryContainer, error: AnyStepColors.error, ), textTheme: _tightTextTheme(AnyStepColors.grayDark), @@ -61,10 +64,14 @@ class AnyStepTheme { colorScheme: ColorScheme.fromSeed( seedColor: AnyStepColors.blueBright, brightness: Brightness.dark, + surface: AnyStepColors.black, + onSurface: AnyStepColors.white, + surfaceContainer: AnyStepColors.grayDark, + surfaceContainerHighest: AnyStepColors.navyDark, error: AnyStepColors.errorDark, onError: AnyStepColors.white, ), - textTheme: _tightTextTheme(AnyStepColors.white).copyWith( + textTheme: _tightTextTheme(AnyStepColors.pureWhite).copyWith( bodyMedium: AnyStepTextStyles.bodyMedium.copyWith( color: AnyStepColors.lightTertiaryContainer, ), @@ -93,8 +100,9 @@ class AnyStepTheme { onPrimaryContainer: AnyStepColors.navyDark, secondary: AnyStepColors.blueDeep, secondaryContainer: AnyStepColors.blueBright20, - onSecondary: AnyStepColors.white, - surface: AnyStepColors.white, + onSecondary: AnyStepColors.pureWhite, + surface: AnyStepColors.pureWhite, + onSurface: AnyStepColors.pureBlack, error: AnyStepColors.error, ), textTheme: _tightTextTheme(AnyStepColors.grayDark), @@ -122,7 +130,9 @@ class AnyStepTheme { contrastLevel: 1.0, brightness: Brightness.dark, error: AnyStepColors.errorDark, - onError: AnyStepColors.white, + onError: AnyStepColors.pureWhite, + surface: AnyStepColors.pureBlack, + onSurface: AnyStepColors.pureWhite, ), textTheme: _tightTextTheme(AnyStepColors.white).copyWith( bodyMedium: AnyStepTextStyles.bodyMedium.copyWith( @@ -137,7 +147,7 @@ class AnyStepTheme { elevation: 0, centerTitle: true, backgroundColor: AnyStepColors.navyDark, - foregroundColor: AnyStepColors.white, + foregroundColor: AnyStepColors.pureWhite, ), ); } diff --git a/lib/core/features/dashboard/presentation/widgets/dashboard_calendar_card.dart b/lib/core/features/dashboard/presentation/widgets/dashboard_calendar_card.dart index 2c4f36c..e3d6455 100644 --- a/lib/core/features/dashboard/presentation/widgets/dashboard_calendar_card.dart +++ b/lib/core/features/dashboard/presentation/widgets/dashboard_calendar_card.dart @@ -2,9 +2,11 @@ import 'package:anystep/core/common/constants/spacing.dart'; import 'package:anystep/core/common/widgets/any_step_shimmer.dart'; import 'package:anystep/core/features/events/data/event_repository.dart'; import 'package:anystep/core/features/events/domain/event.dart'; +import 'package:anystep/core/features/events/presentation/event_detail/event_detail_screen.dart'; import 'package:anystep/l10n/generated/app_localizations.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; import 'package:table_calendar/table_calendar.dart'; class DashboardCalendarCard extends ConsumerStatefulWidget { @@ -164,38 +166,44 @@ class _EventRow extends StatelessWidget { @override Widget build(BuildContext context) { - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 10, - height: 10, - margin: const EdgeInsets.only(top: 6), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, - shape: BoxShape.circle, + final eventId = event.id; + + return InkWell( + borderRadius: BorderRadius.circular(AnyStepSpacing.sm10), + onTap: eventId == null ? null : () => context.push(EventDetailScreen.getPath(eventId)), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 10, + height: 10, + margin: const EdgeInsets.only(top: 6), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.primary, + shape: BoxShape.circle, + ), ), - ), - const SizedBox(width: AnyStepSpacing.sm8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - event.name, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.bodyMedium, - ), - const SizedBox(height: AnyStepSpacing.sm4), - Text( - '${event.startTime.toLocal().hour.toString().padLeft(2, '0')}:${event.startTime.toLocal().minute.toString().padLeft(2, '0')} • ${event.address?.city ?? ''}', - style: Theme.of(context).textTheme.bodySmall, - ), - ], + const SizedBox(width: AnyStepSpacing.sm8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + event.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodyMedium, + ), + const SizedBox(height: AnyStepSpacing.sm4), + Text( + '${event.startTime.toLocal().hour.toString().padLeft(2, '0')}:${event.startTime.toLocal().minute.toString().padLeft(2, '0')} • ${event.address?.city ?? ''}', + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), ), - ), - ], + ], + ), ); } }