60 lines
1.4 KiB
Dart
60 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class DashBoardScreen extends StatefulWidget {
|
|
@override
|
|
_DashBoardScreenState createState() => _DashBoardScreenState();
|
|
}
|
|
|
|
class _DashBoardScreenState extends State<DashBoardScreen> {
|
|
int _selectedIndex = 0;
|
|
static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
|
|
static const List<Widget> _widgetOptions = <Widget>[
|
|
Text(
|
|
'Index 0: Accueil',
|
|
style: optionStyle,
|
|
),
|
|
Text(
|
|
'Index 1: Notes',
|
|
style: optionStyle,
|
|
),
|
|
Text(
|
|
'Index 2: Enseignes',
|
|
style: optionStyle,
|
|
),
|
|
];
|
|
|
|
void _onItemTapped(int index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Center(
|
|
child: _widgetOptions.elementAt(_selectedIndex),
|
|
),
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
items: const <BottomNavigationBarItem>[
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.home),
|
|
title: Text('Accueil'),
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.add),
|
|
title: Text('Notes'),
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.business),
|
|
title: Text('Enseignes'),
|
|
),
|
|
],
|
|
currentIndex: _selectedIndex,
|
|
selectedItemColor: Colors.indigo[900],
|
|
onTap: _onItemTapped,
|
|
),
|
|
);
|
|
}
|
|
}
|