@@ -36,9 +36,13 @@ class DatePicker {
36
36
onConfirm: onConfirm,
37
37
locale: locale,
38
38
theme: theme,
39
- barrierLabel: MaterialLocalizations .of (context).modalBarrierDismissLabel,
39
+ barrierLabel:
40
+ MaterialLocalizations .of (context).modalBarrierDismissLabel,
40
41
pickerModel: DatePickerModel (
41
- currentTime: currentTime, maxTime: maxTime, minTime: minTime, locale: locale)));
42
+ currentTime: currentTime,
43
+ maxTime: maxTime,
44
+ minTime: minTime,
45
+ locale: locale)));
42
46
}
43
47
44
48
///
@@ -61,8 +65,10 @@ class DatePicker {
61
65
onConfirm: onConfirm,
62
66
locale: locale,
63
67
theme: theme,
64
- barrierLabel: MaterialLocalizations .of (context).modalBarrierDismissLabel,
65
- pickerModel: TimePickerModel (currentTime: currentTime, locale: locale)));
68
+ barrierLabel:
69
+ MaterialLocalizations .of (context).modalBarrierDismissLabel,
70
+ pickerModel:
71
+ TimePickerModel (currentTime: currentTime, locale: locale)));
66
72
}
67
73
68
74
///
@@ -85,8 +91,10 @@ class DatePicker {
85
91
onConfirm: onConfirm,
86
92
locale: locale,
87
93
theme: theme,
88
- barrierLabel: MaterialLocalizations .of (context).modalBarrierDismissLabel,
89
- pickerModel: DateTimePickerModel (currentTime: currentTime, locale: locale)));
94
+ barrierLabel:
95
+ MaterialLocalizations .of (context).modalBarrierDismissLabel,
96
+ pickerModel:
97
+ DateTimePickerModel (currentTime: currentTime, locale: locale)));
90
98
}
91
99
92
100
///
@@ -109,7 +117,8 @@ class DatePicker {
109
117
onConfirm: onConfirm,
110
118
locale: locale,
111
119
theme: theme,
112
- barrierLabel: MaterialLocalizations .of (context).modalBarrierDismissLabel,
120
+ barrierLabel:
121
+ MaterialLocalizations .of (context).modalBarrierDismissLabel,
113
122
pickerModel: pickerModel));
114
123
}
115
124
}
@@ -152,13 +161,14 @@ class _DatePickerRoute<T> extends PopupRoute<T> {
152
161
@override
153
162
AnimationController createAnimationController () {
154
163
assert (_animationController == null );
155
- _animationController = BottomSheet .createAnimationController (navigator.overlay);
164
+ _animationController =
165
+ BottomSheet .createAnimationController (navigator.overlay);
156
166
return _animationController;
157
167
}
158
168
159
169
@override
160
- Widget buildPage (
161
- BuildContext context, Animation < double > animation, Animation <double > secondaryAnimation) {
170
+ Widget buildPage (BuildContext context, Animation < double > animation,
171
+ Animation <double > secondaryAnimation) {
162
172
Widget bottomSheet = new MediaQuery .removePadding (
163
173
context: context,
164
174
removeTop: true ,
@@ -179,7 +189,11 @@ class _DatePickerRoute<T> extends PopupRoute<T> {
179
189
180
190
class _DatePickerComponent extends StatefulWidget {
181
191
_DatePickerComponent (
182
- {Key key, @required this .route, this .onChanged, this .locale, this .pickerModel});
192
+ {Key key,
193
+ @required this .route,
194
+ this .onChanged,
195
+ this .locale,
196
+ this .pickerModel});
183
197
184
198
final DateChangedCallback onChanged;
185
199
@@ -205,12 +219,12 @@ class _DatePickerState extends State<_DatePickerComponent> {
205
219
}
206
220
207
221
void refreshScrollOffset () {
208
- leftScrollCtrl =
209
- new FixedExtentScrollController ( initialItem: widget.pickerModel.currentLeftIndex ());
210
- middleScrollCtrl =
211
- new FixedExtentScrollController ( initialItem: widget.pickerModel.currentMiddleIndex ());
212
- rightScrollCtrl =
213
- new FixedExtentScrollController ( initialItem: widget.pickerModel.currentRightIndex ());
222
+ leftScrollCtrl = new FixedExtentScrollController (
223
+ initialItem: widget.pickerModel.currentLeftIndex ());
224
+ middleScrollCtrl = new FixedExtentScrollController (
225
+ initialItem: widget.pickerModel.currentMiddleIndex ());
226
+ rightScrollCtrl = new FixedExtentScrollController (
227
+ initialItem: widget.pickerModel.currentRightIndex ());
214
228
}
215
229
216
230
@override
@@ -222,7 +236,8 @@ class _DatePickerState extends State<_DatePickerComponent> {
222
236
builder: (BuildContext context, Widget child) {
223
237
return new ClipRect (
224
238
child: new CustomSingleChildLayout (
225
- delegate: new _BottomPickerLayout (widget.route.animation.value, theme,
239
+ delegate: new _BottomPickerLayout (
240
+ widget.route.animation.value, theme,
226
241
showTitleActions: widget.route.showTitleActions),
227
242
child: new GestureDetector (
228
243
child: Material (
@@ -269,7 +284,8 @@ class _DatePickerState extends State<_DatePickerComponent> {
269
284
child: Container (
270
285
padding: EdgeInsets .all (8.0 ),
271
286
height: theme.containerHeight,
272
- decoration: BoxDecoration (color: theme.backgroundColor ?? Colors .white),
287
+ decoration:
288
+ BoxDecoration (color: theme.backgroundColor ?? Colors .white),
273
289
child: NotificationListener (
274
290
onNotification: (ScrollNotification notification) {
275
291
if (notification.depth == 0 &&
@@ -350,8 +366,8 @@ class _DatePickerState extends State<_DatePickerComponent> {
350
366
style: theme.itemStyle,
351
367
),
352
368
_renderColumnView (
353
- ValueKey (
354
- widget.pickerModel.currentMiddleIndex () + widget.pickerModel. currentLeftIndex ()),
369
+ ValueKey (widget.pickerModel. currentMiddleIndex () +
370
+ widget.pickerModel.currentLeftIndex ()),
355
371
theme,
356
372
widget.pickerModel.rightStringAtIndex,
357
373
rightScrollCtrl,
@@ -415,7 +431,8 @@ class _DatePickerState extends State<_DatePickerComponent> {
415
431
}
416
432
417
433
class _BottomPickerLayout extends SingleChildLayoutDelegate {
418
- _BottomPickerLayout (this .progress, this .theme, {this .itemCount, this .showTitleActions});
434
+ _BottomPickerLayout (this .progress, this .theme,
435
+ {this .itemCount, this .showTitleActions});
419
436
420
437
final double progress;
421
438
final int itemCount;
0 commit comments