Merge pull request #88 from drown0315/fix/dispose_swiper_controller

fix: dispose swipeController
This commit is contained in:
Shawn 2023-06-26 13:07:29 -06:00 committed by GitHub
commit be5b5fc9a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -61,4 +61,10 @@ class _VerticalSwipeController {
onVerticalDragCancel: handleVerticalSwipeCancelled, onVerticalDragCancel: handleVerticalSwipeCancelled,
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
child: child); child: child);
void dispose(){
swipeAmt.dispose();
isPointerDown.dispose();
swipeReleaseAnim.dispose();
}
} }

View File

@ -147,6 +147,12 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
)); ));
} }
@override
void dispose() {
_swipeController.dispose();
super.dispose();
}
Widget _buildMgPageView() { Widget _buildMgPageView() {
return ExcludeSemantics( return ExcludeSemantics(
child: PageView.builder( child: PageView.builder(