-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.dart
More file actions
51 lines (45 loc) · 1.25 KB
/
home.dart
File metadata and controls
51 lines (45 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import 'package:flutter/material.dart';
import 'package:practice/screen/to_do_screen.dart';
class Home extends StatefulWidget{
const Home({super.key});
@override
HomeState createState() => HomeState();
}
class HomeState extends State<Home> {
int _selectedIndex = 0;
static List<Widget> pages = <Widget>[
todoApp(),
Container(color: Colors.white54),
];
void _onItemTapped(int index){
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepPurpleAccent,
title: Text(
'Todo'
),
),
body:pages[_selectedIndex],
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: Theme.of(context).textSelectionTheme.selectionColor,
currentIndex: _selectedIndex,
onTap: _onItemTapped,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.account_balance_wallet_outlined),
label: 'To-Do',
),BottomNavigationBarItem(
icon: Icon(Icons.access_time),
label: 'Another',
),
],
),
);
}
}