forked from toly1994328/FlutterUnit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome_right_drawer.dart
67 lines (59 loc) · 1.77 KB
/
home_right_drawer.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
import 'package:flutter/material.dart';
import 'package:flutter_unit/components/permanent/circle.dart';
import 'package:flutter_unit/views/common/unit_drawer_header.dart';
import 'edit_category_panel.dart';
class HomeRightDrawer extends StatefulWidget {
final Color color;
HomeRightDrawer({this.color});
@override
_HomeRightDrawerState createState() => _HomeRightDrawerState();
}
class _HomeRightDrawerState extends State<HomeRightDrawer> {
String name;
String color;
String info;
@override
Widget build(BuildContext context) {
return Drawer(
elevation: 3,
child: _buildChild(context),
);
}
Widget _buildChild(BuildContext context) => Container(
color: widget.color.withAlpha(33),
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
UnitDrawerHeader(color:widget.color),
_buildTitle(context),
EditCategoryPanel()
]),
);
Widget _buildTitle(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 5.0, bottom: 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Circle(
color: Theme.of(context).primaryColor,
radius: 5,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Text(
'添加收藏集',
style: TextStyle(fontSize: 16, shadows: [
Shadow(
color: Colors.white, offset: Offset(.5, .5), blurRadius: 1)
]),
),
),
Circle(
color: Theme.of(context).primaryColor,
radius: 5,
),
],
),
);
}
}