text:
Sliders can be changed accidentally by swiping up/down to scroll the page

Steps to Reproduce

Add a slider on a page that scrolls vertically (e.g. a ListView)
Swipe up or down to scroll the page.

If you accidentally touch a slider while swiping, it changes the value of the slider. Even if you only touch the track, not the knob.
For comparison:

Flutter's buttons ignore presses that occur while the page is being swiped.
The HTML 'range' input ignores vertical drags on the track, but it does register vertical drags directly on the knob (this seems a reasonable compromise).

The current behavior can result in unintended changes to a slider's value. If a page has many sliders, you have to be careful not to touch any of them while swiping up or down.
I think a slider should reject presses/drags if there is significant vertical motion.

Thanks for the report @oTree-org
Can you provide your flutter doctor -v and platform on which you are seeing this behavior ?

Add a slider on a page that scrolls vertically (e.g. a ListView)
Swipe up or down to scroll the page.

I tried to come up with minimal code sample for this and ran on iOS simulator but not sure if it correctly represents the use case you are reporting, so please provide any missing details or repro steps to properly address this issue.

 runnable code sample

import 'package:flutter/material.dart';

void main() => runApp(const SliderApp());

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

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

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

  @override
  State<SliderExample> createState() => _SliderExampleState();
}

class _SliderExampleState extends State<SliderExample> {
  double _currentSliderValue = 20;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text('Slider')),
        body: ListView(
          children: [
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[600],
              child: const Center(child: Text('Entry A')),
            ),
            Container(
              height: 50,
              color: Colors.amber[500],
              child: const Center(child: Text('Entry B')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Container(
              height: 50,
              color: Colors.amber[100],
              child: const Center(child: Text('Entry C')),
            ),
            Slider(
              value: _currentSliderValue,
              max: 100,
              divisions: 5,
              label: _currentSliderValue.round().toString(),
              onChanged: (double value) {
                setState(() {
                  _currentSliderValue = value;
                });
              },
            ),
          ],
        )
    );
  }
}

Channel unknown, 2.1.0-12.2.pre

@oTree-org You are on very old version of the framework. Please upgrade to latest and try again your scenario to see if it still persists or not.

@oTree-org could you please provide a minimal code sample to reproduce this issue? I tried running @darshankawar's code, but I'm not sure if it accurately reflects what you've described.

@oTree-org
Is this correct interpretation of the issue you are reporting ?
https://user-images.githubusercontent.com/67046386/219560424-acf22419-8cf4-41d3-b5c3-b4805f1aae47.mov

This doesn't seem to be specific to ipad, as I tried on iOS simulator and it behaves in same way.
https://user-images.githubusercontent.com/67046386/219645664-0903c8b9-bffc-4b69-9413-9d06b020ba82.mov
Although in order to properly replicate the reported behavior, we need to deliberately keep focus on Slider and then swipe / scroll up or down to see the value getting changed.
I am not too sure if this is a bug or intended behavior though.

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

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

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

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

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

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

! Doctor found issues in 1 category.

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

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

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

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

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

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

! Doctor found issues in 1 category.

authors: Sarraj-Sahar darshankawar oTree-org


text:
Update dual scrollbar constructor to support corner space

https://github.com/flutter/flutter/issues/122348

will need to be completed first

Part of the 2D scrolling proposal: flutter.dev/go/2D-Foundation
https://github.com/flutter/flutter/pull/122349 adds a factory constructor that creates two scrollbars for scrolling in two dimensions. This change is proposed as a lead up to TwoDimensionalScrollable etc.
The dual factory constructor works almost perfectly when plugged into TwoDimensionalScrollable, except for the small overlap in the joining corner.

While investigating this, I found multiple native behaviors. Most common:

Image
Description

The scrollbars operate on a first-come-first-serve rule for the corner space. Here the horizontal bar got there first, the vertical is not allowed to overlap. Observed on MacOS as default behavior.

Empty space. No scrollbar enters the corner space.

Both of these should be supported.
I have investigated this a fair bit, and I think the best way for this to work (instead of creating two instances of the scrollbar widget)  is to have the .dual constructor instead create two instances of ScrollPainter internal to the single scrollbar widget.
This is because in order to properly avoid overlapping each other, the painters need to know about the state of each other since the scrollbar size and visibility can change based on hovering, dragging, whether or not scrolling is happening, etc.

I was looking into this as part of a school project (I have no experience contributing to open source) and I was wondering if this issue needs to be updated. I noticed that the dual factory method for the Cupertino Scrollbar was never merged into main so was not sure how to proceed since I can't add to that. Just curious.

