Browse Source

fix checkbox check color no valid bug

Caijinglong 6 years ago
parent
commit
15d3e068db

+ 5
- 2
example/lib/main.dart View File

36
       /// The following are optional parameters.
36
       /// The following are optional parameters.
37
       themeColor: Colors.green, // the title color and bottom color
37
       themeColor: Colors.green, // the title color and bottom color
38
       padding: 1.0, // item padding
38
       padding: 1.0, // item padding
39
-      dividerColor: Colors.deepOrange, // divider color
39
+      dividerColor: Colors.grey, // divider color
40
       disableColor: Colors.grey.shade300, // the check box disable color
40
       disableColor: Colors.grey.shade300, // the check box disable color
41
       itemRadio: 0.88, // the content item radio
41
       itemRadio: 0.88, // the content item radio
42
       maxSelected: 8, // max picker image count
42
       maxSelected: 8, // max picker image count
48
       sortDelegate: SortDelegate
48
       sortDelegate: SortDelegate
49
           .common, // default is common ,or you make custom delegate to sort your gallery
49
           .common, // default is common ,or you make custom delegate to sort your gallery
50
       checkBoxBuilderDelegate:
50
       checkBoxBuilderDelegate:
51
-          DefaultCheckBoxBuilderDelegate(), // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
51
+          DefaultCheckBoxBuilderDelegate(
52
+            activeColor: Colors.white,
53
+            unselectedColor: Colors.white,
54
+          ), // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
52
     );
55
     );
53
 
56
 
54
     if (imgList == null) {
57
     if (imgList == null) {

+ 1
- 1
lib/src/delegate/checkbox_builder_delegate.dart View File

36
         value: checked,
36
         value: checked,
37
         onChanged: (bool check) {},
37
         onChanged: (bool check) {},
38
         activeColor: activeColor,
38
         activeColor: activeColor,
39
-        checkColor: unselectedColor,
39
+        checkColor: Colors.red,
40
         title: Text(
40
         title: Text(
41
           i18nProvider.getSelectedOptionsText(options),
41
           i18nProvider.getSelectedOptionsText(options),
42
           textAlign: TextAlign.end,
42
           textAlign: TextAlign.end,

+ 12
- 2
lib/src/ui/page/photo_preview_page.dart View File

303
 
303
 
304
 class BigPhotoImage extends StatefulWidget {
304
 class BigPhotoImage extends StatefulWidget {
305
   final ImageEntity imageEntity;
305
   final ImageEntity imageEntity;
306
+  final Widget loadingWidget;
306
 
307
 
307
-  const BigPhotoImage({Key key, this.imageEntity}) : super(key: key);
308
+  const BigPhotoImage({
309
+    Key key,
310
+    this.imageEntity,
311
+    this.loadingWidget,
312
+  }) : super(key: key);
308
 
313
 
309
   @override
314
   @override
310
   _BigPhotoImageState createState() => _BigPhotoImageState();
315
   _BigPhotoImageState createState() => _BigPhotoImageState();
312
 
317
 
313
 class _BigPhotoImageState extends State<BigPhotoImage>
318
 class _BigPhotoImageState extends State<BigPhotoImage>
314
     with AutomaticKeepAliveClientMixin {
319
     with AutomaticKeepAliveClientMixin {
320
+
321
+  Widget get loadingWidget{
322
+    return widget.loadingWidget ?? Container();
323
+  }
324
+
315
   @override
325
   @override
316
   Widget build(BuildContext context) {
326
   Widget build(BuildContext context) {
317
     var width = MediaQuery.of(context).size.width;
327
     var width = MediaQuery.of(context).size.width;
330
             height: double.infinity,
340
             height: double.infinity,
331
           );
341
           );
332
         }
342
         }
333
-        return Container();
343
+        return loadingWidget;
334
       },
344
       },
335
     );
345
     );
336
   }
346
   }

+ 1
- 0
lib/src/ui/widget/check_tile_copy.dart View File

173
     final Widget control = Checkbox(
173
     final Widget control = Checkbox(
174
       value: value,
174
       value: value,
175
       onChanged: onChanged,
175
       onChanged: onChanged,
176
+      checkColor: checkColor,
176
       activeColor: activeColor,
177
       activeColor: activeColor,
177
       materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
178
       materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
178
     );
179
     );