Skip to content

Commit

Permalink
Added dispose() for bottomSheet.
Browse files Browse the repository at this point in the history
  • Loading branch information
furkankurt committed Jul 2, 2021
1 parent 9d51040 commit b9de5e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/get_navigation/src/bottomsheet/bottomsheet.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import '../../../get_core/get_core.dart';
import '../../../get_instance/src/get_instance.dart';

class GetModalBottomSheetRoute<T> extends PopupRoute<T> {
GetModalBottomSheetRoute({
Expand Down Expand Up @@ -51,6 +53,15 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> {

AnimationController? _animationController;

@override
void dispose() {
if (Get.smartManagement != SmartManagement.onlyBuilder) {
WidgetsBinding.instance!.addPostFrameCallback(
(_) => GetInstance().removeDependencyByRoute(name));
}
super.dispose();
}

@override
AnimationController createAnimationController() {
assert(_animationController == null);
Expand Down

0 comments on commit b9de5e7

Please sign in to comment.