We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description When navigating from page 1 to page 2, everything goes perfectly. When navigating from page 2 to page 3, everything goes perfectly.
When going back from page 3 to page 2, page 2 loses state, no transition occurs.
The only solution I found was to use the '/page2/page3/' route instead of '/page3'. But it is not a good solution for my case.
Minimum reproduction:
import 'package:beamer/beamer.dart'; import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { MyApp({super.key}); final routerDelegate = BeamerDelegate( locationBuilder: RoutesLocationBuilder( routes: { '/': (context, state, data) { return const BeamPage( key: ValueKey('page1-key'), child: Page1(), ); }, '/page2': (context, state, data) { return const BeamPage( key: ValueKey('page2-key'), child: Material( child: Page2(), ), ); }, '/page3': (context, state, data) { return const BeamPage( key: ValueKey('page3-key'), child: Material( child: Page3(), ), ); }, }, ), ); @override Widget build(BuildContext context) { return MaterialApp.router( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), routerDelegate: routerDelegate, routeInformationParser: BeamerParser(), backButtonDispatcher: BeamerBackButtonDispatcher( delegate: routerDelegate, alwaysBeamBack: true, fallbackToBeamBack: true, ), ); } } class Page1 extends StatelessWidget { const Page1({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: InkWell( onTap: () { Beamer.of(context).beamToNamed('/page2'); }, child: const Text('Page 1'), ), ); } } class Page2 extends StatelessWidget { const Page2({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: SingleChildScrollView( child: Column( children: [ const SizedBox(height: 100), InkWell( onTap: () { Beamer.of(context).beamToNamed('/page3', beamBackOnPop: true); }, child: const Text('Page 2'), ), const SizedBox(height: 1000), ], ), ), ); } } class Page3 extends StatelessWidget { const Page3({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: const Text('Page 3'), ); } }
Can someone help me? Thank you very much!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When navigating from page 1 to page 2, everything goes perfectly.
When navigating from page 2 to page 3, everything goes perfectly.
When going back from page 3 to page 2, page 2 loses state, no transition occurs.
The only solution I found was to use the '/page2/page3/' route instead of '/page3'. But it is not a good solution for my case.
Minimum reproduction:
Can someone help me? Thank you very much!
The text was updated successfully, but these errors were encountered: