Skip to content

feat(sheet): Added back stack for StopSheet/BusSheet#84

Open
iswheeler wants to merge 17 commits intomaizebus-2.1from
back-button-fix
Open

feat(sheet): Added back stack for StopSheet/BusSheet#84
iswheeler wants to merge 17 commits intomaizebus-2.1from
back-button-fix

Conversation

@iswheeler
Copy link
Copy Markdown
Contributor

@iswheeler iswheeler commented Apr 7, 2026

Description

Added a back stack so users who open a stop sheet from a bus sheet (or vice versa) can swipe to go back.

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Refactor / code improvement
  • Dependency / build update
  • Documentation
  • Other (explain)

Related Issues

Closes #50

Changes Made

  • Flutter:
    • Refactored all sheet management stuff out of map_screen.dart into its own class sheet_navigation_manager.dart
    • Adjusted shadows for BusSheet and StopSheet to avoid "pop-in"
    • Allowed StopSheet and BusSheet to accept a ScrollController from the SheetNavigator (to prevent issues with two sheets displayed on top of each other and fighting over the same ScrollController)
    • Fixed a problem where a DraggableScrollableSheet contained a StopSheet, which would contain another nested DraggableScrollableSheet
    • Added subtle "ripple" visual feedback when the user clicks on a bus stop in Flow
    • Removed extra debugPrint statements from my previous work in upcoming_stops_widget.dart

(Note: The diff looks like I changed a bunch of stuff in stop_sheet.dart, but most of that is removing the duplicate DraggableScrollableSheet and fixing the indentation. Not sure why the diff is confused about that. I also made sure this branch was up to date with maizebus-2.1 so hopefully merging should go smoothly)

Testing Done

Flutter:

  • Tested on:
    • iOS Simulator
    • Android Emulator
    • Physical device

Screenshots / Demo (if UI or notification change)

maizebus_feature_pr.mp4

Checklist

  • Commit messages follow Conventional Commits
  • PR title follows [type](scope): short description
  • PR target branch is not main and is our current working update branch (e.g. maizebus2.1)
  • No print() / debugPrint() / console.log() left in production code
  • Secrets / keys not committed

Things are still VERY broken, but it kind of works right now.
What's still broken
* The modal decides it wants to be the entire screen height after the first click
* Swiping down doesn't work yet

We'll keep chipping away at it
Also figured out why the bus sheet was so jank--it made a doubly nested DraggableScrollableSheet
The two Sheets are still fighting over the same ScrollController. Unfortunate.
@TheStaticBits
Copy link
Copy Markdown
Member

When you use Android back button, the sheet moves in from the left, whereas when you swipe the sheet to the right, the bottom sheet stays still and does not move in from the left. This is visible in the video you attached in the pull request description.

@iswheeler
Copy link
Copy Markdown
Contributor Author

iswheeler commented Apr 9, 2026

Just fixed the animation. @TheStaticBits Looks like our changes ended up conflicting--apparently your changes to StopSheet made it accept a new isFavorite parameter that comes from map_screen.dart, but since I pulled all the sheet logic out of map_screen.dart into sheet_navigation_manager.dart, so sheet_navigation_manager.dart doesn't have access to the _favoriteStops array inside map_screen. Would probably be best to make some sort of LocallyCachedData static class that manages all the cached data (e.g. startup data, route polylines, stops, buses, favorited stops, etc)

We should be able to sort this out on Saturday, just figured I'd leave this here as a reminder/documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants