আমি রুট দিয়ে এক স্ক্রিন থেকে অন্য স্ক্রিনে নেভিগেট করার চেষ্টা করছি। আমি যখন পৃষ্ঠাটিতে রুটটিতে সরানোর জন্য বোতামটি চাপি তখন আমি ত্রুটি পাই
I/flutter ( 8790): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
কোডটি এখানে:
রুট:
<String, WidgetBuilder>{
'/first':(BuildContext context) =>NavigatorOne() ,
'/second':(BuildContext context) =>NavigatorTwo(),
'/third':(BuildContext context) =>NavigatorThree(),
},
Navigator.of(context).pushNamed('/first');
Navigator.of(context).pushNamed('/second');
Navigator.of(context).pushNamed('/third');
class NavigatorOne extends StatefulWidget {
@override
_NavigatorOneState createState() => _NavigatorOneState();
}
class _NavigatorOneState extends State<NavigatorOne> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(
color: Colors.green,
child: RaisedButton(child: Text(' one 1'),onPressed: (){
Navigator.of(context).pushNamed('/second');
},),
),
);
}
}
এবং ত্রুটি:
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (21786): The following assertion was thrown during a scheduler callback:
I/flutter (21786): There are multiple heroes that share the same tag within a subtree.
I/flutter (21786): Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
I/flutter (21786): must have a unique non-null tag.
I/flutter (21786): In this case, multiple heroes had the following tag: <default FloatingActionButton tag>
আমি কীভাবে এটি সমাধান করব?