text:
Color.withOpacity on Arabic letters does not fully cover the whole word

When using any color with an opacity on Arabic letters, the opacity does on apply on all of the letters.
here's an image that shows the same color for Arabic and english letters, notice the opacity working fine on english letters however some parts of the Arabic letters do not have the specified opacity.

Here's the code snippet of the image shown above
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Align(
        child: Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          color: Colors.black,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                "أحرف العربية",
                style: TextStyle(
                  fontSize: 60.0,
                  color: Colors.green.withOpacity(0.25),
                ),
              ),
              Text(
                "English letters",
                style: TextStyle(
                  fontSize: 60.0,
                  color: Colors.white.withOpacity(0.25),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

I was able to reproduce this on latest beta channel.

flutter doctor -v
[✓] Flutter (Channel beta, 1.21.0-9.2.pre, on Mac OS X 10.15.6 19G2021, locale en)
    • Flutter version 1.21.0-9.2.pre at /Users/pedromassango/dev/SDKs/flutter_beta
    • Framework revision 81a45ec2e5 (2 weeks ago), 2020-08-27 14:14:33 -0700
    • Engine revision 20a9531835
    • Dart version 2.10.0 (build 2.10.0-7.3.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/pedromassango/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • 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.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[✓] 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 not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 48.1.4
    • Dart plugin version 202.7206

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

[✓] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554                        • android-x86    • Android 11 (API 30) (emulator)
    • iPhone 11 Pro Max (mobile)  • 3DA251B5-C982-48C8-8FF5-C4D1DB21ED89 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
    • Web Server (web)            • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 85.0.4183.102

! Doctor found issues in 1 category.
Process finished with exit code 0

Issue is reproducible on the latest versions of flutter.

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Align(
        child: Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          color: Colors.black,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                "أحرف العربية",
                style: TextStyle(
                  fontSize: 60.0,
                  color: Colors.green.withOpacity(0.25),
                ),
              ),
              Text(
                "English letters",
                style: TextStyle(
                  fontSize: 60.0,
                  color: Colors.white.withOpacity(0.25),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on macOS 13.0 22A380 darwin-arm, locale en-GB)
    • Flutter version 3.3.8 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 52b3dc25f6 (6 days ago), 2022-11-09 12:09:26 +0800
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • 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: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] 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)

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview 2.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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)

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9014738/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.52.0

[✓] Connected device (3 available)
    • 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 22A380 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 107.0.5304.110

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

! Doctor found issues in 2 categories.

[!] Flutter (Channel master, 3.6.0-3.0.pre.20, on macOS 13.0 22A380 darwin-arm64, locale en-GB)
    • Flutter version 3.6.0-3.0.pre.20 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 9d64a0f40b (8 hours ago), 2022-11-15 00:07:08 -0500
    • Engine revision 31ee286845
    • Dart version 2.19.0 (build 2.19.0-398.0.dev)
    • DevTools version 2.19.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: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] 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)

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview 2.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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)

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9014738/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.52.0

[✓] Connected device (3 available)
    • 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 22A380 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 107.0.5304.110

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

! Doctor found issues in 3 categories.

Was about to report, any updates on this?
I tested it in macOS, web and android and all show the same problem

source: gharchive/issue

authors: AbedalazizKaterji danagbemava-nc moham96 pedromassangocode

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
Flutter framework RichText crash when Accessibility Service is enabled

I've found a RichText crash when Accessibility Service is enabled
Flutter version 1.17.5 stable
Steps to Reproduce

Create a demo project
Write code as follows:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'RichText Crash Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Center(
          child: RichText(
            text: TextSpan(children: [
              // remove [WidgetSpan] and crash not happen any more
              WidgetSpan(child: SizedBox.shrink()),
              TextSpan(
                text: "Text",
                style: TextStyle(color: Colors.black),
                // remove [recognizer] and crash not happen any more
                recognizer: TapGestureRecognizer()..onTap = () {},
              )
            ]),
          ),
        ),
      ),
    );
  }
}

Run the code above and enable ONE OF the Accessibility Services in your system
When WidgetSpan is removed OR recognizer in TextSpan is removed, the crash not happen
Full demo in github: https://github.com/singun-lxd/flutter_richtext_crash_demo

Expected results:
nothing crash
Actual results:
Dart code crashes, you can see crash stace traces below in 'Logs'
Temp Solution
To avoid crash, add these two lines AFTER WidgetsFlutterBinding.ensureInitialized() and BEFORE runApp
window.onSemanticsEnabledChanged = () {};
RendererBinding.instance.setSemanticsEnabled(false);

This code is used to disable Accessibility Service on Flutter

Logs
I/flutter (13840): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (13840): The following RangeError was thrown during a scheduler callback:
I/flutter (13840): RangeError (index): Invalid value: Valid value range is empty: 0
I/flutter (13840):
I/flutter (13840): When the exception was thrown, this was the stack:
I/flutter (13840): #0      List.[] (dart:core-patch/growable_array.dart:146:60)
I/flutter (13840): #1      List.elementAt (dart:core-patch/growable_array.dart:355:16)
I/flutter (13840): #2      RenderParagraph.assembleSemanticsNode (package:flutter/src/rendering/paragraph.dart:899:50)
I/flutter (13840): #3      _SwitchableSemanticsFragment.compileChildren (package:flutter/src/rendering/object.dart:3684:13)
I/flutter (13840): #4      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:146:23)
I/flutter (13840): #5      ExpandIterator.moveNext (dart:_internal/iterable.dart:478:31)
I/flutter (13840): #6      new List.from (dart:core-patch/array_patch.dart:47:19)
I/flutter (13840): #7      Iterable.toList (dart:core/iterable.dart:400:12)
I/flutter (13840): #8      _SwitchableSemanticsFragment.compileChildren (package:flutter/src/rendering/object.dart:3681:8)
I/flutter (13840): #9      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:146:23)
I/flutter (13840): #10     _SyncIterator.moveNext (dart:core-patch/core_patch.dart:139:32)
I/flutter (13840): #11     ExpandIterator.moveNext (dart:_internal/iterable.dart:478:31)
I/flutter (13840): #12     new List.from (dart:core-patch/array_patch.dart:47:19)
I/flutter (13840): #13     Iterable.toList (dart:core/iterable.dart:400:12)
I/flutter (13840): #14     _SwitchableSemanticsFragment.compileChildren (package:flutter/src/rendering/object.dart:3681:8)
I/flutter (13840): #15     _SyncIterator.moveNext (dart:core-patch/core_patch.dart:146:23)
I/flutter (13840): #16     ExpandIterator.moveNext (dart:_internal/iterable.dart:478:31)
I/flutter (13840): #17     new List.from (dart:core-patch/array_patch.dart:47:19)
I/flutter (13840): #18     Iterable.toList (dart:core/iterable.dart:400:12)
I/flutter (13840): #19     _RootSemanticsFragment.compileChildren (package:flutter/src/rendering/object.dart:3562:8)
I/flutter (13840): #20     _SyncIterator.moveNext (dart:core-patch/core_patch.dart:146:23)
I/flutter (13840): #21     Iterable.single (dart:core/iterable.dart:554:13)
I/flutter (13840): #22     RenderObject._updateSemantics (package:flutter/src/rendering/object.dart:2584:7)
I/flutter (13840): #23     PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1083:16)
I/flutter (13840): #24     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:407:21)
I/flutter (13840): #25     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:884:13)
I/flutter (13840): #26     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:284:5)
I/flutter (13840): #27     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15)
I/flutter (13840): #28     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1052:9)
I/flutter (13840): #29     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:861:7)
I/flutter (13840): (elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
I/flutter (13840): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (13840): Another exception was thrown: 'package:flutter/src/widgets/binding.dart': Failed assertion: line 863 pos 14: '!_firstFrameCompleter.isCompleted': is not true.

flutter doctor -v
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.6 19G2021, locale zh-Hans-CN)
    • Flutter version 1.17.5 at /Users/singun/Library/Flutter/sdk
    • Framework revision 8af6b2f038 (3 months ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/singun/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /Users/singun/Library/Android/sdk
    • 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.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.8.4

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

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

[✓] Connected device (1 available)
    • JSN L22 • NQX4C20408006356 • android-arm64 • Android 9 (API 28)

• No issues found!

Issue replicable on latest master. Seems to be happening when SizedBox.shrink() is added as a WidgetSpan along with recognizer property added to rest of the TextSpans.
Also happens with official RichText code sample from the docs when we add SizedBox.shrink() and tapRecognizer to the sample code.

code sample with reproducible crash
Text.rich(
              TextSpan(
                children: <InlineSpan>[
                  TextSpan(text: 'Flutter is', recognizer: TapGestureRecognizer()..onTap = () {},),
                  WidgetSpan(
                      child: SizedBox.shrink(
                      //  width: 120,
                      //  height: 50,
                        child: Card(
                            child: Center(
                                child: Text('Hello World!')
                            )
                        ),
                      )
                  ),
                  TextSpan(text: 'the best!', recognizer: TapGestureRecognizer()..onTap = () {},),
                ],
              )
          )

flutter doctor -v
Flutter 1.22.0-10.0.pre.174 • channel master • https://github.com/flutter/flutter.git
Framework • revision 37b03ec2c2 (4 hours ago) • 2020-09-14 23:52:04 -0400
Engine • revision 7e962ba911
Tools • Dart 2.10.0 (build 2.10.0-124.0.dev)

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-10.0.pre.174, on Mac OS X 10.15.4 19E2269, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.46.1)
[✓] Connected device (4 available)

• No issues found!

authors: darshankawar singun-lxd


text:
Crash during timeout of flutter_gallery__transition_perf_e2e_ios test

2020-10-16T13:58:36.948762: stdout: 2020-10-16 13:58:45.012892-0700 Flutter Gallery[29542:3887123] flutter: 05:00 +0 ~1: flutter gallery transitions on e2e all demos [E]
stdout: 2020-10-16 13:58:45.013086-0700 Flutter Gallery[29542:3887123] flutter:   TimeoutException after 0:05:00.000000: Test timed out after 5 minutes.
2020-10-16T13:58:36.956367: stdout: 2020-10-16 13:58:45.020449-0700 Flutter Gallery[29542:3887123] flutter:   package:test_api/src/backend/invoker.dart 318  Invoker._handleError.<fn>
2020-10-16T13:58:36.956532: stdout:   dart:async/zone.dart 1182                      _rootRun
2020-10-16T13:58:36.956858: stdout:   dart:async/zone.dart 1093                      _CustomZone.run
2020-10-16T13:58:36.957009: stdout:   package:test_api/src/backend/invoker.dart 316  Invoker._handleError
2020-10-16T13:58:36.957247: stdout:   package:test_api/src/backend/invoker.dart 272  Invoker.heartbeat.<fn>.<fn>
2020-10-16T13:58:36.957348: stdout:   dart:async/zone.dart 1190                      _rootRun
2020-10-16T13:58:36.957648: stdout:   dart:async/zone.dart 1093                      _CustomZone.run
2020-10-16T13:58:36.957752: stdout:   package:test_api/src/backend/invoker.dart 271  Invoker.heartbeat.<fn>
2020-10-16T13:58:36.957848: stdout:   dart:async-patch/timer_patch.dart 18           Timer._createTimer.<fn>
2020-10-16T13:58:36.958: stdout:   dart:isolate-patch/timer_impl.dart 397         _Timer._runTimers
2020-10-16T13:58:36.958201: stdout:   dart:isolate-patch/timer_impl.dart 428         _Timer._handleMessage
2020-10-16T13:58:36.958280: stdout:   dart:isolate-patch/isolate_patch.dart 168      _RawReceivePortImpl._handleMessage
2020-10-16T13:58:36.958606: stdout: 2020-10-16 13:58:45.024108-0700 Flutter Gallery[29542:3887123] flutter: 05:00 +0 ~1 -1: (tearDownAll)
2020-10-16T13:58:36.962429: stdout: 2020-10-16 13:58:45.027650-0700 Flutter Gallery[29542:3887123] flutter: Warning: E2E test plugin was not detected.
2020-10-16T13:58:36.963863: stdout: 2020-10-16 13:58:45.029311-0700 Flutter Gallery[29542:3887123] flutter: 05:00 +1 ~1 -1: Some tests failed.
2020-10-16T13:58:36.976799: stdout: All tests passed.
2020-10-16T13:58:36.978319: stderr: Unhandled exception:
stderr: NoSuchMethodError: The method '[]' was called on null.
stderr: Receiver: null
stderr: Tried calling: []("performance")
stderr: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
stderr: #1      main.<anonymous closure> (file:///Users/flutter/.cocoon/flutter/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart:11:11)
stderr: #2      e2eDriver (package:e2e/e2e_driver.dart:80:33)
stderr: <asynchronous suspension>
stderr: #3      main (file:///Users/flutter/.cocoon/flutter/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart:7:24)
stderr: #4      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
stderr: #5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
2020-10-16T13:58:37.007445: stdout: Stopping application instance.
2020-10-16T13:58:37.275155: stderr: Driver tests failed: 255
2020-10-16T13:58:37.289574: "/Users/flutter/.cocoon/flutter/bin/flutter" exit code: 255
2020-10-16T13:58:37.297302: Task failed: Executable "/Users/flutter/.cocoon/flutter/bin/flutter" failed with exit code 255.2020-10-16T13:58:37.297577:

Happened on https://github.com/flutter/flutter/commit/7b04435a16358ed0188a22b985114d695e27e03a