Hey @Piinks, do you have a sample app for this problem? I by myself was not even able to get the two scrollbars 😓
My code example
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: TwoDimensionalScrollable(
horizontalDetails: const ScrollableDetails.horizontal(),
verticalDetails: const ScrollableDetails.vertical(),
viewportBuilder: (context, verticalPosition, horizontalPosition) {
return DataTable(columns: const [
DataColumn(label: Text('col label 1')),
DataColumn(label: Text('col label 2')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
], rows: const [
DataRow(cells: [
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
DataRow(cells: [
DataCell(Text('#101')),
DataCell(Text('Dart Internals')),
DataCell(Text('Alex Wick')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
DataRow(cells: [
DataCell(Text('#101')),
DataCell(Text('Dart Internals')),
DataCell(Text('Alex Wick')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
]);
},
),
),
);
}
}
</details>

Hello I am Ajay, I am new to open-source contribution, But I am very interested in resolving issues Can you please explain to me briefly How to resolve good first issues

source: gharchive/issue

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
Support overridding aot_library_path on Linux

Following the work of #117103 we have a case where overriding aot_library_path in FlDartProject is also required:
https://git.openprivacy.ca/cwtch.im/cwtch-ui/src/branch/trunk/linux/my_application.cc#L99
The situation being that we use a launcher shell script to set up the environment a little, and ship the flutter binary in /usr/lib/appname beside libapp.so, requiring managing aot_library_path directly.
Also it just seems odd that it's missing a setter while the rest of FlDartProject's fields have one

this came up because in order to do it right now we have to duplicate FlDartProject in our code as it's not defined in a header cus it is I assume meant to be private, and between 3.7 and 3.10 it lost a member so we started seg faulting :laughing:. So I went looking at changelogs and found 117103 which got most of the way there and seemed promising, thus prompting me to create the above PR so we could drop the struct dup once and for all in our code :+1:
https://git.openprivacy.ca/cwtch.im/cwtch-ui/src/branch/trunk/linux/my_application.cc#L29


text:
Document how to translate our material widgets

Flutter's package:flutter_localizations provides translations for Flutter's material widgets. However, it will not support all of the world's languages out of the box. Instead, we provide API for developers to add missing translations.
On https://flutter.io/tutorials/internationalization/ we should add a section that explains how to do that.
This came up in the discussion over in https://github.com/flutter/flutter/issues/13482.
/cc @LarkAscending @Sfshaza @HansMuller

https://github.com/flutter/flutter/pull/12645 was intended to simplify adding translations for Material.
We could just migrate its example to the tutorial.

Hi there, just a heads-up: Flutter apps can be translated on Crowdin -- Crowdin supports localization of .arb files, has API/CLI, Github integration, and is free for open source projects.

That's good to know. Thanks for the tip!

Is this covered by https://flutter.io/docs/development/accessibility-and-localization/internationalization ?
Can this be closed and if anything is left out more concrete issues be files instead?
The recently merged PR #23850 might be relevant.

Ok with closing until we get specific requests.

authors: HansMuller lyudmylab yjbanov zoechi


text:
Failed assertion

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md
The relevant error-causing widget was:
  GetMaterialApp GetMaterialApp:file:///C:/Users/Admin/AndroidStudioProjects/documenttemplate/lib/main.dart:29:70
When the exception was thrown, this was the stack:
#2      new StatefulElement (package:flutter/src/widgets/framework.dart:5185:12)
#3      StatefulWidget.createElement (package:flutter/src/widgets/framework.dart:776:38)
...     Normal element mounting (287 frames)
#290    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3971:16)
#291    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6570:36)
#292    Element.updateChild (package:flutter/src/widgets/framework.dart:3708:18)
#293    RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:6153:32)
#294    MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6595:17)
#295    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#296    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#297    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#298    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#299    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
#300    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#301    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#302    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#303    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
#304    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#305    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#306    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#307    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
#308    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
#309    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#310    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#311    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#312    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#313    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
#314    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#315    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#316    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#317    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
#318    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
#319    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#320    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#321    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#322    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#323    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
#324    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#325    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#326    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#327    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#328    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
#329    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#330    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
#331    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#332    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
#333    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#334    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#335    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#336    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
#337    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#338    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
#339    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#340    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#341    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2780:19)
#342    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:903:21)
#343    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:358:5)
#344    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1284:15)
#345    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1214:9)
#346    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1072:5)
#347    _invoke (dart:ui/hooks.dart:142:13)
#348    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:359:5)
#349    _drawFrame (dart:ui/hooks.dart:112:31)
(elided 2 frames from class _AssertionError)

@vicichaudhary
Although the log says to file this as an issue, but we also need a complete runnable but reproducible code sample that shows the error, so please provide one in order to make the issue actionable along with flutter doctor -v.

authors: darshankawar vicichaudhary


text:
Inner Scaffold's background color is displayed above the keyboard with height of outer Scaffold's BottomNavigationBar

Is there an existing issue for this?

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

Steps to reproduce

Run sample code
Click on textfield.

Expected results
Scaffold's background is not displayed above keyboard.

Screenshot

Actual results
Scaffold's background color is displayed above the keyboard with height of parent scaffold navbar.

Screenshot

Code sample
Code 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 MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyPage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        resizeToAvoidBottomInset: false,
        bottomNavigationBar: const SizedBox(height: 40),
        body: Scaffold(
          backgroundColor: Colors.red,
          resizeToAvoidBottomInset: true,
          body: ColoredBox(
              color: Colors.blue,
              child: Center(
                child: TextField(),
              )),
        ));
  }
}

Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
[!] Flutter (Channel stable, 3.16.1, on Microsoft Windows [Version 10.0.19045.3693], locale pl-PL)
    • Flutter version 3.16.1 on channel stable at C:\Users\kkras\fvm\versions\3.16.1
    ! Warning: `flutter` on your path resolves to C:\Users\kkras\flutter\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\kkras\fvm\versions\3.16.1. Consider adding C:\Users\kkras\fvm\versions\3.16.1\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\kkras\flutter\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\kkras\fvm\versions\3.16.1. Consider adding C:\Users\kkras\fvm\versions\3.16.1\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7f20e5d18c (2 days ago), 2023-11-27 09:47:30 -0800
    • Engine revision 22b600f240
    • Dart version 3.2.1
    • DevTools version 2.28.3
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\kkras\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 33.0.1
    • ANDROID_HOME = C:\Users\kkras\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✗] Visual Studio - develop Windows apps
    ✗ Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[✓] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[✓] VS Code (version 1.84.2)
    • VS Code at C:\Users\kkras\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.76.0

[✓] Connected device (3 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 8.0.0 (API 26) (emulator)
    • Windows (desktop)                     • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.3693]
    • Edge (web)                            • edge          • web-javascript • Microsoft Edge 119.0.2151.72

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

! Doctor found issues in 3 categories.

I see you are using 2 nested Scaffolds, is there any reason or use case for this?

The first scaffold is used globally, to make navbar persistent between pages. The second scaffold is separate for every page and contains the app bar for this specific page.

Hi @xVemu
This seems to be working as expected.
The inner Scaffold is resized when opening keyboard since you've set resizeToAvoidBottomInset to true. As expected the inner scaffold resize and reveals its background.  You should also  resizeToAvoidBottomInset to false in the inner Scaffold, the TextField is part of the inner Scaffold which invokes the keyboard and resizes the Scaffold.

So in this scenario, it's impossible to achieve resizing when keyboard appears and without setting resizeToAvoidBottomInset: true in outer scaffold, right?

Either resize both Scaffold or none. Currently you're resizing inner Scaffold and it has a red background color so that's what you see when opening keyboard from the text field inside the Scaffold.

I found a temporary solution.
First, install the flutter_keyboard_visibility package.
As shown below, we were able to hide the bottomNavigationBar while the keyboard is displayed, so that the margins are not displayed.
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';

~~~~~~~~~~~

@override
  Widget build(BuildContext context) {
    return Scaffold(
        resizeToAvoidBottomInset: false,
        bottomNavigationBar:
            KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) {
          return Visibility(
            visible: !isKeyboardVisible,
            maintainState: true,
            child: const SizedBox(height: 40),
          );
        }),
        body: Scaffold(
          backgroundColor: Colors.red,
          resizeToAvoidBottomInset: true,
          body: ColoredBox(
              color: Colors.blue,
              child: Center(
                child: TextField(),
              )),
        ));
  }

authors: TahaTesser axsann xVemu


text:
Crash when filling a TextFormField | Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) | Cause: null pointer dereference

