Repository navigation
Expand file tree
/
Copy pathexample.dart
More file actions
executable file
·82 lines (77 loc) · 2.39 KB
/
Copy pathexample.dart
File metadata and controls
executable file
·82 lines (77 loc) · 2.39 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import 'package:buttons_tabbar_plus/buttons_tabbar_plus.dart';
import 'package:material_ui/material_ui.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Example(),
);
}
}
class Example extends StatefulWidget {
const Example({Key? key}) : super(key: key);
@override
_ExampleState createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: DefaultTabController(
length: 6,
child: Column(
children: <Widget>[
ButtonsTabBar(
backgroundColor: Colors.red,
unselectedBackgroundColor: Colors.grey[300],
unselectedLabelStyle: TextStyle(color: Colors.black),
labelStyle:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
tabs: [
Tab(
icon: Icon(Icons.directions_car),
text: "car",
),
Tab(
icon: Icon(Icons.directions_transit),
text: "transit",
),
Tab(icon: Icon(Icons.directions_bike)),
Tab(icon: Icon(Icons.directions_car)),
Tab(icon: Icon(Icons.directions_transit)),
Tab(icon: Icon(Icons.directions_bike)),
],
),
Expanded(
child: TabBarView(
children: <Widget>[
Center(
child: Icon(Icons.directions_car),
),
Center(
child: Icon(Icons.directions_transit),
),
Center(
child: Icon(Icons.directions_bike),
),
Center(
child: Icon(Icons.directions_car),
),
Center(
child: Icon(Icons.directions_transit),
),
Center(
child: Icon(Icons.directions_bike),
),
],
),
),
],
),
),
),
);
}
}