This is happening consistently on mac 10.15.7 and ios 14.3:
Link to all runs:
https://ci.chromium.org/p/flutter/builders/prod/Mac_staging flutter_gallery__transition_perf_e2e_ios
Log:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket.appspot.com/8856383716392834656/+/steps/run_flutter_gallery__transition_perf_e2e_ios/0/stdout
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:31.162394-0800 Flutter Gallery[6773:1782292] flutter: > Activity Indicator@Cupertino
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.513000-0800 Flutter Gallery[6773:1782292] flutter: (The following exception is now available via WidgetTester.takeException:)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.513168-0800 Flutter Gallery[6773:1782292] flutter: Bad state: No element
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.513854-0800 Flutter Gallery[6773:1782292] flutter: #0      Iterable.single (dart:core/iterable.dart:498)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.514201-0800 Flutter Gallery[6773:1782292] flutter: #1      WidgetController.element (package:flutter_test/src/controller.dart:111)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.514536-0800 Flutter Gallery[6773:1782292] flutter: #2      WidgetController.dragUntilVisible.<anonymous closure> (package:flutter_test/src/controller.dart:1037)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.514807-0800 Flutter Gallery[6773:1782292] flutter: <asynchronous suspension>
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.514964-0800 Flutter Gallery[6773:1782292] flutter: <asynchronous suspension>
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.515053-0800 Flutter Gallery[6773:1782292] flutter: (elided one frame from package:stack_trace)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.515405-0800 Flutter Gallery[6773:1782292] flutter: (If WidgetTester.takeException is called, the above exception will be ignored. If it is not, then the above exception will be dumped when another exception is caught by the framework or when the test ends, whichever happens first, and then the test will fail due to having not caught or expected the exception.)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.515723-0800 Flutter Gallery[6773:1782292] flutter: Bad state: No element
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.516562-0800 Flutter Gallery[6773:1782292] flutter: #0      Iterable.single (dart:core/iterable.dart:498)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.516737-0800 Flutter Gallery[6773:1782292] flutter: #1      WidgetController.element (package:flutter_test/src/controller.dart:111)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.516917-0800 Flutter Gallery[6773:1782292] flutter: #2      WidgetController.dragUntilVisible.<anonymous closure> (package:flutter_test/src/controller.dart:1037)
[flutter_gallery__transition_perf_e2e_ios] [STDOUT] stdout: 2021-02-02 10:50:36.517188-0800 Flutter Gallery[6773:1782292] flutter: <asynchronous suspension>

\cc @jmagman

@godofredoc those logs look different, they don't have NoSuchMethodError: The method '[]' was called on null.

Created a new bug to track the issue: https://github.com/flutter/flutter/issues/75647

authors: godofredoc jmagman jonahwilliams


text:
Getting this issue in the chrome console. But my app is working.

I am getting this issue in the chrome console. But my app is working.
Failed to load resource: the server responded with a status of 400 ()
Here is my flutter doctor -v
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Mac OS X 10.15.5 19F101 x86_64, locale en-GB)
    • Flutter version 1.23.0-18.1.pre at /Users/elamparithi/Developer/flutter
    • Framework revision 198df796aa (4 weeks ago), 2020-10-15 12:04:33 -0700
    • Engine revision 1d12d82d9c
    • Dart version 2.11.0 (build 2.11.0-213.1.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/elamparithi/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] 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 installed
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (4 available)
    • AOSP on IA Emulator (mobile) • emulator-5554                        • android-x86    • Android 9 (API 28) (emulator)
    • iPhone 11 Pro (mobile)       • 0A80C3FF-DBE6-4618-AA3D-B1557A8104B1 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
    • Web Server (web)             • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 86.0.4240.183

• No issues found!

What could be the problem

