fullscreen: make sure feedback is dismissed before popping to collection
This commit is contained in:
parent
6abd3f800a
commit
f8deacd8b6
2 changed files with 8 additions and 3 deletions
|
@ -4,8 +4,12 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/scheduler.dart';
|
||||
|
||||
mixin FeedbackMixin {
|
||||
Flushbar _flushbar;
|
||||
|
||||
Future<void> dismissFeedback() => _flushbar?.dismiss();
|
||||
|
||||
void showFeedback(BuildContext context, String message) {
|
||||
Flushbar(
|
||||
_flushbar = Flushbar(
|
||||
message: message,
|
||||
margin: const EdgeInsets.all(8),
|
||||
borderRadius: 8,
|
||||
|
@ -14,6 +18,6 @@ mixin FeedbackMixin {
|
|||
duration: Durations.opToastDisplay * timeDilation,
|
||||
flushbarPosition: FlushbarPosition.TOP,
|
||||
animationDuration: Durations.opToastAnimation,
|
||||
).show(context);
|
||||
)..show(context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,9 +289,10 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
);
|
||||
}
|
||||
|
||||
void _onVerticalPageChanged(int page) {
|
||||
Future<void> _onVerticalPageChanged(int page) async {
|
||||
_currentVerticalPage.value = page;
|
||||
if (page == transitionPage) {
|
||||
await _actionDelegate.dismissFeedback();
|
||||
_onLeave();
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue