Reusable mobile bottom-sheet template + swap modal migration#246
Reusable mobile bottom-sheet template + swap modal migration#246nikfromkeplr wants to merge 1 commit into
Conversation
Introduce showMobileSheet + MobileSheetScaffold + MobileSheetFormBody as the standard mobile modal: a top-rounded, edge-to-edge sheet with a grabber, a centered title flanked by absolute back/close buttons, drag-to-dismiss plus a rubber-band over-pull spring, and an adaptive, content-driven body. The formBody template sizes itself across three levels — rest at the min-height floor with the body centered, grow to hug the content, or cap below the top gap and scroll — always with full-width action buttons pinned to the bottom edge. fillBody keeps a fixed-min Expanded slot for list bodies (contacts), and expand fills the screen for long scroll lists (asset selector). Migrate the swap asset selector, slippage, recipient/refund address, and address-book contact-picker modals onto the template. All sheet styling is mobile-only (kAppFormFactor); desktop layouts are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
💡 Codex Reviewvizor-wallet/ios/Runner/DatePickerHandler.swift Lines 78 to 79 in 42f5b4b When ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
Introduces a reusable mobile bottom-sheet template and migrates the swap modals onto it, replacing the fragmented per-modal presentations with one standard iOS/Android sheet.
The template lives in
lib/src/core/layout/mobile/mobile_sheet.dart:showMobileSheet— root-navigator, edge-to-edgeshowModalBottomSheetwrapper (covers the floating tab bar, transparent surface, neutral scrim).MobileSheetScaffold— top-rounded surface with a grabber, a centered title flanked by absolute back (2nd-level views) and close buttons, keyboard avoidance, drag-to-dismiss, and a rubber-band over-pull spring.MobileSheetFormBody— adaptive form body: content above full-width action buttons pinned to the bottom.Content-driven height (3 levels)
A
formBodysheet sizes itself to its content, clamped between a 400px floor and the top-gap cap:In every level the action buttons stay pinned to the bottom.
fillBodykeeps a fixed-minExpandedslot for list bodies (contacts);expandfills the screen for long scroll lists (asset selector).Migrated modals
Scope / safety
kAppFormFactor; desktop layouts are unchanged (the sharedSwapModalButtonsfull-width behavior is form-factor gated, desktop keeps its original pill layout).Tests
test/core/layout/mobile/mobile_sheet_form_body_test.dartpins all three height levels (floor / hug / cap + scroll, actions pinned).flutter analyzeclean.🤖 Generated with Claude Code