Steps to reproduce
The app has a TextFormField that's being constantly filled, everything was working perfectly.  After upgrading Flutter and probably some Plugins upgrades, the app began to randomly crash when filling the TextFormFIeld.
The problem happens only on Android on profile and release mode, when debugging i couldn't reproduce the issue.
TextFormFIeld Widget
Form(
  key: formKey,
  child: RawKeyboardListener(
    focusNode: FocusNode(),
    onKey: (RawKeyEvent event) {
      if (coletaEmAndamento || !tagFieldFocusNode.hasFocus || coletaAbastecimento) return;
    },
    child: TextFormField(
      autofocus: true,
      autocorrect: false,
      enableSuggestions: false,
      readOnly: coletaEmAndamento,
      textInputAction: TextInputAction.none,
      maxLength: 24,
      controller: tagFieldController,
      focusNode: tagFieldFocusNode,
      style: TextStyle(fontWeight: FontWeight.bold, fontSize: telaTablet ? 20.f : 9.f),
      decoration: InputDecoration(counterText: '', contentPadding: EdgeInsets.only(top: 1.5.h)),
      onTap: () => tagFieldController.clear(),
      onFieldSubmitted: (v) =>
          ((v == '#2' ? false : v.length < 24) && !coletaEmAndamento && !coletaAbastecimento) ? tagFieldController.clear() : null,
      onChanged: (value) => textFieldOnChangedFunction(value),
    ),
  ),
),

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

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

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

environment:
  sdk: '>=2.18.6 <3.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  ota_update: ^6.0.0
  just_audio: ^0.9.32
  wakelock: ^0.6.2
  mask_text_input_formatter: ^2.3.0
  flutter_keyboard_visibility: ^5.4.1
  file_picker: ^5.2.5
  open_file: ^3.3.1
  csv: ^5.0.2
  pluto_grid: ^7.0.2
  flutter_bluetooth_serial:
    git:
      url: https://github.com/pst9354/flutter_bluetooth_serial
      ref: master
  http: ^1.1.0
  shared_preferences: ^2.0.5
  intl: ^0.18.0
  path_provider: ^2.0.9
  dio: ^5.0.2
  sizer_pro: ^3.0.0-alpha
  #^2.2.0
  flutter:
    sdk: flutter

dependency_overrides:
  ffi: ^2.0.1

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

dev_dependencies:
  flutter_test:
    sdk: flutter

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

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

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

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

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

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

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

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

Console LOG
[+3006 ms] F/libc    (26751): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 26777 (1.ui), pid 26751 (mple.logti_rfid)
[ +124 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[        ] Build fingerprint: 'xiaomi/daisy/daisy_sprout:10/QKQ1.191002.002/V11.0.21.0.QDLMIXM:user/release-keys'
[        ] Revision: '0'
[        ] ABI: 'arm64'
[        ] Timestamp: 2023-12-28 21:29:55-0500
[        ] pid: 26751, tid: 26777, name: 1.ui  >>> com.example.logti_rfid <<<
[        ] uid: 10195
[        ] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
[        ] Cause: null pointer dereference
[        ]     x0  0000000000000000  x1  0000007bbf0ddcc9  x2  0000000000000000  x3  0000000000000020
[        ]     x4  0000000000000000  x5  0000000000000020  x6  0000000000000000  x7  0000000000000006
[        ]     x8  00000000be21d448  x9  000000007fc00000  x10 000000007f800000  x11 0000000000000000
[        ]     x12 0000000000000007  x13 0000000000000000  x14 0000000000000008  x15 0000200000000000
[        ]     x16 0000007bd1df7df8  x17 0000007cbd4ea100  x18 0000007bcf41c000  x19 0000000000000081
[        ]     x20 0000007c2a7f7c00  x21 0000007bc283d700  x22 0000007bc64f5900  x23 0000007c2a7f7ca8
[        ]     x24 0000007c2a7f7cb8  x25 0000007bc2841080  x26 0000000000000100  x27 0000007c2a5ad808
[        ]     x28 0000007c2a325b00  x29 0000007bc64e2680
[        ]     sp  0000007c2a4f8a80  lr  0000007bd1a4e9c4  pc  0000007bd1a4e9c8
[        ] backtrace:
[        ]       #00 pc 0000000000a239c8  /data/app/com.example.logti_rfid-vcZsk4qETeheffeC1Ze4-g==/lib/arm64/libflutter.so!libflutter.so (offset 0x73e000)
(BuildId: 0424820c482bb2e78a617033ebca731a95ffeb8e)
[ +897 ms] Service protocol connection closed.
[   +1 ms] Lost connection to device.
[   +2 ms] "flutter run" took 126.407ms.
[ +169 ms] ensureAnalyticsSent: 165ms
[        ] Running 1 shutdown hook
[   +1 ms] Shutdown hooks complete
[        ] exiting with code 0

Flutter Doctor output
Doctor output
C:\Windows\system32>flutter doctor -v
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.19045.3803], locale pt-BR)
    • Flutter version 3.16.5 on channel stable at C:\Src\Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (9 days ago), 2023-12-19 16:14:14 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Lucas\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34330.188
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.85.1)
    • VS Code at C:\Users\Lucas\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.80.0

[√] Connected device (3 available)
    • Mi A2 Lite (mobile) • 6943d09c0605 • android-arm64  • Android 10 (API 29)
    • Windows (desktop)   • windows      • windows-x64    • Microsoft Windows [Version 10.0.19045.3803]
    • Edge (web)          • edge         • web-javascript • Microsoft Edge 120.0.2210.91

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

! Doctor found issues in 1 category.

i think i managed to export the backtrace of the dump file

C:\Users\Lucas\AppData\Local\Android\Sdk\ndk\26.1.10909125>ndk-stack -sym "C:\Users\Lucas\Downloads" -dump "C:\Users\Lucas\Desktop\geral.txt"
********** Crash dump: **********
Build fingerprint: 'xiaomi/daisy/daisy_sprout:10/QKQ1.191002.002/V11.0.21.0.QDLMIXM:user/release-keys'
#00 0x0000000000a239c8 /data/app/com.example.logti_rfid-IaonFBumHOoJNU95V112ow==/lib/arm64/libflutter.so!libflutter.so (offset 0x73e000) (BuildId:
GrGLFunction<void (unsigned int)>::operator()(unsigned int) const
/b/s/w/ir/cache/builder/src/out/android_profile_arm64/../../flutter/third_party/skia/include/gpu/gl/GrGLFunctions.h:0:16
invalidate_buffer(GrGLGpu*, unsigned int, unsigned int, unsigned int, unsigned long)
/b/s/w/ir/cache/builder/src/out/android_profile_arm64/../../flutter/third_party/skia/src/gpu/ganesh/gl/GrGLBuffer.cpp:172:13
Crash dump is completed

Hi @jinosh05,
I'm not sure if it is the best way to do it, but I mentioned you in this issue because I'm using the sizer_pro plugin, and I'm suspicious that the problem described here is related to sizer_pro.
I reverted it to the classic sizer plugin and the app stopped crashing, I tried responsize_sizer plugin too and no issues experienced.

Hi @ldsouza93

Funny thing is that after I commented out the app body widgets, leaving the textformfield only, the crash is now gone on profile mode.

