Simultaneous Button Taps Trigger Multiple Navigation Events in GoRouter

Steps to reproduce

Set up GoRouter with two routes:
Define two screens (ScreenA and ScreenB).
Add the routes for these screens to your GoRouter configuration.

Create a screen with two buttons:
Place two buttons (ButtonA and ButtonB) on the same screen.
Each button should navigate to a different screen using GoRouter.go().

Simulate simultaneous button presses:
Run the app and navigate to the screen with the buttons.
Tap both buttons at the same time.

Expected results
When two buttons are tapped simultaneously:
Only the navigation event for the button tapped first should be processed.
The second navigation event should be ignored, ensuring only one new screen is opened.
This behavior aligns with how Navigator 1.0 handles simultaneous navigation requests.
Actual results
Both navigation events are processed, and two screens are pushed onto the stack, resulting in unintended behavior.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

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

class MyApp extends StatelessWidget {
  final GoRouter _router = GoRouter(
    routes: [
      GoRoute(
        path: '/',
        builder: (context, state) => HomeScreen(),
      ),
      GoRoute(
        path: '/screenA',
        builder: (context, state) => ScreenA(),
      ),
      GoRoute(
        path: '/screenB',
        builder: (context, state) => ScreenB(),
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: _router,
    );
  }
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Home')),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () => GoRouter.of(context).go('/screenA'),
            child: Text('Go to Screen A'),
          ),
          ElevatedButton(
            onPressed: () => GoRouter.of(context).go('/screenB'),
            child: Text('Go to Screen B'),
          ),
        ],
      ),
    );
  }
}

class ScreenA extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Screen A')),
      body: Center(child: Text('Welcome to Screen A')),
    );
  }
}

class ScreenB extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Screen B')),
      body: Center(child: Text('Welcome to Screen B')),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
[Paste your output here]

Hi @ibragimov05, Thanks for filing the issue. I am able to reproduce the issue with latest version of the go router package simultaneous taps pushes both routes on to the stack, this is true for both cotext.go and context.push

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

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

class MyApp extends StatelessWidget {
  final GoRouter _router = GoRouter(
    routes: [
      GoRoute(
        path: '/',
        builder: (context, state) => HomeScreen(),
      ),
      GoRoute(
        path: '/screenA',
        builder: (context, state) => ScreenA(),
      ),
      GoRoute(
        path: '/screenB',
        builder: (context, state) => ScreenB(),
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: _router,
    );
  }
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Home')),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () => context.push('/screenA'),
            child: Text('Go to Screen A'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/screenB'),
            child: Text('Go to Screen B'),
          ),
        ],
      ),
    );
  }
}

class ScreenA extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          leading: BackButton(
            onPressed: () {
              context.pop();
            },
          ),
          title: const Text('Screen A')),
      body: const Center(child: Text('Welcome to Screen A')),
    );
  }
}

class ScreenB extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          leading: BackButton(onPressed: () {
            context.pop();
          }),
          title: const Text('Screen B')),
      body: const Center(child: Text('Welcome to Screen B')),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
    • Flutter version 3.27.0 on channel stable at /Users/mahesh/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8495dee1fd (7 days ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.16.2

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

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

[✓] 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.94.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.100.0

[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 15.1.1 24B2091
      darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 15.1.1 24B2091
      darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome
      128.0.6613.85

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

• No issues found!

[!] Flutter (Channel master, 3.28.0-1.0.pre.123, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
    • Flutter version 3.28.0-1.0.pre.123 on channel master at /Users/mahesh/Development/flutter_master
    • Framework revision a547c7f050 (4 days ago), 2024-12-13 22:11:39 -0500
    • Engine revision 4e4a430bcd
    • Dart version 3.7.0 (build 3.7.0-243.0.dev)
    • DevTools version 2.41.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use
      "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.16.2

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

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

[✓] 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.94.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.100.0

[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 15.1.1 24B2091
      darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 15.1.1 24B2091
      darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome
      128.0.6613.85

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

! Doctor found issues in 1 category.


怎么给所有叶子节点加图标?

Sorry, google translate did not give me enough to understand the question. Please ask in English.

How to add icons to all leaf nodes? Thank answer


Minimal access should be used for storage account creation

What happened?
We checked with Azure support and confirmed that "Microsoft.Storage/storageAccounts/listKeys/action" access is not needed when creating Storage account.
But using a custom role without this access make provider complained about lack of this access.
How can we reproduce it?
Use Azure custom role with below permissions when creating Storage Account .  It could work direclty in Azure UI.
But report error via the provider
   {
      "actions": [
        "Microsoft.Authorization/*/read",
        "Microsoft.Insights/alertRules/*",
        "Microsoft.Insights/diagnosticSettings/*",
        "Microsoft.Network/virtualNetworks/read",
        "Microsoft.ResourceHealth/availabilityStatuses/read",
        "Microsoft.Resources/deployments/*",
        "Microsoft.Resources/subscriptions/resourceGroups/read",
        "Microsoft.Storage/storageAccounts/write",
        "Microsoft.Storage/storageAccounts/delete",
        "Microsoft.Storage/storageAccounts/read",
        "Microsoft.Storage/storageAccounts/blobServices/read",
        "Microsoft.Storage/storageAccounts/blobServices/write",
        "Microsoft.Storage/storageAccounts/fileServices/read",
        "Microsoft.Storage/storageAccounts/fileservices/write",
        "Microsoft.Support/*"
      ],
      "condition": null,
      "conditionVersion": null,
      "dataActions": [],
      "notActions": [],
      "notDataActions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/*"
      ]
    }

Error details:
- lastTransitionTime: "2024-01-22T04:55:49Z"
    message: 'observe failed: cannot run refresh: refresh failed: building Queues
      Client: retrieving Account Key: Listing Keys for Storage Account "xxxxxxxxxxxxxxxxxx"
      (Resource Group "xxxxxxxxxxxxxxx"): storage.AccountsClient#ListKeys: Failure
      responding to request: StatusCode=403 -- Original Error: autorest/azure: Service
      returned an error. Status=403 Code="AuthorizationFailed" Message="The client
      ''xxxxxxxxxxxxxxxxx'' with object id ''xxxxxxxxxxxxxxxxx'
      does not have authorization to perform action ''Microsoft.Storage/storageAccounts/listKeys/action''
      over scope ''/xxxxxxxxxxxxx''
      or the scope is invalid. If access was recently granted, please refresh your
      credentials.": '
    reason: ReconcileError
    status: "False"
    type: Synced
  - lastTransitionTime: "2023-12-26T05:40:04Z"
    reason: Success
    status: "True"
    type: LastAsyncOperation
  - lastTransitionTime: "2023-12-26T05:40:04Z"
    reason: Finished
    status: "True"
    type: AsyncOperation

What environment did it happen in?

Crossplane Version: 1.12.2
Provider Version: 0.33.0
Kubernetes Version: 1.26.9
Kubernetes Distribution: AKS

/fresh

/fresh

@jonathanzhang02, please add /fresh.

/refresh

/refresh


Support for MAUI

Any chance someone has updated this library to .NET 6 and supporting .NET MAUI (net6.0-android and net6.0-ios)? Is this on the roadmap at all @framinosona?
We've made an attempt at rewriting some of the binding library to handle this on Android in MAUI (and it works!) but we can't get the iOS version working (crashes out when starting the flashing process DFUInstall). We're not iOS developers so are a little out of our depth on it. Any help appreciated!

Are you able to share what you've accomplished so far.  I'm looking into rewriting this Library myself and would love to see what you've learned here and possibly collaborate on a new library.

Hey @turbo25mike. Sounds good -- I can share what we have so far. Basically just taken the code and shifted it to .NET 6.0 project type and then dealt with anything that broke. For some reason we can't say the same for the iOS version which is just throwing some exceptions as soon as we try to start it and we just can't figure it out. Do you have any experience in iOS binding libraries?

@baddinosaur-kyle I am more of a .NET developer but I'm willing to work with you on this.  I need this working so it's a high priority for me.  I see you forked this but don't see any changes.   Are you planning on making changes in your repo?

@turbo25mike yup, my changes are on 'develop' -- the main branch was behind so decided to fork from there instead as that's where we got it to work. Our hardware to test against is unfortunately out of action for the next few days whilst we wait on a part so I haven't been able to test it (or the Android version since I created this new branch).

@turbo25mike this is the error we're getting on builds for iOS when we're referencing the nuget package we're building with this library, in our app -- this happens at compile time. We used to actually be able to run the app but then it fell over when it was asked to start the firmware flash. Not too sure what this means and can't find many threads to pull on from the internet. We compiled the framework files (IOSDFU and ZipFoundation) via Carthage on a Mac, and grabbed the arm64 framework files so not sure why it wouldn't like them now... only other things that have changed are Xcode versions, of course. All these changes are pushed to develop.

Any news about support for MAUI ??
Do you know a workaround solution that I can use for Nordic device firmware update on MAUI?

@MouratidisA we have it working on our .NET 7 MAUI app for both iOS and Android. It was a few months ago but if I remember right we just did it from source rather than nuget as that was the only way to get it to work on iOS. We installed the dependencies on our Macbook (sharpie and anything else it needs from brew). Changed the target to .NET 7. Then set the flags in the csproj to download native files and to build with sharpie (they're near the top). We referenced the library from our MAUI project and I don't think there was much else to it...


New event view (twig)

Hi everybody
I made a new event like CalendarEvent. There is an option like below in CalendarEvent entity config:
          "reminder"={               "reminder_template_name"="calendar_reminder",               "reminder_flash_template_identifier"="calendar_event_template"           },
calendar_reminder and calendar_event_template are twigs. How can I make my own twig and show the new event with that view?
Thanks in advance,
Farzam

Hi
calendar_reminder is email template, you can modify it in System -> Emails -> Templates.
calendar_event_template you can override by creating file with the same path. (YourBundle/Resources/views/CalendarEvent/reminderTemplate.html.twig) Here i described how to override.

I'm closing the issue because it has no activity. Feel free open it if you have any question.