import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; class MainView extends StatefulWidget { @override _MainViewState createState() => _MainViewState(); } class _MainViewState extends State { int _selectedIndex = 0; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } void _showSearchView(BuildContext context) { Navigator.of(context).push( MaterialPageRoute( builder: (context) => Scaffold(), ), ); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text( "Le Kiosque By GC&S", style: TextStyle( color: Colors.black, ), ), leading: Builder( builder: (BuildContext context) { return Padding( padding: const EdgeInsets.only(left: 16), child: Image.asset("assets/images/kiosque_logo.png"), ); }, ), elevation: 4, actions: [ Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( shape: BoxShape.circle, color: Color(0xFFF1F1F1), ), child: TextButton( onPressed: () => _showSearchView(context), child: Icon( Icons.search, color: Colors.grey, ), ), ), ) ], backgroundColor: Colors.white, ), bottomNavigationBar: BottomNavigationBar( currentIndex: _selectedIndex, type: BottomNavigationBarType.fixed, onTap: _onItemTapped, selectedItemColor: Colors.grey, items: [ BottomNavigationBarItem( icon: Icon( Icons.home_rounded, color: Colors.grey, ), label: 'Accueil', ), BottomNavigationBarItem( icon: Icon( Icons.subscriptions_rounded, color: Colors.grey, ), label: 'A la une', ), BottomNavigationBarItem( icon: Icon( Icons.amp_stories_rounded, color: Colors.grey, ), label: 'Abonnement', ), BottomNavigationBarItem( icon: Icon( Icons.people_rounded, color: Colors.grey, ), label: 'Mon profil', ), ], ), ); } }