Skip to content

Conversation

@jslavitz
Copy link
Contributor

Fixes symmetrical bug #14649 for general page back navigation on iPhone X.

Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@override
Widget build(BuildContext context) {
assert(debugCheckHasDirectionality(context));
double dragAreaWidth = Directionality.of(context) == TextDirection.ltr ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a code comment for what this is about

@override
Widget build(BuildContext context) {
return MediaQuery(
data: const MediaQueryData(padding: EdgeInsets.fromLTRB(40, 0, 0, 0)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is useful. You already have a 40 padding in the ancestry (from the app builder), you're overriding it and adding the same 40 px padding back but after the page route and the back swipe detector.

Widget build(BuildContext context) {
return MediaQuery(
data: const MediaQueryData(padding: EdgeInsets.fromLTRB(40, 0, 0, 0)),
child: Container(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this container is useful. You can just use the Center directly.

),
);

tester
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indents are a bit weird. Maybe:

tester.state(<NavigatorState>(find.byType(Navigator)).push(
  CupertinoPageRoute<void>(
    title: 'title',
    builder: (BuildContext context) {
      return Center(child: Text('Page 1'));
    },
  ),
);

tester
.state<NavigatorState>(find.byType(Navigator))
.push(CupertinoPageRoute<void>(
title: 'title',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need title

Directionality(
textDirection: TextDirection.rtl,
child: MediaQuery(
data: const MediaQueryData(padding: EdgeInsets.fromLTRB(0, 0, 40, 0)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok but might be slightly easier to read EdgeInsets.only(right: 40)

await tester.pumpWidget(
CupertinoApp(
builder: (BuildContext context, Widget navigator) {
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

);

tester
.state<NavigatorState>(find.byType(Navigator))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation here too

@xster
Copy link
Member

xster commented Nov 15, 2018

LGTM. Good work!

@jslavitz jslavitz merged commit 2654850 into flutter:master Nov 16, 2018
@jslavitz jslavitz deleted the nav-fix branch December 3, 2018 22:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants