-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavigation_bar_page.dart
101 lines (99 loc) · 2.91 KB
/
navigation_bar_page.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import 'package:example/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:platty/platty.dart';
class NavigationBarPage extends StatelessWidget {
_getActions() => <Widget>[
IconButton(
icon: Icon(Icons.add),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.map),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.textsms),
onPressed: () {},
),
];
@override
Widget build(BuildContext context) {
return PScaffold(
backgroundColor: Colors.white,
renderPlatform: TargetPlatform.android,
appBar: navBarFor(title: "Navigation Bars"),
child: Column(
children: <Widget>[
PNavigationBar(
iosHeroTag: "iOS1",
backgroundColor: Colors.red,
title: Text(
"Platform",
),
actions: _getActions(),
),
PNavigationBar(
iosHeroTag: "iOS",
backgroundColor: Colors.red,
renderPlatform: TargetPlatform.iOS,
title: Text(
"Plain iOS",
),
iosMirrorAndroid: false,
actions: _getActions(),
),
PNavigationBar(
iosHeroTag: "iOS2",
iosPreviousPageTitle: "Back",
backgroundColor: Colors.red,
renderPlatform: TargetPlatform.iOS,
title: Text(
"iOS Mirror",
),
actions: _getActions(),
),
PNavigationBar(
backgroundColor: Colors.red,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.maybePop(context);
}),
title: Text(
"Android",
style: TextStyle(color: Colors.white),
),
renderPlatform: TargetPlatform.android,
actions: _getActions(),
),
SizedBox(
height: 120.0,
child: PNavigationBar(
backgroundColor: Colors.red,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.maybePop(context);
}),
title: Text(
"Android with bottom",
style: TextStyle(color: Colors.white),
),
renderPlatform: TargetPlatform.android,
actions: _getActions(),
androidBottom: () => PreferredSize(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("Bottom"),
),
preferredSize: Size.fromHeight(30.0),
),
),
),
],
),
);
}
}