fix: Fixed dispose errors
This commit is contained in:
@@ -127,7 +127,6 @@ class _ReactionPickerState extends State<ReactionPicker>
|
|||||||
void pop() async {
|
void pop() async {
|
||||||
for (var a in animations) {
|
for (var a in animations) {
|
||||||
a.stop();
|
a.stop();
|
||||||
//a.dispose();
|
|
||||||
}
|
}
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
@@ -145,4 +144,12 @@ class _ReactionPickerState extends State<ReactionPicker>
|
|||||||
StreamChannel.of(context).channel.deleteReaction(widget.message, reaction);
|
StreamChannel.of(context).channel.deleteReaction(widget.message, reaction);
|
||||||
pop();
|
pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
for (var a in animations) {
|
||||||
|
a?.dispose();
|
||||||
|
}
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ dependencies:
|
|||||||
media_gallery: ^0.1.5
|
media_gallery: ^0.1.5
|
||||||
permission_handler: ^5.0.1+1
|
permission_handler: ^5.0.1+1
|
||||||
transparent_image: ^1.0.0
|
transparent_image: ^1.0.0
|
||||||
ezanimation: ^0.4.0
|
ezanimation: ^0.4.1
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
assets:
|
assets:
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|
||||||
|
await tester.pump(Duration(milliseconds: 1000));
|
||||||
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
||||||
expect(find.byIcon(StreamIcons.sorting_up), findsOneWidget);
|
expect(find.byIcon(StreamIcons.sorting_up), findsOneWidget);
|
||||||
expect(find.byIcon(StreamIcons.edit), findsOneWidget);
|
expect(find.byIcon(StreamIcons.edit), findsOneWidget);
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|
||||||
|
await tester.pump(Duration(milliseconds: 1000));
|
||||||
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
||||||
expect(find.byIcon(StreamIcons.thumbs_up_reaction), findsNWidgets(2));
|
expect(find.byIcon(StreamIcons.thumbs_up_reaction), findsNWidgets(2));
|
||||||
expect(find.byIcon(StreamIcons.love_reaction), findsNWidgets(2));
|
expect(find.byIcon(StreamIcons.love_reaction), findsNWidgets(2));
|
||||||
|
|||||||
Reference in New Issue
Block a user