-
Notifications
You must be signed in to change notification settings - Fork 0
/
tab_ornek.dart
61 lines (54 loc) · 1.47 KB
/
tab_ornek.dart
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
52
53
54
55
56
57
58
59
60
61
import 'package:flutter/material.dart';
class TabOrnek extends StatefulWidget {
@override
_TabOrnekState createState() => _TabOrnekState();
}
class _TabOrnekState extends State<TabOrnek>
with SingleTickerProviderStateMixin {
TabController tabController;
@override
void initState() {
// TODO: implement initState
super.initState();
tabController = TabController(length: 3, vsync: this);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
bottom: tabBarim(),
title: Text("Tab Kullanımı"),
),
body: TabBarView(controller: tabController,children: <Widget>[
Container(
color: Colors.redAccent,
child: Center(child: Text("TAB 1", style: TextStyle(fontSize: 48),)),
),
Container(
color: Colors.blueAccent,
child: Center(child: Text("TAB 2", style: TextStyle(fontSize: 48),)),
),
Container(
color: Colors.greenAccent,
child: Center(child: Text("TAB 3", style: TextStyle(fontSize: 48),)),
),
],),
);
}
TabBar tabBarim() {
return TabBar(controller: tabController, tabs: [
Tab(
icon: Icon(Icons.keyboard),
text: "Tab 1",
),
Tab(
icon: Icon(Icons.lock),
text: "Tab 2",
),
Tab(
icon: Icon(Icons.add_box),
text: "Tab 3",
),
]);
}
}