Skip to content

CupertinoSliverNavigationBar largeTitle gets bigger when transition finishes #67269

Closed

Description

@hazzo

Steps to Reproduce

  1. Run code in Code sample section (Is a modified version of getting started code from Flutters web page).
  2. Transition to page and go back

Expected results: Large title should have a smooth transition between text without opacity and with opacity.

Actual results: At the end of the transition the large title pops into a text with bigger size, the transition is not smooth.

Example

As you can see the large title pops bigger at the end of transition.

Flutter doctor

[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-ES)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit
      https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[!] Android Studio (version 3.6)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Ultimate Edition (version 2020.1)
 
[✓] Connected device (2 available)   
Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';

void main() => runApp(MyApp());

// #docregion MyApp
class MyApp extends StatelessWidget {
  // #docregion build
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Startup Name Generator',
      theme: ThemeData(
        primaryColor: Colors.white,
      ),
      home: RandomWords(),
    );
  }
// #enddocregion build
}
// #enddocregion MyApp

// #docregion RWS-var
class _RandomWordsState extends State<RandomWords> {
  final _suggestions = <WordPair>[];
  final _saved = <WordPair>{};
  final _biggerFont = TextStyle(fontSize: 18.0);

  // #enddocregion RWS-var

  // #docregion _buildSuggestions
  Widget _buildSuggestions() {
    return ListView.builder(
        padding: EdgeInsets.all(16.0),
        itemBuilder: /*1*/ (context, i) {
          if (i.isOdd) return Divider();
          /*2*/

          final index = i ~/ 2; /*3*/
          if (index >= _suggestions.length) {
            _suggestions.addAll(generateWordPairs().take(10)); /*4*/
          }
          return _buildRow(_suggestions[index]);
        });
  }

  // #enddocregion _buildSuggestions

  // #docregion _buildRow
  Widget _buildRow(WordPair pair) {
    final alreadySaved = _saved.contains(pair);
    return ListTile(
      title: Text(
        pair.asPascalCase,
        style: _biggerFont,
      ),
      trailing: Icon(
        alreadySaved ? Icons.favorite : Icons.favorite_border,
        color: alreadySaved ? Colors.red : null,
      ),
      onTap: () {
        setState(() {
          if (alreadySaved) {
            _saved.remove(pair);
          } else {
            _saved.add(pair);
          }
        });
      },
    );
  }

  // #enddocregion _buildRow

  // #docregion RWS-build
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CupertinoNavigationBar(
        middle: Text('Startup Name Generator'),
        trailing: CupertinoButton(child: Icon(Icons.list), onPressed: _pushSaved),
      ),
      body: _buildSuggestions(),
    );
  }

  // #enddocregion RWS-build

  void _pushSaved() {
    Navigator.of(context).push(
      CupertinoPageRoute(
        // NEW lines from here...
        builder: (BuildContext context) {
          return Scaffold(
            body: CustomScrollView(
              slivers: [
                CupertinoSliverNavigationBar(
                  largeTitle: Text('test'),
                ),
                SliverList(
                    delegate: SliverChildListDelegate([
                  Padding(
                    padding: const EdgeInsets.all(20),
                    child: Text('test'),
                  ),
                ]))
              ],
            ),
          );
        }, //...to here.
      ),
    );
  }
// #docregion RWS-var
}
// #enddocregion RWS-var

class RandomWords extends StatefulWidget {
  @override
  State<RandomWords> createState() => _RandomWordsState();
}

