auto_route_library
auto_route_library copied to clipboard
App crashes when trying to navigate from modal, which is animating.
When I try to navigate by clicking a button in modal, which is still animating, the navigation throws an Exception. If animation has stopped, everything works fine.
Video demonstration
Code sample
import 'package:auto_route/annotations.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
part 'router.gr.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
routerConfig: AppRouter().config(),
);
}
}
@RoutePage()
class First1Page extends StatelessWidget {
const First1Page({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Align(
alignment: Alignment.bottomCenter,
child: FilledButton(
onPressed: () {
context.pushRoute(Modal1Route());
},
child: const Text("Test")),
));
}
}
@RoutePage()
class Modal1Page extends StatelessWidget {
const Modal1Page({super.key});
@override
Widget build(BuildContext context) {
return Column(mainAxisSize: MainAxisSize.min, children: [
SizedBox(
height: 64,
),
SizedBox(
width: double.infinity,
child: FilledButton(
onPressed: () {
context.router.popAndPush(const First1Route());
},
child: const Text("Test")),
),
]);
}
}
@AutoRouterConfig(
replaceInRouteName: "Page,Route",
)
class AppRouter extends _$AppRouter {
@override
RouteType get defaultRouteType => const RouteType.adaptive();
@override
// ignore: long-method
List<AutoRoute> get routes => [
AutoRoute(path: "/", page: First1Route.page),
CustomRoute(
path: "/",
page: Modal1Route.page,
customRouteBuilder: _modalSheetBuilder,
),
];
}
Route<T> _modalSheetBuilder<T>(
BuildContext _,
Widget child,
AutoRoutePage<T> page,
) {
return ModalBottomSheetRoute(
settings: page,
builder: (context) => child,
isScrollControlled: true,
);
}
Logs
======== Exception caught by widgets library =======================================================
The following assertion was thrown building AutoRouteNavigator(dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#c1ec7]], state: AutoRouteNavigatorState#190d0):
'package:flutter/src/widgets/framework.dart': Failed assertion: line 6764 pos 12: 'renderObject.child == child': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///C:/Users/kkras/AndroidStudioProjects/testing/lib/router.dart:16:24
When the exception was thrown, this was the stack:
#2 SingleChildRenderObjectElement.removeRenderObjectChild (package:flutter/src/widgets/framework.dart:6764:12)
#3 RenderObjectElement.detachRenderObject (package:flutter/src/widgets/framework.dart:6579:37)
#4 Element.deactivateChild (package:flutter/src/widgets/framework.dart:4367:11)
#5 Element.updateChild (package:flutter/src/widgets/framework.dart:3826:9)
#6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#7 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#8 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#9 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#10 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#11 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#12 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#13 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#14 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#15 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#16 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#17 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#18 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#20 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#21 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#22 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#23 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#24 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#25 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#26 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#30 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#31 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#32 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#33 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#34 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#35 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#36 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#37 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#38 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#39 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#40 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#42 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#43 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#44 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#45 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#46 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#47 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#48 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#49 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#50 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#51 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#52 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#53 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#54 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#55 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#56 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#57 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#58 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#59 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#60 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#61 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#62 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#63 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#64 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#65 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#66 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#67 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#68 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#69 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#70 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#71 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#72 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#73 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#74 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#75 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#76 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#77 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#78 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#79 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#80 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#81 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#82 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#83 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#84 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#85 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#86 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#87 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#88 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#89 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#90 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#91 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#92 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#93 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#94 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#95 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#96 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#97 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#98 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#99 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#100 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#101 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#102 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#103 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#104 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#105 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#106 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#107 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#108 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#109 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#110 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#111 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#112 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#113 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#114 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#115 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#116 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#117 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#118 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#119 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#120 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#121 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#122 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#123 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#124 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#125 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#126 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#127 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#128 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#129 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#130 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#131 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#132 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#133 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#134 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#135 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#136 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#137 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#138 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#139 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#140 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#141 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#142 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#143 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#144 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#145 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#146 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#147 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#148 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#149 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#150 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#151 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#152 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#153 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#154 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#155 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#156 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#157 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#158 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#159 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#160 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#161 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#162 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#163 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#164 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#165 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#166 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#167 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#168 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#169 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#170 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#171 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#172 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#173 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#174 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#175 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#176 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#177 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#178 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#179 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#180 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#181 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#182 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#183 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#184 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#185 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#186 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#187 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#188 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#189 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#190 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#191 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#192 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#193 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#194 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#195 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
#196 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#197 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#198 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#199 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#200 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#201 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#202 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#203 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#204 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#205 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#206 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#207 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#208 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#209 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#210 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#211 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#212 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#213 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#214 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#215 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#216 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#217 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#218 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#219 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#220 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#221 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#222 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#223 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#224 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#225 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#226 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#227 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#228 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#229 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#230 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#231 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#232 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#233 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#234 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#235 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#236 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#237 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#238 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#239 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#240 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#241 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#242 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#243 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#244 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#245 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#246 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#247 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#248 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#249 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#250 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
#251 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#252 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#253 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#254 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#255 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#256 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#257 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#258 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#259 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#260 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#261 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#262 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#263 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#264 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#265 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#266 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#267 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#268 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
#269 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#270 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#271 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
#272 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#273 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
#274 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
#275 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
#276 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
#277 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2895:19)
#278 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:984:21)
#279 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
#280 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
#281 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9)
#282 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:978:7)
#286 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(elided 5 frames from class _AssertionError, class _Timer, and dart:async-patch)
====================================================================================================
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Tried to build dirty widget in the wrong build scope.
A widget which was marked as dirty and is still active was scheduled to be built, but the current build scope unexpectedly does not contain that widget.
Sometimes this is detected when an element is removed from the widget tree, but the element somehow did not get marked as inactive. In that case, it might be caused by an ancestor element failing to implement visitChildren correctly, thus preventing some or all of its descendants from being correctly deactivated.
The root of the build scope was: [root]
The offending element (which does not appear to be a descendant of the root of the build scope) was: ErrorWidget-[#ba17f]
message: Bad state: Future already completed
See also: https://flutter.dev/docs/testing/errors
dirty
renderObject: RenderErrorBox#0c5d3 NEEDS-LAYOUT NEEDS-PAINT DETACHED
When the exception was thrown, this was the stack:
#0 BuildOwner.buildScope.<anonymous closure> (package:flutter/src/widgets/framework.dart:2854:13)
#1 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2879:10)
#2 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:984:21)
#3 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
#4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
#5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9)
#6 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:978:7)
#10 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(elided 3 frames from class _Timer and dart:async-patch)
====================================================================================================
======== Exception caught by widget library ========================================================
The following assertion was thrown:
A HeroController can not be shared by multiple Navigators. The Navigators that share the same HeroController are:
- NavigatorState#5e83f(tickers: tracking 1 ticker)
- NavigatorState#9584a(tickers: tracking 5 tickers)
Please create a HeroControllerScope for each Navigator or use a HeroControllerScope.none to prevent subtree from receiving a HeroController.
When the exception was thrown, this was the stack:
#0 NavigatorState._updateHeroController.<anonymous closure>.<anonymous closure> (package:flutter/src/widgets/navigator.dart:3716:41)
#1 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
#2 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1264:9)
#3 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1113:5)
#4 _invoke (dart:ui/hooks.dart:312:13)
#5 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:383:5)
#6 _drawFrame (dart:ui/hooks.dart:283:31)
====================================================================================================
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Tried to build dirty widget in the wrong build scope.
A widget which was marked as dirty and is still active was scheduled to be built, but the current build scope unexpectedly does not contain that widget.
Sometimes this is detected when an element is removed from the widget tree, but the element somehow did not get marked as inactive. In that case, it might be caused by an ancestor element failing to implement visitChildren correctly, thus preventing some or all of its descendants from being correctly deactivated.
The root of the build scope was: [root]
The offending element (which does not appear to be a descendant of the root of the build scope) was: _FocusInheritedScope
dirty
When the exception was thrown, this was the stack:
#0 BuildOwner.buildScope.<anonymous closure> (package:flutter/src/widgets/framework.dart:2854:13)
#1 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2879:10)
#2 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:984:21)
#3 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
#4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
#5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9)
#6 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1113:5)
#7 _invoke (dart:ui/hooks.dart:312:13)
#8 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:383:5)
#9 _drawFrame (dart:ui/hooks.dart:283:31)
====================================================================================================
Using replaceRoute
instead of popAndPush
seems to fix the issue.