From 9d6721d58bc9288db9760abf452338931fba2195 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 24 Feb 2023 15:12:03 +0300 Subject: [PATCH] refactor: Deprecate showFab on BrandHeroScreen --- lib/ui/layouts/brand_hero_screen.dart | 3 ++- lib/ui/layouts/root_scaffold_with_navigation.dart | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ui/layouts/brand_hero_screen.dart b/lib/ui/layouts/brand_hero_screen.dart index d51bca4f..6782880a 100644 --- a/lib/ui/layouts/brand_hero_screen.dart +++ b/lib/ui/layouts/brand_hero_screen.dart @@ -9,7 +9,7 @@ class BrandHeroScreen extends StatelessWidget { required this.children, super.key, this.hasBackButton = true, - this.hasFlashButton = true, + this.hasFlashButton = false, this.heroIcon, this.heroIconWidget, this.heroTitle = '', @@ -20,6 +20,7 @@ class BrandHeroScreen extends StatelessWidget { final List children; final bool hasBackButton; + @Deprecated('Flash button is now provided by root scaffold') final bool hasFlashButton; final IconData? heroIcon; final Widget? heroIconWidget; diff --git a/lib/ui/layouts/root_scaffold_with_navigation.dart b/lib/ui/layouts/root_scaffold_with_navigation.dart index 6401a783..ca0010d5 100644 --- a/lib/ui/layouts/root_scaffold_with_navigation.dart +++ b/lib/ui/layouts/root_scaffold_with_navigation.dart @@ -52,6 +52,9 @@ class RootScaffoldWithNavigation extends StatelessWidget { hidden: !(Breakpoints.small.isActive(context) && showBottomBar), key: const Key('bottomBar'), ), + floatingActionButton: showFab && Breakpoints.small.isActive(context) + ? const BrandFab() + : null, ); } }