Closed rlee1990 closed 1 month ago
Thanks for this repro example, I already played around with it!
I already know that the key key [<'/'>]
ends up twice in Navigator.pages
causing the crash. But I don't know why.
I'm unfamiliar with DuckRouter
. I also don't see any active navigation code in your example. This leads me to belive it might be a bug in DuckRouter
not handling nested navigation well.
I'm very familiar with GoRouter, could you push your go_router solution into a separate branch in the example?
@passsy I will do that. Also the router.dart page is where my navigation code and also the navigate to the help page happens in the DrawerView page. I will let you know once the go router branch is up.
I was able to reduce your code to this tiny repro example. I can assure you that the bug is within duck_router
, not in your code. I'll create an issue.
import 'package:duck_router/duck_router.dart';
import 'package:flutter/material.dart';
import 'package:wiredash/wiredash.dart';
void main() {
runApp(const MyApp());
}
class HomeLocation extends Location {
@override
String get path => 'home';
@override
LocationBuilder? get builder => (context) => const Home();
}
class Home extends StatefulWidget {
const Home({super.key});
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () {
Wiredash.of(context).show();
},
child: Text('Feedback'),
),
),
);
}
}
final router = DuckRouter(initialLocation: HomeLocation());
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return Wiredash(
projectId: '',
secret: '',
child: MaterialApp.router(
title: 'Flutter Demo',
routerConfig: router,
),
);
}
}
Thanks @passsy I redid GoRouter and it is working. I will follow up with Duckrouter. I might have to use GoRouter. I was trying to avoid it
I'll close it because it is not actionable from the wiredash side.
Thanks again for reaching out!
@rlee1990 This is fixed in duck_router 5.1.3 thanks to @passsy's detailed bug report!
@JaspervanRiet Thank you
Describe the bug I am using DuckRouter. When I select the button to show the feedback window I get a navigator error. I also have the same issue using AutoRouter or go Router.
Stacktrace
Wiredash SDK Info version 2.2.2 iOS, Android, Web
Flutter SDK
Screenshots I created this simple repo that shows the issue. Repo