-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Show a bottom sheet using
showModalBottomSheet - Push a new route
- Pop the route
- Notice that the modal bottom sheet is not dismissible
Expected results
The bottom sheet should be dismissible.
Actual results
The bottom sheet is not dismissible.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const App());
class App extends StatefulWidget {
const App({super.key});
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> {
bool useFadeTransition = false;
void togglePageTransitionType() {
setState(() {
useFadeTransition = !useFadeTransition;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme:
useFadeTransition
? ThemeData(
pageTransitionsTheme: PageTransitionsTheme(
builders:
Map<TargetPlatform, PageTransitionsBuilder>.fromIterable(
TargetPlatform.values,
value:
(_) => const FadeForwardsPageTransitionsBuilder(),
),
),
)
: null,
home: FirstPage(
useFadeTransition: useFadeTransition,
togglePageTransitionType: togglePageTransitionType,
),
);
}
}
class FirstPage extends StatelessWidget {
final bool useFadeTransition;
final VoidCallback togglePageTransitionType;
const FirstPage({
super.key,
required this.useFadeTransition,
required this.togglePageTransitionType,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('First Page')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Current Page Transition Type:\n${useFadeTransition ? 'FadeForwardsPageTransitionsBuilder' : 'Default (ZoomPageTransitionsBuilder)'}',
textAlign: TextAlign.center,
),
ElevatedButton(
onPressed: togglePageTransitionType,
child: Text('Toggle Page Transition Type'),
),
ElevatedButton(
child: Text('Open Modal BottomSheet'),
onPressed: () {
showModalBottomSheet(
context: context,
builder:
(context) => Container(
height: 200,
color: Colors.amber,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text('Modal BottomSheet'),
ElevatedButton(
child: const Text('Second Page'),
onPressed:
() => Navigator.of(context).push(
MaterialPageRoute<SecondPage>(
builder:
(BuildContext context) =>
SecondPage(),
),
),
),
],
),
),
),
);
},
),
],
),
),
);
}
}
class SecondPage extends StatelessWidget {
const SecondPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBar(title: Text('Second Page')));
}
}Video
Video demonstration
flutter-bug.webm
Flutter version
Flutter version
Flutter 3.31.0-0.1.preMetadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team