Skip to content

Commit

Permalink
issue fixed: #40 and #43
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanwuzh committed Aug 23, 2019
1 parent a14362e commit 4e7c058
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions lib/src/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ class DatePicker {
onChange: onChange,
onConfirm: onConfirm,
theme: Theme.of(context, shadowThemeOnly: true),
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
),
).whenComplete(onClose);
).whenComplete(onClose ?? () => {});
}
}

Expand Down Expand Up @@ -134,14 +133,12 @@ class _DatePickerRoute<T> extends PopupRoute<T> {
@override
AnimationController createAnimationController() {
assert(_animationController == null);
_animationController =
BottomSheet.createAnimationController(navigator.overlay);
_animationController = BottomSheet.createAnimationController(navigator.overlay);
return _animationController;
}

@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
double height = pickerTheme.pickerHeight;
if (pickerTheme.title != null || pickerTheme.showTitle) {
height += pickerTheme.titleHeight;
Expand All @@ -164,8 +161,7 @@ class _DatePickerComponent extends StatelessWidget {
final _DatePickerRoute route;
final double _pickerHeight;

_DatePickerComponent({Key key, @required this.route, @required pickerHeight})
: this._pickerHeight = pickerHeight;
_DatePickerComponent({Key key, @required this.route, @required pickerHeight}) : this._pickerHeight = pickerHeight;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -217,8 +213,7 @@ class _DatePickerComponent extends StatelessWidget {
builder: (BuildContext context, Widget child) {
return new ClipRect(
child: new CustomSingleChildLayout(
delegate: new _BottomPickerLayout(route.animation.value,
contentHeight: _pickerHeight),
delegate: new _BottomPickerLayout(route.animation.value, contentHeight: _pickerHeight),
child: pickerWidget,
),
);
Expand Down

0 comments on commit 4e7c058

Please sign in to comment.