File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ class _FlowShaderState extends State<FlowShader>
26
26
late Animation animation2;
27
27
late Animation animation3;
28
28
29
+ @override
30
+ void dispose () {
31
+ controller.dispose ();
32
+ super .dispose ();
33
+ }
34
+
29
35
@override
30
36
void initState () {
31
37
super .initState ();
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ class _RecordButtonState extends State<RecordButton> {
77
77
void dispose () {
78
78
record.dispose ();
79
79
timer? .cancel ();
80
+ timer = null ;
80
81
super .dispose ();
81
82
}
82
83
@@ -171,16 +172,17 @@ class _RecordButtonState extends State<RecordButton> {
171
172
behavior: HitTestBehavior .opaque,
172
173
onTap: () async {
173
174
var filePath = await Record ().stop ();
175
+ timer? .cancel ();
176
+ timer = null ;
177
+ startTime = null ;
178
+ recordDuration = "00:00" ;
174
179
AudioState .files.add (filePath! );
175
180
Globals .audioListKey.currentState!
176
181
.insertItem (AudioState .files.length - 1 );
177
182
debugPrint (filePath);
178
183
setState (() {
179
184
isLocked = false ;
180
185
});
181
- startTime = null ;
182
- recordDuration = "00:00" ;
183
- timer? .cancel ();
184
186
},
185
187
child: Row (
186
188
mainAxisAlignment: MainAxisAlignment .spaceBetween,
@@ -231,9 +233,11 @@ class _RecordButtonState extends State<RecordButton> {
231
233
widget.controller.reverse ();
232
234
233
235
if (isCancelled (details.localPosition)) {
236
+ timer? .cancel ();
237
+ timer = null ;
234
238
startTime = null ;
235
239
recordDuration = "00:00" ;
236
- timer ? . cancel ();
240
+
237
241
debugPrint ("Cancelled recording" );
238
242
var filePath = await record.stop ();
239
243
debugPrint (filePath);
@@ -245,9 +249,11 @@ class _RecordButtonState extends State<RecordButton> {
245
249
isLocked = true ;
246
250
});
247
251
} else {
252
+ timer? .cancel ();
253
+ timer = null ;
248
254
startTime = null ;
249
255
recordDuration = "00:00" ;
250
- timer ? . cancel ();
256
+
251
257
var filePath = await Record ().stop ();
252
258
AudioState .files.add (filePath! );
253
259
Globals .audioListKey.currentState!
You can’t perform that action at this time.
0 commit comments