poem_more_menu.dart
4.76 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import 'package:flutter/material.dart';
import 'package:Parlando/res/resources.dart';
import 'package:Parlando/util/theme_utils.dart';
import 'package:Parlando/widgets/load_image.dart';
class PoemMoreMenu extends StatefulWidget {
const PoemMoreMenu({
Key? key,
}) : super(key: key);
@override
_PoemMoreMenuState createState() => _PoemMoreMenuState();
}
class _PoemMoreMenuState extends State<PoemMoreMenu>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _scaleAnimation;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(milliseconds: 200),
vsync: this,
);
_scaleAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(_controller);
_controller.forward();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final Color backgroundColor = context.backgroundColor;
final Color? iconColor = ThemeUtils.getIconColor(context);
final Widget body = Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 12.0),
child: LoadAssetImage(
'common/jt',
width: 8.0,
height: 4.0,
color: ThemeUtils.getDarkColor(context, Colours.dark_bg_color),
),
),
SizedBox(
width: 120.0,
height: 60.0,
child: TextButton.icon(
onPressed: () {},
icon: IconButton(
icon: const Icon(
Icons.mic_none_outlined,
size: 16.0,
),
color: iconColor,
onPressed: () {},
),
label: const Text('录音'),
style: TextButton.styleFrom(
primary: Theme.of(context).textTheme.bodyText2?.color,
onSurface: Theme.of(context)
.textTheme
.bodyText2
?.color
?.withOpacity(0.12),
backgroundColor: backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0),
),
),
),
),
),
Container(
width: 120.0,
height: 0.6,
color: Colours.line,
),
SizedBox(
width: 120.0,
height: 60.0,
child: TextButton.icon(
onPressed: () {},
icon: IconButton(
icon: const Icon(
Icons.camera_alt_outlined,
size: 16.0,
),
color: iconColor,
onPressed: () {},
),
label: const Text('拍摄'),
style: TextButton.styleFrom(
primary: Theme.of(context).textTheme.bodyText2?.color,
onSurface: Theme.of(context)
.textTheme
.bodyText2
?.color
?.withOpacity(0.12),
backgroundColor: backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
),
),
Container(
width: 120.0,
height: 0.6,
color: Colours.line,
),
SizedBox(
width: 120.0,
height: 60.0,
child: TextButton.icon(
onPressed: () {},
icon: IconButton(
icon: const Icon(
Icons.delete_forever_outlined,
size: 16.0,
),
color: iconColor,
onPressed: () {},
),
label: const Text('删除'),
style: TextButton.styleFrom(
primary: Theme.of(context).textTheme.bodyText2?.color,
onSurface: Theme.of(context)
.textTheme
.bodyText2
?.color
?.withOpacity(0.12),
backgroundColor: backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8.0),
bottomRight: Radius.circular(8.0),
),
),
),
),
),
],
);
return AnimatedBuilder(
animation: _scaleAnimation,
builder: (_, child) {
return Transform.scale(
scale: _scaleAnimation.value,
alignment: Alignment.topRight,
child: child,
);
},
child: body,
);
}
}