Repository navigation
feat: add sliver_app_bar - #42
Merged
Merged
Conversation
Add SliverAppBar (sliver_app_bar), the collapsing app bar sliver for custom_scroll_view: title, variant (small, medium, large), leading, actions, pinned, floating, snap, stretch, heights, flexible_space, bottom and colors, plus the iOS previous_page_title, border, always_show_middle and transition_between_routes. Like the other sliver children it only accepts key, data, visible and its own keywords.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #35 (custom_scroll_view). This branch is stacked on
feat/custom-scroll-view. Until #35 merges, review only the last commit, "feat: add sliver_app_bar".What
Adds
sliver_app_bar(SPEC E2), the collapsing app bar that goes first in acustom_scroll_view. On Android it is the Material small, medium or large top app bar. On iOS it is the large title that shrinks into the navigation bar as the content scrolls.Engine counterpart (renderer): AdamMusa/ruflet-engine#26
Usage
Wire keys
SliverAppBar(sliver_app_bar,sliverappbar;shared/sliverappbar_control.rb). It is a sliver child: it takeskey data visibleand its own keywords only, with no box layout keywords and no events.titlevariant"small""small"/"medium"/"large"leading,actionspinnedfloating,snap,stretchfalseexpanded_height,collapsed_height,toolbar_heightflexible_spaceFlexibleSpaceBarbackground; iOS plain box below the barbottom,bottom_heightbgcolorcolor,elevation,scrolled_under_elevation,shadow_color,center_titleautomatically_imply_leadingtrueprevious_page_title,borderalways_show_middletruetransition_between_routesfalseMaterial vs Cupertino
SliverAppBar,.mediumor.large. Large expands to 152 and collapses to 64.CupertinoSliverNavigationBar. The 44pt bar plus the 52pt large title collapses into the always-pinned bar.CupertinoNavigationBarthat is pinned, floating or scrolls away.The engine PR has the full mapping table.
Gotchas
page.appbarwhen using asliver_app_bar: you would get two bars.sliver_app_baroutside acustom_scroll_viewshows the unknown-control error (D-3).Tests
test/sliver_app_bar_compatibility_test.rb(6 tests) covers:leading,actions,bottomandflexible_space, and color normalizationpinnedleft nilcontrol(:sliver_app_bar)ArgumentErrorfor box layout keywords and eventscustom_scroll_view(slivers:)page.update(bar, title:)patches the bar's own wire idteam/verify_pr.sh(engine + Ruby worktrees, stacked on E1): PASSflutter test(Flutter 3.41.2): +732, all passed (E1's 720 + 12 new)flutter analyze lib test: No issues foundsliver_app_bar_spec.dart). The "NEW vs baseline: 3" are pre-existing ReorderableListView / ReorderableDragHandle findings whose hint text now also names the new files. They are not new findings.