Conversation
There was a problem hiding this comment.
Just a thought - maybe this is worth doing to avoid the assert. What if instead of not building one drawer when the other is opened - you changed the order in which they were built such that the open drawer is on top?
Might be a simple change that will still fix the issue without requiring an assert.
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/widgets.dart'; | ||
| import 'package:flutter/material.dart'; |
There was a problem hiding this comment.
import the appropriate source files from material (like below) instead of the entire lib. The circular import will break the docs shard
| /// Typically called by [ScaffoldState.openDrawer]. | ||
| void open() { | ||
| _controller.fling(velocity: 1.0); | ||
| if(widget.drawerCallback != null) |
There was a problem hiding this comment.
space between if and (, here and elsewhere
| behavior: HitTestBehavior.translucent, | ||
| excludeFromSemantics: true, | ||
| child: new Container(width: _kEdgeDragWidth) | ||
| key: _gestureDetectorKey, |
There was a problem hiding this comment.
Revert unrelated change, here and elsewhere
|
|
||
| void _drawerOpenedCallback(bool isOpened) { | ||
| _drawerOpened = isOpened; | ||
| setState(() {}); |
There was a problem hiding this comment.
For more idiomatic setState:
setState(() {
_drawerOpened = isOpened;
});
| removeBottomPadding: false, | ||
| ); | ||
| if(!_endDrawerOpened) { | ||
| if (widget.drawer != null) { |
There was a problem hiding this comment.
Combine these if statements -
if (widget.drawer != null && !_endDrawerOpened)
| removeRightPadding: textDirection == TextDirection.rtl, | ||
| removeBottomPadding: false, | ||
| ); | ||
| if (!_drawerOpened) { |
| right: false, | ||
| bottom: false, | ||
| child: new Scaffold( | ||
| endDrawer: new Drawer( |
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/widgets.dart'; | ||
|
|
||
| import 'package:flutter/material.dart'; |
There was a problem hiding this comment.
Don't forget to fix this import 📁
There was a problem hiding this comment.
But I get like 100 errors if I take it out... How do I know which specific files to include?
There was a problem hiding this comment.
On the auto import suggestion in intellij you should see an option that imports from '/material/src` - just pick those and then make them relative.
There was a problem hiding this comment.
Looks like I didn't need that import, must have not been filtering for the errors in the current file before.
…erFix2 Trying to fix stupid errors
|
Ignore the result of travis BTW |
|
@jslavitz This is good to submit |
| GlobalKey key, | ||
| @required this.child, | ||
| @required this.alignment, | ||
| this.drawerCallback, |
There was a problem hiding this comment.
this should be called onFoo, not fooCallback
| final DrawerAlignment alignment; | ||
|
|
||
| /// Optional callback that is called when a [Drawer] is opened or closed. | ||
| final DrawerCallback drawerCallback; |
There was a problem hiding this comment.
maybe onDrawerChange or some such.
Or maybe even better, have two callbacks, onOpen and onClose.
| numNotificationsAtLastFrame = listenerState.numNotifications; | ||
| }); | ||
|
|
||
| testWidgets('Simultaneous drawers on either side', (WidgetTester tester) async { |
There was a problem hiding this comment.
why was this moved to the ScaffoldGeometry test section?
|
This seems to have regressed the |
|
Where can I check out that benchmark? Maybe we could just do the set state using Future so that it doesn't get called on the first frame of the animation? |
|
I don't really understand what caused the regression. Nothing here looks like it should be slow. https://flutter-dashboard.appspot.com/benchmarks.html has the results of the benchmarks |
|
So what benchmark am I looking at? The only thing I can figure is that the set state calls slowed it down? Outside of that, I agree, nothing should be causing performance issues. |
|
@jslavitz lets look at them on Monday |
|
Did y'all come to any conclusion on this? |
Fixes #19704