text:
Reloading the td-agent after configuration changes throws a nil:NilClass exception

NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
Hi.
So we are changing our configuration to update a log cluster information. The config doesn't really matter at that point because the the agent is running fine.
However when the fluentd logcollector is stopped by systemd and then restarted in the middle of that, td-agent says this:
Dec  7 13:45:33 xxx-7 log[8870]: No log cluster configured for this server.
Dec  7 13:45:33 xxx-7 log[8870]: updated /etc/td-agent/log.d/server_logs.conf
Dec  7 13:45:33 xxx-7 log[8870]: Reloading td-agent after configuration changes.
Dec  7 13:45:33 xxx-7 systemd[1]: Stopping Fluentd log collector...
Dec  7 13:45:33 xxx-7 td-agent[7101]: Unexpected error undefined method `each' for nil:NilClass
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:52:in `dump_backtrace'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:34:in `block in dump_all_thread_backtrace'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:33:in `each'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:33:in `dump_all_thread_backtrace'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:16:in `block in dump'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `open'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `_open_dump_path'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/sigdump-0.2.4/lib/sigdump.rb:14:in `dump'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/server.rb:107:in `block (2 levels) in install_signal_handlers'
Dec  7 13:45:33 xxx-7 td-agent[7101]:   /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/signal_thread.rb:96:in `main'
Dec  7 13:45:34 xxx-7 systemd[1]: Stopped Fluentd log collector.
Dec  7 13:45:34 xxx-7 systemd[1]: Started Fluentd log collector.

Right now we are ignoring this because after that the td-agent runs just fine, but I would rather not have a nil class exception in there. Is this something excepted or are we doing something wrong or is there a bug in the code?
I would be happy to investigate this in the code if you don't have any free cycles for this.
Thank you!

Dec  7 13:45:33 xxx-7 td-agent[7101]: Unexpected error undefined method `each' for nil:NilClass

Hmm... this is very weird because we check backtrace field before access.
https://github.com/frsyuki/sigdump/blob/e47589517f2d84858f12156b1928706540b6734c/lib/sigdump.rb#L53
Is this problem reproducible? I'm not sure why sigdump is called in fluentd stop but I assume fluentd stopped threads which sigdump dumps.

After digging into this a bit, it might not be fluentd-s problem per say. 🤔 I think we are doing something extra to it maybe. We'll investigate further on our part. I will close up this issue for now. It's linked into our internal bug tracking system, so if it's reopened it will be more detail. If not, I guess it was our fault. :)
Thanks for chiming in @repeatedly.

authors: Skarlso repeatedly

repo: fluent/fluentd


text:
Issue Template: Render configuration

Which issue(s) this PR fixes:
None
What this PR does / why we need it:
Most users doesn't quote Your Configuration field manually when they report a bug.
So it should be quoted automatically.
Docs Changes:
None
Release Note:
None

Available Languages:
https://github.com/github/linguist/blob/master/lib/linguist/languages.yml

source: gharchive/pull-request

license_type: permissive

license_source: github-api


text:
[BUG]Dataload's status should be Pending when the status of dataset is Calculating

What is your environment(Kubernetes version, Fluid version, etc.)
Fluid:0.5.0
Describe the bug
My dataset is about 800G,all the data are small files.I create dataset and runtime,the status of dataset is Calculating.I create a dataload and the status of dataload is Loading
The following Scenarios should notify the end user:

the dataload's namespace is different from dataset
the path to load doesn't exist

What you expect to happen:
How to reproduce it
Additional Information

@ldd91 Hi, dongdong, you can try the new commit.

@xieydd Thanks,I will have a try

@xieydd Thanks,I will have a try

@ldd91 how about the test? can we close it now?

Close it since it's not active for a long time. Feel free to reopen it.

source: gharchive/issue

authors: cheyang ldd91 xieydd

repo: fluid-cloudnative/fluid


text:
modify the date

Ⅰ. Describe what this PR does
this pr is to modify the date from 2022 to 2020
Ⅱ. Does this pull request fix one issue?

fixes #XXXX
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

look good to me

ok-to-test

/lgtm
/approve


text:
Migration guide should mention that the previous .min.js files have been deprecated.

In 2.0 era releases, the build scripts produced both minified and uncompressed bundles.  The minified bundles were called things like dist/infusion-all.min.js, and the uncompressed bundles were called things like dist/infusion-all.js.
In replacing the build scripts in the run up to 3.0, we moved to only producing minified bundles, but gave them the uncompressed file used previously.  We should mention this in the migration notes document.

Tracking in JIRA instead, see FLUID-6719

repo: fluid-project/infusion-docs


text:
How to use flurry for cumulative data like total amount of moneys users spent?

Hi, thank you for your perfect library, I need to know sum of money users spent daily on my app. how can I achieve that with your api's,
Also I want to log an event with more than one parameters so is this the write way?
 Flurry.logEvent(eventType, {itemType : eventParam , itemID : eventParam2, itemCost : eventParam3, itemCurrency : eventParam4})

@pouya92 To get the cumulative data, or any numerical measurements, please use Flurry console by,

Click on Explorer tab
Use Measures under Data Analysis category
In your query, select "Event Parameter - Numeric - Sum, Avg, etc..." for Metrics

Please check the Flurry Doc site for more information. Thanks!
https://developer.yahoo.com/flurry/docs/

repo: flurry/react-native-flurry-sdk


text:
[Fonts] Icon request: network_wifi_[X]_bar

Hi
I've noticed some icons are missing in the current Flutter codebase.
In my app I need to show a Wifis' list with the power/closeness specified by ad icon, as the OS does.
Although I should be able to set the desired icons, I'm here to notify.
Icons not present:

signal_wifi_1_bar
signal_wifi_2_bar
signal_wifi_3_bar

While 0 (min) and 4 (max) are present.
I've tried to use the web's code point but they point to other icons.
I.e.: Network Wifi 3 Bar in Google Fonts points to the printer icon in the Flutter code.
Can I help in any way?
Thanks.

Hi @FabrizioBilleciUNICT, thanks for the report. We're trying to consolidate all the missing icons into one issue so that it's easier to track. If you do find any more missing icons, kindly leave a comment in https://github.com/flutter/flutter/issues/99973.

I've tried to use the web's code point but they point to other icons.
I.e.: Network Wifi 3 Bar in Google Fonts points to the printer icon in the Flutter code.

See https://github.com/flutter/flutter/issues/75633 for why this may not be a good idea.
Closing from here as duplicate.
Thank you

Hi @FabrizioBilleciUNICT, see https://github.com/flutter/flutter/issues/99973#issuecomment-1088400026

authors: FabrizioBilleciUNICT danagbemava-nc

repo: flutter/flutter


text:
While i'm using getx to go to second route it shows here

Steps to Reproduce

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

Expected results:
Actual results:

Code sample

Logs

probably should be addressed here

Issues with third-party packages need to be reported to their developers, rather than the Flutter project.
Closing as this does not describe a Flutter bug report or feature request.

authors: farhansadikgalib iapicca stuartmorgan


text:
Test failure, localizedName is nil in testSetMenu at -[FlutterMenuPlugin menuItemFromFlutterRepresentation:] > -[__NSCFConstantString stringByReplacingOccurrencesOfString:withString:options:range:]

See: https://github.com/flutter/engine/pull/33603#issuecomment-1137560253
When running tests in parallel, the value is appName is null here: https://github.com/flutter/engine/blob/main/shell/platform/darwin/macos/framework/Source/FlutterMenuPlugin.mm#L256
This caused crashes during the test.
[NSRunningApplication currentApplication].localizedName is supposed to pick up the name of the test executable: flutter_desktop_darwin_unittests

Not only localizedName is null, there are other strange behaviors.
For example, after I fixed the localizedName issue, All the tests in testSetMenu failed:
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:135: Failure
Expected equality of these values:
  [NSApp.mainMenu numberOfItems]
    Which is: 0
  2
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:137: Failure
Value of: [[firstMenu title] isEqualToString:@"flutter_desktop_darwin_unittests"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:138: Failure
Expected equality of these values:
  [firstMenu tag]
    Which is: 0
  1
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:139: Failure
Value of: [firstMenu isEnabled]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:141: Failure
Value of: [[firstMenu keyEquivalent] isEqualToString:@"\0"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:143: Failure
Expected equality of these values:
  [[firstMenu submenu] numberOfItems]
    Which is: 0
  1
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:145: Failure
Value of: [[firstItem title] isEqualToString:@"flutter_desktop_darwin_unittests Info"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:146: Failure
Value of: [[firstItem keyEquivalent] isEqualToString:@"a"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:147: Failure
Value of: [firstItem isEnabled]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:150: Failure
Value of: [NSStringFromSelector([firstItem action]) isEqualToString:@"flutterMenuItemSelected:"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:151: Failure
Expected equality of these values:
  [firstItem tag]
    Which is: 0
  2
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:154: Failure
Value of: [[secondMenu title] isEqualToString:@"Help for flutter_desktop_darwin_unittests"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:155: Failure
Expected equality of these values:
  [secondMenu tag]
    Which is: 0
  4
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:156: Failure
Value of: [secondMenu isEnabled]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:159: Failure
Expected equality of these values:
  [[secondMenu submenu] numberOfItems]
    Which is: 0
  3
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:161: Failure
Value of: [[secondMenuFirst title] isEqualToString:@"Help me!"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:162: Failure
Value of: [secondMenuFirst isEnabled]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:165: Failure
Value of: [NSStringFromSelector([secondMenuFirst action]) isEqualToString:@"flutterMenuItemSelected:"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:166: Failure
Expected equality of these values:
  [secondMenuFirst tag]
    Which is: 0
  5
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:169: Failure
Value of: [[secondMenuDivider title] isEqualToString:@""]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:170: Failure
Value of: [[secondMenuDivider keyEquivalent] isEqualToString:@""]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:177: Failure
Value of: [[secondMenuLast title] isEqualToString:@"Search help"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:181: Failure
Value of: [NSStringFromSelector([secondMenuLast action]) isEqualToString:@"flutterMenuItemSelected:"]
  Actual: false
Expected: true
../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm:182: Failure
Expected equality of these values:
  [secondMenuLast tag]
    Which is: 0
  7

When debugging the first failure
Expected equality of these values:
  [NSApp.mainMenu numberOfItems]
    Which is: 0
  2

I tried something like:
  NSApp.mainMenu = newMenu;
  NSLog(@"newMenu %ld", [newMenu numberOfItems]);
  NSLog(@"NSApp.mainMenu %ld", [NSApp.mainMenu numberOfItems]);

The [newMenu numberOfItems] returns 2 as expected, but the [NSApp.mainMenu numberOfItems] returns 0.

Looks like NSApp is null during the test. Not exactly sure why.

The issue is due to the NSApplication not running. I tried add [[NSApplication sharedApplication] run]; at the very beginning of the test, it fixes the test, but caused  FlutterEngineTest.ResetsAccessibilityBridgeWhenSetsNewViewController to hang.
I think this is rather an issue with gtest parallel not working well with objective C tests that access the NSApplication.
Can we run other tests with gtest parallel and leave this test to run as before? @zanderso

@cyanglaz Yes, we can leave this one out. I'll update my PR.

Closing the issue as the test accesses global variables and is not suitable for running in parallel.

This menu test fails when run on its own, which is causing flakes and tree redness given particular random seeds, even when not run in parallel.
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8811085493680231345/+/u/test:_Host_Tests_for_host_profile__2_/stdout
flutter_desktop_darwin_unittests --gtest_filter=FlutterMenuPluginTest.TestSetMenu

2022-06-17 15:40:49.166 flutter_desktop_darwin_unittests[52411:68175731] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByReplacingOccurrencesOfString:withString:options:range:]: nil argument'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff802b7b7b3 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff8028dbbc3 objc_exception_throw + 48
	2   Foundation                          0x00007ff80393040f -[NSString stringByReplacingOccurrencesOfString:withString:options:range:] + 276
	3   Foundation                          0x00007ff8039302d0 -[NSString stringByReplacingOccurrencesOfString:withString:] + 97
	4   flutter_desktop_darwin_unittests    0x000000010270fd4a -[FlutterMenuPlugin menuItemFromFlutterRepresentation:] + 3226
	5   flutter_desktop_darwin_unittests    0x0000000102713810 -[FlutterMenuPlugin setMenus:] + 512
	6   flutter_desktop_darwin_unittests    0x0000000102713521 -[FlutterMenuPlugin handleMethodCall:result:] + 561
	7   flutter_desktop_darwin_unittests    0x00000001026bf2df -[FlutterMenuPluginTestObjc testSetMenu] + 8863
	8   flutter_desktop_darwin_unittests    0x00000001026c49d3 _ZN7flutter7testing38FlutterMenuPluginTest_TestSetMenu_Test8TestBodyEv + 67
	9   flutter_desktop_darwin_unittests    0x00000001057ee0f9 _ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc + 137
	10  flutter_desktop_darwin_unittests    0x00000001057c3355 _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc + 117
	11  flutter_desktop_darwin_unittests    0x00000001057c3271 _ZN7testing4Test3RunEv + 209
	12  flutter_desktop_darwin_unittests    0x00000001057c4002 _ZN7testing8TestInfo3RunEv + 290
	13  flutter_desktop_darwin_unittests    0x00000001057c548b _ZN7testing9TestSuite3RunEv + 331
	14  flutter_desktop_darwin_unittests    0x00000001057d23dd _ZN7testing8internal12UnitTestImpl11RunAllTestsEv + 973
	15  flutter_desktop_darwin_unittests    0x00000001057f46d9 _ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc + 137
	16  flutter_desktop_darwin_unittests    0x00000001057d1f75 _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc + 117
	17  flutter_desktop_darwin_unittests    0x00000001057d1e0a _ZN7testing8UnitTest3RunEv + 186
	18  flutter_desktop_darwin_unittests    0x000000010289b6e3 _Z13RUN_ALL_TESTSv + 35
	19  flutter_desktop_darwin_unittests    0x000000010289b5f3 main + 547
	20  dyld                                0x000000011424951e start + 462
)

The tests passed when I added
NSView* view = [[NSView alloc] initWithFrame:NSZeroRect];
view.wantsLayer = YES;

@gspencergoog @cbracken @jason-simmons

I can also take a look at fixing the test.

@gspencergoog This test is currently disabled. Should we delete it or work on fixing it?

I don't see any way to avoid using a global instance of the NSApplication in this test.  Deleting (or not re-enabling) the test means we will have no test coverage on menus, though, so I don't know where to go from here.  Maybe someone who has better AppKit/macOS foo than I can figure out how to make it work?

It's a hack, but does it pass when you add this to the top of the test?

The tests passed when I added
NSView* view = [[NSView alloc] initWithFrame:NSZeroRect];
view.wantsLayer = YES;

The view is just instantiated, setting wantsLayer somehow put the shared NSApplication in some state where it spoke menus.  I didn't actually use the view at all.

@cyanglaz @jmagman @gspencergoog This test has been disabled for quite some time. Is it time to delete it? https://github.com/flutter/engine/blob/main/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm

I think adding the workaround in https://github.com/flutter/flutter/issues/104748#issuecomment-1159336728 is better than no test coverage.

authors: cyanglaz gspencergoog jmagman zanderso


text:
[web] PWA apps do not update automatically

When accessing a website and installing a PWA application, the name and logo do not update as the application's source site receives new updates. you have to remove it and redo the installation again when there is a name change it's logo

Hi @MarlonSantosDev, Thanks for filing the issue. Are you reloading the PWA when the site is updated? PWA would require minimum of two reloads to update the app. Can you please share the output of flutter doctor -v ?

Oi@MarlonSantosDev, Obrigado por registrar o problema. Você está recarregando o PWA quando o site está atualizado? O PWAia requer no mínimo duas recargas para atualizar o aplicativo. Você pode compartilhar uma saída de flutter doctor -v?
output:
_[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-x64, locale pt-BR)
• Flutter version 3.0.2 at /Users/marlon/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (7 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.68.0)
• VS Code at /Users/marlon/Downloads/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos  • darwin-x64     • macOS 12.4 21F79 darwin-x64
• Chrome (web)    • chrome • web-javascript • Google Chrome 102.0.5005.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories._

Thanks for the info @MarlonSantosDev, I was able to reproduce the issue. I am quite not sure if  pwa's are supposed to auto update on the home screen, But I could see that doesn;t seem to happen.
Steps I tried to reproduce
I verified with this sample app https://github.com/maheshmnj/triage_issues/tree/master/apps/listview

on launching the app https://flutterlistview.netlify.app/#/ I got a pop up to add to homescreen which I accepted.
then I updated the manifest.json and the index.html to change the app title and the icon
I published the app and refreshed this app multiple times in chrome and also tried launching the PWA, But I didn't see those changes in the pwa title and app icon.
I deleted the pwa and manually added to homescreen and the changes were published

flutter doctor -v (mac)
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.0.2 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cd41fdd495 (5 days ago), 2022-06-08 09:52:13 -0700
    • Engine revision f15f824b57
    • Dart version 2.17.3
    • DevTools version 2.12.2

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

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

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

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

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 102.0.5005.61

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

• No issues found!

[✓] Flutter (Channel master, 3.1.0-0.0.pre.1237, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.1.0-0.0.pre.1237 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6062e40510 (64 minutes ago), 2022-06-12 23:53:08 -0400
    • Engine revision f80294b57e
    • Dart version 2.18.0 (build 2.18.0-180.0.dev)
    • DevTools version 2.14.0

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

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

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

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

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 102.0.5005.61

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

• No issues found!

cc: @yjbanov

I am looking for something similar. I thought that Flutter would do this automatically, or at least give a better solution.

any updates on this?!

authors: AliEasy MarlonSantosDev jaca420 maheshmnj


text:
'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 322 pos 18: 'event is! PointerRemovedEvent': is not true.

I am getting this issue every time I try to debug some sample code from the book "Flutter for Beginners" on Ubuntu 20:04
I do not see the issue if I launch the code without debuging.
Launching lib/main_form.dart on Linux in debug mode...
Connecting to VM Service at ws://127.0.0.1:42767/iUZZegLmZJk=/ws
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 322 pos 18: 'event is! PointerRemovedEvent': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      MouseTracker.updateWithEvent.<anonymous closure>.<anonymous closure>
#3      MouseTracker._deviceUpdatePhase
#4      MouseTracker.updateWithEvent.<anonymous closure>
#5      MouseTracker._monitorMouseConnection
#6      MouseTracker.updateWithEvent
#7      RendererBinding.dispatchEvent
#8      GestureBinding._handlePointerEventImmediately
#9      GestureBinding.handlePointerEvent
#10     GestureBinding._flushPointerEventQueue
#11     GestureBinding._handlePointerDataPacket
#12     _rootRunUnary (dart:async/zone.dart:1442:13)
#13     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#14     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#15     _invoke1 (dart:ui/hooks.dart:170:10)
#16     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
#17     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
Application finished.
Exited (sigterm)

main.dart
import 'package:flutter/material.dart';
import 'forms.dart';
import 'input_fields.dart';

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

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

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

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

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

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  final TextEditingController _controller =
      TextEditingController.fromValue(TextEditingValue(text: ""));

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

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

forms.dart
import 'package:flutter/material.dart';
// import 'package:flutter/services.dart';

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

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

class _FormExampleState extends State<FormExample> {
  final _controller = TextEditingController.fromValue(
    TextEditingValue(text: "Initial value"),
  );
  final _key = GlobalKey<FormFieldState<String>>();
  String _textValue = "";

  @override
  void initState() {
    _controller.addListener(() {
      this.setState(() {
        _textValue = _controller.text;
      });
    });

    super.initState();
  }

  @override
  Widget build(BuildContext topContext) {
    return Form(
      key: _key,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          TextFormField(
            validator: (String? value) {
              return value == null || value.isEmpty
                  ? "Please type a value, this field cannot be empty"
                  : null;
            },
          ),
          TextFormField(),
          Builder(
            builder: (BuildContext subContext) => TextButton(
              onPressed: () {
                final valid = Form.of(subContext)!.validate();
                print("valid: $valid");
              },
              child: Text("validate"),
            ),
          )
        ],
      ),
    );
  }
}

input_fields.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class VerificationCodeInput extends StatefulWidget {
  final BorderSide borderSide;
  final void Function(String)? onChanged;
  final TextEditingController? controller;

  const VerificationCodeInput({
    Key? key,
    this.controller,
    this.borderSide = const BorderSide(),
    this.onChanged,
  }) : super(key: key);

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

class _VerificationCodeInputState extends State<VerificationCodeInput> {
  @override
  Widget build(BuildContext context) {
    return TextField(
      controller: widget.controller,
      inputFormatters: [
        FilteringTextInputFormatter.allow(RegExp("[0-9]")),
        LengthLimitingTextInputFormatter(6),
      ],
      textAlign: TextAlign.center,
      decoration: InputDecoration(
        border: OutlineInputBorder(
          borderSide: widget.borderSide,
        ),
      ),
      keyboardType: TextInputType.number,
      onChanged: widget.onChanged,
    );
  }
}

/// FormField version of the VerificationCodeInput widget
class VerificationCodeFormField extends FormField<String> {
  final TextEditingController controller;

  VerificationCodeFormField({
    Key? key,
    FormFieldSetter<String>? onSaved,
    required this.controller,
    FormFieldValidator<String>? validator,
  }) : super(
          key: key,
          validator: validator,
          builder: (FormFieldState<String> field) {
            _VerificationCodeFormFieldState state = field as _VerificationCodeFormFieldState;
            return VerificationCodeInput(
              controller: state._controller,
            );
          },
        );

  @override
  FormFieldState<String> createState() => _VerificationCodeFormFieldState();
}

class _VerificationCodeFormFieldState extends FormFieldState<String> {
  final TextEditingController _controller = TextEditingController(text: "");

  @override
  void initState() {
    super.initState();

    _controller.addListener(_controllerChanged);
  }

  @override
  void reset() {
    super.reset();
    _controller.text = "";
  }

  void _controllerChanged() {
    didChange(_controller.text);
  }

  @override
  void dispose() {
    _controller.removeListener(_controllerChanged);
    super.dispose();
  }
}

lutter doctor -v
[✓] Flutter (Channel stable, 3.0.4, on Ubuntu 20.04.4 LTS 5.13.0-52-generic, locale en_IE.UTF-8)
• Flutter version 3.0.4 at /home/snuc/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 85684f9300 (2 weeks ago), 2022-06-30 13:22:47 -0700
• Engine revision 6ba2af10bb
• Dart version 2.17.5
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /home/snuc/Android/Sdk/
• Platform android-33, build-tools 33.0.0
• Java binary at: /home/snuc/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 2021.2)
• Android Studio at /home/snuc/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] Android Studio
• Android Studio at /home/snuc/android-studio/
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /home/snuc/android-studio/
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.69.0)
• VS Code at /usr/share/code
• Flutter extension version 3.44.0
[✓] Connected device (2 available)
• Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.4 LTS 5.13.0-52-generic
• Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.114
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class VerificationCodeInput extends StatefulWidget {
  final BorderSide borderSide;
  final void Function(String)? onChanged;
  final TextEditingController? controller;

  const VerificationCodeInput({
    Key? key,
    this.controller,
    this.borderSide = const BorderSide(),
    this.onChanged,
  }) : super(key: key);

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

class _VerificationCodeInputState extends State<VerificationCodeInput> {
  @override
  Widget build(BuildContext context) {
    return TextField(
      controller: widget.controller,
      inputFormatters: [
        FilteringTextInputFormatter.allow(RegExp("[0-9]")),
        LengthLimitingTextInputFormatter(6),
      ],
      textAlign: TextAlign.center,
      decoration: InputDecoration(
        border: OutlineInputBorder(
          borderSide: widget.borderSide,
        ),
      ),
      keyboardType: TextInputType.number,
      onChanged: widget.onChanged,
    );
  }
}

/// FormField version of the VerificationCodeInput widget
class VerificationCodeFormField extends FormField<String> {
  final TextEditingController controller;

  VerificationCodeFormField({
    Key? key,
    FormFieldSetter<String>? onSaved,
    required this.controller,
    FormFieldValidator<String>? validator,
  }) : super(
          key: key,
          validator: validator,
          builder: (FormFieldState<String> field) {
            _VerificationCodeFormFieldState state = field as _VerificationCodeFormFieldState;
            return VerificationCodeInput(
              controller: state._controller,
            );
          },
        );

  @override
  FormFieldState<String> createState() => _VerificationCodeFormFieldState();
}

class _VerificationCodeFormFieldState extends FormFieldState<String> {
  final TextEditingController _controller = TextEditingController(text: "");

  @override
  void initState() {
    super.initState();

    _controller.addListener(_controllerChanged);
  }

  @override
  void reset() {
    super.reset();
    _controller.text = "";
  }

  void _controllerChanged() {
    didChange(_controller.text);
  }

  @override
  void dispose() {
    _controller.removeListener(_controllerChanged);
    super.dispose();
  }
}

Hi @johnosbb, thanks for filing the issue.
But I can not reproduce the issue on the latest stable and master channels.

Demo
Screencast from 15-07-2022 15:12:23.webm

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

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

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

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

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

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

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  final TextEditingController _controller =
      TextEditingController.fromValue(TextEditingValue(text: ""));

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

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

class VerificationCodeInput extends StatefulWidget {
  final BorderSide borderSide;
  final void Function(String)? onChanged;
  final TextEditingController? controller;

  const VerificationCodeInput({
    Key? key,
    this.controller,
    this.borderSide = const BorderSide(),
    this.onChanged,
  }) : super(key: key);

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

class _VerificationCodeInputState extends State<VerificationCodeInput> {
  @override
  Widget build(BuildContext context) {
    return TextField(
      controller: widget.controller,
      inputFormatters: [
        FilteringTextInputFormatter.allow(RegExp("[0-9]")),
        LengthLimitingTextInputFormatter(6),
      ],
      textAlign: TextAlign.center,
      decoration: InputDecoration(
        border: OutlineInputBorder(
          borderSide: widget.borderSide,
        ),
      ),
      keyboardType: TextInputType.number,
      onChanged: widget.onChanged,
    );
  }
}

/// FormField version of the VerificationCodeInput widget
class VerificationCodeFormField extends FormField<String> {
  final TextEditingController controller;

  VerificationCodeFormField({
    Key? key,
    FormFieldSetter<String>? onSaved,
    required this.controller,
    FormFieldValidator<String>? validator,
  }) : super(
          key: key,
          validator: validator,
          builder: (FormFieldState<String> field) {
            _VerificationCodeFormFieldState state = field as _VerificationCodeFormFieldState;
            return VerificationCodeInput(
              controller: state._controller,
            );
          },
        );

  @override
  FormFieldState<String> createState() => _VerificationCodeFormFieldState();
}

class _VerificationCodeFormFieldState extends FormFieldState<String> {
  final TextEditingController _controller = TextEditingController(text: "");

  @override
  void initState() {
    super.initState();

    _controller.addListener(_controllerChanged);
  }

  @override
  void reset() {
    super.reset();
    _controller.text = "";
  }

  void _controllerChanged() {
    didChange(_controller.text);
  }

  @override
  void dispose() {
    _controller.removeListener(_controllerChanged);
    super.dispose();
  }
}

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

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

class _FormExampleState extends State<FormExample> {
  final _controller = TextEditingController.fromValue(
    TextEditingValue(text: "Initial value"),
  );
  final _key = GlobalKey<FormFieldState<String>>();
  String _textValue = "";

  @override
  void initState() {
    _controller.addListener(() {
      this.setState(() {
        _textValue = _controller.text;
      });
    });

    super.initState();
  }

  @override
  Widget build(BuildContext topContext) {
    return Form(
      key: _key,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          TextFormField(
            validator: (String? value) {
              return value == null || value.isEmpty
                  ? "Please type a value, this field cannot be empty"
                  : null;
            },
          ),
          TextFormField(),
          Builder(
            builder: (BuildContext subContext) => TextButton(
              onPressed: () {
                final valid = Form.of(subContext)!.validate();
                print("valid: $valid");
              },
              child: Text("validate"),
            ),
          )
        ],
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on Ubuntu 20.04.4 LTS 5.13.0-44-generic, locale en_US.UTF-8)
    • Flutter version 3.0.5 at /home/huynq/Documents/Working/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (2 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /home/huynq/Android/Sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /home/huynq/Documents/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.1)
    • Android Studio at /home/huynq/Documents/android-studio
    • Flutter plugin version 67.0.1
    • Dart plugin version 211.7817
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.64.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.4 LTS 5.13.0-44-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 101.0.4951.54

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

• No issues found!

[✓] Flutter (Channel master, 3.1.0-0.0.pre.1669, on Ubuntu 20.04.4 LTS 5.13.0-44-generic, locale en_US.UTF-8)
    • Flutter version 3.1.0-0.0.pre.1669 on channel master at /home/huynq/Documents/Working/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 30eba39bba (40 minutes ago), 2022-07-15 03:34:06 -0400
    • Engine revision 41351f4a2a
    • Dart version 2.18.0 (build 2.18.0-283.0.dev)
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /home/huynq/Android/Sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /home/huynq/Documents/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.1)
    • Android Studio at /home/huynq/Documents/android-studio
    • Flutter plugin version 67.0.1
    • Dart plugin version 211.7817
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.64.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.4 LTS 5.13.0-44-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 101.0.4951.54

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

• No issues found!

As far as I can see, you are using the old Flutter version 3.0.4, the latest Flutter stable is 3.0.5 and the master is 3.1.0-0.0.pre.1669. Please try upgrading them and retry to see if this issue still reproduces.

Hi,
Thank you for your response. I can reproduce it every time with the code above.  Can I gather more information for you?

Hi,
I have reproduced with V3.0.5 using the same code. It happens every time on my system.  I will see if I can reproduce on a second Linux system.

Hi,
I have reproduced with V3.0.5 using the same code. It happens every time on my system. I will see if I can reproduce on a second Linux system.

I have the same problem on my surface laptop. But it worked yesterday before I upgraded my flutter to the latest stable version.

Hi @johnosbb, @shihuayong, please try again on the latest master channel since there is a similar issue that was fixed recently: #100659

Tested with the latest master and could not reproduce the issue.
Flutter 3.1.0-9.0.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision f28e570c8c (5 weeks ago) • 2022-06-14 13:39:33 -0500
Engine • revision 74ee6b5afd
Tools • Dart 2.18.0 (build 2.18.0-165.1.beta) • DevTools 2.14.0

Tested with the latest master and could not reproduce the issue. Flutter 3.1.0-9.0.pre • channel beta • https://github.com/flutter/flutter.git Framework • revision f28e570 (5 weeks ago) • 2022-06-14 13:39:33 -0500 Engine • revision 74ee6b5afd Tools • Dart 2.18.0 (build 2.18.0-165.1.beta) • DevTools 2.14.0

@johnosbb Closing as fixed on the master channel. The fix should land on the stable channel in future releases.

authors: huycozy johnosbb shihuayong


text:
_CastError ScrollPosition.didUpdateScrollPositionBy

from this stack we can not detect which app page encount error. so we guess may be there is any issue with framework?
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.0, on macOS 11.6 20G165 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Connected device (3 available)

Hi @zjrwdl
Is this issue reproducible locally? If so, can you please share the output of flutter run -v and a completed and minimal reproducible code sample?
As far as I can see, you are using the old Flutter version 2.8.0, the latest Flutter stable is 3.0.5 and the master is 3.1.0. Please also try upgrading them and retry to see if this issue still reproduces.

Hi @zjrwdl Is this issue reproducible locally? If so, can you please share the output of flutter run -v and a completed and minimal reproducible code sample?
As far as I can see, you are using the old Flutter version 2.8.0, the latest Flutter stable is 3.0.5 and the master is 3.1.0. Please also try upgrading them and retry to see if this issue still reproduces.

sorry, we can not reproduce this issule locally.
we have upgrade flutter engine to 3.0.1 for our app which will be published in nex month until which  time we may confirm if this issule has been fixed.
thanks

Hey @zjrwdl, could you provide full crash log (see hint flutter_error_details from your screenshot) and list of affected devices?
(The log should be in the text format instead of a screenshot for better investigation)

Hi @zjrwdl
The information from the log above is not enough to investigate the issue. Do you see this issue when try running the project with release mode?

authors: huycozy zjrwdl


text:
StarBorder does not lerp to Oval

The new StarBorder has a genius 2-3 step lerp for most shapes, except Circle, where it works well except when eccentricity != 0. I think it was forgotten in the implementation, as Oval is only a few weeks old. I propose adding the 2-way lerp to circle, so oval works. cc @gspencergoog
Related: in the upcoming BoderSide.only PR (draft is here: https://github.com/bernaferrari/flutter/pull/3), which may or may not be accepted, Star -> Circle is the only lerp that doesn't work, as it draws a path all the time. The other shapes draw a path until 50%, then their shape until 100%, so lerp is good (not great, might need a few fixes). I see two potential solutions:

Add 2 step lerp for Oval (and eccentricity != 0).
Add 2 step lerp for all circles.

If you fix oval only, in a hypothetical future, we might need to do if (multiBorder) 2-step lerp for circle, which is also fine. Just telling you the plan.
https://user-images.githubusercontent.com/351125/182044760-fcee0bee-7463-4d29-a1fd-95be7aaf2bdd.mov
Simple sample:
StarBorder(
    side: BorderSide(color: Colors.yellow.withOpacity(0.5), width: 10),
).lerpTo(RoundedRectangleBorder(side: BorderSide(color: Colors.red.withOpacity(0.5), width: 10), 0.5)

I knew by the time I went to answer this, there would be a PR already. Nice work @gspencergoog! lol

Yes, seems like a great sample @maheshmnj.


text:
Error when running snapcraft command to create a snap

Steps to Reproduce

Execute the steps mentioned in the official docs to create a snap to upload to the snap store:
snapcraft.yaml:
name: batch-image-editor
version: 0.1.0
summary: Batch Image Editor
description: Basic image editor that can generate images using text from text files in batches.

confinement: strict
base: core18
grade: stable

slots:
  dbus-batch-image-editor:
    interface: dbus
    bus: session
    name: org.zlimits.batch_image_editor

apps:
  batch-image-editor:
    command: batch-image-editor
    extensions: [flutter-stable]
    plugs:
      - network
    slots:
      - dbus-batch-image-editor
parts:
  batch-image-editor:
    source: .
    plugin: flutter
    flutter-target: lib/main.dart

Expected results:
The snap should be built normally when I run snapcraft at the root of my project
Actual results:
Build fails with error

Logs

This error happens when the build fails
Failed to run 'flutter build linux --release -v -t lib/main.dart' for 'batch-image-editor': Exited with code 1.
Verify that the part is using the correct parameters and try again.

Going up a little bit in the logs I can see the original error:
[  +60 ms] executing: [build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64
/root/parts/batch-image-editor/build/linux
[ +119 ms] CMake Error at flutter/generated_plugins.cmake:16 (add_subdirectory):
[   +3 ms]   add_subdirectory given source
[        ]   "flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux" which is not
[        ]   an existing directory.
[        ] Call Stack (most recent call first):
[        ]   CMakeLists.txt:69 (include)
[        ] CMake Error at flutter/generated_plugins.cmake:16 (add_subdirectory):
[        ]   add_subdirectory given source
[        ]   "flutter/ephemeral/.plugin_symlinks/window_size/linux" which is not an
[        ]   existing directory.
[        ] Call Stack (most recent call first):
[        ]   CMakeLists.txt:69 (include)
[   +1 ms] -- Configuring incomplete, errors occurred!
[        ] See also "/root/parts/batch-image-editor/build/build/linux/x64/release/CMakeFiles/CMakeOutput.log".
[  +32 ms] Building Linux application... (completed in 202ms)
[        ] "flutter linux" took 1,827ms.
[   +8 ms] Unable to generate build files
[        ]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      _runCmake (package:flutter_tools/src/linux/build_linux.dart:155:5)
           <asynchronous suspension>
           #2      buildLinux (package:flutter_tools/src/linux/build_linux.dart:76:5)
           <asynchronous suspension>
           #3      BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:85:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>

Results of flutter doctor on my device:
[✓] Flutter (Channel stable, 3.3.1, on Ubuntu 22.04.1 LTS 5.15.0-47-generic, locale en_US.UTF-8)
    • Flutter version 3.3.1 on channel stable at /home/haidar/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4f9d92fbbd (8 days ago), 2022-09-06 17:54:53 -0700
    • Engine revision 3efdf03e73
    • Dart version 2.18.0
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /home/haidar/Android/Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /snap/android-studio/123/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[✓] Android Studio (version 2021.2)
    • Android Studio at /snap/android-studio/123/android-studio
    • Flutter plugin version 70.0.2
    • Dart plugin version 212.5744
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
    • IntelliJ at /snap/intellij-idea-ultimate/383
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

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

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.1 LTS 5.15.0-47-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 105.0.5195.125

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

• No issues found!

Flutter doctor inside the snap image gives:
[✓] Flutter (Channel stable, 3.3.2, on Ubuntu 18.04.6 LTS 5.15.0-47-generic, locale C.UTF-8)
    • Flutter version 3.3.2 on channel stable at /root/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (8 hours ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

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

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Ubuntu 18.04.6 LTS 5.15.0-47-generic

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

! Doctor found issues in 3 categories.

Hello @huycozy
I solved the issue by an endless loop of cleaning the original project and the generated project inside the snap image.
finally the snapcraft.yaml now looks like this:
name: batch-image-editor
version: 0.1.0
summary: Batch Image Editor
description: Basic image editor that can generate images using text from text files in batches.

confinement: strict
base: core18
grade: stable

slots:
  dbus-batch-image-editor:
    interface: dbus
    bus: session
    name: org.zlimits.batch_image_editor

apps:
  batch-image-editor:
    command: photo_editor
    extensions: [flutter-stable]
    plugs:
      - network
    slots:
      - dbus-batch-image-editor
parts:
  batch-image-editor:
    source: .
    plugin: flutter
    flutter-target: lib/main.dart

I don't know what the actual solution was tbh, but I ran these commands inside the snap image:
snapcraft clean
cd project
flutter clean
and I also ran flutter clean in the original project.


text:
enderBox was not laid out: RenderRepaintBoundary#9d14d relayoutBoundary=up3 NEEDS-PAINT 'package:flutter/src/rendering/box.dart': Failed assertion: line 1966 pos 12: 'hasSize'

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.

Hi,
When opening an issue, please try to provide all or some of the information indicated in the template.

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

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

Steps to Reproduce

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

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

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

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

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

Target Platform:
Target OS version/browser:
Devices:

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

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

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

Closing this issue, since relatively no information has been provided.
Thank you.


text:
[go_router] support popUntil

Is there an existing issue for this?

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

Use case
We should come up a way to do popUntil that matches the behavior of https://api.flutter.dev/flutter/widgets/Navigator/popUntil.html
The difficulty is then to come up with a reasonable predicate that fits the go_router.
Proposal
Come up with the api

Some ideas for predicatethat are thrown around.

bool(RouteMatch match)
bool(GoRoute route)
bool(GoRouteState state)

Hi , I coded a function popUtil , hope it can help you :
popUtil(context, page) {
    final router = GoRouter.of(context);
    final GoRouterDelegate delegate = router.routerDelegate;
    final routes = delegate.currentConfiguration.routes;
    for (var i = 0; i < routes.length; i++) {
      final route = routes[i] as GoRoute;
      if (route.name == page) break;
      GoRouter.of(context).pop();
    }
  }

Hello @dinhbathi2702! Thanks for your contribution. But my request actually covers the fact that popUntil doesn't allow anything to be returned to the underlienig views/contexts. This was requested and ignored/forgotten a long time ago (in the request I marked in my last post).
This is allowed by pop, but was never allowed by popUntil.

@dinhbathi2702, keep in mind that your code won't work if you use ShellRoute, because you are casting all routes to GoRoute, and ShellRoute is not a subclass of GoRoute, so the cast would fail.
I am not sure what would be the expected behavior if a ShellRoute is in the stack, as if it should be skipped or if it should be pop.

Until now, how to push and remove all previous route in go_router ?

Until now, how to push and delete all previous routes in go_router ?

You have two options:

Use the context.go method, which replaces the whole stack with a new route.
Manually pop until a specific route name; then push the new route. Similar to what @dinhbathi2702 does in their code example.

Hi, I optimize the popUntil above with ShellRoute usage.
extension GoRouterExt on GoRouter {
  void popUntilPath(String routePath) {
    List routeStacks = [...routerDelegate.currentConfiguration.routes];

    for (int i = routeStacks.length - 1; i >= 0; i--) {
      RouteBase route = routeStacks[i];
      if (route is GoRoute) {
        if (route.name == routePath) break;
        if (i != 0 && routeStacks[i - 1] is ShellRoute) {
          RouteMatchList matchList = routerDelegate.currentConfiguration;
          restore(matchList.remove(matchList.matches.last));
        } else {
          pop();
        }
      }
    }
  }
}

Hopefully, this would help~
void popUntil(String target) {
  final list = routerDelegate.currentConfiguration.routes.toList();

  for (final route in list.reversed) {
    if (route is GoRoute) {
      if (route.path == target || route.name == target) break;
      if (!canPop()) break;
      pop();
    }

    if (list.elementAt(list.indexOf(route) - 1) is ShellRoute) {
      routerDelegate.currentConfiguration.matches.removeLast();
    }
  }
}

It's been a while, perhaps, the following will help.
void popUntil({required bool Function(GoRoute route) predicate}) {
    var routes = routerDelegate.currentConfiguration.routes;
    var route = routerDelegate.currentConfiguration.routes.last;

    while (routerDelegate.canPop()) {
        final cIndex = routes.indexOf(route);

        if (routes.elementAt(cIndex - 1) is ShellRoute) {
            routerDelegate.currentConfiguration.matches.removeLast();
        }

        if (route is GoRoute) {
            if (predicate(route)) break;
            if (!routerDelegate.canPop()) break;
            routerDelegate.pop();
        }

        routes = routerDelegate.currentConfiguration.routes;
        route = routes.last;
    }
}

到目前为止，如何推送和删除 go_router 中所有以前的路由？

您有两个选择：

使用该context.go方法，用新路由替换整个堆栈。
手动pop直至指定路线name；然后是push新路线。类似于什么@dinhbathi2702在他们的代码示例中做了。

@miquelbeltran  Using the GoRouter approach is not ideal as it recreates a new stack. If the navigated page already exists, it is destroyed and recreated.

Hi All!
@cailirl980519 Does your current solution work for dialogs?

Is that a to just remove instead of pop?
When I try replace and then pop it will have pop animation, which looks so weird.
The animation also happens if I do context.goNamed("/someRoute")

It's been a while, perhaps, the following will help.
void popUntil({required bool Function(GoRoute route) predicate}) {
    var routes = routerDelegate.currentConfiguration.routes;
    var route = routerDelegate.currentConfiguration.routes.last;

    while (routerDelegate.canPop()) {
        final cIndex = routes.indexOf(route);

        if (routes.elementAt(cIndex - 1) is ShellRoute) {
            routerDelegate.currentConfiguration.matches.removeLast();
        }

        if (route is GoRoute) {
            if (predicate(route)) break;
            if (!routerDelegate.canPop()) break;
            routerDelegate.pop();
        }

        routes = routerDelegate.currentConfiguration.routes;
        route = routes.last;
    }
}

I personally really need this.

`void popUntil(bool Function(Route) predicate) {
final routerDelegate = _router.routerDelegate;
var matches = routerDelegate.currentConfiguration.matches;
while (_router.canPop()) {
  final routeMatch = matches.last;

  if (routeMatch.route is ShellRouteBase) {
    routerDelegate.currentConfiguration =
        routerDelegate.currentConfiguration.remove(routeMatch);
    matches = routerDelegate.currentConfiguration.matches;
    continue;
  }

  if (routeMatch.route is GoRoute) {
    final goRoute = routeMatch.route as GoRoute;

    final routeMatchList = RouteMatchList(
      matches: matches,
      uri: routerDelegate.currentConfiguration.uri,
      pathParameters: routerDelegate.currentConfiguration.pathParameters,
    );

    final flutterRoute = MaterialPageRoute(
      settings: RouteSettings(name: routeMatch.matchedLocation),
      builder: (context) => goRoute.builder!(
        context,
        routeMatch.buildState(_router.configuration, routeMatchList),
      ),
    );

    if (predicate(flutterRoute)) break;
    if (!routerDelegate.canPop()) break;

    routerDelegate.pop();
  }

  matches = routerDelegate.currentConfiguration.matches;
}

}`


text:
Building android widgets in flutter

I wasn't sure if the Flutter team regularly checks Stackoverflow, so here's a link:
https://stackoverflow.com/questions/47504574/can-we-build-android-widgets-in-flutter
Feel free to close the issue if this was inappropriate, sorry about that.

Well you do check stackoverflow as reported in your faq, so I'll close this issue now :)


text:
onPressed event being sent to the wrong button in a Stack

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

Compile the code sample below, and run in the Android emulator.
Observe that you can click on the up or down arrows at the top right or bottom right respectively, when the scrollable area is not scrolled to its full minimum or maximum extent. Each time you click on an arrow, the console will tell you whether you clicked on the up arrow or the down arrow.
Scroll down a bit, then click multiple times in quick succession on the up arrow. The scroll position will animate to the top of the scrollable area, then it will jump down one scroll increment, then it will jump up again. When this happens, the console will tell you you clicked on the down arrow when the view scrolls in the wrong direction, when actually the whole time you have only been clicking on the up arrow. The event is actually sent to the wrong button.
Scrolling in the wrong direction only happens when the view animates to the very top of the scrollable area (when the up arrow is supposed to be hidden), and then you click the button again within a short period of time.
The erroneous scrolling only happens on the up arrow, not the down arrow.

Expected results
There should be no "bounce-back" at the top of the list. But more importantly, clicking the up arrow should only send onPressed events to the up arrow, not to the down arrow.
Actual results
As above.
Note in the video below that you can see the touch area around the down arrow lighting up after the up arrow is clicked, which it should not do, because the up-arrow touch event is far outside the touchable range of the down arrow.
Probably this is some weird interaction between buttons and Stack?
Code sample
Code sample
import 'package:flutter/material.dart';

const loremIpsum =
    'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
    'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim '
    'veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea '
    'commodo consequat. Duis aute irure dolor in reprehenderit in voluptate '
    'velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint '
    'occaecat cupidatat non proident, sunt in culpa qui officia deserunt '
    'mollit anim id est laborum.';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter bug',
      home: SafeArea(
        child: Center(
            child: SizedBox(
          width: 200,
          height: 300,
          child: ScrollableWithIndicators(
              child: Text(
            loremIpsum * 5,
            style: const TextStyle(
              fontSize: 12,
              color: Colors.blue,
              decoration: TextDecoration.none,
            ),
          )),
        )),
      ),
    );
  }
}

/// Widget that wraps a [SingleChildScrollView], and displays up/down scroll
/// arrows if area is not scrolled all the way to the beginning or end of the
/// scrollable range.
class ScrollableWithIndicators extends StatefulWidget {
  final Widget child;
  const ScrollableWithIndicators({
    Key? key,
    required this.child,
  }) : super(key: key);

  @override
  State<ScrollableWithIndicators> createState() =>
      _ScrollableWithIndicatorsState();
}

class _ScrollableWithIndicatorsState extends State<ScrollableWithIndicators> {
  late ScrollController _scrollController;
  bool _downArrow = false;
  bool _upArrow = false;
  int _animateDepth = 0;
  double _animateTarget = 0.0;
  static const double _animateStepSize = 250.0;
  static const int _animateDuration = 250;

  @override
  void initState() {
    super.initState();
    _scrollController = ScrollController();
    _scrollController.addListener(_updateScrollArrows);
    // Update the scroll arrows after first layout
    WidgetsBinding.instance.addPostFrameCallback((_) => _updateScrollArrows());
  }

  @override
  void dispose() {
    _scrollController.dispose();
    super.dispose();
  }

  void _updateScrollArrows() {
    final upArrowNew = _scrollController.position.hasContentDimensions &&
        _scrollController.position.extentBefore > 6;
    final downArrowNew = _scrollController.position.hasContentDimensions &&
        _scrollController.position.extentAfter > 6;
    if (upArrowNew != _upArrow || downArrowNew != _downArrow) {
      setState(() {
        _downArrow = downArrowNew;
        _upArrow = upArrowNew;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        SingleChildScrollView(
          controller: _scrollController,
          child: widget.child,
        ),
        Builder(
          builder: (context) {
            return Stack(
              children: [
                if (_upArrow) _scrollArrow(true),
                if (_downArrow) _scrollArrow(false),
              ],
            );
          },
        ),
      ],
    );
  }

  Widget _scrollArrow(bool isUp) => Positioned.fill(
        child: Align(
          alignment: isUp ? Alignment.topRight : Alignment.bottomRight,
          child: Padding(
            padding: isUp
                ? const EdgeInsets.only(top: 8, right: 8)
                : const EdgeInsets.only(bottom: 8, right: 8),
            child: SizedBox(
              width: 40,
              height: 40,
              child: ElevatedButton(
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.blueGrey.withAlpha(15),
                  foregroundColor: Colors.white,
                  padding: const EdgeInsets.all(0),
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(40),
                  ),
                ),
                child: Icon(isUp ? Icons.arrow_upward : Icons.arrow_downward),
                onPressed: () async {
                  print(isUp
                      ? "*** Up button clicked"
                      : "*** Down button clicked");
                  // If button is pressed while an animation is
                  // running, base new target on current target,
                  // not on current scroll position
                  final newAnimateTarget = (_animateDepth > 0
                          ? _animateTarget
                          : _scrollController.position.pixels) +
                      _animateStepSize * (isUp ? -1 : 1);
                  // Clamp to min/max extent, to prevent bounce on
                  // multiple button presses in quick succession
                  _animateTarget = newAnimateTarget.clamp(
                      _scrollController.position.minScrollExtent,
                      _scrollController.position.maxScrollExtent);
                  // Figure out how much the animation wanted
                  // to overshoot by, and shorten the animation
                  // if necessary so that it is not slow when it
                  // is only scrolling a short distance
                  final overshootAmount =
                      (_animateTarget - newAnimateTarget).abs();
                  final animateDuration =
                      (((_animateStepSize - overshootAmount) / _animateStepSize)
                                  .clamp(0, 1) *
                              _animateDuration)
                          .toInt()
                          .clamp(50, _animateDuration);
                  // Keep track of animation depth, to handle case
                  // where button is pressed while an animation is
                  // still running
                  _animateDepth++;
                  await _scrollController.animateTo(_animateTarget,
                      duration: Duration(milliseconds: animateDuration),
                      curve: Curves.easeIn);
                  _animateDepth--;
                },
              ),
            ),
          ),
        ),
      );
}

Screenshots or Video

Screenshots / Video demonstration
As you can see, the second time I tried to replicate the behavior, it took a handful of attempts to see the "bounce".
https://github.com/flutter/flutter/assets/811305/52af799d-1405-4307-b5e7-a8eec245d244

Logs
Logs
N/A

Flutter Doctor output
Doctor output
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.10.6, on Fedora Linux 38 (Workstation Edition) 6.4.6-200.fc38.x86_64, locale en_US.utf8)
    • Flutter version 3.10.6 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (4 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-UpsideDownCake, build-tools 33.0.1
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

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

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6 (Fedora 16.0.6-2.fc38)
    • cmake version 3.27.1
    • ninja version 1.11.1
    • pkg-config version 1.8.0

[✓] Android Studio (version 2022.2)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 73.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (3 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Linux (desktop)            • linux         • linux-x64      • Fedora Linux 38 (Workstation Edition) 6.4.6-200.fc38.x86_64
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 115.0.5790.110

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

• No issues found!

changing
            return Stack(
              children: [
                if (_upArrow) _scrollArrow(true),
                if (_downArrow) _scrollArrow(false),
              ],
            );

to
            return Stack(
              children: [
                Visibility(visible: _upArrow, child: _scrollArrow(true)),
                Visibility(visible: _downArrow, child: _scrollArrow(false)),
              ],
            );

solves the problem -- it's not possible to get a "bounce" at the top of the list, with a click on the up arrow being sent to the down arrow. So this seems to be a problem with Stack sending events to the widget in the wrong layer, if a layer suddenly disappears in a given frame.
However, Stack doesn't apparently like Visibility either: it stops Positioned.fill from working. See the video below, when the down arrow is hidden, the up arrow jumps to the top left. And when the up arrow is hidden, both arrows are shown over the top of each other at top left. The arrows shown at top left do not even accept touch events.
https://github.com/flutter/flutter/assets/811305/3860fc85-610c-4f3d-9ec0-9375895736b3

The full fix for this is to leave both layering and visibility in-place (since both seem broken!), and to change
            return Stack(
              children: [
                if (_upArrow) _scrollArrow(true),
                if (_downArrow) _scrollArrow(false),
              ],
            );
//...
  Widget _scrollArrow(bool isUp) => Positioned.fill(
        child: Align(
          alignment: isUp ? Alignment.topRight : Alignment.bottomRight,
          child: Padding(
//...

to
                  return Stack(
                    children: [
                      _scrollArrow(isUp: true, enabled: _upArrow),
                      _scrollArrow(isUp: false, enabled: _downArrow),
                    ],
                  );
//...
  Widget _scrollArrow({required bool isUp, required bool enabled}) =>
      Positioned.fill(
        child: Align(
          alignment: isUp ? Alignment.topRight : Alignment.bottomRight,
          child: !enabled
              ? Container()
              : Padding(
//...

Thanks for the detailed report @lukehutch
I ran your code sample using latest stable on Android emulator, but didn't observe the down arrow button being highlighted while tapping on up arrow button. Although I probably observed vice-versa, ie, up arrow button being highlighted upon tapping down arrow button but that was when it reached at the bottom of the screen.
https://github.com/flutter/flutter/assets/67046386/2c028e28-faff-42c1-8ca0-4d5a5f2c4638
If you wrap the scrollable area with GestureDetector and use behavior property and then run your scenario to see if it helps further to check what's going on with the wrong buttons or down arrow being getting highlighted ?

@darshankawar I definitely see the down arrow flashing sometimes when you click the up arrow, in your video.
To reproduce the bounce though, you have to quickly click the up arrow several times, including before and after the text scrolls to the top. This is easiest if you manually drag the content to a random position before you start clicking.
I tried wrapping the ElevatedButton in a GestureDetector, but no setting of behavior had any effect, and the GestureDectector's onTap method was never called.

Thanks for the update. After revisiting the scroll up and down and doing it rather quickly, I do see the bounce effect and also the down arrow being highlighted sometimes while up arrow is being tapped.

 stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.10.6, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.10.6 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 f468f3366c (5 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.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.14.0-3.0.pre.33, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.14.0-3.0.pre.33 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 dd4c8d9f09 (81 minutes ago), 2023-08-10 23:33:30 -0400
    • Engine revision acd1bc5536
    • Dart version 3.2.0 (build 3.2.0-58.0.dev)
    • DevTools version 2.26.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.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

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

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

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

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

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

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

! Doctor found issues in 1 category.

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

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

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

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

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

! Doctor found issues in 1 category.

Great, glad you can repro.
I assume this is a race condition of some sort. The reason the bounce only happens in the upwards direction is presumably because the up arrow is the first item in the stack when it is shown, but it may disappear in a given build, moving the down arrow to the first position in the stack. The event (received before the build) is presumably being routed based on the layer index at the time of the button click, or something to that effect.

I wonder if this is a problem where the framework updates an element with the "wrong" widget. Does the problem go away if you provide keys to the buttons, e.g. change it to:
  Widget _scrollArrow(bool isUp) => Positioned.fill(
        key: ValueKey(isUp), // NEW
        child: Align(

@goderbauer Brilliant -- yes, with that change, I never see the wrong arrow highlighted, and I can't replicate the bounce effect.

Ok, perfect. This is working as intended then. The framework logic is matching new widgets with existing elements and needs the help of some keys to get it right here. Adding keys as shown in the example above is the right (and expected) thing to do here.

@goderbauer I don't understand. How is it ever the right thing to do to send events to a widget that is far from the actual click event location? I don't think this is a good default behavior.

@darshankawar @goderbauer I don't think this issue should have been closed. There's a real problem here still. Tap events should never be sent to a widget that is nowhere near the tap coordinates.

authors: darshankawar goderbauer lukehutch