-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Description
Steps to reproduce
Open a full page from the dialog / any other transparent route and try to go backwards
Expected results
Correct closing of a dialog by tap outside of it
Actual results
Ignoring taps and visual overlap during animation
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
pageTransitionsTheme: PageTransitionsTheme(
builders: {
for (var platform in TargetPlatform.values)
platform: FadeForwardsPageTransitionsBuilder(),
},
),
),
home: const HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (context) {
return TheDialog();
},
);
},
child: const Text('тык'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
PageRouteBuilder(
opaque: false,
barrierDismissible: true,
barrierColor: Colors.black54,
pageBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return TheDialog();
},
),
);
},
child: const Text('другой тык'),
),
],
),
),
);
}
}
class TheDialog extends StatelessWidget {
const TheDialog({super.key});
@override
Widget build(BuildContext context) {
return Dialog(
child: Center(
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Scaffold(appBar: AppBar()),
),
);
},
child: Text('тык 2'),
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
screen-20250322-101359.2.mp4
Metadata
Metadata
Assignees
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue