Skip to content

Commit 4674565

Browse files
fix(view): ensure end drawer closes before navigation (#1638)
1 parent bcb3fc8 commit 4674565

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

mobile-app/lib/ui/views/learn/widgets/pass/pass_widget_view.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ class PassButton extends StatelessWidget {
208208
width: MediaQuery.of(context).size.width,
209209
child: TextButton(
210210
onPressed: () async {
211+
// Close the end drawer if open before navigating.
212+
// This is needed to ensure the back navigation works correctly.
213+
final scaffoldState = model.scaffoldKey.currentState;
214+
if (scaffoldState != null && scaffoldState.isEndDrawerOpen) {
215+
scaffoldState.closeEndDrawer();
216+
await Future.delayed(const Duration(milliseconds: 300));
217+
}
218+
211219
model.closeWebViews();
212220
model.disposeOfListeners();
213221

0 commit comments

Comments
 (0)