Fixes navigation page back drag area for iPhone X#24375
Merged
Conversation
xster
reviewed
Nov 15, 2018
| @override | ||
| Widget build(BuildContext context) { | ||
| assert(debugCheckHasDirectionality(context)); | ||
| double dragAreaWidth = Directionality.of(context) == TextDirection.ltr ? |
Member
There was a problem hiding this comment.
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)), |
Member
There was a problem hiding this comment.
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( |
Member
There was a problem hiding this comment.
I don't think this container is useful. You can just use the Center directly.
| ), | ||
| ); | ||
|
|
||
| tester |
Member
There was a problem hiding this comment.
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', |
| Directionality( | ||
| textDirection: TextDirection.rtl, | ||
| child: MediaQuery( | ||
| data: const MediaQueryData(padding: EdgeInsets.fromLTRB(0, 0, 40, 0)), |
Member
There was a problem hiding this comment.
This is ok but might be slightly easier to read EdgeInsets.only(right: 40)
| await tester.pumpWidget( | ||
| CupertinoApp( | ||
| builder: (BuildContext context, Widget navigator) { | ||
| return |
| ); | ||
|
|
||
| tester | ||
| .state<NavigatorState>(find.byType(Navigator)) |
Member
|
LGTM. Good work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes symmetrical bug #14649 for general page back navigation on iPhone X.