Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigating to Screen which is not wrapped by Scaffold causes laggy on iOS #97109

Open
mthinh opened this issue Jan 24, 2022 · 2 comments
Open
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@mthinh
Copy link

mthinh commented Jan 24, 2022

Steps to Reproduce

  1. Screen A navigate to Screen B
  2. Screen B returns a widget without being wrapped by Scaffold widget (ex CircularProgressIndicator)

Expected results:

Navigating should be smooth

Simulator Screen Recording - iPhone 7 - 2022-01-24 at 07 49 50

Actual results:

It's laggy here

Simulator Screen Recording - iPhone 7 - 2022-01-24 at 07 50 56

Code sample
class ScreenA extends StatelessWidget {
  const ScreenA({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(floatingActionButton: FloatingActionButton(
      onPressed: () {
        Navigator.push(
            context, MaterialPageRoute(builder: (context) => const ScreenB()));
      },
    ));
  }
}


class ScreenB extends StatelessWidget {
  const B({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Center(child: CircularProgressIndicator());
  }
}

Logs
Doctor summary (to see all details,
run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on
    macOS 12.0.1 21A559 darwin-x64,
    locale en-US)
[✓] Android toolchain - develop for
    Android devices (Android SDK
    version 32.0.0)
[✓] Xcode - develop for iOS and macOS
    (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)

• No issues found!
@mthinh mthinh changed the title Navigating to Screen without being wrapped Scaffold causes laggy on iOS Navigating to Screen which is not wrapped by Scaffold causes laggy on iOS Jan 24, 2022
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jan 24, 2022
@darshankawar
Copy link
Member

Thanks for the report. I do see the same behavior using latest master and stable. If screen B doesn't have Scaffold widget, then the routing seems to a bit lagged / slow and also while swiping back, the transition isn't smooth as shown below:

97109.mov

After adding Scaffold on screen B and giving it a background color to match the same scenario, the routing is smooth and swiping back gesture is also proper and as expected, as shown below:

97109_1.mov
master, stable flutter doctor -v

[✓] Flutter (Channel master, 2.9.0-1.0.pre.463, on Mac OS X 10.15.4 19E2269
    darwin-x64, locale en-GB)
    • Flutter version 2.9.0-1.0.pre.463 at
      /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e92d8ef2b1 (13 hours ago), 2022-01-23 13:20:17 -0500
    • Engine revision 4f58a01268
    • Dart version 2.17.0 (build 2.17.0-48.0.dev)
    • DevTools version 2.9.2

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (4 available)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 97.0.4692.71

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[✓] Flutter (Channel stable, 2.8.1, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-GB)
    • Flutter version 2.8.1 at /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (13 hours ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/dhs/Library/Android/sdk
    • Java binary at: /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.    

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)        

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (4 available)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 93.0.4577.82


• No issues found!

@darshankawar darshankawar added f: routes Navigator, Router, and related APIs. found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically c: performance Relates to speed or footprint issues (see "perf:" labels) and removed in triage Presently being triaged by the triage team labels Jan 24, 2022
@HansMuller HansMuller added the f: material design flutter/packages/flutter/material repository. label Jan 24, 2022
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@stuartmorgan stuartmorgan added team-design Owned by Design Languages team triaged-design Triaged by Design Languages team and removed team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 17, 2023
@netDinger
Copy link

Is this problem still persist? I am still facing the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. found in release: 2.8 Found to occur in 2.8 found in release: 2.9 Found to occur in 2.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

6 participants