Browse Source

Merge pull request #46 from CaiJingLong/fix-text-color-not-true

fix text color not true in title.
Caijinglong 5 years ago
parent
commit
34fe57735c
No account linked to committer's email address

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

117
       /// The following are optional parameters.
117
       /// The following are optional parameters.
118
       themeColor: Colors.green,
118
       themeColor: Colors.green,
119
       // the title color and bottom color
119
       // the title color and bottom color
120
+
121
+      textColor: Colors.white,
122
+      // text color
120
       padding: 1.0,
123
       padding: 1.0,
121
       // item padding
124
       // item padding
122
       dividerColor: Colors.grey,
125
       dividerColor: Colors.grey,
132
       // i18n provider ,default is chinese. , you can custom I18nProvider or use ENProvider()
135
       // i18n provider ,default is chinese. , you can custom I18nProvider or use ENProvider()
133
       rowCount: 3,
136
       rowCount: 3,
134
       // item row count
137
       // item row count
135
-      textColor: Colors.white,
136
-      // text color
138
+
137
       thumbSize: 150,
139
       thumbSize: 150,
138
       // preview thumb size , default is 64
140
       // preview thumb size , default is 64
139
       sortDelegate: SortDelegate.common,
141
       sortDelegate: SortDelegate.common,
141
       checkBoxBuilderDelegate: DefaultCheckBoxBuilderDelegate(
143
       checkBoxBuilderDelegate: DefaultCheckBoxBuilderDelegate(
142
         activeColor: Colors.white,
144
         activeColor: Colors.white,
143
         unselectedColor: Colors.white,
145
         unselectedColor: Colors.white,
146
+        checkColor: Colors.green,
144
       ),
147
       ),
145
       // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
148
       // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
146
 
149
 

+ 1
- 1
example/lib/preview.dart View File

12
   Widget build(BuildContext context) {
12
   Widget build(BuildContext context) {
13
     return Scaffold(
13
     return Scaffold(
14
       appBar: AppBar(
14
       appBar: AppBar(
15
-        title: Text("预览"),
15
+        title: Text("Preview"),
16
       ),
16
       ),
17
       body: ListView(
17
       body: ListView(
18
         children: list
18
         children: list

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

16
 class DefaultCheckBoxBuilderDelegate extends CheckBoxBuilderDelegate {
16
 class DefaultCheckBoxBuilderDelegate extends CheckBoxBuilderDelegate {
17
   Color activeColor;
17
   Color activeColor;
18
   Color unselectedColor;
18
   Color unselectedColor;
19
+  Color checkColor;
19
 
20
 
20
   DefaultCheckBoxBuilderDelegate({
21
   DefaultCheckBoxBuilderDelegate({
21
     this.activeColor = Colors.white,
22
     this.activeColor = Colors.white,
22
     this.unselectedColor = Colors.white,
23
     this.unselectedColor = Colors.white,
24
+    this.checkColor = Colors.black,
23
   });
25
   });
24
 
26
 
25
   @override
27
   @override
36
         value: checked,
38
         value: checked,
37
         onChanged: (bool check) {},
39
         onChanged: (bool check) {},
38
         activeColor: activeColor,
40
         activeColor: activeColor,
39
-        checkColor: Colors.red,
41
+        checkColor: checkColor,
40
         title: Text(
42
         title: Text(
41
           i18nProvider.getSelectedOptionsText(options),
43
           i18nProvider.getSelectedOptionsText(options),
42
           textAlign: TextAlign.end,
44
           textAlign: TextAlign.end,

+ 7
- 1
lib/src/ui/page/photo_main_page.dart View File

108
         child: Scaffold(
108
         child: Scaffold(
109
           appBar: AppBar(
109
           appBar: AppBar(
110
             leading: IconButton(
110
             leading: IconButton(
111
-              icon: Icon(Icons.close),
111
+              icon: Icon(
112
+                Icons.close,
113
+                color: options.textColor,
114
+              ),
112
               onPressed: _cancel,
115
               onPressed: _cancel,
113
             ),
116
             ),
114
             title: Text(
117
             title: Text(
115
               i18nProvider.getTitleText(options),
118
               i18nProvider.getTitleText(options),
119
+              style: TextStyle(
120
+                color: options.textColor,
121
+              ),
116
             ),
122
             ),
117
             actions: <Widget>[
123
             actions: <Widget>[
118
               FlatButton(
124
               FlatButton(

+ 10
- 1
lib/src/ui/page/photo_preview_page.dart View File

96
 
96
 
97
   @override
97
   @override
98
   Widget build(BuildContext context) {
98
   Widget build(BuildContext context) {
99
+    var data = Theme.of(context);
99
     var textStyle = TextStyle(
100
     var textStyle = TextStyle(
100
       color: options.textColor,
101
       color: options.textColor,
101
       fontSize: 14.0,
102
       fontSize: 14.0,
102
     );
103
     );
103
     return Theme(
104
     return Theme(
104
-      data: Theme.of(context).copyWith(primaryColor: options.themeColor),
105
+      data: data.copyWith(
106
+        primaryColor: options.themeColor,
107
+      ),
105
       child: Scaffold(
108
       child: Scaffold(
106
         appBar: AppBar(
109
         appBar: AppBar(
107
           backgroundColor: config.options.themeColor,
110
           backgroundColor: config.options.themeColor,
111
+          leading: BackButton(
112
+            color: options.textColor,
113
+          ),
108
           title: StreamBuilder(
114
           title: StreamBuilder(
109
             stream: pageStream,
115
             stream: pageStream,
110
             initialData: widget.initIndex,
116
             initialData: widget.initIndex,
111
             builder: (ctx, snap) => Text(
117
             builder: (ctx, snap) => Text(
112
                   "${snap.data + 1}/${widget.list.length}",
118
                   "${snap.data + 1}/${widget.list.length}",
119
+                  style: TextStyle(
120
+                    color: options.textColor,
121
+                  ),
113
                 ),
122
                 ),
114
           ),
123
           ),
115
           actions: <Widget>[
124
           actions: <Widget>[

+ 6
- 6
pubspec.lock View File

7
       name: async
7
       name: async
8
       url: "https://pub.flutter-io.cn"
8
       url: "https://pub.flutter-io.cn"
9
     source: hosted
9
     source: hosted
10
-    version: "2.2.0"
10
+    version: "2.1.0"
11
   boolean_selector:
11
   boolean_selector:
12
     dependency: transitive
12
     dependency: transitive
13
     description:
13
     description:
70
   photo_manager:
70
   photo_manager:
71
     dependency: "direct main"
71
     dependency: "direct main"
72
     description:
72
     description:
73
-      path: "../flutter_photo_manager"
74
-      relative: true
75
-    source: path
73
+      name: photo_manager
74
+      url: "https://pub.flutter-io.cn"
75
+    source: hosted
76
     version: "0.3.4"
76
     version: "0.3.4"
77
   quiver:
77
   quiver:
78
     dependency: transitive
78
     dependency: transitive
80
       name: quiver
80
       name: quiver
81
       url: "https://pub.flutter-io.cn"
81
       url: "https://pub.flutter-io.cn"
82
     source: hosted
82
     source: hosted
83
-    version: "2.0.3"
83
+    version: "2.0.2"
84
   sky_engine:
84
   sky_engine:
85
     dependency: transitive
85
     dependency: transitive
86
     description: flutter
86
     description: flutter
127
       name: test_api
127
       name: test_api
128
       url: "https://pub.flutter-io.cn"
128
       url: "https://pub.flutter-io.cn"
129
     source: hosted
129
     source: hosted
130
-    version: "0.2.5"
130
+    version: "0.2.4"
131
   typed_data:
131
   typed_data:
132
     dependency: transitive
132
     dependency: transitive
133
     description:
133
     description: