@@ -7,7 +7,6 @@ import 'package:fallback/services/firebase_services.dart';
77import 'package:fallback/services/secure_storage.dart' ;
88import 'package:fallback/services/shared_prefs.dart' ;
99import 'package:fallback/widgets_basic/buttons/custom_material_button.dart' ;
10- import 'package:fallback/widgets_basic/material_you/you_bottom_app_bar_button.dart' ;
1110import 'package:fallback/widgets_basic/material_you/you_alert_dialog.dart' ;
1211import 'package:firebase_core/firebase_core.dart' ;
1312import 'package:flutter/material.dart' ;
@@ -37,6 +36,7 @@ class _MainLayoutState extends LifecycleState<MainLayout> with SingleTickerProvi
3736 _secureStorage= SecureStorage .getInstance ();
3837
3938 CanAuthenticateResponse availability= await (await _secureStorage).getBiometricStatus ();
39+
4040 if (availability== CanAuthenticateResponse .success){
4141 return ;
4242 }
@@ -165,39 +165,40 @@ class _MainLayoutState extends LifecycleState<MainLayout> with SingleTickerProvi
165165 return Scaffold (
166166 backgroundColor: kBackgroundColor,
167167 bottomNavigationBar: BottomAppBar (
168- child: Container (
169- color: kBackgroundColor,
170- height: 65 ,
171- child: Row (
172- mainAxisAlignment: MainAxisAlignment .spaceEvenly,
173- children: [
174- YouBottomAppBarButton (
175- iconData: Icons .home,
176- text: "Home" ,
177- isSelected: _selectedScreen== Screen .home,
178- onPressed: (){
179- if (_selectedScreen!= Screen .home){
180- setState (() {
181- _selectedScreen= Screen .home;
182- });
183- }
184- },
168+ child: NavigationBarTheme (
169+ data: NavigationBarThemeData (
170+ backgroundColor: kBackgroundColor,
171+ indicatorColor: kIconColor,
172+ labelTextStyle: MaterialStateProperty .all (const TextStyle (
173+ color: kIconColor,
174+ ),),
175+ labelBehavior: NavigationDestinationLabelBehavior .onlyShowSelected,
176+ height: 65 ,
177+ ),
178+ child: NavigationBar (
179+ onDestinationSelected: (index){
180+ if (_selectedScreen!= Screen .values[index]){
181+ setState (() {
182+ _selectedScreen= Screen .values[index];
183+ });
184+ }
185+ },
186+ selectedIndex: _selectedScreen.index,
187+ destinations: const [
188+ NavigationDestination (
189+ icon: Icon (Icons .home,color: kIconColor,),
190+ selectedIcon: Icon (Icons .home,color: kBackgroundColor,),
191+ label: "Home" ,
185192 ),
186- YouBottomAppBarButton (
187- iconData: Icons .settings,
188- text: "Settings" ,
189- isSelected: _selectedScreen== Screen .settings,
190- onPressed: (){
191- if (_selectedScreen!= Screen .settings){
192- setState (() {
193- _selectedScreen= Screen .settings;
194- });
195- }
196- },
193+ NavigationDestination (
194+ icon: Icon (Icons .settings,color: kIconColor,),
195+ selectedIcon: Icon (Icons .settings,color: kBackgroundColor,),
196+ label: "Settings" ,
197197 ),
198198 ],
199+
199200 ),
200- ),
201+ )
201202 ),
202203 floatingActionButton: AnimatedScale (
203204 duration: const Duration (milliseconds: 250 ),
0 commit comments