Skip to content

Material Page transition will draw outside of the navigator #113130

@chunhtai

Description

@chunhtai

Steps to Reproduce

import 'package:flutter/material.dart';

final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>();
void main() => runApp(MaterialApp(
  home: Row(
    children: [
      Container(width: 100, color: Colors.red,),
      Container(width: 100 ,child: Navigator(
        key: key,
        onGenerateRoute: (RouteSettings settings) {
          return MaterialPageRoute<void>(builder: (_) {
            return Scaffold(
              appBar: AppBar(title: Text(settings.name?? '')),
              body: ElevatedButton(
                child: Text(settings.name ?? ''),
                onPressed: () {
                  key.currentState!.pushNamed('/a');
                },
              ),
            );
          });
        },
      ))
    ]
  ),
));
  1. press the button and the page transition will move outside of the navigator container.

Logs

Logs

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listf: material designflutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions