text:
[animations] Navigator.pushAndRemoveUntil does not reset OpenContainer's state

For the animations package:
If you have some OpenContainer, click on it, which causes a new route to appear, go to another route, then use pushAndRemoveUntil, where we remove until the original route with the OpenContainer, go back from the pushed route, the OpenContainer's state will act as if it's open, causing the original closedBuilder to be invisible.

Hi @wilkomanger
could you provide a complete minimal reproducible code sample and your flutter doctor -v?

flutter doctor -v
[✓] Flutter (Channel stable, v1.17.1, on Linux, locale en_US.UTF-8)
    • Flutter version 1.17.1 at /somewhere
    • Framework revision f7a6a7906b (2 weeks ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /somewhere
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /somewhere
    • Java binary at: /snap/android-studio/88/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /snap/android-studio/88/android-studio
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

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

import 'package:animations/animations.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      routes: {
        '/': (_) => FirstPage(),
        '/second': (_) => SecondPage(),
        '/third': (_) => ThirdPage(),
      },
    );
  }
}

class FirstPage extends StatelessWidget {
  FirstPage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('First page'),
      ),
      body: Container(),
      floatingActionButton: OpenContainer(
        tappable: false,
        closedShape: CircleBorder(),
        closedColor:
            Theme.of(context).floatingActionButtonTheme.backgroundColor ??
                Theme.of(context).colorScheme.secondary,
        closedBuilder: (context, void Function() action) {
          return FloatingActionButton(
            onPressed: action,
            child: Icon(Icons.input),
          );
        },
        openBuilder: (_, __) => SecondPage(),
      ),
    );
  }
}

class SecondPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: RaisedButton(
          onPressed: () {
            Navigator.pushNamedAndRemoveUntil(
              context,
              '/third',
              ModalRoute.withName('/'),
            );
          },
          child: Text('pushAndRemoveUntil'),
        ),
      ),
    );
  }
}

class ThirdPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text(
          'Press back and the floating action button is gone',
        ),
      ),
    );
  }
}

Reproduces with current animations version 1.0.0+5

Persists with animations: ^1.1.1, master 1.21.0-6.0.pre.38.

flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-6.0.pre.38, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-6.0.pre.38 at /Users/nevercode/dev/flutter
    • Framework revision 8e0eee9008 (4 hours ago), 2020-07-26 23:38:01 -0700
    • Engine revision 626244a72c
    • Dart version 2.9.0 (build 2.9.0-21.0.dev a3815b6590)
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • 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.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.1

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

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (4 available)
    • Redmi Note 7 (mobile) • 6345c469   • android-arm64  • Android 9 (API 28)
    • macOS (desktop)       • macos      • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)      • web-server • web-javascript • Flutter Tools
    • Chrome (web)          • chrome     • web-javascript • Google Chrome 84.0.4147.89

• No issues found!

Is there any progress on this? Thanks

I can no longer reproduce this issue on the latest version of flutter using the latest version of animations(^2.0.7)
Closing this as fixed. If anyone still experiences this issue, kindly file a new issue and provide detailed steps to reproduce.
Thank you

flutter 1.22.6 & animations: ^1.1.1
latest flutter & animations: ^2.0.7

updated sample
import 'package:flutter/material.dart';

import 'package:animations/animations.dart';

void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      routes: {
        '/': (_) => const FirstPage(),
        '/second': (_) => const SecondPage(),
        '/third': (_) => const ThirdPage(),
      },
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('First page'),
      ),
      body: Container(),
      floatingActionButton: OpenContainer(
        tappable: false,
        closedShape: const CircleBorder(),
        closedColor:
            Theme.of(context).floatingActionButtonTheme.backgroundColor ?? Theme.of(context).colorScheme.secondary,
        closedBuilder: (context, void Function() action) {
          return FloatingActionButton(
            onPressed: action,
            child: const Icon(Icons.input),
          );
        },
        openBuilder: (_, __) => const SecondPage(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            Navigator.pushNamedAndRemoveUntil(
              context,
              '/third',
              ModalRoute.withName('/'),
            );
          },
          child: const Text('pushAndRemoveUntil'),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // appBar: AppBar(
      //   title: const Text('Third page'),
      // ),
      body: const Center(
        child: Text(
          'Press back and the floating action button is gone',
        ),
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel unknown, 1.22.6, on macOS 13.0.1 22A400 darwin-arm, locale en-GB)
    • Flutter version 1.22.6 at /Users/nexus/dev/sdks/flutter_rc/flutter
    • Framework revision 9b2d32b605 (1 year, 10 months ago), 2021-01-22 14:36:39 -0800
    • Engine revision 2f0af37152
    • Dart version 2.10.5

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 14.1, Build version 14B47b
    • CocoaPods version 1.11.3

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

[!] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile)    • 5dd3be00                             • android-arm64  • Android 12 (API 31)
    • iPhone 14 Pro (mobile) • 4F72110C-F38B-4CF9-93C4-4D6042148D28 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • Web Server (web)       • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.94

! Doctor found issues in 1 category.

[✓] Flutter (Channel stable, 3.3.9, on macOS 13.0.1 22A400 darwin-arm, locale en-GB)
    • Flutter version 3.3.9 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (2 weeks ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/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 11.0.13+0-b1751.21-8125866)

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile)    • 5dd3be00                             • android-arm64  • Android 12 (API 31)
    • iPhone 14 Pro (mobile) • 4F72110C-F38B-4CF9-93C4-4D6042148D28 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.94

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

• No issues found!

[!] Flutter (Channel master, 3.7.0-3.0.pre.35, on macOS 13.0.1 22A400 darwin-arm64, locale en-GB)
    • Flutter version 3.7.0-3.0.pre.35 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eaf6254488 (5 hours ago), 2022-12-06 00:39:23 -0500
    • Engine revision 5d8530f790
    • Dart version 2.19.0 (build 2.19.0-463.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/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 11.0.13+0-b1751.21-8125866)

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile)    • 5dd3be00                             • android-arm64  • Android 12 (API 31)
    • iPhone 14 Pro (mobile) • 4F72110C-F38B-4CF9-93C4-4D6042148D28 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.94

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

! Doctor found issues in 1 category.

authors: VladyslavBondarenko aytunch danagbemava-nc wilkomanger


text:
Prevent flutter doctor from automatically upgrading

When I am not on the newest version, flutter doctor automatically upgrades to it.
This behaviour is not documented (hope I didn't missed something) nor wanted (by me).
Solution:
I see tree solutions here..

Disable the automatic update function
Modify flutter doctor that it takes a special parameter if it should upgrade too.
Document this functionality.

Thanks :)

Hi @CAoTx
flutter doctor doesn't upgrade your flutter version. Could you attach your flutter doctor -v and describe your case - from what version does it upgrade, what commands do you use to reproduce it?

flutter doctor does not automatically upgrade, but it will download missing cache artifacts if it needs to. Closing as WAI

Hi @CAoTx
flutter doctor doesn't upgrade your flutter version. Could you attach your flutter doctor -v and describe your case - from what version does it upgrade, what commands do you use to reproduce it?

Hey, here is the output of  flutter doctor -v after I downgraded and switched from channel dev(1.19) to channel stable
Hey, I downgraded from dev 1.20 to dev 1.19, switched then from channel dev to stable and back again to dev (assuming that I land on dev 1.19. Here's the output of  flutter doctor -v after I switched:
Downloading Dart SDK from Flutter engine d48085141c2f201b1c534e6926eb39bb52d9db3e...
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  246M  100  246M    0     0  5965k      0  0:00:42  0:00:42 --:--:-- 5871k
Building flutter tool...
Downloading package sky_engine...                                   0.3s
Downloading flutter_patched_sdk tools...                            1.2s
Downloading flutter_patched_sdk_product tools...                    1.3s
Downloading linux-x64 tools...                                      3.8s
Downloading linux-x64/font-subset tools...                          0.4s
Downloading android-arm-profile/linux-x64 tools...                  0.3s
Downloading android-arm-release/linux-x64 tools...                  0.3s
Downloading android-arm64-profile/linux-x64 tools...                0.3s
Downloading android-arm64-release/linux-x64 tools...                0.3s
Downloading android-x64-profile/linux-x64 tools...                  0.3s
Downloading android-x64-release/linux-x64 tools...                  0.3s
[✓] Flutter (Channel dev, 1.20.0-7.1.pre, on Linux, locale en_US.UTF-8)
• Flutter version 1.20.0-7.1.pre at /home/sbey/flutter
• Framework revision 7736f3bc90 (5 days ago), 2020-07-10 16:33:05 -0700
• Engine revision d48085141c
• Dart version 2.9.0 (build 2.9.0-21.2.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/sbey/Android/Sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /home/sbey/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1~18.04.1
• cmake version 3.17.3
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 3.6)
• Android Studio at /home/sbey/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Linux
• No issues found!

So after switching from dev 1.19 to stable and back to dev, I am landing on dev 1.20.
To me that seems like it upgraded or do i miss something?

@CAoTx
I tried to perform the same:
dev 1.20.0-7.1.pre -> dev 1.20.0-7.0.pre -> stable -> dev. It remains on dev 1.20.0-7.0.pre.

log
nevercode@Nevercodes-MacBook-Pro AndroidStudioProjects % flutterd doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.20.0-7.1.pre, on Mac OS X 10.15.5 19F101, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.0)

[✓] Connected device (5 available)