Your body widget is a complex widget that is not a minimal sample code. Since you suspected and also checked this issue with sizer_pro package, I would recommend you open an issue there for better support.
Closing as this doesn't seem to be a Flutter bug. If you disagree, please write in the comments a completed and minimal reproducible code sample that doesn’t include 3rd party packages or complex production code so that we may verify this. Thanks!


text:
[google_sign_in] empty popup screen on MacOS M1

Steps to reproduce
Using google_sign_in: ^6.2.1 and it works fine in Chrome and in iPhone.
Tried to use the same application in MacOS: it opens empty popup.
Expected results
It should open Google sign in form
Actual results
empty blank form
Code sample
Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.6, on macOS 14.1 23B74 darwin-arm64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
[✓] VS Code (version 1.85.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Thanks for filing this @FuadEfendi.
Are there any errors logged to the console when the blank screen appears, if yes, kindly share the full logs here.

Hi @dam-ease
No any errors in console; just popup (separate screen) on MacBook Pro M1, which is empty and "white" background; at the same time, if I run the same app in Chrome browser, it works without issues. I saw some old forum posts (two years old) that issue exists for M1 and I was hoping it is fixed, but it seems it is not fixed (probably not even reported).

I run with -v debug option and finally found that outgoing network is disabled. Added this to "entitlements:
	<key>com.apple.security.network.client</key>
        <true/>

Now it works. Except that I need (of course ) configure OAuth redirect at Google.
This is nice article to follow:
https://codewithandrea.com/articles/flutter-firebase-auth-macos/

authors: FuadEfendi dam-ease


text:
[CP] Workaround HardwareRenderer breakage in Android 14

Issue Link
https://github.com/flutter/flutter/issues/146499
Target
stable
PR Link
https://github.com/flutter/engine/pull/52370
Changelog Description
Workaround for Android Platform views not displaying after background + trimMemory on android 14.
Impacted Users
Flutter Android developers who use platform views
Impact Description
Apps using platform views when backgrounded and under memory pressure (trimMemory) the platform views fail to render more frames.
Workaround
No work around other than to update the engine.
Risk
medium
Test Coverage
no
Validation Steps

Launch app with platform view on an Android 14 host device.
Background the app and either open the camera or run adb shell am send-trim-memory <APP PACKAGE> BACKGROUND
Re launch the app
Notice platform views are not getting new frames but are still interactable.

@johnmccutchan for review

The underlying code has changed too much to land this into 3.19.

authors: itsjustkevin reidbaker


text:
[skia / Impeller] linear gradient depends on stroke width -- inconsistency between skia & Impeller

Steps to reproduce
Setup: customer painter with a linear gradient shader
in skia, a linear gradient is applied differently (i.e. probably not as intended) when the stroke width is <=1. In Impeller, linear gradient is always applied in the same way (as skia with width > 1)
This seems like a bug in skia but since a lot of code uses a width of == 1.0 (at least in my code), with Impeller everything looks "wrong".
Expected results
Gradient to be applied equally, independent of stroke width
Actual results
Gradient suddenly changes when stroke width <= 1.0
Code sample
Code sample
import 'package:flutter/material.dart';
import 'dart:math' as math;

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

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

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

class _MyAppState extends State<MyApp> {
  double width = 1.0001;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            children: [
              Row(
                children: [
                  Text("Width: $width"),
                  const SizedBox(width: 10),
                  Expanded(
                    child: Slider(
                      value: width,
                      onChanged: (val) => setState(() => width = val),
                      min: 0,
                      max: 5.0,
                    ),
                  ),
                ],
              ),
              Expanded(
                child: Stack(
                  children: [
                    Container(color: Colors.black),
                    Center(
                      child: Padding(
                        padding: const EdgeInsets.only(top: 20.0),
                        child: Container(
                          height: 250,
                          width: 250,
                          child: CustomPaint(
                            painter: _InconsistentRenderingExample(width: width),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

extension on Size {
  double get circleSize => math.max(width, height);
  Offset get circleCenter => Offset(width / 2, height / 2);
  Rect get circleRect => Rect.fromCircle(center: circleCenter, radius: circleSize / 2);
}

class _InconsistentRenderingExample extends CustomPainter {
  final double width;

  const _InconsistentRenderingExample({required this.width});

  @override
  void paint(Canvas canvas, Size size) {
    var outline = Paint()
      ..strokeCap = StrokeCap.round
      ..shader = const LinearGradient(
        begin: Alignment.topCenter,
        end: Alignment.bottomCenter,
        colors: [
          Colors.white,
          Colors.yellow,
          Colors.red,
          Colors.blue,
        ],
        stops: [0.0, 0.2, 0.8, 1],
      ).createShader(size.circleRect)
      ..strokeWidth = width
      ..style = PaintingStyle.stroke;

    canvas.drawArc(size.circleRect, 0, math.pi * 2, false, outline);
  }

  @override
  bool shouldRepaint(covariant _InconsistentRenderingExample oldDelegate) => true;
}

Screenshots or Video

Screenshots / Video demonstration
Skia, Stroke width = 1.001

Skia, Stroke width = 1.000

Impeller, width = 1.0

Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79
    darwin-arm64, locale en-AT)
    • Flutter version 3.22.0 on channel stable at
      /Users/florian/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (13 days ago), 2024-05-09
      07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

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

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.14.3

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

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (4 available)
    • F (mobile)                      •
      00008110-000640A11187801E • ios            • iOS 17.4.1
      21E236
    • macOS (desktop)                 • macos
      • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad
      • darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome
      • web-javascript • Google Chrome 124.0.6367.210

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

• No issues found!```

</details>

Thanks for the report @flo80
Can you checked similar / related issues with strokeWith for impeller and see if they resemble your case or not?
https://github.com/flutter/flutter/issues/144313
https://github.com/flutter/flutter/issues/138682
https://github.com/flutter/flutter/issues/136688

Thanks for the report @flo80 Can you checked similar / related issues with strokeWith for impeller and see if they resemble your case or not?
#144313 #138682 #136688

I did check already before, I don't think any of these are a duplicate (my bug is more linear shader issue than stroke width).
I also think my issue is more a bug in skia and these all seem to be Impeller bugs.
my only problem is, the skia bug seems like the "intended" behavior since the "normal" use case with stroke width 1.0 always triggers it. So it leads to quite a difference in appearance when switching to impeller.
I am fine if this is closed as a "won't fix", then it might just be good to document/ explain it as a change with Impeller, as it quickly leads to graphically very weird renderings (especially if the shader uses alpha) which (from own experience) take quite a while to find.

Thanks for the feedback. I'll keep the issue open for team's input on above comment.

The linear gradient is working as intended in the Impeller case, we don't plan to duplicate the Skia rendering bug.

authors: darshankawar flo80 jonahwilliams


text:
[Android] Virtual display - Surface view blank on App Resume

Steps to reproduce
This is a duplicate of #144219
This issue was resolved earlier when tested on the Flutter 3.19.6 version.
This is again happening on the flutter stable 3.22.0 and the latest master as well.

Run code sample on Android device (Tested on Redmi Note 9 Pro Max)
Leave the app and come back.
This can be to the home screen or any other app, it doesn't matter.
You should now only see the color of the container behind the platform view.

Expected results
The video should continue to play without the screen going black.
Actual results
The AndroidView is blank on app resume.
The debug console is spammed with
E/BufferQueueProducer(28102): [ImageReader-1080x2000f22m4-28102-0](id:6dc600000002,api:1,p:1104,c:28102) dequeueBuffer: BufferQueue has been abandoned

Code sample
(basic surfaceview)
https://github.com/timbotimbo/flutter-GLTest/tree/initial
(basic surfaceview + additional surfaceholder)
https://github.com/timbotimbo/flutter-GLTest/tree/master
Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
2024-07-02 22:31:36.560  2920-3296  ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: taskId=39285   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=805306368 cmp=ComponentInfo{com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity} }
2024-07-02 22:31:36.913  2920-3296  ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: taskId=39285   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=805306368 cmp=ComponentInfo{com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity} }
2024-07-02 22:31:36.996  2920-2982  InstallApkReceiver      com.miui.home                        E  uninstall:package:com.example.video_player_surface_example
2024-07-02 22:31:37.069  2920-2982  InstallApkReceiver      com.miui.home                        E  install:package:com.example.video_player_surface_example
2024-07-02 22:31:37.238  1468-2450  AppScanObserverService  system_server                        E  Try to add a invalid package: com.example.video_player_surface_example | 10105 | 0
2024-07-02 22:31:37.291  1468-2060  VerityUtils             system_server                        E  Failed to measure fs-verity, errno 1: /data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.apk
2024-07-02 22:31:37.631  1468-2060  VerityUtils             system_server                        E  Failed to measure fs-verity, errno 1: /data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.apk
2024-07-02 22:31:37.647  2920-3296  ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: taskId=39287   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=805306368 cmp=ComponentInfo{com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity} }
---------------------------- PROCESS STARTED (942) for package com.example.video_player_surface_example ----------------------------
2024-07-02 22:31:37.793   942-942   Compatibil...geReporter com....video_player_surface_example  D  Compat change id reported: 171979766; UID 10105; state: ENABLED
2024-07-02 22:31:37.803   942-977   AppScoutStateMachine    com....video_player_surface_example  D  942-ScoutStateMachinecreated
2024-07-02 22:31:37.822   942-942   ziparchive              com....video_player_surface_example  W  Unable to open '/data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.dm': No such file or directory
2024-07-02 22:31:37.822   942-942   ziparchive              com....video_player_surface_example  W  Unable to open '/data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.dm': No such file or directory
2024-07-02 22:31:37.984   942-942   nativeloader            com....video_player_surface_example  D  Configuring clns-4 for other apk /data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/lib/arm64:/data/app/~~AFgIZfEnPXPwV4Zc0M9t6Q==/com.example.video_player_surface_example-Ygd2on25qek0ANSnZb-xMQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.example.video_player_surface_example
2024-07-02 22:31:38.002   942-942   Perf                    com....video_player_surface_example  I  Connecting to perf service.
2024-07-02 22:31:38.021   942-942   GraphicsEnvironment     com....video_player_surface_example  V  ANGLE Developer option for 'com.example.video_player_surface_example' set to: 'default'
2024-07-02 22:31:38.022   942-942   GraphicsEnvironment     com....video_player_surface_example  V  Neither updatable production driver nor prerelease driver is supported.
2024-07-02 22:31:38.030   942-942   ForceDarkHelperStubImpl com....video_player_surface_example  I  initialize for com.example.video_player_surface_example , ForceDarkOrigin
2024-07-02 22:31:38.032   942-942   OpenGLRenderer          com....video_player_surface_example  D  JNI_OnLoad success
2024-07-02 22:31:38.032   942-942   MiuiForceDarkConfig     com....video_player_surface_example  I  setConfig density:2.750000, mainRule:0, secondaryRule:0, tertiaryRule:0
2024-07-02 22:31:38.035   942-942   NetworkSecurityConfig   com....video_player_surface_example  D  No Network Security Config specified, using platform default
2024-07-02 22:31:38.036   942-942   NetworkSecurityConfig   com....video_player_surface_example  D  No Network Security Config specified, using platform default
2024-07-02 22:31:38.178   942-1079  ResourceExtractor       com....video_player_surface_example  I  Found extracted resources res_timestamp-1-1719939030387
2024-07-02 22:31:38.178   942-1079  ResourceExtractor       com....video_player_surface_example  I  Resource version mismatch res_timestamp-1-1719939696786
2024-07-02 22:31:38.451   942-1079  ResourceExtractor       com....video_player_surface_example  I  Extracted baseline resource assets/flutter_assets/kernel_blob.bin
2024-07-02 22:31:38.452   942-1079  ResourceExtractor       com....video_player_surface_example  I  Extracted baseline resource assets/flutter_assets/vm_snapshot_data
2024-07-02 22:31:38.525   942-1079  ResourceExtractor       com....video_player_surface_example  I  Extracted baseline resource assets/flutter_assets/isolate_snapshot_data
2024-07-02 22:31:38.581   942-942   AdrenoGLES-0            com....video_player_surface_example  I  QUALCOMM build                   : 820d4a4028, I5580630f49
                                                                                Build Date                       : 11/04/21
                                                                                OpenGL ES Shader Compiler Version: EV031.32.02.16
                                                                                Local Branch                     :
                                                                                Remote Branch                    :
                                                                                Remote Branch                    :
                                                                                Reconstruct Branch               :
2024-07-02 22:31:38.581   942-942   AdrenoGLES-0            com....video_player_surface_example  I  Build Config                     : S P 10.0.7 AArch64
2024-07-02 22:31:38.581   942-942   AdrenoGLES-0            com....video_player_surface_example  I  Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
2024-07-02 22:31:38.601   942-942   AdrenoGLES-0            com....video_player_surface_example  I  PFP: 0x016ee190, ME: 0x00000000
2024-07-02 22:31:38.669   942-942   ViewScrollStubImpl      com....video_player_surface_example  D  the value of mScrollFrictionRes is: 0.015
2024-07-02 22:31:38.739   942-942   surface_exampl          com....video_player_surface_example  W  Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (unsupported,test-api, reflection, allowed)
2024-07-02 22:31:38.739   942-942   surface_exampl          com....video_player_surface_example  W  Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (unsupported, reflection, allowed)
2024-07-02 22:31:38.739   942-942   surface_exampl          com....video_player_surface_example  W  Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (unsupported, reflection, allowed)
2024-07-02 22:31:38.739   942-942   surface_exampl          com....video_player_surface_example  W  Accessing hidden method Landroid/util/LongArray;->get(I)J (unsupported, reflection, allowed)
2024-07-02 22:31:38.774   942-1184  flutter                 com....video_player_surface_example  I  The Dart VM service is listening on http://127.0.0.1:41347/_7Xo2JuQ0iw=/
2024-07-02 22:31:38.786   942-942   MiuiMultiWindowUtils    com....video_player_surface_example  D  freeform resolution args raw data:{  "zizhan":{    "freeform_args": {      "inner":{        "vertical_portrait":{"aspect_ratio":0.626, "original_ratio":0.5643,"original_scale":0.74,"top_margin":0.168,"left_margin":0.484},        "horizontal_portrait":{"aspect_ratio":0.626, "original_ratio":0.5643,"original_scale":0.74,"top_margin":0.1222,"left_margin":0.59745},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":1,"original_scale":0.604,"top_margin":0.2596,"left_margin":0.2624},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":1,"original_scale":0.604,"top_margin":0.213,"left_margin":0.3758}      },      "outer":{        "vertical_portrait":{"aspect_ratio":0.626, "original_ratio":1,"original_scale":0.74,"top_margin":0.0753,"left_margin":-1},        "horizontal_portrait":{"aspect_ratio":0.626, "original_ratio":1,"original_scale":0.5756,"top_margin":-1,"left_margin":0.0753},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":0.6847,"original_scale":0.587,"top_margin":0.0753,"left_margin":-1},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":0.6847,"original_scale":0.587,"top_margin":-1,"left_margin":0.0753}}    },    "mini_freeform_args":{      "inner":{        "vertical_portrait":{"aspect_ratio":0.626, "original_ratio":0.147},        "horizontal_portrait":{"aspect_ratio":0.626, "original_ratio":0.147},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":0.165},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":0.165}      },      "outer":{        "vertical_portrait":{"aspect_ratio":0.626, "original_ratio":0.26},        "horizontal_portrait":{"aspect_ratio":0.626, "original_ratio":0.26},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":0.293},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":0.293}}    }  },  "wide_default":{    "freeform_args": {        "vertical_portrait":{"aspect_ratio":0.625, "original_ratio":0.58,"original_scale":0.7574,"top_margin":0.125,"left_margin":-1},        "horizontal_portrait":{"aspect_ratio":0.625, "original_ratio":0.58,"original_scale":0.7574,"top_margin":-1,"left_margin":0.0714},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":1,"original_scale":0.5153,"top_margin":0.125,"left_margin":-1},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":1,"original_scale":0.5153,"top_margin":-1,"left_margin":0.0714}    },    "mini_freeform_args":{        "vertical_portrait":{"aspect_ratio":0.5625, "original_ratio":0.144},        "horizontal_portrait":{"aspect_ratio":0.5625, "original_ratio":0.144},        "vertical_landscape":{"aspect_ratio":-1, "original_ratio":0.144},        "horizontal_landscape":{"aspect_ratio":-1, "original_ratio":0.144}    }  },  "narrow_default": {    "freeform_args": {        "vertical_portrait":{"aspect_ratio":0.5625, "original_ratio":1,"original_scale":0.7182,"top_margin":0.142,"left_margin":-1},        "horizontal_portrait":{"aspect_ratio":0.8, "original_ratio":1,"original_scale":0.7182,"top_margin":-1,"left_margin":0.05},        "vertical_landscape":{"aspect_ratio":1.6, "original_ratio":0.6545,"original_scale":0.4473,"top_margin":0.142,"left_margin":-1},        "horizontal_landscape":{"aspect_ratio":1.6, "original_ratio":0.6545,"original_scale":0.4473,"top_margin":-1,"left_margin":0.05}    },    "mini_freeform_args":{        "vertical_portrait":{"aspect_ratio":0.5625, "original_ratio":0.3},        "horizontal_portrait":{"aspect_ratio":0.5625, "original_ratio":0.3},        "vertical_landscape":{"aspect_ratio":1.7778, "original_ratio":0.3},        "horizontal_landscape":{"aspect_ratio":1.7778, "original_ratio":0.3}    }  },  "regular_default": {    "freeform_args": {      "vertical_portrait":{"aspect_ratio":0.625, "original_ratio":1,"original_scale":0.7,"top_margin":0.109,"left_margin":-1},      "horizontal_portrait":{"aspect_ratio":0.6667, "original_ratio":1,"original_scale":0.6102,"top_margin":-1,"left_margin":0.026},      "vertical_landscape":{"aspect_ratio
2024-07-02 22:31:38.798   942-942   System.err              com....video_player_surface_example  W  org.json.JSONException: No value for excalibur
2024-07-02 22:31:38.803   942-942   System.err              com....video_player_surface_example  W  	at org.json.JSONObject.get(JSONObject.java:398)
2024-07-02 22:31:38.803   942-942   System.err              com....video_player_surface_example  W  	at org.json.JSONObject.getJSONObject(JSONObject.java:618)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at android.util.MiuiMultiWindowUtils.initFreeFormResolutionArgsOfDevice(MiuiMultiWindowUtils.java:1433)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at android.util.MiuiMultiWindowUtils.initFreeFormResolutionArgs(MiuiMultiWindowUtils.java:1427)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at android.util.MiuiMultiWindowUtils.<clinit>(MiuiMultiWindowUtils.java:209)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStubImpl.<init>(DecorViewMultiWinStubImpl.java:19)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStubImpl$Provider$SINGLETON.<clinit>(DecorViewMultiWinStubImpl$Provider.java:21)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStubImpl$Provider.provideSingleton(DecorViewMultiWinStubImpl$Provider.java:10)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStubImpl$Provider.provideSingleton(DecorViewMultiWinStubImpl$Provider.java:8)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.miui.base.MiuiStubRegistry.get(MiuiStubRegistry.java:129)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.miui.base.MiuiStubRegistry.get(MiuiStubRegistry.java:123)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.miui.base.MiuiStubUtil.getInstance(MiuiStubUtil.java:46)
2024-07-02 22:31:38.804   942-942   System.err              com....video_player_surface_example  W  	at com.miui.base.MiuiStubUtil.getImpl(MiuiStubUtil.java:30)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStub$SingletonHolder.<clinit>(DecorViewMultiWinStub.java:11)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorViewMultiWinStub.newInstance(DecorViewMultiWinStub.java:16)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.DecorView.<init>(DecorView.java:335)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.PhoneWindow.generateDecor(PhoneWindow.java:2380)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2760)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:487)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:478)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at android.app.Activity.setContentView(Activity.java:3618)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:645)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at android.app.Activity.performCreate(Activity.java:8163)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at android.app.Activity.performCreate(Activity.java:8130)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1330)
2024-07-02 22:31:38.805   942-942   System.err              com....video_player_surface_example  W  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3744)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3938)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2291)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.os.Handler.dispatchMessage(Handler.java:106)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.os.Looper.loopOnce(Looper.java:210)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.os.Looper.loop(Looper.java:299)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at android.app.ActivityThread.main(ActivityThread.java:8319)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at java.lang.reflect.Method.invoke(Native Method)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
2024-07-02 22:31:38.806   942-942   System.err              com....video_player_surface_example  W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
2024-07-02 22:31:38.807   942-942   IS_CTS_MODE             com....video_player_surface_example  D  false
2024-07-02 22:31:38.807   942-942   MULTI_WIND...CH_ENABLED com....video_player_surface_example  D  false
2024-07-02 22:31:38.808   942-942   IS_CTS_MODE             com....video_player_surface_example  D  false
2024-07-02 22:31:38.808   942-942   MULTI_WIND...CH_ENABLED com....video_player_surface_example  D  false
2024-07-02 22:31:38.808   942-942   IS_CTS_MODE             com....video_player_surface_example  D  false
2024-07-02 22:31:38.808   942-942   MULTI_WIND...CH_ENABLED com....video_player_surface_example  D  false
2024-07-02 22:31:38.815   942-942   DecorView[]             com....video_player_surface_example  D  getWindowModeFromSystem  windowmode is 1
2024-07-02 22:31:38.829   942-942   Activity                com....video_player_surface_example  W  PerfMonitor: Slow Operation: Activity com.example.video_player_surface_example/.MainActivity onCreate took 716ms
2024-07-02 22:31:38.884   942-942   DecorView[]             com....video_player_surface_example  D  getWindowModeFromSystem  windowmode is 1
2024-07-02 22:31:38.885   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:38.904   942-942   Looper                  com....video_player_surface_example  W  PerfMonitor looperActivity : package=com.example.video_player_surface_example/.MainActivity time=1ms latency=1106ms running=4ms  procState=-1  historyMsgCount=4 (msgIndex=1 wall=831ms seq=4 running=270ms runnable=41ms io=54ms late=275ms h=android.app.ActivityThread$H w=159) (msgIndex=2 wall=831ms seq=4 running=270ms runnable=41ms io=54ms late=275ms h=android.app.ActivityThread$H w=159) (msgIndex=3 wall=278ms seq=3 running=185ms runnable=49ms io=14ms h=android.app.ActivityThread$H w=110) (msgIndex=4 wall=831ms seq=4 running=270ms runnable=41ms io=54ms late=275ms h=android.app.ActivityThread$H w=159)
2024-07-02 22:31:38.906   942-942   Choreographer           com....video_player_surface_example  I  Skipped 50 frames!  The application may be doing too much work on its main thread.
2024-07-02 22:31:39.185   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE null, mIsCastMode = false
2024-07-02 22:31:39.187   942-1000  hw-ProcessState         com....video_player_surface_example  D  Binder ioctl to enable oneway spam detection failed: Invalid argument
2024-07-02 22:31:39.202   942-942   Looper                  com....video_player_surface_example  W  PerfMonitor doFrame : time=296ms vsyncFrame=0 latency=850ms procState=-1 historyMsgCount=6 (msgIndex=1 wall=831ms seq=4 running=270ms runnable=41ms io=54ms h=android.app.ActivityThread$H w=159) (msgIndex=2 wall=831ms seq=4 running=270ms runnable=41ms io=54ms h=android.app.ActivityThread$H w=159) (msgIndex=3 wall=296ms seq=7 running=245ms runnable=19ms io=2ms late=850ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver) (msgIndex=4 wall=831ms seq=4 running=270ms runnable=41ms io=54ms h=android.app.ActivityThread$H w=159)
2024-07-02 22:31:39.220   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity])/@0x26777b2, mIsProjectionMode = false
2024-07-02 22:31:40.299   942-942   DecorView[]             com....video_player_surface_example  D  getWindowModeFromSystem  windowmode is 1
2024-07-02 22:31:40.299   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:40.364   942-1154  surface_exampl          com....video_player_surface_example  E  open libmigui.so failed! dlopen - dlopen failed: library "libmigui.so" not found
2024-07-02 22:31:40.548   942-942   DecorView[]             com....video_player_surface_example  D  onWindowFocusChanged hasWindowFocus true
2024-07-02 22:31:43.998   942-942   PlatformViewsController com....video_player_surface_example  I  Hosting view in a virtual display for platform view: 0
2024-07-02 22:31:44.002   942-942   PlatformViewsController com....video_player_surface_example  I  PlatformView is using SurfaceProducer backend
2024-07-02 22:31:44.113   942-942   IS_CTS_MODE             com....video_player_surface_example  D  false
2024-07-02 22:31:44.113   942-942   MULTI_WIND...CH_ENABLED com....video_player_surface_example  D  false
2024-07-02 22:31:44.148   942-1154  ImageReade...ceProducer com....video_player_surface_example  D  ImageTextureEntry can't wait on the fence on Android < 33
2024-07-02 22:31:44.162   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE null, mIsCastMode = false
2024-07-02 22:31:44.187   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0xe620dd6, mIsProjectionMode = false
2024-07-02 22:31:44.640   942-1225  ProfileInstaller        com....video_player_surface_example  D  Installing profile for com.example.video_player_surface_example
2024-07-02 22:31:45.625   942-1223  MediaPlayerNative       com....video_player_surface_example  W  info/warning (3, 0)
2024-07-02 22:31:49.010  1275-1346  Finsky                  com.android.vending                  E  [422] VerifyRequiredSplitTypesInstallTask.mw(653): VerifyApps: Required split types check failed for com.example.video_player_surface_example. (Ask Gemini)
                                                                                java.lang.IllegalStateException: Install path is null
                                                                                at com.google.android.finsky.verifier.impl.installtimeverification.VerifyRequiredSplitTypesInstallTask.mw(PG:640)
                                                                                at com.google.android.finsky.verifier.impl.installtimeverification.VerifyInstallTask.mw(PG:41)
                                                                                at akwu.run(PG:228)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                at auxe.run(PG:74)
                                                                                at java.lang.Thread.run(Thread.java:1012)
2024-07-02 22:31:49.048  1275-1346  Finsky                  com.android.vending                  E  [422] VerifyV31SignatureInstallTask.e(159): VerifyApps V31SignatureVerification: Failed to collect certificates for the package: com.example.video_player_surface_example using APK Signature Scheme v3
2024-07-02 22:31:50.662   942-942   BpBinder                com....video_player_surface_example  W  Slow Binder: BpBinder transact took 214 ms, interface=android.app.IActivityClientController, code=24 oneway=false
2024-07-02 22:31:50.683   942-942   DecorView[]             com....video_player_surface_example  D  getWindowModeFromSystem  windowmode is 1
2024-07-02 22:31:50.684   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:51.031   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:53.250   942-942   DecorView[]             com....video_player_surface_example  D  getWindowModeFromSystem  windowmode is 1
2024-07-02 22:31:53.250   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:53.541   942-942   DecorView[]             com....video_player_surface_example  D  updateDecorCaptionStatus displayWindowDecor is false
2024-07-02 22:31:55.689   942-942   DecorView[]             com....video_player_surface_example  D  onWindowFocusChanged hasWindowFocus false
2024-07-02 22:31:56.267  2920-3296  ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: taskId=39287   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=805306368 cmp=ComponentInfo{com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity} }
2024-07-02 22:31:56.271   942-1223  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:31:56.292   942-981   BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:31:56.336   942-981   BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:31:56.355   942-981   BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:00.664   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:00.715   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:06.541   942-1536  AppScoutStateMachine    com....video_player_surface_example  D  942-ScoutStateMachinecreated
2024-07-02 22:32:06.546   942-1223  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:06.562   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:06.574   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0xe620dd6, mIsCastMode = false
2024-07-02 22:32:06.575   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0xe620dd6, mIsProjectionMode = false
2024-07-02 22:32:06.579   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [ImageReader-1080x688f22m5-942-2](id:3ae00000006,api:1,p:1128,c:942) dequeueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:06.605   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [SurfaceView[]#3(BLAST Consumer)3](id:3ae00000004,api:3,p:1407,c:942) queueBuffer: BufferQueue has been abandoned
2024-07-02 22:32:06.607   942-1536  MediaPlayerNative       com....video_player_surface_example  W  info/warning (805, -19)
2024-07-02 22:32:06.608   942-1536  MediaPlayerNative       com....video_player_surface_example  W  info/warning (805, -38)
2024-07-02 22:32:06.654   942-1536  BufferQueueProducer     com....video_player_surface_example  E  [SurfaceView[]#3(BLAST Consumer)3](id:3ae00000004,api:3,p:1407,c:942) connect: BufferQueue has been abandoned
2024-07-02 22:32:06.714  2920-3296  ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: taskId=39287   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=805306368 cmp=ComponentInfo{com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity} }
2024-07-02 22:32:06.721   942-942   IS_CTS_MODE             com....video_player_surface_example  D  false
2024-07-02 22:32:06.721   942-942   MULTI_WIND...CH_ENABLED com....video_player_surface_example  D  false
2024-07-02 22:32:06.781   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity])/@0x4fb6328, mIsProjectionMode = false
2024-07-02 22:32:06.818   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE null, mIsCastMode = false
2024-07-02 22:32:06.838   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0x7edd1e6, mIsProjectionMode = false
2024-07-02 22:32:06.840   942-942   DecorView[]             com....video_player_surface_example  D  onWindowFocusChanged hasWindowFocus true
2024-07-02 22:32:12.300   942-942   MIUIInput               com....video_player_surface_example  D  [KeyEvent] ViewRootImpl windowName 'com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity', KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=57149548, downTime=57149548, deviceId=-1, source=0x101, displayId=0 }, phoneEventTime=22:32:12.261
2024-07-02 22:32:12.306   942-942   MIUIInput               com....video_player_surface_example  D  [KeyEvent] ViewRootImpl windowName 'com.example.video_player_surface_example/com.example.video_player_surface_example.MainActivity', KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=57149548, downTime=57149548, deviceId=-1, source=0x101, displayId=0 }, phoneEventTime=22:32:12.261
2024-07-02 22:32:12.662   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0x7edd1e6, mIsCastMode = false
2024-07-02 22:32:12.663   942-942   SurfaceView             com....video_player_surface_example  D  UPDATE Surface(name=SurfaceView[])/@0x7edd1e6, mIsProjectionMode = false
2024-07-02 22:32:12.665   942-942   MediaPlayer             com....video_player_surface_example  V  resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
2024-07-02 22:32:12.665   942-942   MediaPlayer             com....video_player_surface_example  V  cleanDrmObj: mDrmObj=null mDrmSessionId=null

Flutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.23.0-14.0.pre.77, on macOS 14.1 23B2073 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.1)
[✓] Connected device (6 available)
    ! Error: Browsing on the local area network for Sanket’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same
      local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Thanks for the report @Neelansh-ns
I used both code samples you provided and ran it in S10 device using latest stable and master versions but didn't see the blank screen upon resuming app from background. See below:
https://github.com/flutter/flutter/assets/67046386/8804bdbe-8b9c-46ab-b63d-0bd4d9cb9f0a
If above doesn't represent your case, please provide a short video that shows the behavior you are seeing.

I'm the creator of the original issue you linked.
I just tried the basic surfaceview sample with Flutter 3.22.2 on some of the affected devices:

Samsung S20FE Android 13
emulator Android 13
emulator Android 14

The S20FE had no resuming issues at all.
The emulators had no issue when leaving the using the home or overview button.

However on both emulators leaving using the back button/back swipe breaks the entire flutter app.
Both the surfaceview and the flutter button aren't even visible anymore, but the button still clicks.
Even fully killing the app and restarting it doesn't fix it.
I reinstalled my emulators with the latest images, and this still happens.
This video is a Pixel 8 API 34 emulator on Windows 10.
I first leave the app with a swipe up, go to settings and return to the app. (works fine)
Then I leave the app using a back swipe and return, and the app is fucked.
Last I kill the app and restart it, still broken.
https://github.com/flutter/flutter/assets/11444698/9b5558f1-bf2b-418c-9e46-f5ea5e690585

Flutter doctor -v
[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.19045.4529], locale en-GB)
    • Flutter version 3.22.2 on channel stable at C:\Flutter\flutter_windows_3.22.0-stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (4 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\XXXXXXX\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)
    • All Android licenses accepted.

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

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.0)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.9.34607.119
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[√] VS Code (version 1.90.2)
    • VS Code at C:\Users\XXXXXXX\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.90.0

[√] Connected device (5 available)
    • SM G780G (mobile)            • RF8R8021WSR   • android-arm64  • Android 13 (API 33)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.4529]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 126.0.6478.127
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 126.0.2592.68

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

• No issues found!

@Neelansh-ns  can you share a screen recording and the android version of your phone?
I'm not sure if what I just ran into is your issue or an entirely new one.

@darshankawar if your video is of the linked repro project, something else is broken.
You should be seeing an image with mountains. The green is a backgroundcolor that only shows up when the surfaceview is invisible.

authors: Neelansh-ns darshankawar timbotimbo