Activity

  1. darshankawar commented on Oct 5, 2020

    @darshankawar
    Member

    @hazzo
    Can you upgrade to latest stable and try again to see if issue persists ?
    Thanks.

  2. added
    in triagePresently being triaged by the triage team
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 5, 2020
  3. hazzo commented on Oct 5, 2020

    @hazzo
    Author

    @darshankawar
    Updated Flutter and problem persists in device (iPhone 11 Pro Max) but does not happen in simulator (iPhone SE 2nd generation). Here are some gifs.

    iPhoneSE
    iPhoneSE

    iPhone 11 Pro Max
    iPhoneSE

    Flutter is already up to date on channel stable
    Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision d408d302e2 (6 days ago) • 2020-09-29 11:49:17 -0700
    Engine • revision 5babba6c4d
    Tools • Dart 2.10.0
    
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 5, 2020
  5. darshankawar commented on Oct 6, 2020

    @darshankawar
    Member

    @hazzo Can you point to the code sample to use to replicate this issue ? or else please provide a minimal code sample.
    thanks.

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2020
  7. hazzo commented on Oct 6, 2020

    @hazzo
    Author

    @darshankawar sure, the code sample is in the first post in the collapsing element with title "Code sample", but here is it again.

    
    import 'package:flutter/cupertino.dart';
    import 'package:flutter/material.dart';
    import 'package:english_words/english_words.dart';
    
    void main() => runApp(MyApp());
    
    // #docregion MyApp
    class MyApp extends StatelessWidget {
      // #docregion build
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Startup Name Generator',
          theme: ThemeData(
            primaryColor: Colors.white,
          ),
          home: RandomWords(),
        );
      }
    // #enddocregion build
    }
    // #enddocregion MyApp
    
    // #docregion RWS-var
    class _RandomWordsState extends State<RandomWords> {
      final _suggestions = <WordPair>[];
      final _saved = <WordPair>{};
      final _biggerFont = TextStyle(fontSize: 18.0);
    
      // #enddocregion RWS-var
    
      // #docregion _buildSuggestions
      Widget _buildSuggestions() {
        return ListView.builder(
            padding: EdgeInsets.all(16.0),
            itemBuilder: /*1*/ (context, i) {
              if (i.isOdd) return Divider();
              /*2*/
    
              final index = i ~/ 2; /*3*/
              if (index >= _suggestions.length) {
                _suggestions.addAll(generateWordPairs().take(10)); /*4*/
              }
              return _buildRow(_suggestions[index]);
            });
      }
    
      // #enddocregion _buildSuggestions
    
      // #docregion _buildRow
      Widget _buildRow(WordPair pair) {
        final alreadySaved = _saved.contains(pair);
        return ListTile(
          title: Text(
            pair.asPascalCase,
            style: _biggerFont,
          ),
          trailing: Icon(
            alreadySaved ? Icons.favorite : Icons.favorite_border,
            color: alreadySaved ? Colors.red : null,
          ),
          onTap: () {
            setState(() {
              if (alreadySaved) {
                _saved.remove(pair);
              } else {
                _saved.add(pair);
              }
            });
          },
        );
      }
    
      // #enddocregion _buildRow
    
      // #docregion RWS-build
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: CupertinoNavigationBar(
            middle: Text('Startup Name Generator'),
            trailing: CupertinoButton(child: Icon(Icons.list), onPressed: _pushSaved),
          ),
          body: _buildSuggestions(),
        );
      }
    
      // #enddocregion RWS-build
    
      void _pushSaved() {
        Navigator.of(context).push(
          CupertinoPageRoute(
            // NEW lines from here...
            builder: (BuildContext context) {
              return Scaffold(
                body: CustomScrollView(
                  slivers: [
                    CupertinoSliverNavigationBar(
                      largeTitle: Text('test'),
                    ),
                    SliverList(
                        delegate: SliverChildListDelegate([
                      Padding(
                        padding: const EdgeInsets.all(20),
                        child: Text('test'),
                      ),
                    ]))
                  ],
                ),
              );
            }, //...to here.
          ),
        );
      }
    // #docregion RWS-var
    }
    // #enddocregion RWS-var
    
    class RandomWords extends StatefulWidget {
      @override
      State<RandomWords> createState() => _RandomWordsState();
    }
    
    
  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2020
  9. darshankawar commented on Oct 6, 2020

    @darshankawar
    Member

    @hazzo Thanks for the code sample.
    I tried on iPhone SE and iPhone 11 Pro max simulators but didn't see the issue. I am on latest stable.

    67269.mov.zip

    flutter doctor -v
    [✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.4 19E2269, locale en-IN)
        • Flutter version 1.22.0 at /Users/dhs/documents/Fluttersdk/flutter
        • Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
        • Engine revision 5babba6c4d
        • Dart version 2.10.0
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
        • Android SDK at /Users/dhs/Library/Android/sdk
        • Platform android-30, build-tools 30.0.0
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 11.5)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.5, Build version 11E608c
        • CocoaPods version 1.9.3
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 46.0.2
        • Dart plugin version 193.7361
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.49.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.11.0
    
    [✓] Connected device (1 available)
        • SM A260G (mobile) • 5200763ebcfa861f • android-arm • Android 8.1.0 (API
          27)
    
    • No issues found!
    
    
  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2020
  11. hazzo commented on Oct 6, 2020

    @hazzo
    Author

    Hmmm the issue occurs for me in a real device with iOS14, which is an iPhone 11 Pro max.

  12. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2020
  13. darshankawar commented on Oct 7, 2020

    @darshankawar
    Member

    @hazzo although I don't have iPhone 11 pro max, I tried the code sample on iPhone 6s with iOS 14 and saw no issues.
    So not sure if it's device specific.

    RPReplay-Final1602051232.mov.zip

    flutter doctor -v
    [✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.4 19E2269, locale en-IN)
        • Flutter version 1.22.0 at /Users/dhs/documents/Fluttersdk/flutter
        • Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
        • Engine revision 5babba6c4d
        • Dart version 2.10.0
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
        • Android SDK at /Users/dhs/Library/Android/sdk
        • Platform android-30, build-tools 30.0.0
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.0.1, Build version 12A7300
        ✗ Xcode requires additional components to be installed in order to run.
          Launch Xcode and install additional required components when prompted or
          run:
            sudo xcodebuild -runFirstLaunch
        • CocoaPods version 1.9.3
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 46.0.2
        • Dart plugin version 193.7361
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.49.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.11.0
    
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 2 categories.
    
  14. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 7, 2020
  15. 22 remaining items

  16. added
    P2Important issues not at the top of the work list
    on Mar 21, 2023
  17. hazzo commented on Sep 9, 2023

    @hazzo
    Author

    Almost three years later stumbled with the same problem. Searched on google for possible bug and the second result it's my open issue 🥲 without apparent resolution. Rolling back again to material app bar. It's a pitty.

  18. victorsanni commented on May 2, 2025

    @victorsanni
    Contributor

    Closing as duplicate of #90589. This is a text scaling issue with the nav bars. Please feel free to reopen otherwise.

  19. github-actions commented on May 19, 2025

    @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.

  20. locked as resolved and limited conversation to collaborators on May 19, 2025
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: qualityA truly polished experiencee: device-specificOnly manifests on certain devicesf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagesplatform-iosiOS applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions