Skip to content

CupertinoSliverNavigationBar needs to implement snapping #23321

Closed

Description

@xster

iOS's nav bar snaps to the large or small title formats, but not in between.

Activity

  1. added
    a: fidelityMatching the OEM platforms better
    p: cupertino_uicupertino_ui package in flutter/packages
    on Oct 20, 2018
  2. xster commented on Oct 24, 2018

    @xster
    MemberAuthor

    Hints, implement FloatingHeaderSnapConfiguration of SliverPersistentHeaderDelegate on _LargeTitleNavigationBarSliverDelegate

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Oct 24, 2018
  4. SimonVillage commented on Oct 27, 2021

    @SimonVillage

    I assume that this should be the behavior? Is there any way to realize this already?

    RPReplay_Final1635302933.MP4
  5. LathDevers commented on Jan 19, 2024

    @LathDevers

    I assume that this should be the behavior? Is there any way to realize this already?

    RPReplay_Final1635302933.MP4

    I think this should work:

    const double threshold = 51;
    @override
    void initState() {
      super.initState();
      WidgetsBinding.instance.addPostFrameCallback((_) {
        _scrollController.position.isScrollingNotifier.addListener(() {
          if (!_scrollController.position.isScrollingNotifier.value && widget.scrollController.offset > 0 && widget.scrollController.offset < threshold) {
            // User finished scrolling
            if (_scrollController.offset >= threshold / 2) {
              _scrollController.animateTo(
                threshold,
                duration: const Duration(milliseconds: 200),
                curve: Curves.ease,
              );
            } else {
              _scrollController.animateTo(
                0,
                duration: const Duration(milliseconds: 200),
                curve: Curves.ease,
              );
            }
          }
        });
      });
    }
  6. flutter-triage-bot commented on Apr 26, 2024

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-design label.

  7. Piinks commented on May 8, 2024

    @Piinks
    Contributor

    @HansMuller's sliver PRs should provide a solution here.

  8. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on May 8, 2024
  9. Piinks commented on Aug 22, 2024

    @Piinks
    Contributor
  10. github-actions commented on Sep 5, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions