From baf24d161ccc44172f19783b338bcb9baa6c18be Mon Sep 17 00:00:00 2001 From: Pablo Guerra Date: Fri, 3 May 2024 18:09:34 -0400 Subject: [PATCH] Visual Improvements --- CHANGELOG.md | 7 ++++ lib/models/app_state.dart | 4 +++ lib/screens/home.dart | 54 ++++++++++++++++------------- lib/widgets/custom_filter_chip.dart | 24 ++++++++----- lib/widgets/frosted_container.dart | 6 ++-- lib/widgets/header_banner.dart | 15 ++++++-- pubspec.yaml | 2 +- 7 files changed, 70 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 458a8d7..d85eb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.3.1 + +- REVISED: Revised home header banner padding. +- REVISED: Revised timeline filter chip fitment. +- REVISED: Timeline entries are now sorted by start date in descending order. +- REVISED: Revised the FrostedContainer color for light mode. + ## 2.3.0 - NEW: Timeline section on home page now includes projects. diff --git a/lib/models/app_state.dart b/lib/models/app_state.dart index 14caa4a..9fd5dbb 100644 --- a/lib/models/app_state.dart +++ b/lib/models/app_state.dart @@ -162,6 +162,10 @@ class AppState extends ChangeNotifier { entries.addAll(_projects.map((Project project) => project.timelineEntry)); } + entries.sort((TimelineEntry a, TimelineEntry b) { + return b.startDate.compareTo(a.startDate); + }); + return entries; } diff --git a/lib/screens/home.dart b/lib/screens/home.dart index e74f82f..ec13a45 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -165,31 +165,35 @@ class HomeScreen extends StatelessWidget { controller: scrollController, padding: const EdgeInsets.all(16), childrenDelegate: SliverChildListDelegate([ - Wrap( - spacing: 8, - children: [ - CustomFilterChip( - label: Strings.education, - selected: appState.educationVisible, - onSelected: (bool value) { - appState.toggleEducationVisibility(); - }, - ), - CustomFilterChip( - label: Strings.professional, - selected: appState.professionalExperiencesVisible, - onSelected: (bool value) { - appState.toggleProfessionalExperienceVisibility(); - }, - ), - CustomFilterChip( - label: Strings.projects, - selected: appState.projectsVisible, - onSelected: (bool value) { - appState.toggleProjectsVisibility(); - }, - ), - ], + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Row( + children: [ + CustomFilterChip( + label: Strings.education, + selected: appState.educationVisible, + onSelected: (bool value) { + appState.toggleEducationVisibility(); + }, + ), + CustomFilterChip( + label: Strings.professional, + selected: appState.professionalExperiencesVisible, + onSelected: (bool value) { + appState + .toggleProfessionalExperienceVisibility(); + }, + ), + CustomFilterChip( + label: Strings.projects, + selected: appState.projectsVisible, + onSelected: (bool value) { + appState.toggleProjectsVisibility(); + }, + ), + ], + ), ), Padding( padding: const EdgeInsets.only(top: 8.0), diff --git a/lib/widgets/custom_filter_chip.dart b/lib/widgets/custom_filter_chip.dart index 6c9eeaa..c64761f 100644 --- a/lib/widgets/custom_filter_chip.dart +++ b/lib/widgets/custom_filter_chip.dart @@ -19,15 +19,21 @@ class CustomFilterChip extends StatelessWidget { @override Widget build(BuildContext context) { - return FilterChip.elevated( - label: Text(label), - selected: selected, - onSelected: onSelected, - selectedColor: Theme.of(context).colorScheme.background, - backgroundColor: - Theme.of(context).colorScheme.background.withOpacity(0.2), - checkmarkColor: Theme.of(context).colorScheme.primary, - visualDensity: VisualDensity.compact, + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 4.0), + child: FilterChip.elevated( + label: Text( + label, + style: Theme.of(context).textTheme.labelLarge, + ), + selected: selected, + onSelected: onSelected, + selectedColor: Theme.of(context).colorScheme.background, + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.2), + checkmarkColor: Theme.of(context).colorScheme.primary, + visualDensity: VisualDensity.compact, + ), ); } } diff --git a/lib/widgets/frosted_container.dart b/lib/widgets/frosted_container.dart index 4f563ce..2d89521 100644 --- a/lib/widgets/frosted_container.dart +++ b/lib/widgets/frosted_container.dart @@ -25,9 +25,7 @@ class FrostedContainer extends StatelessWidget { return Material( color: Colors.transparent, elevation: 3, - shadowColor: Theme.of(context).brightness == Brightness.dark - ? Colors.black87 - : Colors.black87, + shadowColor: Colors.black87, borderRadius: BorderRadius.circular(borderRadiusAmount), child: ClipRRect( borderRadius: BorderRadius.circular(borderRadiusAmount), @@ -36,7 +34,7 @@ class FrostedContainer extends StatelessWidget { child: Container( decoration: BoxDecoration( color: Theme.of(context).brightness == Brightness.light - ? Theme.of(context).colorScheme.surface.withOpacity(0.75) + ? Theme.of(context).colorScheme.background.withOpacity(0.8) : Theme.of(context) .colorScheme .surfaceVariant diff --git a/lib/widgets/header_banner.dart b/lib/widgets/header_banner.dart index 0015b90..bdbc20b 100644 --- a/lib/widgets/header_banner.dart +++ b/lib/widgets/header_banner.dart @@ -23,17 +23,26 @@ class HeaderBanner extends StatelessWidget { @override Widget build(BuildContext context) { return FrostedContainer( + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Row( children: [ if (leading != null) leading!, - if (leading != null) const SizedBox(width: 16.0), + if (leading != null) const SizedBox(width: 12.0), Expanded( child: Column( + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - title, + const SizedBox(height: 10.0), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4.0), + child: title, + ), const Divider(), - subtitle, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4.0), + child: subtitle, + ), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 322108e..2cbcf7c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: plg_portfolio description: Pablo L. Guerra's web-app portfolio powered by Flutter. publish_to: "none" -version: 2.3.0+40 +version: 2.3.1+41 environment: sdk: ">=3.1.1 <4.0.0"