fix: color not show issue when change cover photo color. (#2624)

* fixe: color not show issue when change cover photo color.

* fix:added missing a required comma. and toColor() extension
This commit is contained in:
chirag paneliya 2023-05-29 19:38:56 +05:30 committed by GitHub
parent 6bbdc7ceff
commit 57389d1fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -499,27 +499,25 @@ class _CoverColorPickerState extends State<CoverColorPicker> {
child: Padding( child: Padding(
padding: const EdgeInsets.only(right: 10.0), padding: const EdgeInsets.only(right: 10.0),
child: SizedBox.square( child: SizedBox.square(
dimension: 25, dimension: isChecked ? 24 : 25,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: isChecked color: option.colorHex.toColor(),
? Colors.transparent
: Color(int.tryParse(option.colorHex) ?? 0xFFFFFFFF),
border: isChecked border: isChecked
? Border.all( ? Border.all(
color: Color(int.tryParse(option.colorHex) ?? 0xFFFFFF), color: const Color(0xFFFFFFFF),
width: 2.0,
) )
: null, : null,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: isChecked child: isChecked
? SizedBox.square( ? SizedBox.square(
dimension: 25, dimension: 24,
child: Container( child: Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: option.colorHex.toColor(),
Color(int.tryParse(option.colorHex) ?? 0xFFFFFFFF),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
), ),