Skip to content

CupertinoSliverNavigationBar.search does not fade or animate insets if search view scrolled in automatic mode #165152

@victorsanni

Description

@victorsanni

Steps to reproduce

  1. In CupertinoSliverNavigationBar.search, in automatic mode, tap to open the search view.
  2. Scroll the search view.
  3. Without scrolling back up, exit the search view.
  4. Then, try to collapse the search field in the inactive search view.

Expected results

When the inactive search view is scrolled, the search field should fade and animate its insets.

Actual results

When the inactive search view is scrolled, the search field does not fade or animate its insets.

Code sample

Code sample
import 'package:flutter/cupertino.dart';

void main() => runApp(const NavBarBlueApp());

class NavBarBlueApp extends StatelessWidget {
  const NavBarBlueApp({super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      theme: CupertinoThemeData(),
      home: FirstPage(),
    );
  }
}

class FirstPage extends StatefulWidget {
  const FirstPage({super.key});

  @override
  State<FirstPage> createState() => _FirstPageState();
}

class _FirstPageState extends State<FirstPage> {
  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      child: CustomScrollView(
        slivers: [
          CupertinoSliverNavigationBar.search(
            stretch: true,
            searchField: CupertinoSearchTextField(
                suffixMode: OverlayVisibilityMode.always,
                suffixIcon: Icon(
                  CupertinoIcons.mic_solid,
                )),
            largeTitle: Text('First Page'),
            automaticallyImplyLeading: true,
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
              (BuildContext context, int index) {
                return CupertinoListTile(
                  title: Text('Item $index'),
                );
              },
              childCount: 20,
            ),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2025-03-13.at.1.57.05.PM.mov

Logs

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.30.0-1.0.pre.588, on macOS 15.3.1 24D70 darwin-arm64, locale en)
    ! Flutter version 3.30.0-1.0.pre.588 on channel [user-branch] at /Users/victorsanni/development/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository [email protected]:victorsanni/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to [email protected]:victorsanni/flutter.git to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.88.1)
[✓] Connected device (4 available)
    ! Error: Browsing on the local area network for Victor’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions