Caijinglong 6 年 前
コミット
0a16adb6e2

+ 1
- 1
lib/src/engine/lru_cache.dart ファイルの表示

11
   }
11
   }
12
 
12
 
13
   static void setData(ImageEntity entity, int size, Uint8List list) {
13
   static void setData(ImageEntity entity, int size, Uint8List list) {
14
-    _map.put(_ImageCacheEntity(entity,size), list);
14
+    _map.put(_ImageCacheEntity(entity, size), list);
15
   }
15
   }
16
 }
16
 }
17
 
17
 

+ 1
- 1
lib/src/provider/i18n_provider.dart ファイルの表示

16
 
16
 
17
   String getAllGalleryText(Options options);
17
   String getAllGalleryText(Options options);
18
 
18
 
19
-  String loadingText(){
19
+  String loadingText() {
20
     return "loading...";
20
     return "loading...";
21
   }
21
   }
22
 
22
 

+ 1
- 2
lib/src/provider/selected_provider.dart ファイルの表示

34
     var srcList = List.of(selectedList);
34
     var srcList = List.of(selectedList);
35
     selectedList.clear();
35
     selectedList.clear();
36
     srcList.forEach((entity) {
36
     srcList.forEach((entity) {
37
-      if (previewSelectedList.contains(entity)){
37
+      if (previewSelectedList.contains(entity)) {
38
         selectedList.add(entity);
38
         selectedList.add(entity);
39
       }
39
       }
40
     });
40
     });
41
   }
41
   }
42
 
42
 
43
-
44
   void sure();
43
   void sure();
45
 }
44
 }

+ 43
- 34
lib/src/ui/widget/check_box_copy.dart ファイルの表示

52
     this.activeColor,
52
     this.activeColor,
53
     this.checkColor,
53
     this.checkColor,
54
     this.materialTapTargetSize,
54
     this.materialTapTargetSize,
55
-  }) : assert(tristate != null),
55
+  })  : assert(tristate != null),
56
         assert(tristate || value != null),
56
         assert(tristate || value != null),
57
         super(key: key);
57
         super(key: key);
58
 
58
 
133
     Size size;
133
     Size size;
134
     switch (widget.materialTapTargetSize ?? themeData.materialTapTargetSize) {
134
     switch (widget.materialTapTargetSize ?? themeData.materialTapTargetSize) {
135
       case MaterialTapTargetSize.padded:
135
       case MaterialTapTargetSize.padded:
136
-        size = const Size(2 * kRadialReactionRadius + 8.0, 2 * kRadialReactionRadius + 8.0);
136
+        size = const Size(
137
+            2 * kRadialReactionRadius + 8.0, 2 * kRadialReactionRadius + 8.0);
137
         break;
138
         break;
138
       case MaterialTapTargetSize.shrinkWrap:
139
       case MaterialTapTargetSize.shrinkWrap:
139
         size = const Size(2 * kRadialReactionRadius, 2 * kRadialReactionRadius);
140
         size = const Size(2 * kRadialReactionRadius, 2 * kRadialReactionRadius);
145
       tristate: widget.tristate,
146
       tristate: widget.tristate,
146
       activeColor: widget.activeColor ?? themeData.toggleableActiveColor,
147
       activeColor: widget.activeColor ?? themeData.toggleableActiveColor,
147
       checkColor: widget.checkColor ?? themeData.primaryColor,
148
       checkColor: widget.checkColor ?? themeData.primaryColor,
148
-      inactiveColor: widget.onChanged != null ? themeData.unselectedWidgetColor : themeData.disabledColor,
149
+      inactiveColor: widget.onChanged != null
150
+          ? themeData.unselectedWidgetColor
151
+          : themeData.disabledColor,
149
       onChanged: widget.onChanged,
152
       onChanged: widget.onChanged,
150
       additionalConstraints: additionalConstraints,
153
       additionalConstraints: additionalConstraints,
151
       vsync: this,
154
       vsync: this,
164
     @required this.onChanged,
167
     @required this.onChanged,
165
     @required this.vsync,
168
     @required this.vsync,
166
     @required this.additionalConstraints,
169
     @required this.additionalConstraints,
167
-  }) : assert(tristate != null),
170
+  })  : assert(tristate != null),
168
         assert(tristate || value != null),
171
         assert(tristate || value != null),
169
         assert(activeColor != null),
172
         assert(activeColor != null),
170
         assert(inactiveColor != null),
173
         assert(inactiveColor != null),
182
 
185
 
183
   @override
186
   @override
184
   _RenderCheckbox createRenderObject(BuildContext context) => _RenderCheckbox(
187
   _RenderCheckbox createRenderObject(BuildContext context) => _RenderCheckbox(
185
-    value: value,
186
-    tristate: tristate,
187
-    activeColor: activeColor,
188
-    checkColor: checkColor,
189
-    inactiveColor: inactiveColor,
190
-    onChanged: onChanged,
191
-    vsync: vsync,
192
-    additionalConstraints: additionalConstraints,
193
-  );
188
+        value: value,
189
+        tristate: tristate,
190
+        activeColor: activeColor,
191
+        checkColor: checkColor,
192
+        inactiveColor: inactiveColor,
193
+        onChanged: onChanged,
194
+        vsync: vsync,
195
+        additionalConstraints: additionalConstraints,
196
+      );
194
 
197
 
195
   @override
198
   @override
196
   void updateRenderObject(BuildContext context, _RenderCheckbox renderObject) {
199
   void updateRenderObject(BuildContext context, _RenderCheckbox renderObject) {
220
     BoxConstraints additionalConstraints,
223
     BoxConstraints additionalConstraints,
221
     ValueChanged<bool> onChanged,
224
     ValueChanged<bool> onChanged,
222
     @required TickerProvider vsync,
225
     @required TickerProvider vsync,
223
-  }): _oldValue = value,
224
-      checkColor = checkColor,
226
+  })  : _oldValue = value,
227
+        checkColor = checkColor,
225
         super(
228
         super(
226
-        value: value,
227
-        tristate: tristate,
228
-        activeColor: activeColor,
229
-        inactiveColor: inactiveColor,
230
-        onChanged: onChanged,
231
-        additionalConstraints: additionalConstraints,
232
-        vsync: vsync,
233
-      );
229
+          value: value,
230
+          tristate: tristate,
231
+          activeColor: activeColor,
232
+          inactiveColor: inactiveColor,
233
+          onChanged: onChanged,
234
+          additionalConstraints: additionalConstraints,
235
+          vsync: vsync,
236
+        );
234
 
237
 
235
   bool _oldValue;
238
   bool _oldValue;
236
 
239
 
238
 
241
 
239
   @override
242
   @override
240
   set value(bool newValue) {
243
   set value(bool newValue) {
241
-    if (newValue == value)
242
-      return;
244
+    if (newValue == value) return;
243
     _oldValue = value;
245
     _oldValue = value;
244
     super.value = newValue;
246
     super.value = newValue;
245
   }
247
   }
257
   RRect _outerRectAt(Offset origin, double t) {
259
   RRect _outerRectAt(Offset origin, double t) {
258
     final double inset = 1.0 - (t - 0.5).abs() * 2.0;
260
     final double inset = 1.0 - (t - 0.5).abs() * 2.0;
259
     final double size = _kEdgeSize - inset * _kStrokeWidth;
261
     final double size = _kEdgeSize - inset * _kStrokeWidth;
260
-    final Rect rect = Rect.fromLTWH(origin.dx + inset, origin.dy + inset, size, size);
262
+    final Rect rect =
263
+        Rect.fromLTWH(origin.dx + inset, origin.dy + inset, size, size);
261
     return RRect.fromRectAndRadius(rect, _kEdgeRadius);
264
     return RRect.fromRectAndRadius(rect, _kEdgeRadius);
262
   }
265
   }
263
 
266
 
267
     // As t goes from 0.0 to 0.25, animate from the inactiveColor to activeColor.
270
     // As t goes from 0.0 to 0.25, animate from the inactiveColor to activeColor.
268
     return onChanged == null
271
     return onChanged == null
269
         ? inactiveColor
272
         ? inactiveColor
270
-        : (t >= 0.25 ? activeColor : Color.lerp(inactiveColor, activeColor, t * 4.0));
273
+        : (t >= 0.25
274
+            ? activeColor
275
+            : Color.lerp(inactiveColor, activeColor, t * 4.0));
271
   }
276
   }
272
 
277
 
273
   // White stroke used to paint the check and dash.
278
   // White stroke used to paint the check and dash.
282
     assert(t >= 0.0 && t <= 0.5);
287
     assert(t >= 0.0 && t <= 0.5);
283
     final double size = outer.width;
288
     final double size = outer.width;
284
     // As t goes from 0.0 to 1.0, gradually fill the outer RRect.
289
     // As t goes from 0.0 to 1.0, gradually fill the outer RRect.
285
-    final RRect inner = outer.deflate(math.min(size / 2.0, _kStrokeWidth + size * t));
290
+    final RRect inner =
291
+        outer.deflate(math.min(size / 2.0, _kStrokeWidth + size * t));
286
     canvas.drawDRRect(outer, inner, paint);
292
     canvas.drawDRRect(outer, inner, paint);
287
   }
293
   }
288
 
294
 
326
     final Canvas canvas = context.canvas;
332
     final Canvas canvas = context.canvas;
327
     paintRadialReaction(canvas, offset, size.center(Offset.zero));
333
     paintRadialReaction(canvas, offset, size.center(Offset.zero));
328
 
334
 
329
-    final Offset origin = offset + (size / 2.0 - const Size.square(_kEdgeSize) / 2.0);
335
+    final Offset origin =
336
+        offset + (size / 2.0 - const Size.square(_kEdgeSize) / 2.0);
330
     final AnimationStatus status = position.status;
337
     final AnimationStatus status = position.status;
331
-    final double tNormalized = status == AnimationStatus.forward || status == AnimationStatus.completed
332
-        ? position.value
333
-        : 1.0 - position.value;
338
+    final double tNormalized =
339
+        status == AnimationStatus.forward || status == AnimationStatus.completed
340
+            ? position.value
341
+            : 1.0 - position.value;
334
 
342
 
335
     // Four cases: false to null, false to true, null to false, true to false
343
     // Four cases: false to null, false to true, null to false, true to false
336
     if (_oldValue == false || value == false) {
344
     if (_oldValue == false || value == false) {
350
         else
358
         else
351
           _drawCheck(canvas, origin, tShrink, paint);
359
           _drawCheck(canvas, origin, tShrink, paint);
352
       }
360
       }
353
-    } else { // Two cases: null to true, true to null
361
+    } else {
362
+      // Two cases: null to true, true to null
354
       final RRect outer = _outerRectAt(origin, 1.0);
363
       final RRect outer = _outerRectAt(origin, 1.0);
355
-      final Paint paint = Paint() ..color = _colorAt(1.0);
364
+      final Paint paint = Paint()..color = _colorAt(1.0);
356
       canvas.drawRRect(outer, paint);
365
       canvas.drawRRect(outer, paint);
357
 
366
 
358
       _initStrokePaint(paint);
367
       _initStrokePaint(paint);

+ 7
- 3
lib/src/ui/widget/check_tile_copy.dart ファイルの表示

2
 // Use of this source code is governed by a BSD-style license that can be
2
 // Use of this source code is governed by a BSD-style license that can be
3
 // found in the LICENSE file.
3
 // found in the LICENSE file.
4
 
4
 
5
-import 'package:flutter/material.dart' hide Checkbox,CheckboxListTile;
5
+import 'package:flutter/material.dart' hide Checkbox, CheckboxListTile;
6
 
6
 
7
 import 'package:photo/src/ui/widget/check_box_copy.dart';
7
 import 'package:photo/src/ui/widget/check_box_copy.dart';
8
 
8
 
86
     this.secondary,
86
     this.secondary,
87
     this.selected = false,
87
     this.selected = false,
88
     this.controlAffinity = ListTileControlAffinity.platform,
88
     this.controlAffinity = ListTileControlAffinity.platform,
89
-  }) : assert(value != null),
89
+  })  : assert(value != null),
90
         assert(isThreeLine != null),
90
         assert(isThreeLine != null),
91
         assert(!isThreeLine || subtitle != null),
91
         assert(!isThreeLine || subtitle != null),
92
         assert(selected != null),
92
         assert(selected != null),
199
           isThreeLine: isThreeLine,
199
           isThreeLine: isThreeLine,
200
           dense: dense,
200
           dense: dense,
201
           enabled: onChanged != null,
201
           enabled: onChanged != null,
202
-          onTap: onChanged != null ? () { onChanged(!value); } : null,
202
+          onTap: onChanged != null
203
+              ? () {
204
+                  onChanged(!value);
205
+                }
206
+              : null,
203
           selected: selected,
207
           selected: selected,
204
         ),
208
         ),
205
       ),
209
       ),