@@ -110,10 +110,10 @@ class _MaterialPickerState extends State<MaterialPicker> {
110110 height: _isPortrait ? null : 60 ,
111111 decoration: BoxDecoration (
112112 color: Theme .of (context).cardColor,
113- boxShadow: [BoxShadow (color: Colors .grey[300 ]! , blurRadius: 10 )],
113+ boxShadow: [BoxShadow (color: ( Theme . of (context).brightness == Brightness .light) ? ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 : Colors .black38 , blurRadius: 10 )],
114114 border: _isPortrait
115- ? Border (right: BorderSide (color: Colors .grey[300 ]! , width: 1 ))
116- : Border (top: BorderSide (color: Colors .grey[300 ]! , width: 1 )),
115+ ? Border (right: BorderSide (color: ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 , width: 1 ))
116+ : Border (top: BorderSide (color: ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 , width: 1 )),
117117 ),
118118 child: ScrollConfiguration (
119119 behavior: ScrollConfiguration .of (context).copyWith (dragDevices: PointerDeviceKind .values.toSet ()),
@@ -133,7 +133,7 @@ class _MaterialPickerState extends State<MaterialPicker> {
133133 child: Container (
134134 color: const Color (0x00000000 ),
135135 padding:
136- _isPortrait ? const EdgeInsets .fromLTRB (0 , 7 , 0 , 7 ) : const EdgeInsets .fromLTRB (7 , 0 , 7 , 0 ),
136+ _isPortrait ? const EdgeInsets .fromLTRB (0 , 7 , 0 , 7 ) : const EdgeInsets .fromLTRB (7 , 0 , 7 , 0 ),
137137 child: Align (
138138 child: AnimatedContainer (
139139 duration: const Duration (milliseconds: 300 ),
@@ -144,19 +144,19 @@ class _MaterialPickerState extends State<MaterialPicker> {
144144 shape: BoxShape .circle,
145145 boxShadow: _currentColorType == _colors
146146 ? [
147- _colorType == Theme .of (context).cardColor
148- ? BoxShadow (
149- color : Colors .grey[300 ]! ,
150- blurRadius: 10 ,
151- )
152- : BoxShadow (
153- color: _colorType,
154- blurRadius: 10 ,
155- ),
156- ]
147+ _colorType == Theme .of (context).cardColor
148+ ? BoxShadow (
149+ color : ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 ,
150+ blurRadius: 10 ,
151+ )
152+ : BoxShadow (
153+ color: _colorType,
154+ blurRadius: 10 ,
155+ ),
156+ ]
157157 : null ,
158158 border: _colorType == Theme .of (context).cardColor
159- ? Border .all (color: Colors .grey[300 ]! , width: 1 )
159+ ? Border .all (color: ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 , width: 1 )
160160 : null ,
161161 ),
162162 ),
@@ -199,66 +199,66 @@ class _MaterialPickerState extends State<MaterialPicker> {
199199 curve: Curves .fastOutSlowIn,
200200 duration: const Duration (milliseconds: 500 ),
201201 width:
202- _isPortrait ? (_currentShading == _color ? 250 : 230 ) : (_currentShading == _color ? 50 : 30 ),
202+ _isPortrait ? (_currentShading == _color ? 250 : 230 ) : (_currentShading == _color ? 50 : 30 ),
203203 height: _isPortrait ? 50 : 220 ,
204204 decoration: BoxDecoration (
205205 color: _color,
206206 boxShadow: _currentShading == _color
207207 ? [
208- (_color == Colors .white) || (_color == Colors .black)
209- ? BoxShadow (
210- color : Colors .grey[300 ]! ,
211- blurRadius: 10 ,
212- )
213- : BoxShadow (
214- color: _color,
215- blurRadius: 10 ,
216- ),
217- ]
208+ (_color == Colors .white) || (_color == Colors .black)
209+ ? BoxShadow (
210+ color : ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 ,
211+ blurRadius: 10 ,
212+ )
213+ : BoxShadow (
214+ color: _color,
215+ blurRadius: 10 ,
216+ ),
217+ ]
218218 : null ,
219219 border: (_color == Colors .white) || (_color == Colors .black)
220- ? Border .all (color: Colors .grey[300 ]! , width: 1 )
220+ ? Border .all (color: ( Theme . of (context).brightness == Brightness .light) ? Colors .grey[300 ]! : Colors .black38 , width: 1 )
221221 : null ,
222222 ),
223223 child: widget.enableLabel
224224 ? _isPortrait
225- ? Row (
226- children: [
227- Text (
228- ' ${color .values .first }' ,
229- style: TextStyle (color: useWhiteForeground (_color) ? Colors .white : Colors .black),
230- ),
231- Expanded (
232- child: Align (
233- alignment: Alignment .centerRight,
234- child: Text (
235- '#${(_color .toString ().replaceFirst ('Color(0xff' , '' ).replaceFirst (')' , '' )).toUpperCase ()} ' ,
236- style: TextStyle (
237- color: useWhiteForeground (_color) ? Colors .white : Colors .black,
238- fontWeight: FontWeight .bold,
239- ),
240- ),
241- ),
242- ),
243- ],
244- )
245- : AnimatedOpacity (
246- duration: const Duration (milliseconds: 300 ),
247- opacity: _currentShading == _color ? 1 : 0 ,
248- child: Container (
249- padding: const EdgeInsets .only (top: 16 ),
250- alignment: Alignment .topCenter,
251- child: Text (
252- color.values.first,
253- style: TextStyle (
254- color: useWhiteForeground (_color) ? Colors .white : Colors .black,
255- fontWeight: FontWeight .bold,
256- fontSize: 14 ,
257- ),
258- softWrap: false ,
259- ),
260- ),
261- )
225+ ? Row (
226+ children: [
227+ Text (
228+ ' ${color .values .first }' ,
229+ style: TextStyle (color: useWhiteForeground (_color) ? Colors .white : Colors .black),
230+ ),
231+ Expanded (
232+ child: Align (
233+ alignment: Alignment .centerRight,
234+ child: Text (
235+ '#${(_color .toString ().replaceFirst ('Color(0xff' , '' ).replaceFirst (')' , '' )).toUpperCase ()} ' ,
236+ style: TextStyle (
237+ color: useWhiteForeground (_color) ? Colors .white : Colors .black,
238+ fontWeight: FontWeight .bold,
239+ ),
240+ ),
241+ ),
242+ ),
243+ ],
244+ )
245+ : AnimatedOpacity (
246+ duration: const Duration (milliseconds: 300 ),
247+ opacity: _currentShading == _color ? 1 : 0 ,
248+ child: Container (
249+ padding: const EdgeInsets .only (top: 16 ),
250+ alignment: Alignment .topCenter,
251+ child: Text (
252+ color.values.first,
253+ style: TextStyle (
254+ color: useWhiteForeground (_color) ? Colors .white : Colors .black,
255+ fontWeight: FontWeight .bold,
256+ fontSize: 14 ,
257+ ),
258+ softWrap: false ,
259+ ),
260+ ),
261+ )
262262 : const SizedBox (),
263263 ),
264264 ),
0 commit comments