Skip to content

Android zoom page transition display scrim in an odd position when there are nested navigators. #116127

Description

@jonahwilliams

Run on Android and tab between PageOne and PageTwo, notice the scrim darkens the screen in an unexpected manner. b/260364434

import'package:flutter/material.dart';
voidmain() {
runApp(MyApp());
}
classMyAppextendsStatelessWidget {
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
home:MainPage(),
);
}
}
classMainPageextendsStatelessWidget {
final navigatorKey =GlobalKey<NavigatorState>();
@overrideWidgetbuild(BuildContext context) {
returnScaffold(
body:Column(
children:<Widget>[
Expanded(
child:Navigator(
key: navigatorKey,
onGenerateRoute: (route) =>MaterialPageRoute(
settings: route,
builder: (context) =>PageOne(),
),
),
),
BottomNavigationBar(navigatorKey)
],
),
);
}
}
classBottomNavigationBarextendsStatelessWidget {
finalGlobalKey<NavigatorState> navigatorKey;
BottomNavigationBar(this.navigatorKey) :assert(navigatorKey !=null);
Future<void> push(Route route) {
return navigatorKey.currentState!.push(route);
}
@overrideWidgetbuild(BuildContext context) {
returnContainer(
color:Colors.blue,
child:ButtonBar(
alignment:MainAxisAlignment.spaceEvenly,
children:<Widget>[
TextButton(
child:Text("PageOne", style:TextStyle(color:Colors.red)),
onPressed: () {
push(MaterialPageRoute(builder: (context) =>PageOne()));
},
),
TextButton(
child:Text("PageTwo", style:TextStyle(color:Colors.red)),
onPressed: () {
push(MaterialPageRoute(builder: (context) =>PageTwo()));
},
)
],
),
);
}
}
classPageOneextendsStatelessWidget {
@overrideWidgetbuild(BuildContext context) {
returnContainer(
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children:<Widget>[
Text("Page One"),
TextButton(
onPressed: (){
Navigator.of(context).pop();
},
child:Text("Pop"),
),
],
),
);
}
}
classPageTwoextendsStatelessWidget {
@overrideWidgetbuild(BuildContext context) {
returnContainer(
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children:<Widget>[
Text("Page Two"),
TextButton(
onPressed: (){
Navigator.of(context).pop();
},
child:Text("Pop"),
),
],
),
);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettercustomer: money (g3)frameworkflutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish liner: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions