Skip to content

Commit 97e1228

Browse files
committed
fix: Dn-a#43, Dn-a#47; chore: example_1
1 parent eba585a commit 97e1228

File tree

13 files changed

+688
-666
lines changed

13 files changed

+688
-666
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [0.5.7+2] - 2020-08-05.
2+
3+
* [Clean] - deprecated functions.
4+
* [Updated] - example 1.
5+
* [Fixed] - issues #43, #47.
6+
17
## [0.5.7+1] - 2020-07-31.
28

39
* [Updated] - Readme.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# flutter_inner_drawer
2-
[![pub package](https://img.shields.io/badge/pub-0.5.7+1-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
2+
[![pub package](https://img.shields.io/badge/pub-0.5.7+2-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
33
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter#drawers)
44
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/dnag88)
55

@@ -10,7 +10,7 @@ Inner Drawer is an easy way to create an internal side section (left/right) wher
1010
Add this to your package's pubspec.yaml file:
1111
```dart
1212
dependencies:
13-
flutter_inner_drawer: "^0.5.7+1"
13+
flutter_inner_drawer: "^0.5.7+2"
1414
```
1515
## Demo
1616
<div align="center">
Binary file not shown.
950 Bytes
Binary file not shown.
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
import 'dart:ui';
2+
import 'package:example/notifier/drawer_notifier.dart';
3+
import 'package:flutter/material.dart';
4+
import 'package:provider/provider.dart';
5+
6+
class LeftChild extends StatelessWidget {
7+
LeftChild({Key key}) : super(key: key);
8+
9+
@override
10+
Widget build(BuildContext context) {
11+
print("build left");
12+
13+
return Consumer<DrawerNotifier>(
14+
builder: (context, drawer, child) {
15+
return Material(
16+
child: Stack(
17+
children: <Widget>[
18+
Container(
19+
decoration: BoxDecoration(
20+
gradient: LinearGradient(
21+
begin: Alignment.topRight,
22+
end: Alignment.bottomLeft,
23+
// Add one stop for each color. Stops should increase from 0 to 1
24+
//stops: [0.1, 0.5,0.5, 0.7, 0.9],
25+
colors: [
26+
ColorTween(
27+
begin: Colors.blueAccent,
28+
end: Colors.blueGrey[400].withRed(100),
29+
).lerp(drawer.swipeOffset),
30+
ColorTween(
31+
begin: Colors.green,
32+
end: Colors.blueGrey[800].withGreen(80),
33+
).lerp(drawer.swipeOffset),
34+
],
35+
),
36+
),
37+
child: Stack(
38+
children: <Widget>[
39+
Padding(
40+
padding: EdgeInsets.only(left: 30),
41+
child: Column(
42+
crossAxisAlignment: CrossAxisAlignment.start,
43+
mainAxisAlignment: MainAxisAlignment.center,
44+
children: <Widget>[
45+
Column(
46+
children: <Widget>[
47+
Container(
48+
margin: EdgeInsets.only(left: 10, bottom: 15),
49+
width: 80,
50+
child: ClipRRect(
51+
child: Image.network(
52+
"https://img.icons8.com/officel/2x/user.png",
53+
),
54+
borderRadius: BorderRadius.circular(50),
55+
),
56+
),
57+
Text(
58+
"User",
59+
style:
60+
TextStyle(color: Colors.white, fontSize: 18),
61+
)
62+
],
63+
//mainAxisAlignment: MainAxisAlignment.center,
64+
),
65+
Padding(
66+
padding: EdgeInsets.all(10),
67+
),
68+
ListTile(
69+
onTap: () => print("Dashboard"),
70+
title: Text(
71+
"Dashboard",
72+
style: TextStyle(color: Colors.white, fontSize: 14),
73+
),
74+
leading: Icon(
75+
Icons.dashboard,
76+
color: Colors.white,
77+
size: 22,
78+
),
79+
),
80+
ListTile(
81+
title: Text(
82+
"Nametag",
83+
style: TextStyle(fontSize: 14),
84+
),
85+
leading: Icon(
86+
Icons.rounded_corner,
87+
size: 22,
88+
),
89+
),
90+
ListTile(
91+
title: Text(
92+
"Favorite",
93+
style: TextStyle(fontSize: 14),
94+
),
95+
leading: Icon(
96+
Icons.bookmark_border,
97+
size: 22,
98+
),
99+
),
100+
ListTile(
101+
title: Text(
102+
"Close Friends",
103+
style: TextStyle(fontSize: 14),
104+
),
105+
leading: Icon(
106+
Icons.list,
107+
size: 22,
108+
),
109+
),
110+
ListTile(
111+
title: Text(
112+
"Suggested People",
113+
style: TextStyle(fontSize: 14),
114+
),
115+
leading: Icon(
116+
Icons.person_add,
117+
size: 22,
118+
),
119+
),
120+
],
121+
),
122+
),
123+
Positioned(
124+
bottom: 0,
125+
child: Container(
126+
alignment: Alignment.bottomLeft,
127+
margin: EdgeInsets.only(top: 50),
128+
padding:
129+
EdgeInsets.symmetric(vertical: 15, horizontal: 25),
130+
width: double.maxFinite,
131+
child: Row(
132+
mainAxisAlignment: MainAxisAlignment.start,
133+
children: <Widget>[
134+
Icon(
135+
Icons.all_out,
136+
size: 18,
137+
color: Colors.grey,
138+
),
139+
Text(
140+
" LogOut",
141+
style: TextStyle(
142+
fontSize: 16,
143+
color: Colors.grey,
144+
),
145+
),
146+
],
147+
),
148+
),
149+
)
150+
],
151+
),
152+
),
153+
drawer.swipeOffset < 1
154+
? BackdropFilter(
155+
filter: ImageFilter.blur(
156+
sigmaX: (10 - drawer.swipeOffset * 10),
157+
sigmaY: (10 - drawer.swipeOffset * 10)),
158+
child: Container(
159+
decoration: BoxDecoration(
160+
color: Colors.black.withOpacity(0),
161+
),
162+
),
163+
)
164+
: null,
165+
].where((a) => a != null).toList(),
166+
));
167+
},
168+
);
169+
}
170+
}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
import 'dart:ui';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_inner_drawer/inner_drawer.dart';
4+
import '../env.dart';
5+
6+
class RightChild extends StatelessWidget {
7+
final bool _position = true;
8+
final GlobalKey<InnerDrawerState> innerDrawerKey;
9+
RightChild({this.innerDrawerKey, Key key}) : super(key: key);
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
print("build right");
14+
15+
return Material(
16+
child: SafeArea(
17+
//top: false,
18+
right: false,
19+
left: false,
20+
child: Container(
21+
decoration: BoxDecoration(
22+
border: Border(
23+
left: BorderSide(width: 1, color: Colors.grey[200]),
24+
right: BorderSide(width: 1, color: Colors.grey[200])),
25+
),
26+
child: Stack(
27+
children: <Widget>[
28+
ListView(
29+
children: <Widget>[
30+
Padding(
31+
padding:
32+
EdgeInsets.only(top: 12, bottom: 4, left: 15),
33+
child: Row(
34+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
35+
children: <Widget>[
36+
Row(
37+
children: <Widget>[
38+
SizedBox(
39+
width: 15,
40+
height: 15,
41+
child: CircleAvatar(
42+
child: Icon(Icons.person,
43+
color: Colors.white, size: 12),
44+
backgroundColor: Colors.grey,
45+
),
46+
),
47+
Text(
48+
" Guest",
49+
style: TextStyle(
50+
fontWeight: FontWeight.w600,
51+
height: 1.2),
52+
),
53+
],
54+
),
55+
Padding(
56+
padding: EdgeInsets.only(top: 2, right: 25),
57+
child: GestureDetector(
58+
child: Icon(
59+
_position
60+
? Icons.arrow_back
61+
: Icons.arrow_forward,
62+
size: 18,
63+
),
64+
onTap: () {
65+
innerDrawerKey.currentState.toggle();
66+
},
67+
),
68+
),
69+
],
70+
)),
71+
Divider(),
72+
ListTile(
73+
title: Text("Statistics"),
74+
leading: Icon(Icons.show_chart),
75+
),
76+
ListTile(
77+
title: Text("Activity"),
78+
leading: Icon(Icons.access_time),
79+
),
80+
ListTile(
81+
title: Text("Nametag"),
82+
leading: Icon(Icons.rounded_corner),
83+
),
84+
ListTile(
85+
title: Text("Favorite"),
86+
leading: Icon(Icons.bookmark_border),
87+
),
88+
ListTile(
89+
title: Text("Close Friends"),
90+
leading: Icon(Icons.list),
91+
),
92+
ListTile(
93+
title: Text("Suggested People"),
94+
leading: Icon(Icons.person_add),
95+
),
96+
ListTile(
97+
title: Text("Open Facebook"),
98+
leading: Icon(
99+
Env.facebook_icon,
100+
size: 18,
101+
),
102+
),
103+
Container(
104+
alignment: Alignment.bottomLeft,
105+
margin: EdgeInsets.only(top: 50),
106+
padding:
107+
EdgeInsets.symmetric(vertical: 15, horizontal: 25),
108+
//width: double.maxFinite,
109+
decoration: BoxDecoration(
110+
//color: Colors.grey,
111+
border: Border(
112+
top: BorderSide(
113+
color: Colors.grey[300],
114+
))),
115+
child: Row(
116+
mainAxisAlignment: MainAxisAlignment.start,
117+
children: <Widget>[
118+
Icon(
119+
Icons.settings,
120+
size: 18,
121+
),
122+
Text(
123+
" Settings",
124+
style: TextStyle(fontSize: 16),
125+
),
126+
],
127+
),
128+
)
129+
],
130+
),
131+
],
132+
),
133+
)));
134+
}
135+
}

0 commit comments

Comments
 (0)