Hi @Elam126
Can't reproduce the issue on beta

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var title = 'Web Images';

    return MaterialApp(
      title: title,
      home: Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: Image.network('https://picsum.photos/250?image=9'),
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.0.1 20B29 darwin-x64,
    locale en-GB)
    • Flutter version 1.24.0-10.2.pre at /Users/tahatesser/Code/flutter_beta
    • Framework revision 022b333a08 (2 days ago), 2020-11-18 11:35:09 -0800
    • Engine revision 07c1eed46b
    • Dart version 2.12.0 (build 2.12.0-29.10.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • 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-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

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

[✓] Android Studio (version 4.1)
    • 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
      1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (3 available)
    • Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios            • iOS
      14.2
    • Web Server (web)     • web-server                • web-javascript •
      Flutter Tools
    • Chrome (web)         • chrome                    • web-javascript • Google
      Chrome 87.0.4280.67

• No issues found!

Can you please upgrade to the latest  beta and try again
flutter channel beta
flutter upgrade --force
flutter doctor -v
If the problem persists, Can you please provide your flutter doctor -v (with upgrade)  and a minimal complete reproducible code sample?
Thank you

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

authors: Elam126 TahaTesser pedromassangocode


text:
MainActivity is defined multiple times.

Steps to Reproduce
Run a functional app on any android device or emulator
Type project.com.project.MainActivity is defined multiple times
./project/build/app/intermediates/javac/debug/classes/project/com/project/MainActivity.class,
./project/build/app/tmp/kotlin-classes/debug/project/com/project/MainActivity.class
The same issue has been reported twice in last four weeks on stackoverflow :
https://stackoverflow.com/questions/65686011/flutter-build-appbundle-r8-type-com-bundle-id-mainactivity-is-defined-multiple
https://stackoverflow.com/questions/66164771/type-project-com-project-mainactivity-is-defined-multiple-times
The issue occurs only with android. I can run the app on iOS without any problem.
Environment :
Android Studio  4.2 Beta
Gradle Plugin       4.0.0
Gradle Version  6.7.1.
Flutter Version     1.22

Tried in Android Studio :

 Build -> Clean Project,
 Build -> Rebuild Project,
 File -> Invalidate Cache Restart

Tried in Command Line :
flutter clean
flutter run
rm -Rf ~/.gradle/caches

Expected results: The app should run as it is in the case of iOS
Actual results:
Relevant Error Logs
Execution failed for task ':app:dexBuilderDebug'.

There was a failure while executing work items
A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction
Failed to process:
~/AndroidStudioProjects/project/build/app/intermediates/javac/debug/classes, ~/AndroidStudioProjects/project/build/app/tmp/kotlin-classes/debug

Type project.com.project.MainActivity is defined multiple times
./project/build/app/intermediates/javac/debug/classes/project/com/project/MainActivity.class,
./project/build/app/tmp/kotlin-classes/debug/project/com/project/MainActivity.class

Logs
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H512 darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Android Studio
[✓] VS Code (version 1.34.0)
[✓] Connected device (2 available)
• No issues found!

Logs
  error • The parameter 'key' can't have a value of 'null' because of its type, and no non-null default value is provided • android/lib/main.dart:35:19 • missing_default_value_for_parameter
  error • The parameter 'title' can't have a value of 'null' because of its type, and no non-null default value is provided • android/lib/main.dart:35:29 • missing_default_value_for_parameter
   info • The value of the local variable 'saveCredentials' isn't used • lib/main.dart:111:10 • unused_local_variable
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/calendar.dart:1:8 • unused_import
   info • Unused import: 'package:agora/constants/api_path.dart' • lib/screens/calendar.dart:7:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: Calendar.routeFrom, Calendar.calendarUrl •
          lib/screens/calendar.dart:10:7 • must_be_immutable
   info • Unused import: 'package:flutter/rendering.dart' • lib/screens/components/cards.dart:2:8 • unused_import
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/components/content_list.dart:1:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: AgoraList.searchController, AgoraList.collectionName •
          lib/screens/components/content_list.dart:13:7 • must_be_immutable
   info • 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8. •
          lib/screens/components/custom_expansion_tile.dart:168:24 • deprecated_member_use
   info • 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8. •
          lib/screens/components/custom_expansion_tile.dart:199:33 • deprecated_member_use
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/components/drawer.dart:4:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: AppDrawer.routeFrom • lib/screens/components/drawer.dart:13:7 •
          must_be_immutable
warning • The parameter 'child' is required • lib/screens/components/drawer.dart:48:17 • missing_required_param
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/components/notifications.dart:3:8 • unused_import
   info • Unused import: 'package:firebase_messaging/firebase_messaging.dart' • lib/screens/components/notifications.dart:4:8 • unused_import
   info • Unused import: 'package:agora/constants/api_path.dart' • lib/screens/components/notifications.dart:6:8 • unused_import
   info • This function has a return type of 'Future<dynamic>', but doesn't end with a return statement • lib/screens/components/notifications.dart:33:26 • missing_return
   info • The value of the local variable 'data' isn't used • lib/screens/components/notifications.dart:36:21 • unused_local_variable
   info • The value of the local variable 'notification' isn't used • lib/screens/components/notifications.dart:41:21 • unused_local_variable
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/components/pdf_viewer.dart:5:8 • unused_import
warning • The parameter 'title' is required • lib/screens/components/pdf_viewer.dart:13:5 • missing_required_param
   info • A value for optional parameter 'key' isn't ever given • lib/screens/components/pdf_viewer.dart:31:24 • unused_element
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/dynamic_streaming.dart:1:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: DynamicStreaming.routeFrom, DynamicStreaming.calendarUrl •
          lib/screens/dynamic_streaming.dart:8:7 • must_be_immutable
   info • The value of the local variable 'data' isn't used • lib/screens/landing.dart:103:21 • unused_local_variable
   info • The value of the local variable 'notification' isn't used • lib/screens/landing.dart:108:21 • unused_local_variable
   info • 'title' is deprecated and shouldn't be used. Use "label" instead, as it allows for an improved text-scaling experience. This feature was deprecated after v1.19.0. • lib/screens/landing.dart:265:19 •
          deprecated_member_use
   info • 'title' is deprecated and shouldn't be used. Use "label" instead, as it allows for an improved text-scaling experience. This feature was deprecated after v1.19.0. • lib/screens/landing.dart:271:19 •
          deprecated_member_use
   info • 'title' is deprecated and shouldn't be used. Use "label" instead, as it allows for an improved text-scaling experience. This feature was deprecated after v1.19.0. • lib/screens/landing.dart:278:19 •
          deprecated_member_use
   info • 'title' is deprecated and shouldn't be used. Use "label" instead, as it allows for an improved text-scaling experience. This feature was deprecated after v1.19.0. • lib/screens/landing.dart:284:19 •
          deprecated_member_use
   info • Avoid empty statements • lib/screens/news.dart:86:5 • empty_statements
warning • The parameter 'title' is required • lib/screens/player/audio_player.dart:19:11 • missing_required_param
   info • A value for optional parameter 'key' isn't ever given • lib/screens/player/audio_player.dart:42:23 • unused_element
   info • The declaration '_playLocal' isn't referenced • lib/screens/player/audio_player.dart:114:10 • unused_element
   info • The declaration '_loadFile' isn't referenced • lib/screens/player/audio_player.dart:153:10 • unused_element
   info • Don't import implementation files from another package • lib/screens/player/auto_orientation.dart:3:8 • implementation_imports
   info • Don't import implementation files from another package • lib/screens/player/player.dart:3:8 • implementation_imports
warning • The parameter 'title' is required • lib/screens/player/player.dart:13:5 • missing_required_param
   info • A value for optional parameter 'key' isn't ever given • lib/screens/player/player.dart:31:26 • unused_element
   info • The value of the field '_platform' isn't used • lib/screens/player/player.dart:36:18 • unused_field
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: PodcastPage.routeFrom, PodcastPage.calendarUrl •
          lib/screens/podcasts.dart:9:7 • must_be_immutable
   info • Unused import: 'package:cloud_firestore/cloud_firestore.dart' • lib/screens/rows_and_header.dart:3:8 • unused_import
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/rows_and_header.dart:5:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: RowsAndHeaderPage.header, RowsAndHeaderPage.rows,
          RowsAndHeaderPage.mediaUri • lib/screens/rows_and_header.dart:14:7 • must_be_immutable
   info • Unused import: 'package:agora/services/helper.dart' • lib/screens/streaming.dart:1:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: LiveStreaming.routeFrom, LiveStreaming.streamingUri •
          lib/screens/streaming.dart:8:7 • must_be_immutable
   info • Unused import: 'package:agora/constants/api_path.dart' • lib/services/firestore.dart:1:8 • unused_import
   info • The value of the local variable 'index' isn't used • lib/services/firestore.dart:207:21 • unused_local_variable
   info • This function has a return type of 'MaterialPageRoute<dynamic>', but doesn't end with a return statement • lib/services/router.dart:11:19 • missing_return
   info • This function has a return type of 'MaterialPageRoute<dynamic>', but doesn't end with a return statement • lib/services/router.dart:25:19 • missing_return
   info • The value of the field '_schedule' isn't used • lib/services/schedule_notifications.dart:181:12 • unused_field
   info • Unused import: 'package:agora/constants/app_var.dart' • lib/services/web_api.dart:2:8 • unused_import
   info • Unused import: 'helper.dart' • lib/services/web_api.dart:5:8 • unused_import
   info • 'title' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline6. This feature was deprecated after v1.13.8. •
          lib/theme/style.dart:29:11 • deprecated_member_use
   info • 'headline' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline5. This feature was deprecated after v1.13.8. •
          lib/theme/style.dart:46:9 • deprecated_member_use
   info • 'title' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline6. This feature was deprecated after v1.13.8. •
          lib/theme/style.dart:47:9 • deprecated_member_use
   info • 'subtitle' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle2. This feature was deprecated after v1.13.8. •
          lib/theme/style.dart:48:9 • deprecated_member_use
   info • 'body1' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is bodyText2. This feature was deprecated after v1.13.8. •
          lib/theme/style.dart:49:9 • deprecated_member_use

flutter doctor -v
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H512 darwin-x64, locale en-CA)
    • Flutter version 1.22.6 at /opt/flutter
    • Framework revision 9b2d32b605 (3 weeks 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 30.0.3)
    • Android SDK at /Users/ronline/Library/Android/sdk/
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/ronline/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio 4.2 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

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

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 4.2 Preview.app/Contents
    • Flutter plugin installed
    • Dart plugin version 202.8346
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

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

[✓] Connected device (1 available)
    • SM P550 (mobile)              • 7bcd256c15ac161c                         • android-arm • Android 7.1.1 (API 25)

