Skip to content

Commit 8a0d8d8

Browse files
authored
fix: make "Pick image from device" button full-width (#764)
1 parent 4c0add4 commit 8a0d8d8

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

lib/utilities/playlist_image_picker.dart

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,33 @@ Widget buildImagePickerRow(
116116
) {
117117
final colorScheme = Theme.of(context).colorScheme;
118118

119-
return OutlinedButton.icon(
120-
onPressed: onPickImage,
121-
style: OutlinedButton.styleFrom(
122-
foregroundColor: colorScheme.primary,
123-
side: BorderSide(
124-
color: isImagePicked ? colorScheme.primary : colorScheme.outline,
119+
return SizedBox(
120+
width: double.infinity,
121+
child: OutlinedButton.icon(
122+
onPressed: onPickImage,
123+
style: OutlinedButton.styleFrom(
124+
alignment: Alignment.centerLeft,
125+
foregroundColor: colorScheme.primary,
126+
side: BorderSide(
127+
color: isImagePicked ? colorScheme.primary : colorScheme.outline,
128+
),
129+
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
130+
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
131+
),
132+
icon: Padding(
133+
padding: const EdgeInsets.only(left: 4),
134+
child: Icon(
135+
isImagePicked
136+
? FluentIcons.checkmark_circle_20_filled
137+
: FluentIcons.image_add_20_regular,
138+
size: 20,
139+
),
140+
),
141+
label: Text(
142+
isImagePicked
143+
? context.l10n!.imagePicked
144+
: context.l10n!.pickImageFromDevice,
125145
),
126-
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
127-
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
128-
),
129-
icon: Icon(
130-
isImagePicked
131-
? FluentIcons.checkmark_circle_20_filled
132-
: FluentIcons.image_add_20_regular,
133-
size: 20,
134-
),
135-
label: Text(
136-
isImagePicked
137-
? context.l10n!.imagePicked
138-
: context.l10n!.pickImageFromDevice,
139146
),
140147
);
141148
}

0 commit comments

Comments
 (0)