I have an issue about to display Bottom Navigation Bar. I don't understand why I have no issues in the console.
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState(){
return _MyAppState();
}
}
class _MyAppState extends State<MyApp> {
int _selectedPage =0;
final _pageOptions = [
HomeScreen(),
ProfileScreen(),
];
@override
Widget build(BuildContext context) {
var localizationDelegate = LocalizedApp.of(context).delegate;
return LocalizationProvider(
state: LocalizationProvider.of(context).state,
child: MaterialApp(
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
localizationDelegate
],
initialRoute: '',
onGenerateRoute: MyRoutes().getRoute,
supportedLocales: localizationDelegate.supportedLocales,
// locale: localizationDelegate.currentLocale,
theme: ThemeData( primarySwatch: Colors.red),
home: Scaffold(
body: _pageOptions[_selectedPage],
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: _selectedPage,
onTap: (int index){
setState(() {
_selectedPage = index;
});
},
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
title: Text('Home'),
),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle),
title: Text('Me'),
),
]
),
),
),
);
}
}
I use flutter_translate. I know it's a very simple case but I'm stuck on it. I search in google but I find nothing which can fit my case.
Thank you.
Solved
- Delete App from my device (mobile)
- Flutter clean in the console
- Launch Debug in Android Studio