Hi, I am new to Flutter Open Source. But I have built apps using the framework. Will a newbie like me be able to work on this issue. If so can you direct me where to start ?

Hi @rclemsmith ,
The app is a proprietary product so I cannot allow you to clone the codebase for testing.  Issue occurs only in the android folder which is generated by flutter so I believe that the problem is in ..... Flutter .....
So far my investigation leads to https://developer.android.com/studio/build/dependencies#duplicate_classes   but the fix in the above link is for Java Devs who are creating Java Classes manually.
My question is what is the procedure to fix this issue for Flutter Devs who are dealing with Java code generated by Fluter app the error here is yelling about redundant MainActivity.class in Java and Kotlin folders

So I am crawling through generated android folder and now I see that the Generated MainActivity.java is complaining about the Generated  Kotlin Class MainActivity.kt:
Duplicate class found in the file '~/AndroidStudioProjects/project/android/app/src/main/kotlin/project/com/project/MainActivity.kt'

@ronlinet
Can you provide flutter doctor -v, a complete minimal reproducible code sample and flutter run --verbose in properly formatted text ?

@darshankawar  please find the graddle files as well as a minimal main.dart with all packages used in my project.
build.gradle( android )
buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.4'  // Google Services plugin
        classpath "com.netflix.nebula:gradle-lint-plugin:16.0.0" //don't update any higher version throws compileClasspath error
        classpath 'gradle.plugin.net.idlestate:gradle-duplicate-classes-check:1.0.2' //another duplicated class checks
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }

    apply plugin: "nebula.lint"
    //gradleLint.rules = ['duplicate-dependency-class', 'transitive-duplicate-dependency-class']
    gradleLint.rules = ['all-dependency']
    // add as many rules here as you'd like
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(  )
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '23'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.7.3'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'net.idlestate.gradle-duplicate-classes-check'

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "project.com.project"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
        testFunctionalTest true
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}"
    implementation "com.google.firebase:firebase-messaging:20.3.0";

    // Import the BoM for the Firebase platform
    implementation 'com.google.firebase:firebase-bom:26.1.0'

    // Declare the dependencies for the desired Firebase products without specifying versions
    // For example, declare the dependencies for Firebase Authentication and Cloud Firestore
    implementation 'com.google.firebase:firebase-auth:20.0.2'
    implementation 'com.google.firebase:firebase-firestore:22.1.0'

}