• No issues found!
nevercode@Nevercodes-MacBook-Pro AndroidStudioProjects % flutterd downgrade
Downgrade flutter to version 1.20.0-7.0.pre
? [y|n]: y
Success
nevercode@Nevercodes-MacBook-Pro AndroidStudioProjects % flutterd channel stable
Downloading Dart SDK from Flutter engine 0dc86cda19d55aba8b719231c11306eeaca4b798...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  248M  100  248M    0     0  3565k      0  0:01:11  0:01:11 --:--:-- 3523k
Building flutter tool...
  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝

Downloading package sky_engine...                                   1.2s
Downloading flutter_patched_sdk tools...                            3.7s
Downloading flutter_patched_sdk_product tools...                    3.8s
Downloading darwin-x64 tools...                                    10.0s
Downloading darwin-x64/font-subset tools...                         1.6s
Switching to flutter channel 'stable'...
git: From https://github.com/flutter/flutter
git:  * [new branch]          flutter-1.21-candidate.2 -> origin/flutter-1.21-candidate.2
git: Switched to a new branch 'stable'
git: Branch 'stable' set up to track remote branch 'stable' from 'origin'.
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
nevercode@Nevercodes-MacBook-Pro AndroidStudioProjects % flutterd channel dev
Downloading Dart SDK from Flutter engine ee76268252c22f5c11e82a7b87423ca3982e51a7...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  212M  100  212M    0     0  3568k      0  0:01:00  0:01:00 --:--:-- 3568k
Building flutter tool...
Downloading package sky_engine...                                   0.8s
Downloading flutter_patched_sdk tools...                            3.1s
Downloading flutter_patched_sdk_product tools...                    3.2s
Downloading darwin-x64 tools...                                     9.3s
Downloading libimobiledevice...                                     0.4s
Downloading usbmuxd...                                              0.4s
Downloading libplist...                                             0.4s
Downloading openssl...                                              0.5s
Downloading darwin-x64/font-subset tools...                         1.0s
Switching to flutter channel 'dev'...
git: From https://github.com/flutter/flutter
git:    9c4a5ef1e..fc09119d0  master     -> origin/master
git: Switched to branch 'dev'
git: Your branch is behind 'origin/dev' by 1 commit, and can be fast-forwarded.
git:   (use "git pull" to update your local branch)
Successfully switched to flutter channel 'dev'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
nevercode@Nevercodes-MacBook-Pro AndroidStudioProjects % flutterd doctor
Downloading Dart SDK from Flutter engine 0dc86cda19d55aba8b719231c11306eeaca4b798...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  248M  100  248M    0     0  3579k      0  0:01:11  0:01:11 --:--:-- 3710k
Building flutter tool...
  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝

Downloading package sky_engine...                                   1.3s
Downloading flutter_patched_sdk tools...                            3.9s
Downloading flutter_patched_sdk_product tools...                    3.6s
Downloading darwin-x64 tools...                                    10.0s
Downloading libimobiledevice...                                     0.3s
Downloading usbmuxd...                                              0.4s
Downloading libplist...                                             0.2s
Downloading openssl...                                              0.7s
Downloading darwin-x64/font-subset tools...                         1.1s
Downloading android-arm-profile/darwin-x64 tools...                 1.8s
Downloading android-arm-release/darwin-x64 tools...                 1.5s
Downloading android-arm64-profile/darwin-x64 tools...               1.6s
Downloading android-arm64-release/darwin-x64 tools...               1.6s
Downloading android-x64-profile/darwin-x64 tools...                 1.8s
Downloading android-x64-release/darwin-x64 tools...                 1.5s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.20.0-7.0.pre, on Mac OS X 10.15.5 19F101, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.0)
[✓] Connected device (5 available)

• No issues found!

In what way did you downgrade to dev 1.19? does flutter doctor show 1.19 after downgrading?

@CAoTx
I tried to perform the same:
dev 1.20.0-7.1.pre -> dev 1.20.0-7.0.pre -> stable -> dev. It remains on dev 1.20.0-7.0.pre.
log
In what way did you downgrade to dev 1.19? does flutter doctor show 1.19 after downgrading?

Interesting, maybe it's only upgrading major versions...?
Here is my output, being on dev 1.19:
user:user$ flutter doctor -v
[✓] Flutter (Channel unknown, 1.19.0-4.0.pre, on Linux, locale en_US.UTF-8)
• Flutter version 1.19.0-4.0.pre at /home/sbey/flutter
• Framework revision 2f7a59a8da (6 weeks ago), 2020-06-05 03:44:02 -0700
• Engine revision d17c84e7af
• Dart version 2.9.0 (build 2.9.0-13.0.dev 02915ec5ce)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/sbey/Android/Sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /home/sbey/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1~18.04.1
• cmake version 3.17.3
• ninja version 1.8.2
[✓] Android Studio (version 3.6)
• Android Studio at /home/sbey/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Linux • Linux • linux-x64 • Linux
• No issues found!
user:user$ flutter channel stable
Switching to flutter channel 'stable'...
git: From https://github.com/flutter/flutter
git:  + 7736f3bc90...f25bd9c55c dev        -> origin/dev  (forced update)
git:    7736f3bc90..394ccaa8a1  flutter-1.20-candidate.7 -> origin/flutter-1.20-candidate.7
git:  * [new branch]            flutter-1.21-candidate.2 -> origin/flutter-1.21-candidate.2
git:    9c4a5ef1ed..1840b7121a  master     -> origin/master
git: Previous HEAD position was 2f7a59a8da Update engine hash for 1.19.0-4.0.pre (#58736)
git: Switched to branch 'stable'
git: Your branch is up to date with 'origin/stable'.
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
sbey@nunki:~/Projects/bachelorresearch/Flutter/flutterReference$ flutter channel dev
Downloading Dart SDK from Flutter engine ee76268252c22f5c11e82a7b87423ca3982e51a7...
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  212M  100  212M    0     0  5957k      0  0:00:36  0:00:36 --:--:-- 5870k
Building flutter tool...
Downloading package sky_engine...                                   0.3s
Downloading flutter_patched_sdk tools...                            1.2s
Downloading flutter_patched_sdk_product tools...                    1.2s
Downloading linux-x64 tools...                                      3.7s
Downloading linux-x64/font-subset tools...                          0.7s
Switching to flutter channel 'dev'...
git: Switched to branch 'dev'
git: Your branch and 'origin/dev' have diverged,
git: and have 1 and 99 different commits each, respectively.
git:   (use "git pull" to merge the remote branch into yours)
Successfully switched to flutter channel 'dev'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
user:user$ flutter doctor -v
Downloading Dart SDK from Flutter engine d48085141c2f201b1c534e6926eb39bb52d9db3e...
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  246M  100  246M    0     0  5924k      0  0:00:42  0:00:42 --:--:-- 5868k
Building flutter tool...
╔════════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available!                                     ║
║                                                                            ║
║ To update to the latest version, run "flutter upgrade".                    ║
╚════════════════════════════════════════════════════════════════════════════╝
Downloading package sky_engine...                                   0.5s
Downloading flutter_patched_sdk tools...                            1.4s
Downloading flutter_patched_sdk_product tools...                    1.3s
Downloading linux-x64 tools...                                      3.7s
Downloading linux-x64/font-subset tools...                          0.9s
Downloading android-arm-profile/linux-x64 tools...                  0.8s
Downloading android-arm-release/linux-x64 tools...                  0.8s
Downloading android-arm64-profile/linux-x64 tools...                0.8s
Downloading android-arm64-release/linux-x64 tools...                0.7s
Downloading android-x64-profile/linux-x64 tools...                  0.6s
Downloading android-x64-release/linux-x64 tools...                  0.8s
[✓] Flutter (Channel dev, 1.20.0-7.1.pre, on Linux, locale en_US.UTF-8)
• Flutter version 1.20.0-7.1.pre at /home/sbey/flutter
• Framework revision 7736f3bc90 (6 days ago), 2020-07-10 16:33:05 -0700
• Engine revision d48085141c
• Dart version 2.9.0 (build 2.9.0-21.2.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/sbey/Android/Sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /home/sbey/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1~18.04.1
• cmake version 3.17.3
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 3.6)
• Android Studio at /home/sbey/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Linux
• No issues found!

@CAoTx
after downgrading by git checkout or flutter version SDK is in a detached HEAD state.
So you have Channel unknown. After switching channel back to dev it changes it to the latest dev instead. This was the reason, so it's working as intended

@CAoTx
after downgrading by git checkout or flutter version SDK is in a detached HEAD state.
So you have Channel unknown. After switching channel back to dev it changes it to the latest dev instead. This was the reason, so it's working as intended

Ok, I'm sorry for the misunderstanding.
Thanks for the help and clarification!

source: gharchive/issue

authors: CAoTx VladyslavBondarenko jonahwilliams

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
The function MyApp is not defined

Hey everyone as I am polish my skills on UI but when I code it's completely fine even working but in console it's showing a message in file widget_test.dart error message like => The MyApp function is not defined
Thanks in advance 🙂

Steps to Reproduce

Run flutter create bug.
Update the files as follows: ...
...

Expected results:
Actual results:

Logs

Hi @rohan1234,
You might have changed the root method of your app in main.dart which usually is something like:
void main() {
  runApp(MyApp());
}

And the test/widget_test.dart file looks for MyApp() method in its test upon compiling. If you have removed / renamed the MyApp() method in main.dart file and if you are not running any widget tests, you can simply comment out the entire widget_test.dart which should resolve your issue.
Thanks.

@darshankawar @maheshmnj it`s resolved thnx for cooperating