From 80894c687e0333c5c8319de10e94f6a5c595452f Mon Sep 17 00:00:00 2001 From: Jordy de Jonghe Date: Fri, 11 Oct 2024 14:40:12 +0200 Subject: [PATCH] #334: added shadow to themeing --- lib/styles/theme_data.dart | 10 ++++++++++ .../general/bottom_navigation/bottom_navigation.dart | 9 ++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/styles/theme_data.dart b/lib/styles/theme_data.dart index 4b84b4e5..cd5867d4 100644 --- a/lib/styles/theme_data.dart +++ b/lib/styles/theme_data.dart @@ -286,3 +286,13 @@ extension TextStyleExtension on TextStyle { TextStyle get italic => copyWith(fontStyle: FontStyle.italic); } + +extension ShadowsExtension on Color { + List get bottomNavShadow => [ + BoxShadow( + spreadRadius: 2, + blurRadius: 8, + color: this, + ) + ]; +} diff --git a/lib/widget/general/bottom_navigation/bottom_navigation.dart b/lib/widget/general/bottom_navigation/bottom_navigation.dart index 382cb5b7..7b9a5ff4 100644 --- a/lib/widget/general/bottom_navigation/bottom_navigation.dart +++ b/lib/widget/general/bottom_navigation/bottom_navigation.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/model/bottom_navigation/bottom_navigation_tab.dart'; +import 'package:flutter_template/styles/theme_data.dart'; import 'package:flutter_template/widget/general/bottom_navigation/bottom_navigation_item.dart'; import 'package:flutter_template/widget/provider/data_provider_widget.dart'; @@ -20,13 +21,7 @@ class BottomNavigation extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: theme.bottomNavbarBackground, - boxShadow: [ - BoxShadow( - spreadRadius: 2, - blurRadius: 8, - color: theme.shadow, - ), - ], + boxShadow: theme.shadow.bottomNavShadow, ), child: Column( mainAxisSize: MainAxisSize.min,