From 22e3067d059ce6d44c4b29ba9f47cd63b0a583f0 Mon Sep 17 00:00:00 2001 From: zaid_daoud Date: Tue, 10 Oct 2023 16:22:08 +0300 Subject: [PATCH] Floating button theme --- lib/new_views/app_style/app_themes.dart | 14 ++++++++++++-- .../common_widgets/app_floating_button.dart | 18 ------------------ lib/new_views/pages/land_page/land_page.dart | 5 ++--- 3 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 lib/new_views/common_widgets/app_floating_button.dart diff --git a/lib/new_views/app_style/app_themes.dart b/lib/new_views/app_style/app_themes.dart index b19ac7dd..0341d07d 100644 --- a/lib/new_views/app_style/app_themes.dart +++ b/lib/new_views/app_style/app_themes.dart @@ -9,7 +9,12 @@ class AppThemes { indicatorColor: AppColor.primary50, scaffoldBackgroundColor: AppColor.backgroundLight, colorScheme: const ColorScheme.light(primary: AppColor.primary50, onPrimary: Colors.white, secondary: Colors.white, onSecondary: AppColor.neutral70), - floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: AppColor.backgroundDark), + floatingActionButtonTheme: const FloatingActionButtonThemeData( + elevation: 0, + iconSize: 46, + backgroundColor: AppColor.primary70, + foregroundColor: AppColor.neutral30, + ), bottomNavigationBarTheme: BottomNavigationBarThemeData( type: BottomNavigationBarType.fixed, unselectedLabelStyle: ThemeData.light().textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w500), @@ -32,7 +37,12 @@ class AppThemes { indicatorColor: AppColor.primary50, scaffoldBackgroundColor: AppColor.backgroundDark, colorScheme: const ColorScheme.light(primary: AppColor.primary50, onPrimary: AppColor.neutral60, secondary: AppColor.neutral60, onSecondary: Colors.white), - floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: AppColor.primary40), + floatingActionButtonTheme: const FloatingActionButtonThemeData( + elevation: 0, + iconSize: 46, + backgroundColor: AppColor.primary40, + foregroundColor: AppColor.neutral50, + ), bottomNavigationBarTheme: BottomNavigationBarThemeData( type: BottomNavigationBarType.fixed, unselectedLabelStyle: ThemeData.dark().textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w500), diff --git a/lib/new_views/common_widgets/app_floating_button.dart b/lib/new_views/common_widgets/app_floating_button.dart deleted file mode 100644 index 0f48cde3..00000000 --- a/lib/new_views/common_widgets/app_floating_button.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:test_sa/extensions/context_extension.dart'; - -import '../app_style/app_color.dart'; - -class AppFloatingButton extends StatelessWidget { - final IconData icon; - final VoidCallback onPressed; - const AppFloatingButton({Key key, @required this.icon, @required this.onPressed}) : super(key: key); - - @override - Widget build(BuildContext context) { - return FloatingActionButton( - onPressed: onPressed, - child: Icon(icon, color: context.isDark ? AppColor.neutral50 : AppColor.neutral30), - ); - } -} diff --git a/lib/new_views/pages/land_page/land_page.dart b/lib/new_views/pages/land_page/land_page.dart index 1df3ba7a..9c92d6ee 100644 --- a/lib/new_views/pages/land_page/land_page.dart +++ b/lib/new_views/pages/land_page/land_page.dart @@ -9,7 +9,6 @@ import 'package:test_sa/new_views/pages/land_page/my_requests_page.dart'; import '../../common_widgets/app_bottom_nav_bar.dart'; import '../../common_widgets/app_drawer.dart'; -import '../../common_widgets/app_floating_button.dart'; import 'contact_us_bottom_sheet.dart'; import 'dashboard_page.dart'; @@ -59,8 +58,8 @@ class _LandPageState extends State { child: _pages[currentPageIndex], ), drawer: const AppDrawer(), - floatingActionButton: AppFloatingButton( - icon: Icons.add, + floatingActionButton: FloatingActionButton( + child: const Icon(Icons.add), onPressed: () {}, ), bottomNavigationBar: AppBottomNavigationBar(