fix: Fixed dispose errors

This commit is contained in:
Deven Joshi
2020-11-23 15:46:38 +05:30
parent b0b05e165c
commit 0ba45d82be
4 changed files with 11 additions and 2 deletions
+8 -1
View File
@@ -127,7 +127,6 @@ class _ReactionPickerState extends State<ReactionPicker>
void pop() async {
for (var a in animations) {
a.stop();
//a.dispose();
}
Navigator.of(context).pop();
}
@@ -145,4 +144,12 @@ class _ReactionPickerState extends State<ReactionPicker>
StreamChannel.of(context).channel.deleteReaction(widget.message, reaction);
pop();
}
@override
void dispose() {
for (var a in animations) {
a?.dispose();
}
super.dispose();
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ dependencies:
media_gallery: ^0.1.5
permission_handler: ^5.0.1+1
transparent_image: ^1.0.0
ezanimation: ^0.4.0
ezanimation: ^0.4.1
flutter:
assets:
+1
View File
@@ -40,6 +40,7 @@ void main() {
);
await tester.pump();
await tester.pump(Duration(milliseconds: 1000));
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
expect(find.byIcon(StreamIcons.sorting_up), findsOneWidget);
expect(find.byIcon(StreamIcons.edit), findsOneWidget);
@@ -87,6 +87,7 @@ void main() {
);
await tester.pump();
await tester.pump(Duration(milliseconds: 1000));
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
expect(find.byIcon(StreamIcons.thumbs_up_reaction), findsNWidgets(2));
expect(find.byIcon(StreamIcons.love_reaction), findsNWidgets(2));