text:
Building web without null safety fails in 3.3.0

Steps to Reproduce

Create a flutter application without any null safe code and set the sdk constraints as sdk: ">=2.11.0 <3.0.0" to disable null safety features
Using Flutter 3.3.0 from the beta channel, run flutter build web --release
The build should fail

Logs
Of special note below is use of an optional on Registrar in the web_plugin_registrant which causes an error since the requested Dart version doesn't support it. I believe this change was made in the following commit: https://github.com/flutter/flutter/commit/1af8cc118390f3b0e53164b150ccc69339e9329c

Logs
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Compiling lib/main.dart for the Web...
Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
.dart_tool/flutter_build/572d7750549a8327067a38f83ec01c02/web_plugin_registrant.dart:31:38:
Error: Null safety features are disabled for this library.
void registerPlugins([final Registrar? pluginRegistrar]) {
                                     ^
Error: Compilation failed.

Compiling lib/main.dart for the Web...                             29.4s
Exception: Failed to compile application for the Web.

Build failed :|
Failed to build for Web

[✓] Flutter (Channel beta, 3.3.0-0.2.pre, on macOS 12.4 21F79 darwin-arm, locale en-CA)
    • Flutter version 3.3.0-0.2.pre on channel beta at /Users/matthewpatience/fluttersdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7ac27ac8e6 (6 days ago), 2022-08-02 14:35:08 -0700
    • Engine revision d1e7dc18bf
    • Dart version 2.18.0 (build 2.18.0-271.4.beta)
    • DevTools version 2.15.0

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

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.134

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

• No issues found!

Hi @MatthewPatience
I was following your Step to reproduce above but the result is different, it was built successfully.

Logs
➜  test_without_nullsafety_109160_web flutterb build web --release
Running "flutter pub get" in test_without_nullsafety_109160_web...        577ms

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Compiling lib/main.dart for the Web...                             28.8s
➜  test_without_nullsafety_109160_web

Sample code
import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

name: test_without_nullsafety_109160_web
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.11.0 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
    • Flutter version 3.0.5 at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (9 hours ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 103.0.5060.114

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

• No issues found!

[✓] Flutter (Channel master, 3.1.0-0.0.pre.2160, on macOS 12.5 21G72 darwin-x64, locale en-VN)
    • Flutter version 3.1.0-0.0.pre.2160 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 612e536282 (54 minutes ago), 2022-08-08 22:54:07 -0400
    • Engine revision 6c14fb339f
    • Dart version 2.19.0 (build 2.19.0-75.0.dev)
    • DevTools version 2.16.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 12.5 21G72 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 104.0.5112.79

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

• No issues found!

[✓] Flutter (Channel beta, 3.3.0-0.2.pre, on macOS 12.5 21G72 darwin-x64, locale en-VN)
    • Flutter version 3.3.0-0.2.pre on channel beta at /Users/huynq/Documents/GitHub/flutter_beta
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7ac27ac8e6 (7 hours ago), 2022-08-02 14:35:08 -0700
    • Engine revision d1e7dc18bf
    • Dart version 2.18.0 (build 2.18.0-271.4.beta)
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 12.5 21G72 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 103.0.5060.134

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

• No issues found!

To make the issue to be more clear, please provide the information indicated below:

A completed and minimal reproducible code sample
Expected results, Actual results

To support unsound null safety, please see: https://dart.dev/null-safety/unsound-null-safety
Thank you!

Thanks for running the test, however, according to your flutter doctor it appears you were using v3.0.5, could you please upgrade to 3.3.0 and retry? Please also run a flutter clean before building to ensure the web plugin registrant gets rebuilt.

Hi @MatthewPatience
Please scroll down and you can see I have beta version 3.3.0-0.2.pre like yours. And from the logs, you can notice that I have tested with flutterb which means flutter beta. I also tried running flutter clean and build again, the result is still the same.
Please provide a completed and minimal reproducible code sample so that we may verify this. Also, please provide expected results and actual results to make the issue clearer.
Thank you!

Sorry @huycozy for that oversight! I suspect the reason you didn't encounter the issue is because no web_plugin_registrant is built when the project has no web plugins. I have created a basic sample project as requested that has a firebase_core as a dependency. The error occurs on this project when creating a web release build.
https://github.com/MatthewPatience/FlutterWebNullSafetyTest
Expected results
Project builds web release without errors
Actual results
Compilation fails with the following error in web_plugin_registrant.dart:
$ flutter build web --release

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
.dart_tool/flutter_build/1d1fac7d679db36d893f7d63ab650682/web_plugin_registrant.dart:11:38:
Error: Null safety features are disabled for this library.
void registerPlugins([final Registrar? pluginRegistrar]) {
                                     ^
Error: Compilation failed.

Compiling lib/main.dart for the Web...                              4.5s
Exception: Failed to compile application for the Web.

Hello. I can reproduce this issue in beta and master channels. Stable works as expected.

Logs
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Compiling lib\main.dart for the Web...
Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
.dart_tool/flutter_build/b6d8348c191af35df51a8e8c80d8929e/web_plugin_registrant.dart:11:38:
Error: Null safety features are disabled for this library.
void registerPlugins([final Registrar? pluginRegistrar]) {
                                     ^
Error: Compilation failed.

Compiling lib\main.dart for the Web...                             10.5s
Exception: Failed to compile application for the Web.

pubspec.yaml
name: issue_109160
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: ">=2.11.0 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  firebase_core: ^1.20.0

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

flutter doctor -v (Stable)
[✓] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22000.832], locale en-IN)
    • Flutter version 3.0.5 at C:\Users\Nabeel Parkar\fvm\versions\stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (4 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\android-sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32630.192
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.12+7-b1504.28-7817840)

[✓] VS Code (version 1.70.0)
    • VS Code at C:\Users\Nabeel Parkar\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.832]
    • Chrome (web)      • chrome  • web-javascript • unknown
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 90.0.818.66

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

• No issues found!

flutter doctor -v (Master)
[✓] Flutter (Channel master, 3.1.0-0.0.pre.2185, on Microsoft Windows [Version 10.0.22000.832], locale en-IN)
    • Flutter version 3.1.0-0.0.pre.2185 on channel master at C:\Users\Nabeel Parkar\fvm\versions\master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e53fdfef6b (2 hours ago), 2022-08-09 23:55:07 -0400
    • Engine revision 60cec04398
    • Dart version 2.19.0 (build 2.19.0-80.0.dev)
    • DevTools version 2.16.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\android-sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32630.192
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.12+7-b1504.28-7817840)

[✓] VS Code (version 1.70.0)
    • VS Code at C:\Users\Nabeel Parkar\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.832]
    • Chrome (web)      • chrome  • web-javascript • unknown
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 90.0.818.66

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

• No issues found!

authors: MatthewPatience exaby73 huycozy

repo: flutter/flutter


text:
Not able to navigate using tab key when using nested Navigators

I'm not able to navigate using tab key when using nested Navigators, see the minimal reproducible code.
Steps to Reproduce

Execute flutter run on the code sample
Use tab key to navigate between widgets

Expected results: You should be able to navigate in the entire widget tree
Actual results: You can't navigate to the app bar button, neither the widgets of the outer navigator.

Minimal reproducible code
void main()  => runApp(MyApp());

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Navigator(
        pages: [
          MaterialPage(
            child: Scaffold(
              appBar: AppBar(
                leading: IconButton(
                  icon: const Icon(Icons.menu),
                  onPressed: () {},
                ),
              ),
              body: Row(
                children: [
                  TextButton(
                    onPressed: () {},
                    child: const Text('Menu button 1'),
                  ),
                  Expanded(
                    child: Navigator(
                      pages: [
                        MaterialPage(
                          child: Column(
                            children: [
                              TextButton(
                                onPressed: () {},
                                child: const Text('Body button 1'),
                              ),
                              TextButton(
                                onPressed: () {},
                                child: const Text('Body button 2'),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Updating to P2 because this is about to block a Google customer launch in September see internal issue b/241143126 for more context.

goderbauer@, could you please route this to someone who can look into it?

@gspencergoog This looks like a focus traversal problem. Could you take a look at this?

I think this is because of the nested Navigator widgets. A Navigator adds a FocusScope around its contents, and that is what is restricting the traversal, so the inner navigator is preventing traversal outside of itself.

That makes sense! This behavior seems to be causing problems when the inner navigator does not occupy the entire screen. Do you have any ideas for workarounds or framework-level fixes?

The first idea would be not to use nested navigators, if possible. If not, I can think of some possible framework level changes that might help, but are quite risky:

Simply remove the FocusScope from Navigator.  This probably would break a lot of tab navigation in a lot of apps, and probably wouldn't be acceptable.
Replace the FocusScope in the Navigator with a FocusTraversalGroup, and move the FocusScope outside of the Navigator in WidgetsApp, so that there's still a scope, but only one, not any nested ones.  The FocusTraversalGroup would help keep the tab order sane, but still allow traversal outside of the group.

Here's an attempt at number two, above: https://github.com/flutter/flutter/pull/109702

2 sounds conceptually sensible. Or otherwise, it would have been odd to bundle a scope with the navigator where in the following case

the traversal wouldn't go through the bottom tabs

Should be fixed by https://github.com/flutter/flutter/pull/109702

Actually, this doesn't appear to have fixed this issue.  Reopening.

It looks like the root of the problem is that MaterialPage inserts a PageRoute, which is a form of ModalRoute.  Modal routes are supposed to capture the focus and not release it (they have a FocusScope in them). Pages are intended to be full screen routes, so this is correct behavior for the code in the sample. The description of ModalRoute is "A route that blocks interaction with previous routes."

source: gharchive/issue

authors: eduardoGo goderbauer gspencergoog jacobsimionato xster

license_type: permissive

license_source: github-api


text:
[local_auth] Details about the package

I would like to understand more about how can I know which biometric is displayed for registration and is there a way to specify which biometrics such as only touch ID (before I select I would confirm if the device supports it or not!)

@danagbemava-nc  so I am trying to implement local auth but if device support face authentication and fingerprint authentication can I select which one to use?

iOS devices (at present) only have either face ID or Touch ID and as far as I can tell, you there isn't an API that will allow you to select which one you want to use so it's not possible for iOS.
Android, on the other hand, allows you to specify a biometric type. See https://source.android.com/docs/security/features/biometric for the options. However, currently, this has not been implemented yet. You can query for the existence of either STRONG or WEAK biometric, but the option to add either to authenticate hasn't been added yet. That is being tracked in https://github.com/flutter/flutter/issues/81169
Does this answer your question?

Yes it does! Thank you!


text:
Why there is showing only one document in firebase firestore when extracting on flutter app?

amusing flutter app but when i signup as new user nothing happen on the firestore database and only i see new user email on authentication

// ignore: avoid_web_libraries_in_flutter
import 'dart:ui';

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:yumor/bottomanavigationbar.dart';
import 'package:yumor/models/user_model.dart';
import 'package:yumor/pages/Home_page.dart';

class signup_screen extends StatefulWidget {
  const signup_screen({Key? key}) : super(key: key);

  @override
  _signup_screenState createState() => _signup_screenState();
}

class _signup_screenState extends State<signup_screen> {
  final _auth = FirebaseAuth.instance;
  // form key
  final _formkey = GlobalKey<FormState>();
  // editing controller
  final usernameEditorcontroller =  TextEditingController();
  final emailEditorcontroller = TextEditingController();
  final passwordEditorcontroller =  TextEditingController();
  final confirmEditorcontroller =  TextEditingController();

  @override
  Widget build(BuildContext context) {
    final showKeyboard = MediaQuery.of(context).viewInsets.bottom != 0;

    final logo = SizedBox(
      height: 140,
      child: Image.asset(
        "assets/yumor-logo.png",
        fit: BoxFit.contain,
      ),
    );
    //firstname field
    final usernamefield = TextFormField(
      autofocus: false,
      controller: usernameEditorcontroller,
      keyboardType: TextInputType.name,
      validator: (value) {
        RegExp regexp = RegExp(r'^.{4,}$');
        if (value!.isEmpty) {
          return ("First Name Cannot be Empty");
        }
        if (!regexp.hasMatch(value)) {
          return ("Enter Valid Name . (Min 4 Characters)");
        }

      },
      onSaved: (value) {
        usernameEditorcontroller.text = value!;
      },
      textInputAction: TextInputAction.next,
      decoration: InputDecoration(
        prefixIcon: Icon(Icons.account_circle),
        contentPadding: EdgeInsets.fromLTRB(20, 15, 20, 15),
        hintText: "Username",
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(10),
        ),
      ),
    );
    //lastname field

    //email field
    final emailfield = TextFormField(
      autofocus: false,
      controller: emailEditorcontroller,
      keyboardType: TextInputType.emailAddress,
      validator: (value) {
        RegExp newReg = RegExp(
            r"^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$");
        if (value!.isEmpty) {
          "please enter your email";
        }
        // reg expression for email validation
        if (!newReg.hasMatch(value)) {
          return ("Please Enter A valid email");
        }
        return null;
      },
      onSaved: (value) {
        emailEditorcontroller.text = value!;
      },
      textInputAction: TextInputAction.next,
      decoration: InputDecoration(
        prefixIcon: Icon(Icons.mail_outline_sharp),
        contentPadding: EdgeInsets.fromLTRB(20, 15, 20, 15),
        hintText: "Email",
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(10),
        ),
      ),
    );
    //password field
    final passwordfield = TextFormField(
      autofocus: false,
      controller: passwordEditorcontroller,
      obscureText: true,
      validator: (value) {
        RegExp regexp = new RegExp(r'^.{6,}$');
        if (value!.isEmpty) {
          return ("Password is Required for login");
        }
        if (!regexp.hasMatch(value)) {
          return ("Enter Valid password . Min 6 Characters");
        }
      },
      onSaved: (value) {
        passwordEditorcontroller.text = value!;
      },
      textInputAction: TextInputAction.next,
      decoration: InputDecoration(
        prefixIcon: Icon(Icons.vpn_key),
        contentPadding: EdgeInsets.fromLTRB(20, 15, 20, 15),
        hintText: "Password",
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(10),
        ),
      ),
    );
    // password confirmation field
    final confirmfield = TextFormField(
      autofocus: false,
      controller: confirmEditorcontroller,
      obscureText: true,
      validator: (value) {
        if (confirmEditorcontroller.text != passwordEditorcontroller.text) {
          return "Password don't Match";
        }
        if (value!.isEmpty) {
          return ("Confirm password is required for signup");
        }
        return null;
      },
      onSaved: (value) {
        confirmEditorcontroller.text = value!;
      },
      textInputAction: TextInputAction.done,
      decoration: InputDecoration(
        prefixIcon: Icon(Icons.vpn_key),
        contentPadding: EdgeInsets.fromLTRB(20, 15, 20, 15),
        hintText: "Confirm Password",
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(10),
        ),
      ),
    );
    // signup button field
    final signupbutton = Material(
      elevation: 5,
      borderRadius: BorderRadius.circular(30),
      color: Colors.blueGrey.shade500,
      child: MaterialButton(
        padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
        minWidth: MediaQuery.of(context).size.width,
        onPressed: () {
          signUp(emailEditorcontroller.text, passwordEditorcontroller.text);
        },
        child: Text(
          "SignUp",
          textAlign: TextAlign.center,
          style: TextStyle(
              fontSize: 20, color: Colors.white, fontWeight: FontWeight.bold),
        ),
      ),
    );
    return Scaffold(
        resizeToAvoidBottomInset: false,
        backgroundColor: Colors.white,
        appBar: AppBar(
          backgroundColor: Colors.transparent,
          elevation: 0,
          leading: IconButton(
            icon: Icon(
              Icons.adaptive.arrow_back,
              color: Colors.yellow.shade700,
            ),
            onPressed: () {
              Navigator.of(context).pop();
            },
          ),
          title: Center(
            child: Text(
              "Sign Up",
              style: TextStyle(color: Colors.blueGrey.shade500),
            ),
          ),
        ),
        body: Center(
          child: SingleChildScrollView(
            scrollDirection: Axis.vertical,
            child: Container(
              color: Colors.white,
              child: Padding(
                padding: const EdgeInsets.all(36.0),
                child: Form(
                  key: _formkey,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      // this Sized box is used for the logo and fit in side
                      // a box like textfiled
                      // ||||||||||||
                      //
                      Text(
                        "Yumor",
                        style: TextStyle(
                          color: Colors.yellow.shade600,
                          fontSize: 80,
                        ),
                      ),
                      //
                      // ||||||||||||
                      // if (!showKeyboard) logo,

                      SizedBox(height: 25),
                      usernamefield,
                      SizedBox(height: 20),
                      emailfield,
                      SizedBox(height: 20),
                      passwordfield,
                      SizedBox(height: 20),
                      confirmfield,
                      SizedBox(height: 20),
                      signupbutton,
                      SizedBox(height: 15),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ));
  }

  void signUp(String email, String password)  async{
    if (_formkey.currentState!.validate()) {
    await  _auth
          .createUserWithEmailAndPassword(email: email, password: password)
          .then((value) => {postDetailsToFirestore()})
          .catchError((er) {
        Fluttertoast.showToast(msg: er!.message);
      });
    }
  }

  postDetailsToFirestore() async {
    // calling our firestore
    // calling our user model
    // sending these values
    FirebaseFirestore firebaseFirestore = FirebaseFirestore.instance;
    User? user = _auth.currentUser;
    UserModel userModel = UserModel();
    // // writing all the values
    userModel.email = user!.email;
    userModel.uid = user.uid;
    userModel.username = usernameEditorcontroller.text;

    await firebaseFirestore
        .collection("users")
        .doc(user.uid)
        .set(userModel.toMap());
    Fluttertoast.showToast(msg: "account Created successfully");
    Navigator.pushAndRemoveUntil((context),
        MaterialPageRoute(builder: (context) => BottomBar()), (route) => false);
  }
}

Please file this issue in dedicated repo: https://github.com/firebase/flutterfire/issues and only provide a complete minimal reproducible code sample without any third party plugin along with actual vs expected result in it while filing.
Closing from here.

authors: Abderrezak-douba darshankawar


text:
TextPainter.getLineBoundary returns the wrong value when run on web tests

Info
When tests are run on the web TextPainter.getLineBoundary includes the line terminator when the documentation states it does not. When tests are run on the native platform TextPainter.getLineBoundary return value does not include the line terminator.
In a non-test environment, when a flutter app is running on the native platform TextPainter.getLineBoundary return value does not include the line terminator.
Steps to Reproduce
The following test variation from #83392 passes with flutter test test/widgets/text_test.dart but fails with flutter test test/widgets/text_test.dart --platform chrome
  test('getLineBoundary does not include newline characters', () {
    const text = 'aaa\nbbb';

    final paragraphStyle = ui.ParagraphStyle(
      textDirection: ui.TextDirection.ltr,
    );
    final paragraphBuilder = ui.ParagraphBuilder(paragraphStyle)
      ..addText(text);
    final constraints = ui.ParagraphConstraints(width: 1000);
    final paragraph = paragraphBuilder.build();
    paragraph.layout(constraints);

    var range = paragraph.getLineBoundary(const TextPosition(offset: 0));
    expect(
      range.textInside(text),
      equals('aaa'),
    );
    expect(range.start, 0);
    expect(range.end, 3);

    range = paragraph.getLineBoundary(const TextPosition(offset: 5));
    expect(
      range.textInside(text),
      equals('bbb'),
    );
    expect(range.start, 4);
    expect(range.end, 7);
  });

There is also conflicting documentation in text_painter.dart and text.dart
text_painter (last updated #83626):
  /// Returns the text range of the line at the given offset.
  ///
  /// The newline (if any) is not returned as part of the range.

text:
  /// Returns the [TextRange] of the line at the given [TextPosition].
  ///
  /// The newline (if any) is returned as part of the range.
  ///
  /// Not valid until after layout.
  ///
  /// This can potentially be expensive, since it needs to compute the line
  /// metrics, so use it sparingly.

cc @LongCatIsLooong

I replicated the reported behavior using latest stable and master versions.
dhs@Dhss-MacBook-Pro test_app % flutter test test/widget_test.dart
00:03 +1: All tests passed!

dhs@Dhss-MacBook-Pro test_app % flutter test test/widget_test.dart --platform chrome
00:02 +0 -1: getLineBoundary does not include newline characters [E]
  Expected: 'aaa'
    Actual: 'aaa\n'
              ''
     Which: is different. Both strings start the same, but the actual value also has the following trailing characters: \n

 stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.7.3, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.7.3 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (4 days ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] 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 (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • 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 98.0.4758.80

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

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.8.0-12.0.pre.49, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.8.0-12.0.pre.49 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b08cc8be79 (74 minutes ago), 2023-02-13 22:36:26 -0500
    • Engine revision c4f51bc786
    • Dart version 3.0.0 (build 3.0.0-233.0.dev)
    • DevTools version 2.21.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] 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 (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • 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 98.0.4758.80

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

! Doctor found issues in 1 category.

authors: Renzo-Olivares darshankawar


text:
Janky GridView with remote images

Scrolling a gridView is janky
Tested with Impeller on latest stable and master 3.8.0-15.0.pre.25, iphone 13 pro, iose 16.1.
Steps to Reproduce
Please run this example here:
https://github.com/delfme/janky-gridview-scrolling
Expected results:
Smooth scrolling.
Actual results:
Scrolling janks are less evident on ios with Impeller but it is still not perfectly smooth and it janks at times.
https://user-images.githubusercontent.com/53510751/221690041-a76036bf-4b28-4fee-b2cd-e4ce1bc84986.mp4
Profiling vid:
A few janks here and there, more janks from 0:12 on.
https://user-images.githubusercontent.com/53510751/221689399-88c1aba0-ba2d-4b3c-91a7-42cf0be2ec19.mov

Flutter doctor:

[✓] Flutter (Channel master, 3.8.0-15.0.pre.25, on macOS 12.2 21D49 darwin-arm64, locale en-IT)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Raster thread takes much time but it is just 100x100px pics that weight a few KB each. Fade effects disabled. It looks a simple scenario.

I'm not able to reproduce any issues running with or without impeller on iOS.

What device are you using to test?
Can you upload the timeline so I can inspect it myself

iphone 13 pro iose 16.1
https://drive.google.com/file/d/16J4K2sp2X971hgvu61HoF0eAlHBYlVt1/view?usp=sharing

I see raster mostly and at times a huge paint

@delfme
I ran with --profile using latest master version on iPhone 6s but didn't see / experience the jank:
https://user-images.githubusercontent.com/67046386/221804962-de6b2363-dba9-47d5-891b-e0d904af4d37.MP4
Although saw couple of performance shader as below while running / scrolling in the app:
https://user-images.githubusercontent.com/67046386/221804681-3fc81052-de47-4322-a109-4f5b73c826e8.mov
Also, since the repo you shared in this issue is same as https://github.com/flutter/flutter/issues/121525 with images loading via network, wondering what exactly is the difference between this issue and the other one.

@darshankawar I edited the code to let Jonah see the issue with remote images. Inside the main you can disabled remote images and enable asset images to test things as it is needed.
https://github.com/delfme/janky-gridview-scrolling/blob/0098f033403501ba8aee69121d5002fcf36c1686/lib/main.dart#L52-L64
OR
https://github.com/delfme/janky-gridview-scrolling/blob/0098f033403501ba8aee69121d5002fcf36c1686/lib/main.dart#L40-L49

@delfme I ran with --profile using latest master version on iPhone 6s but didn't see / experience the jank:
Although saw couple of performance shader as below while running / scrolling in the app:
Also, since the repo you shared in this issue is same as #121525 with images loading via network, wondering what exactly is the difference between this issue and the other one.

This is curious, I can see janks in the scrolling even if you have just a couple of slow frames in your timeline. At least in my case I have several slow frames.

Here is another sample from ios Impeller. This is horizontal scrolling, janks make it feel like avatars are bumping. Item is a small size pic with a gradient circle and text.
https://user-images.githubusercontent.com/53510751/221934686-27c33648-7f5f-411f-8a8f-50587645ed0a.MOV

I've tried a few more phones and I'm not able to reproduce any jank in the timeline. I see some sort of jank in the trace you posted, but when i tried to open the devtools trace from https://github.com/flutter/flutter/issues/121547#issuecomment-1447254885 it fails to load any information correctly. FYI @kenzieschmoll

@jonahwilliams what do you mean by "it fails to load any information correctly"? I'm able to load the file into DevTools:

as soon as I start scrolling around it starts to break. Also notices issues if I clikced on other frame times in the top, sometimes it would jump around incorrectly.

Ran again with impeller enabled in profile mode using latest master version on iPhone 6s and saw below:

Will keep this issue open for team's tracking and attention.

 master flutter doctor -v

[!] Flutter (Channel master, 3.8.0-18.0.pre.28, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.8.0-18.0.pre.28 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 25712d95d3 (2 hours ago), 2023-02-28 19:31:23 -0800
    • Engine revision 46ee3209b9
    • Dart version 3.0.0 (build 3.0.0-277.0.dev)
    • DevTools version 2.22.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

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

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

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

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

[!] 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 (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • 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 98.0.4758.80

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

! Doctor found issues in 1 category.

@jonahwilliams @kenzieschmoll I can create a new one if needed. That one has 70 jank frames if I recall correctly.
@darshankawar can you please share your timeline as well?

Departing for a moment from numbers, and describing it by user experience:

On ios with Impeller (iphoneX and newer models) it is a mixed bag. When it is smooth, it is very smooth. But on several scenarios (ie. images) it can be janky and bumping. In other cases, it is smooth and at some point, out of blue, you have a jank for 1-2sec till smoothness recovers.
On android we can never get a smooth scrolling. Even in the best case scenario, there is always some micro-jitters. We also noticed that things get worse when finger touches up the screen (which makes us think there might be also a touch gesture issue).

We filled issues to report things for each platform, but this is the big picture.

Of the single trace file you've uploaded I see only a single missed frame - on the UI thread and due to GC. This doesn't have anything to do with impeller.

@delfme can you upload a trace that shows raster thread taking a long time?

@jonahwilliams my bad, I have uploaded a trace that is not the one used to file the issue.
Please check this other one, I'm testing on iphone 13 pro.
https://drive.google.com/file/d/1fdWSSA6x53WaUn9ZxLPKKcbfGk5H_hVr/view?usp=sharing
https://user-images.githubusercontent.com/53510751/222229891-57936d8f-5fa1-47d9-86fd-1fc8278f7d65.mp4

Here is the interesting part of the trace. it looks like texture upload is delaying the raster start time, which is contributing to the long raster thread timing. I wonder if the impeller decoders need to be aware of what the raster thread is doing so they can schedule more efficiently.
@chinmaygarde @bdero for more insight

This is the trace of the scrolling from this comment above
https://github.com/flutter/flutter/issues/121547#issuecomment-1448605141
https://drive.google.com/file/d/1Cn-2xwsumRqES97OpJQH-AccgcFYzVmG/view?usp=sharing
https://user-images.githubusercontent.com/53510751/222407212-8dbcc98f-ef06-4303-96cd-df0ea953cebc.mp4

Did latest commits after 3.8.0-15.0.pre.25 affect this? Because I just upgraded and now I see more janks, both list/grid scrolling and screens animations (basic left/right animation).
Lmk if other traces might be helpful. I think sharing code should instead not be required.

We should get a multi-frame GPU trace from Instruments. The multiple texture uploads will also cause overhead due to mip-mapping and potential format conversions. But that ought to not be a sweat for the GPU.
Another cause could be that with Metal, we are doing concurrent texture uploads and mip-mapping. Perhaps that is causing the GPU to be bandwidth limited? Don't know but Instruments will tell us this answer fairly quickly. We perhaps don't face this issue as much on OpenGL because we only have one IO context and everything is serialized. So just slower. We could just lower the concurrency on the modern backends.
Either way, Instruments traces.

@chinmaygarde this is the trace for android.
https://drive.google.com/file/d/1EQrBWpIieNmWHZvhBilghB7TAHfvZIVn/view?usp=sharing
https://user-images.githubusercontent.com/53510751/224507587-6c36a1c3-ab98-43c1-93d5-1358463ee2fa.mp4

This is trace from sample code:
https://drive.google.com/file/d/1N9vFeoGJopmQyVUMydFpi7MQIKaEWoPo/view?usp=sharing
https://user-images.githubusercontent.com/53510751/224508201-f83b7e63-4250-4298-a413-fb1902c12328.mp4

Was wondering if there is something in the engine that is not working as supposed to and could be disabled.
Just guessing theoretically-wise, coz dart is compiled into native. So, scrolling a grid of images cannot be janky if app is making no background work, pics are lightweight (150x150px) and cached in memory.
React Native can operate at 60fps consistently in that scenario. Flutter should be smoother than RN. Is it GC that gets in the middle when it shouldn't? Is it an attempt to go at 80 - 120 fps which somehow end up causing janks?

Ok

authors: Iuri92 chinmaygarde darshankawar delfme jonahwilliams kenzieschmoll


text:
what kind of error this is while using cubit

Steps to Reproduce

Execute flutter run on the code sample
...
...

Expected results:
Actual results:

Code sample

Logs

Hi @BINOD-KHANAL
When opening an issue, please try to provide all or some of the information indicated in the template so that we can address this issue properly.

Issue Template
If you are looking for support, please check out our documentation
or consider asking a question on Stack Overflow:
- https://flutter.dev/
- https://api.flutter.dev/
- https://stackoverflow.com/questions/tagged/flutter?sort=frequent

If you have found a bug or if our documentation doesn't have an answer
to what you're looking for, then fill our the template below. Please read
our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports

Steps to Reproduce

Please tell us exactly how to reproduce the problem you are running into.

Please attach a small application (ideally just one main.dart file) that
reproduces the problem. You could use https://gist.github.com/ for this.

If the problem is with your application's rendering, then please attach
a screenshot and explain what the problem is.

1. ...
2. ...
3. ...

Please tell us which target platform(s) the problem occurs (Android / iOS / Web / macOS / Linux / Windows)
Which target OS version, for Web, browser, is the test system running?
Does the problem occur on emulator/simulator as well as on physical devices?

Target Platform:
Target OS version/browser:
Devices:

Run your application with `flutter run --verbose` and attach all the
log output below between the lines with the backticks. If there is an
exception, please see if the error message includes enough information
to explain how to solve the issue.

Run `flutter analyze` and attach any output of that command below.
If there are any analysis errors, try resolving them before filing this issue.

Finally, paste the output of running `flutter doctor -v` here.

Closing this issue, since no information has been provided.

authors: BINOD-KHANAL huycozy


text:
Add debugWebViewPlatformProvider for WebViewPlatform

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Use case
If we set the WebViewPlatform instance in one test, we cannot set it back to null after the instance is no longer needed.
  /// Platform-specific plugins should set this with their own platform-specific
  /// class that extends [WebViewPlatform] when they register themselves.
  static set instance(WebViewPlatform? instance) {
    if (instance == null) {
      throw AssertionError(
          'Platform interfaces can only be set to a non-null instance');
    }
    PlatformInterface.verify(instance, _token);
    _instance = instance;
  }

So if we mock the WebViewPlatform in one test, the other test would deal with the side effect of setting the mock.
class MockWebViewPlatform extends Mock
    with MockPlatformInterfaceMixin
    implements WebViewPlatform {}

main(){
  group('web view platforms do not have side effects', () {
    late final bool testWebViewPlatformWasCalled;

    test('Set instance in first test', () {
      testWebViewPlatformWasCalled = true;
      WebViewPlatform.instance = MockWebViewPlatform();
    });

    test('check if the WebViewPlatform instance is null', () {
      expect(
        testWebViewPlatformWasCalled,
        true,
        reason: 'We have to verify that the testWebViewPlatformWasCalled'
            ' is once executed so we can see if this affect this test',
      );
      expect(WebViewPlatform.instance, null);
    });
  });
}

The result of the second test would be as follows.
This test Fails with:
Expected: <null>
Actual: MockWebViewPlatform:<MockWebViewPlatform>

This may cause undesired behaviour because the mock is still present.
One solution would be to simply generate a new mock and set it, but we could not go back to the 'initial' state.
Proposal
I would suggest something like the debugNetworkImageHttpClientProvider.
flutter/packages/flutter/lib/src/painting/debug.dart
Somewhere there is a debugWebViewPlatformProvider field:
WebViewPlatform Function()? debugWebViewPlatformProvider;

And when we try to get the instance, we use it like this:
  /// The instance of [WebViewPlatform] to use.
  static WebViewPlatform? get instance {
    WebViewPlatform? result = _instance;
    assert(() {
      if (debugWebViewPlatformProvider != null) {
        final WebViewPlatform platform = debugWebViewPlatformProvider!();
        PlatformInterface.verify(platform, _token);
        result = platform;
      }
      return true;
    }());
    return result;
  }

It looks like you are trying to prevent test pollution between tests; normally we handle this in our own tests by setting a fake/mock/dummy implementation fresh for every test in setUp. Is there a reason that doesn't work for your use case?
If so, could you elaborate on the expected behavior of the "debug" implementation? Would it provide a benefit over allowing setting back to null?

Consider the following, you have a test file with several groups. In the group at the beginning of your file, you set the MockWebViewPlatform instance in the group's setUp method.
A few groups later, you interact with the instance again, unaware that the instance has been set. When you check the setUp of the group and the inherited setUps, it is not visible that the instance has been set.
So by default, I would say it would be good practice to always set the instance that survives multiple tests and is not a globally visible field in the testfile to a non-functional instance or null in the tearDwon method. That way, accessing it again will at least throw an exception, and it will be clear that you are accessing something that needs a proper test setup.
As mentioned above, a non-functional instance can also serve the purpose of giving the tester feedback that an exchange has taken place. However, the error message is not as informative as the default one that is thrown if you access it with null. Otherwise, you have to figure out from the stack trace that a substitution has been made, and if you want to interact with it, you have to replace/use the current one.

So by default, I would say it would be good practice to always set the instance that survives multiple tests and is not a globally visible field in the testfile to a non-functional instance or null in the tearDwon method.

Fair enough; we could probably change this to allow setting back to null (either by allowing null here, or to avoid accidental usage of null in production a @visibleForTesting method to reset it).
As a workaround for now, you can add something like:
class TombstoneWebViewPlatform extends WebViewPlatform {}

to your test file, and set instance to that in your teardown.

However, the error message is not as informative as the default one that is thrown if you access it with null.

It sounds like you would prefer being able to set it back to null rather than having a special built-in "debug" instance then? If so I can retitle this issue.

If you can give us a solution that allows us to set it to null. I would prefer that.
I chose the debugWebViewPlatformProvider interceptor because the assertion guarantees that it is not available in prod.
@visibleForTesting is just an annotation for the analyser, which can still be bypassed with and : // ignore: invalid_use_of_visible_for_testing_member.
But I leave the way to achieve this up to you.

I chose the debugWebViewPlatformProvider interceptor because the assertion guarantees that it is not available in prod.
@visibleForTesting is just an annotation for the analyser, which can still be bypassed with and : // ignore: invalid_use_of_visible_for_testing_member.

If someone wants to go out of their way to break webview in their own webview-using application in production, they can already trivially do so (such as via the line in my comment just above), so I'm not sure what the concern is here.

authors: SimonWeidemann stuartmorgan


text:
type 'Null' is not a subtype of type 'bool'

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce

Access the given repo
Run it
Try to click on the edit icon and search for a location that has a timezone (for eg. Cairo)
Select it.

Expected results
It is expected that after selecting the item it should change the time on the home screen and other such data.
Actual results
Instead, it is returning an error saying:
type 'Null' is not a subtype of type 'bool'
Code sample
Path to git repo: World-Time
Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
The following _TypeError was thrown building Home(dirty, dependencies: [_ModalScopeStatus], state: _HomeState#51f36):
type 'Null' is not a subtype of type 'bool'

The relevant error-causing widget was:
  Home Home:file:///Users/sanchitbatra/StudioProjects/world_time/lib/main.dart:13:34
When the exception was thrown, this was the stack:
#0      _HomeState.build (package:world_time/pages/home.dart:29:27)
#1      StatefulElement.build (package:flutter/src/widgets/framework.dart:5198:27)
#2      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5086:15)
#3      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#4      Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#5      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2780:19)
#6      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:903:21)
#7      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:358:5)
#8      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1284:15)
#9      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1214:9)
#10     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:939:7)
#14     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
(elided 3 frames from class _Timer and dart:async-patch)
====================================================================================================

Simulator
type 'Null' is not a subtype of type 'bool'

Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4 22F66 darwin-arm64, locale en-US)
    • Flutter version 3.10.6 on channel stable at /Users/sanchitbatra/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (10 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/sanchitbatra/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

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

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google
    Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2022.2)
    • 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 17.0.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (2 available)
    • iPhone 14 Pro Max (mobile) • B99E9B8C-45F5-4B81-94D5-FE403B6CDCC0 • ios          •
      com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64 • macOS 13.4 22F66 darwin-arm64

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

As indicated in the stack, this error is coming from that project's code, not Flutter. For help with your own code, consider trying one of the resources listed at https://flutter.dev/community#community-grid
Closing as this is not a Flutter bug.

authors: Sanchit-Batra stuartmorgan


text:
permission denied error when using camera ^0.11.0 with permission_handler latest plugin for storage permission in android 10.

Steps to reproduce
add camera ^0.11.0 and permission_handler ^11.3.1 plugin then use storage permission for android 10 device and try to create directory outside of app storage.
even though i grant permission it denies directory creation.
Expected results
after granting permission it should not throw error
Actual results
error: Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PathAccessException: Creation failed, path = '/storage/emulated/0/Images' (OS Error: Permission denied, errno = 13)
at _Directory.create..(dart:io)
Code sample
Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
error: Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PathAccessException: Creation failed, path = '/storage/emulated/0/Images' (OS Error: Permission denied, errno = 13)
at _Directory.create..(dart:io)
Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on macOS 13.6 22G120 darwin-x64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.74.3)
[✓] Connected device (3 available)
[✓] Network resources

Hi @dev3-tech
Based on the error above, it doesn't seem to relate to camera plugin. Does the issue occur without using camera plugin?
For us to further investigate this issue, please provide a completed and minimal reproducible code sample. And please provide the entire crash stack trace as well. Thanks!

it only occur when i use camera ^0.11.0 plugin but when i downgrade to ^0.10.6, it works.

Please also provide the remaining information that will help us identify the issue properly. Thanks!

add camera ^0.11.0 and permission_handler ^11.3.1 plugin
request storage permission for android 10 device and grant permission.
now try to create directory outside of app storage. like try to create directory at this path "/storage/emulated/0/Images"
even though i grant permission it denies directory creation.

Thanks for the update but that is steps only but not a sample code. Please provide a complete sample code as mentioned above so that we can pull/download it to reproduce the issue. It would be helpful if you can create a GitHub repository for the sample and please add license the code in the repository under some open-source license (e.g. MIT, Apache, BSD, GPL) so that we may look into it.

add camera ^0.11.0 and permission_handler ^11.3.1 plugin.
try it in android 10 real device.
case:1 test with camera ^0.11.0 package
case:2 test without camera ^0.11.0 package
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const TestPackHome(),
);
}
}
class TestPackHome extends StatefulWidget {
const TestPackHome({super.key});
@override
State createState() => _TestPackHomeState();
}
class _TestPackHomeState extends State {
bool _isPermissionGranted = false;
Future askStoragePermission() async {
var status = await Permission.storage.status;
if (status.isDenied) {
// Request the permission
if (await Permission.storage.request().isGranted) {
// Permission granted
setState(() {
_isPermissionGranted = true;
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Storage permission granted')),
);
} else {
// Permission denied
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Storage permission denied')),
);
}
} else if (status.isGranted) {
// Permission already granted
setState(() {
_isPermissionGranted = true;
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Storage permission already granted')),
);
}
}
Future createDirectory() async {
try {
const directory = '/storage/emulated/0/test_folder';
final newDir = Directory(directory);
// Create the directory if it doesn't exist
if (await newDir.exists()) {
print('Directory already exists');
} else {
await newDir.create(recursive: true);
print('Directory created successfully');
}
} catch (e) {
print('Error creating directory: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: askStoragePermission,
child: const Text("Ask Storage Permission for Android"),
),
if (_isPermissionGranted)
ElevatedButton(
onPressed: createDirectory,
child: const Text("Create Directory"),
),
],
),
),
);
}
}

Thanks for the update. I can reproduce this issue now on Android 10 (emulator).
Some additional tests:

The issue only occurs if adding camera: ^0.11.0 to the sample project
It's not reproduced with the previous version camera: 0.10.6
Perhaps this is related to camera: ^0.11.0's Breaking Change when the endorsed camera_android_camerax is using instead of camera_android. I also checked this issue by following cases:

Only add camera_android: ^0.10.9+3: issue is not reproduced ✅
Only add camera_android_camerax: ^0.6.5+2: issue is reproduced ❗

✅: No Issue ❗: Issue reproduced
I am labeling this for further insights from others. The complete sample project: repro_148926.zip

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.2)
    • 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
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.76

[✓] Network resources
    • All expected network resources are available.

• No issues found!

[!] Flutter (Channel master, 3.23.0-12.0.pre.5, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.23.0-12.0.pre.5 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 886de22182 (31 minutes ago), 2024-05-29 02:33:16 +0000
    • Engine revision d0323905fc
    • Dart version 3.5.0 (build 3.5.0-191.0.dev)
    • DevTools version 2.36.0-dev.10
    • 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 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.2)
    • 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
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.113

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Could we get a stack trace for this exception?

I see there is only one line of PathAccessException from the output log when running with verbose (flutter run -v):
...
[   +2 ms] Syncing files to device Android SDK built for x86... (completed in 136ms)
[   +1 ms] Synced 0.0MB.
[   +3 ms] <- accept
[   +5 ms] Connected to _flutterView/0xf1d73710.
[   +4 ms] Flutter run key commands.
[   +3 ms] r Hot reload. 🔥🔥🔥
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] A Dart VM Service on Android SDK built for x86 is available at: http://127.0.0.1:50964/VwOPMjffN6c=/
[+1126 ms] D/eglCodecCommon( 7112): setVertexArrayObject: set vao to 0 (0) 1 0
[  +36 ms] The Flutter DevTools debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:50964/VwOPMjffN6c=/
[  +78 ms] D/EGL_emulation( 7112): eglMakeCurrent: 0xdb7e5a80: ver 3 0 (tinfo 0xc7650260)
[   +8 ms] D/eglCodecCommon( 7112): setVertexArrayObject: set vao to 0 (0) 1 0
[+8503 ms] I/flutter ( 7112): Error creating directory: PathAccessException: Creation failed, path = '/storage/emulated/0/test_folder' (OS Error: Permission denied, errno = 13)

and also don't see other traces from adb logcat.

any update?

any update?

i am still getting this issue

@dev3-tech Do you also have a similar output to the one I shared at https://github.com/flutter/flutter/issues/148926#issuecomment-2138610617? (there is only one line of PathAccessException error)

yes

authors: dev3-tech huycozy stuartmorgan