main.dart
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'dart:async';
import 'dart:io' show Platform;
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'dart:convert';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:custom_switch/custom_switch.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.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(
        // 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,
        // This makes the visual density adapt to the platform that you run
        // the app on. For desktop platforms, the controls will be smaller and
        // closer together (more dense) than on mobile platforms.
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  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
  _MyHomePageState 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>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

@ronlinet
Thanks for the code, but as I had mentioned in earlier comment, the minimal code sample should be without 3rd party. With all the imports in the sample, we'll need to import all those plugins in order for the sample to work. Also, only include plugins that are first party, as we don't need to have 3rd party plugins (firebase, local_notifications,custom_switch and so on) in your sample.

@darshankawar  if that's the case you can close the ticket as I am afraid that the issue is coming from the firebase plugins.

@ronlinet
Thanks for confirming. If you sure about it, please open this issue in firebase dedicated repo by providing all required details to avoid going back and forth. https://github.com/FirebaseExtended/flutterfire/issues
Closing from here based on your comment above.

authors: darshankawar rclemsmith ronlinet


text:
Execution failed for task ':app:compileFlutterBuildDebug'.

Launching lib\main.dart on Android SDK built for x86 in debug mode...
 lib\main.dart
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.2+1/lib/src/picture_provider.dart:57:59: Error: No named parameter with the name 'nullOk'.
        context != null ? Localizations.localeOf(context, nullOk: true) : null,
                                                          ^^^^^^
/D:/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
  static Locale localeOf(BuildContext context) {
                ^^^^^^^^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:1111:7: Info: Struct 'ENUMLOGFONTEX' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class ENUMLOGFONTEX extends Struct {
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2835:7: Info: Struct 'BLUETOOTH_PIN_INFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class BLUETOOTH_PIN_INFO extends Struct {

      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2960:7: Info: Struct 'EXCEPINFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.

class EXCEPINFO extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2966:7: Info: Struct 'PROPERTYKEY' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.

class PROPERTYKEY extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2973:7: Info: Struct 'PROPVARIANT' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class PROPVARIANT extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2978:7: Info: Struct 'SAFEARRAY' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class SAFEARRAY extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2985:7: Info: Struct 'CLSID' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class CLSID extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2992:7: Info: Struct 'STATSTG' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class STATSTG extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2999:7: Info: Struct 'NLM_SIMULATED_PROFILE_INFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class NLM_SIMULATED_PROFILE_INFO extends Struct {}
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:23:7: Info: Struct 'Utf8' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class Utf8 extends Struct {
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:16:7: Info: Struct 'Utf16' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class Utf16 extends Struct {
      ^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Info: Support for using non-constant type arguments 'T' in this FFI API is deprecated and will be removed in the next stable version of Dart. Rewrite the code to ensure that type arguments are compile time constants referring to a valid native type.
  final int totalSize = count * sizeOf<T>();
                                ^

FAILURE: Build failed with an exception.

* Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

(The Infos are harmless, and will go away when the dependencies (package:win32, package:ffi) are updated to their latest versions. See https://github.com/flutter/flutter/issues/75429 https://github.com/flutter/flutter/issues/75438 https://github.com/flutter/flutter/issues/75113.)

@hemanthkb97
From your log, there seem to be only 1 error.
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.2+1/lib/src/picture_provider.dart:57:59: Error: No named parameter with the name 'nullOk'.         context != null ? Localizations.localeOf(context, nullOk: true) : null,
which is coming from flutter_svg plugin. You'll need to follow-up in dedicated repo for it. I already see a similar open issue in that repo. Please follow-up there for updates.
Closing from here.

authors: darshankawar dcharkes hemanthkb97


text:
Textformfield, readonly is faulty

Hi Guys,
I stand in front of a problem and do not come on. That's why I hope for a help / support.
I have created a textFormfield here as Readonly. But you can still click in the field so that the cursor is displayed. If I move the cursor to the right or left with the arrow keys, this error message appears above.
page_address_view.dart:
          Expanded(
            flex: 5,
            child: TextFormFieldTemplate(
              key: this.textFieldGlobalKey,
              controller: this.txtAddressNameController,
              focusNode: this.txtAddressFocus,
              inputFormatters: [
                ModifiedLengthLimitingTextInputFormatter(
                    this.addressLength ?? 1),
              ],
              labelText: AppLocalizations.of(context).lblTextAddress,
              hintText: AppConfig.templateQrCode,
              maxCharsAllowed: [this.addressLength ?? 1],
              dontEdit: true,
              closeKeyboard: true,
              onChanged: () => this.onChangedValue(context),
              errorText: this.errorAddress,
            ),
          ),

textform_field_template.dart:
import "package:flutter/material.dart";
import "package:flutter/services.dart";

import "../../../core/enums/action_confirmed.dart";
import "../../../ui/shared/action_helper.dart";
import "../../../ui/utils/locale/app_localizations.dart";
import "../../../ui/utils/media_size.dart";

class TextFormFieldTemplate extends StatefulWidget {
  final TextEditingController controller;
  final FocusNode focusNode;
  final Function onChanged;
  final Function(String) onSubmitted;
  final Function() onEditingComplete;
  final List<dynamic> maxCharsAllowed;
  final bool autofocus;
  final String initialValue;
  final String labelText;
  final String hintText;
  final String errorText;
  final TextInputType inputType;
  final TextInputAction textInputAction;
  final bool obScureText;
  final bool closeKeyboard;
  final bool dontEdit;
  final List<TextInputFormatter> inputFormatters;
  final bool ifTextFieldIsEmptyValidateIsOk;

  const TextFormFieldTemplate({
    Key key,
    @required this.controller,
    @required this.focusNode,
    @required this.labelText,
    @required this.onChanged,
    this.onSubmitted,
    this.onEditingComplete,
    this.closeKeyboard = false,
    this.autofocus = false,
    this.initialValue = "",
    this.hintText = "",
    this.maxCharsAllowed = const [100],
    this.errorText = "",
    this.inputType = TextInputType.text,
    this.textInputAction,
    this.obScureText = false,
    this.dontEdit = false,
    this.inputFormatters = const [],
    this.ifTextFieldIsEmptyValidateIsOk,
  }) : super(key: key);

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

class _TextFormFieldTemplateState extends State<TextFormFieldTemplate> {
  bool closeKeyboard = false;

  @override
  void initState() {
    setState(() {
      this.closeKeyboard = this.widget.closeKeyboard;
    });

    this.widget.controller.addListener(this.widget.onChanged);
    super.initState();
  }

  void toggleShowKeyboard(bool value) {
    setState(() {
      this.closeKeyboard = !value;
    });

    if (!this.closeKeyboard) {
      SystemChannels.textInput.invokeMethod("TextInput.hide");
      FocusScope.of(context).unfocus();
      // FocusScope.of(context).requestFocus(this.widget.focusNode);
    } else {
      SystemChannels.textInput.invokeMethod("TextInput.show");
      FocusScope.of(context).unfocus();
      // FocusScope.of(context).requestFocus(this.widget.focusNode);
    }
  }

  @override
  Widget build(BuildContext context) {
    MediaSize().init(context);

    final Widget textField = TextFormField(
      controller: this.widget.controller,
      focusNode: this.widget.focusNode,
      maxLength: this.widget.maxCharsAllowed?.first,

      textInputAction: this.widget.textInputAction ?? TextInputAction.done,
      obscureText: this.widget.obScureText,
      readOnly: this.widget.dontEdit,
      onEditingComplete: this.widget.onEditingComplete,
      onFieldSubmitted: this.widget.onSubmitted,
      onTap: () {
        if (this.closeKeyboard && this.widget.dontEdit) {
          this.toggleShowKeyboard(this.closeKeyboard);
        }
      },
      showCursor: true,
      autocorrect: false,
      autofocus: this.widget.autofocus ?? true,
      keyboardType: this.widget.inputType, //TextInputType.text,
      inputFormatters: this.widget.inputFormatters,

      autovalidateMode: AutovalidateMode.onUserInteraction,
      validator: (String value) {
        if (value.isEmpty) {
          if (this.widget.ifTextFieldIsEmptyValidateIsOk ?? false) return null;
          return AppLocalizations.of(context).confirmAction(
            ActionHelper.getValue(ActionConfirmed.TEXTFIELD_EMPTY),
          );
        } else if (value.isNotEmpty &&
            (this.widget.errorText.isNotEmpty ||
                this.widget.errorText == null)) {
          return this.widget.errorText;
        }
        return null;
      },
      style: Theme.of(context).textTheme.subtitle2,
      decoration: InputDecoration(
        suffixIcon: Container(
          width: 1,
        ),
        counterStyle: Theme.of(context)
            .inputDecorationTheme
            .counterStyle
            .copyWith(
              color: (this.widget.focusNode?.hasFocus ?? false)
                  ? Theme.of(context).primaryColor
                  : Theme.of(context).inputDecorationTheme.counterStyle.color,
            ),
        counterText:
            "${this.widget.controller.text.length}/${this.widget.maxCharsAllowed?.join("-")}",
        labelStyle: Theme.of(context).inputDecorationTheme.labelStyle.copyWith(
              color: (this.widget.errorText.isNotEmpty ||
                      this.widget.errorText == null)
                  ? Theme.of(context).errorColor
                  : this.widget.focusNode.hasFocus
                      ? Theme.of(context).primaryColor
                      : Colors.grey,
            ),
        isDense: Theme.of(context).inputDecorationTheme.isDense,
        errorText:
            this.widget.errorText.isNotEmpty ? this.widget.errorText : null,

        labelText: this.widget.labelText,
        hintText: this.widget.hintText,
      ),
    );

    final Widget clearBtnIcon =
        this.widget.focusNode.hasFocus && this.widget.controller.text.isNotEmpty
            ? Align(
                alignment: Alignment.topRight,
                child: IconButton(
                  icon: Icon(
                    Icons.cancel,
                    color: Theme.of(context).primaryColor,
                  ),
                  onPressed: () {
                    this.widget.controller.clear();
                  },
                ),
              )
            : Container();

    return Stack(
      // overflow: Overflow.visible,
      // fit: StackFit.loose,
      // alignment: Alignment.topLeft,
      children: <Widget>[
        textField,
        clearBtnIcon,
      ],
    );
  }
}

flutter doctor -v
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.18363.1379], locale de-DE)
    • Flutter version 2.0.1 at C:\src\flutter
    • Framework revision c5a4b4029c (7 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Mr.Lion\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\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-b04)

[√] VS Code, 64-bit edition (version 1.54.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.20.0

[√] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 88.0.4324.190

• No issues found!

Hi @Mr-Lion
Can you please provide a minimal complete reproducible code sample? Please see here how to create a minimal complete reproducible code sample.
Thank you

Hi @pedromassangocode ,
To next I thank for the answer.
However, even more minimal than that does not work. The code is already kept as small as possible. It consists of a widget what you can integrate into every flutter

However, even more minimal than that does not work.

I would still want it, the code above seems just too complex to show the issue you described.
Are you facing this on Flutter web?
Thank you

However, even more minimal than that does not work.

I would still want it, the code above seems just too complex to show the issue you described.
Are you facing this on Flutter web?
Thank you

I think you're just lazy.
The code has been written in beginner level. If that occurs too complex, I doubt my help.
Copy the code and build around a new Flutter project and put the widget specified above in your build. This is not more.

Hi @Mr-Lion
I cannot reproduce this issue on Android emulator nor on Web using the code bellow on latest stable channel.

code sample
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Future<void> main() async {
  runApp(MaterialApp(
    theme: ThemeData.light(),
    home: MainView(),
  ));
}

class MainView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("MainView"),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.only(top: 32),
          child: TextFormFieldTemplate(
            controller: TextEditingController(text: "Flutter by Google"),
            focusNode: FocusNode(),
            maxCharsAllowed: [1],
            dontEdit: true,
            closeKeyboard: true,
            onChanged: () {},
          ),
        ),
      ),
    );
  }
}

class TextFormFieldTemplate extends StatefulWidget {
  final TextEditingController controller;
  final FocusNode focusNode;
  final Function onChanged;
  final Function(String) onSubmitted;
  final Function() onEditingComplete;
  final List<dynamic> maxCharsAllowed;
  final bool autofocus;
  final String initialValue;
  final String labelText;
  final String hintText;
  final String errorText;
  final TextInputType inputType;
  final TextInputAction textInputAction;
  final bool obScureText;
  final bool closeKeyboard;
  final bool dontEdit;
  final List<TextInputFormatter> inputFormatters;
  final bool ifTextFieldIsEmptyValidateIsOk;

  const TextFormFieldTemplate({
    Key key,
    @required this.controller,
    @required this.focusNode,
    @required this.labelText,
    @required this.onChanged,
    this.onSubmitted,
    this.onEditingComplete,
    this.closeKeyboard = false,
    this.autofocus = false,
    this.initialValue = "",
    this.hintText = "",
    this.maxCharsAllowed = const [100],
    this.errorText = "",
    this.inputType = TextInputType.text,
    this.textInputAction,
    this.obScureText = false,
    this.dontEdit = false,
    this.inputFormatters = const [],
    this.ifTextFieldIsEmptyValidateIsOk,
  }) : super(key: key);

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

class _TextFormFieldTemplateState extends State<TextFormFieldTemplate> {
  bool closeKeyboard = false;

  @override
  void initState() {
    setState(() {
      this.closeKeyboard = this.widget.closeKeyboard;
    });

    this.widget.controller.addListener(this.widget.onChanged);
    super.initState();
  }

  void toggleShowKeyboard(bool value) {
    setState(() {
      this.closeKeyboard = !value;
    });

    if (!this.closeKeyboard) {
      SystemChannels.textInput.invokeMethod("TextInput.hide");
      FocusScope.of(context).unfocus();
      // FocusScope.of(context).requestFocus(this.widget.focusNode);
    } else {
      SystemChannels.textInput.invokeMethod("TextInput.show");
      FocusScope.of(context).unfocus();
      // FocusScope.of(context).requestFocus(this.widget.focusNode);
    }
  }

  @override
  Widget build(BuildContext context) {
    final Widget textField = TextFormField(
      controller: this.widget.controller,
      focusNode: this.widget.focusNode,
      maxLength: this.widget.maxCharsAllowed?.first,

      textInputAction: this.widget.textInputAction ?? TextInputAction.done,
      obscureText: this.widget.obScureText,
      readOnly: this.widget.dontEdit,
      onEditingComplete: this.widget.onEditingComplete,
      onFieldSubmitted: this.widget.onSubmitted,
      onTap: () {
        if (this.closeKeyboard && this.widget.dontEdit) {
          this.toggleShowKeyboard(this.closeKeyboard);
        }
      },
      showCursor: true,
      autocorrect: false,
      autofocus: this.widget.autofocus ?? true,
      keyboardType: this.widget.inputType, //TextInputType.text,
      inputFormatters: this.widget.inputFormatters,

      autovalidateMode: AutovalidateMode.onUserInteraction,
      validator: (String value) {
        if (value.isEmpty) {
          if (this.widget.ifTextFieldIsEmptyValidateIsOk ?? false) return null;
          return 'TEXTFIELD_EMPTY';
        } else if (value.isNotEmpty &&
            (this.widget.errorText.isNotEmpty ||
                this.widget.errorText == null)) {
          return this.widget.errorText;
        }
        return null;
      },
      style: Theme.of(context).textTheme.subtitle2,
      decoration: InputDecoration(
        suffixIcon: Container(
          width: 1,
        ),
        counterText:
        "${this.widget.controller.text.length}/${this.widget.maxCharsAllowed?.join("-")}",
        isDense: Theme.of(context).inputDecorationTheme.isDense,
        errorText:
        this.widget.errorText.isNotEmpty ? this.widget.errorText : null,

        labelText: this.widget.labelText,
        hintText: this.widget.hintText,
      ),
    );

    final Widget clearBtnIcon =
    this.widget.focusNode.hasFocus && this.widget.controller.text.isNotEmpty
        ? Align(
      alignment: Alignment.topRight,
      child: IconButton(
        icon: Icon(
          Icons.cancel,
          color: Theme.of(context).primaryColor,
        ),
        onPressed: () {
          this.widget.controller.clear();
        },
      ),
    )
        : Container();

    return Stack(
      // overflow: Overflow.visible,
      // fit: StackFit.loose,
      // alignment: Alignment.topLeft,
      children: <Widget>[
        textField,
        clearBtnIcon,
      ],
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.2 20D80 darwin-x64, locale en-AO)
    • Flutter version 2.0.2 at /Users/pedromassango/Code/flutter_stable
    • Framework revision 8962f6dc68 (4 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/pedromassango/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/pedromassango/Library/Android/sdk
    • 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-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

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

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 54.0.3
    • Dart plugin version 203.7759

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.2 20D80 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.82

! Doctor found issues in 1 category.

Hi @pedromassangocode
I thank you for your effort and help. It is actually strange. After deleting the Flutter app in the emulator and completely compiled it completely, the above error / problem is no longer visible. Somehow apparently there has been a little hook.

Hi @Mr-Lion
Given your last message I feel safe to close this issue, if you disagree please write in the comments and I will reopen it.
Thank you

authors: Mr-Lion pedromassangocode


text:
Error after using ListView in Column

The ListView Widget throws an error while being used in a column. The only way to fix it is to use Expanded and Flexible widgets. It would be great to use it as a standard widget.

[...] The only way to fix it is to use Expanded and Flexible widgets.

@shreyassai123
this statement is false, for example you you can use a SizedBox or a Containerwith a given height
(see example below)

[...] It would be great to use it as a standard widget.

imho it would be bad to "bake in" the expanded behavior,  try to removing the comments in the code below
import 'package:flutter/material.dart';

void main() => runApp(
      MaterialApp(
        home: Material(
          child: Column(
            children: [
              SizedBox(
                height: 120,
                child:
                //  Expanded(child:
                ListView.builder(
                    itemBuilder: (contet, index) => const FlutterLogo(),
                  ),
               // ),
              ),
              const SizedBox(height: 120),
              SizedBox(
                height: 120,
                child: ListView.builder(
                  itemBuilder: (contet, index) => const FlutterLogo(),
                ),
              ),
            ],
          ),
        ),
      ),
    );

@shreyassai123
What kind fo error is thrown if you use ListView inside Column ?
Also check this similar open issue and underlying comments for further reference, https://github.com/flutter/flutter/issues/18341

Hi @shreyassai123 ,
Wrap the Listview inside the Expanded widget.

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

authors: Packiaseelan darshankawar iapicca pedromassangocode shreyassai123


text:
image_picker 0.7.4 - should it save to a temporary location?

Hi all, should image_picker 0.7.4 getImage() save to a temp location or the appdir?
It appears to using my appdir, which is filling up quick. Anyway for it to save to a temp location and let me manually copy to my appdir if I want to keep the image?

Hi @Lee-Fixter
This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this, you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
See https://github.com/flutter/flutter/issues/70335 which is a related issue.
Closing, as this isn't an issue with Flutter itself.
Thank you

authors: Lee-Fixter pedromassangocode


text:
flutter stable failing to serialize cocoon dependencies

json_serializable is causing an infinite loop:
[SEVERE] json_serializable:json_serializable on bin/yaml_converter.dart:

Bad state: Unexpected diagnostics:
/Users/godofredoc/flutter_checkouts/flutter/bin/cache/dart-sdk/lib/core/int.dart:122:18 - Operator declarations must be preceded by the keyword 'operator'.
/Users/godofredoc/flutter_checkouts/flutter/bin/cache/dart-sdk/lib/core/int.dart:122:16 - Methods must have an explicit list of parameters.
/Users/godofredoc/flutter_checkouts/flutter/bin/cache/dart-sdk/lib/core/int.dart:122:18 - A function body must be provided.
package:analyzer/dart/sdk/build_sdk_summary.dart 212:7   _Builder._parse
package:analyzer/dart/sdk/build_sdk_summary.dart 147:36  _Builder._addLibrary
package:analyzer/dart/sdk/build_sdk_summary.dart 143:9   _Builder._addLibrary
package:analyzer/dart/sdk/build_sdk_summary.dart 143:9   _Builder._addLibrary
package:analyzer/dart/sdk/build_sdk_summary.dart 143:9   _Builder._addLibrary
dart:core                                                List.forEach
package:analyzer/dart/sdk/build_sdk_summary.dart 101:20  _Builder.build
package:analyzer/dart/sdk/build_sdk_summary.dart 75:5    buildSdkSummary
package:build_resolvers/src/resolver.dart 389:36         _defaultSdkSummaryGenerator
package:build_resolvers/src/resolver.dart 327:11         AnalyzerResolvers._ensureInitialized.<fn>
package:build_resolvers/src/resolver.dart 334:5          AnalyzerResolvers.get
package:build                                            _DelayedResolver.isLibrary
package:source_gen/src/builder.dart 75:10                _Builder.build

\cc @christopherfujino @CaseyHillers

Seeing this as well. Promoting to P1 as this is blocking cocoon tree.

I have a PR WIP at https://github.com/flutter/cocoon/pull/1246 - I'm finishing the request handlers today (25 tests left to fix), and I expect to have it reviewed and a prod test today.

Blocked on the cocoon nullsafety migration.

This is blocking https://github.com/flutter/cocoon/pull/1350 from landing and resolving https://github.com/flutter/flutter/issues/90151

Casey has a PR ready and he has been fixing small issues before landing it. If everything goes well we will be landing the fix early next week.
@Piinks is this blocking something that we need to land asap?
@keyonghan will it be possible to land flutter/cocoon#1350 with the failing tests?

Casey has a PR ready and he has been fixing small issues before landing it. If everything goes well we will be landing the fix early next week.
@Piinks is this blocking something that we need to land asap?
@keyonghan will it be possible to land flutter/cocoon#1350 with the failing tests?

per internal chat, @Piinks said she would be ok waiting until Monday for Casey's PR to land.

@keyonghan will it be possible to land flutter/cocoon#1350 with the failing tests?

flutter/cocoon#1350 seems safe to land with failing tests, but I would prefer to wait until the null safety lands.

Any updates on when flutter/cocoon#1350 can land? The golden file testing infra is broken while that change is blocked.

(that bug is blocked on the cocoon null safety migration which is underway)

Any updates on when flutter/cocoon#1350 can land? The golden file testing infra is broken while that change is blocked.

We're aiming to land the migration this week as we're in the middle of doing prod validation tests of it
Some of the difficulty is NNBD surfaced some issues that are in prod that we're now catching versus silently failing

authors: CaseyHillers Hixie Piinks christopherfujino godofredoc keyonghan


text:
The vertical and horizontal scroll drag and drop with the mouse, does not work in "DESKTOP" in any widget as with the new version flutter 2.5.0

The vertical and horizontal scroll drag and drop with the mause, does not work in "DEKTOP" in any widget as with the new version flutter 2.5.0:

Flutter doctor
[✓] Flutter (Channel stable, 2.5.0, on Ubuntu 20.04.3 LTS 5.4.0-80-generic, locale es_BO.UTF-8)
    • Flutter version 2.5.0 at /home/marcelo/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cc385b4b8 (2 days ago), 2021-09-07 23:01:49 -0700
    • Engine revision f0826da7ef
    • Dart version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/marcelo/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /snap/android-studio/current/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.20.0
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2020.3)
    • Android Studio at /snap/android-studio/114/android-studio
    • Flutter plugin version 59.0.2
    • Dart plugin version 203.8292
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Android Studio (version 4.2)
    • Android Studio at /snap/android-studio/113/android-studio
    • Flutter plugin version 55.1.1
    • Dart plugin version 202.8488
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)

[✓] Android Studio
    • Android Studio at /snap/android-studio/current/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
    • android-studio-dir = /snap/android-studio/current/android-studio/
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.26.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.4.0-80-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 93.0.4577.63

I have an application with many vertical and horizontal scrolls SingleChildScroll, ListView, etc. Neither works since I upgraded to flutter version 2.5.0.
I can only do vertical scrolling with the mouse wheel, horizontal scrolling is not possible
code example where it fails:
  @override
  Widget build(BuildContext context) {
    return Container(
        child: Scaffold(
      appBar: AppBar(
        title: Text('Test scroll'),
      ),
      body: ListView.builder(itemBuilder: (context, index) {
        return ListTile(title: Text("Item ${index + 1}"));
      }),
    ));
  }

The scrolling part is expected. Please see: https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

Hi @jpolstre as @TheJulianJES pointed out above, there is a breaking change in the behaviour of Scrollables in stable 2.5.0. Please follow the migration guide in this link
Closing as solved.
If the migration guide doesn't fix your issue, kindly leave a comment with a minimal complete reproducible code sample](https://stackoverflow.com/help/minimal-reproducible-example) and I will reopen.
Thank you

authors: TheJulianJES danagbemava-nc jpolstre


text:
Collect benchmark device tags in a scalable way considering more platforms

https://flutter-review.googlesource.com/c/recipes/+/19380 collects devicelab benchmark tags by filtering the builder names. We will support benchmarks on desktop soon, and may have other platforms as well in the future.
A more scalable way to collect device tags is needed.
A possible solution is to have a new property denoting the device info.

Closing because the bug has not been updated for more than one year.
Feel free to reopen any bugs that you believe are important but please provide updates on how to resource the fix of the bug and what can be done to prevent the issue from not getting updates for another year.

authors: godofredoc keyonghan