-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
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
Using go_router .go() method to close a sheet don't seems to reset animation state #211
Comments
Hi @glemartret, I tried the following code, but couldn't reproduce the problem. Codeimport 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
void main() {
runApp(const _DeclarativeModalSheetExample());
}
final _router = GoRouter(
routes: [
GoRoute(
path: '/',
builder: (context, state) {
return const _ExampleHome();
},
routes: [
GoRoute(
path: 'modal-sheet',
pageBuilder: (context, state) {
return CupertinoModalSheetPage(
key: state.pageKey,
swipeDismissible: true,
child: const _ExampleSheet(),
);
},
),
],
),
],
);
class _DeclarativeModalSheetExample extends StatelessWidget {
const _DeclarativeModalSheetExample();
@override
Widget build(BuildContext context) {
return MaterialApp.router(routerConfig: _router);
}
}
class _ExampleHome extends StatelessWidget {
const _ExampleHome();
@override
Widget build(BuildContext context) {
return CupertinoStackedTransition(
child: Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () => context.go('/modal-sheet'),
child: const Text('Show Modal Sheet'),
),
),
),
);
}
}
class _ExampleSheet extends StatelessWidget {
const _ExampleSheet();
@override
Widget build(BuildContext context) {
return DraggableSheet(
child: Container(
color: Colors.white,
height: 800,
width: double.infinity,
alignment: Alignment.center,
child: TextButton(
onPressed: () => context.go('/'),
child: const Text('Close Sheet'),
),
),
);
}
} |
I guess this is because the transition animation is not performed when the modal sheet closes. (I don't know why, though) |
Hey @fujidaiti, Code
|
@glemartret What does |
@fujidaiti That's a Flutter function |
Thank you. Seeing the same issue as reported with the provided code. |
When I use .go() method from go router the current Sheet closes but the screen behind stays scaled down.
Quick exemple:
I'll complete this issue more precisely later.
If anyone have some infos to help on this, I'll be thankful
The text was updated successfully, but these errors were encountered: