Skip to content

Commit

Permalink
feat: apk picker list tile should have 3 rows (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Aug 23, 2023
1 parent 2dccef7 commit 415c7ff
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
18 changes: 14 additions & 4 deletions lib/pages/apk_picker_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class _ApkPickerPageState extends State<ApkPickerPage> {
children: [
MemoryThumbnail(
bytes: thumbnail,
size: 60,
fileType: FileType.apk,
),
const SizedBox(width: 10),
Expand All @@ -130,12 +131,21 @@ class _ApkPickerPageState extends State<ApkPickerPage> {
builder: (context, ref) {
final appSize = ref.watch(apkSizeProvider(app.apkFilePath));
final appSizeString = appSize.maybeWhen(
data: (size) => '${size.asReadableFileSize} - ',
data: (size) => '${size.asReadableFileSize} ',
orElse: () => '',
);
return Text(
'$appSizeString${app.versionName ?? '?'} - ${app.packageName}',
style: Theme.of(context).textTheme.bodySmall,
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'$appSizeString${app.versionName != null ? 'v${app.versionName}' : ''}',
style: Theme.of(context).textTheme.bodySmall,
),
Text(
app.packageName,
style: Theme.of(context).textTheme.bodySmall,
),
],
);
},
),
Expand Down
9 changes: 7 additions & 2 deletions lib/widget/file_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ class FilePathThumbnail extends StatelessWidget {
class MemoryThumbnail extends StatelessWidget {
final Uint8List? bytes;
final FileType fileType;
final double size;

const MemoryThumbnail({
required this.bytes,
required this.fileType,
this.size = 50,
});

@override
Expand All @@ -117,24 +119,27 @@ class MemoryThumbnail extends StatelessWidget {
return _Thumbnail(
thumbnail: thumbnail,
icon: fileType.icon,
size: size,
);
}
}

class _Thumbnail extends StatelessWidget {
final Widget? thumbnail;
final IconData? icon;
final double size;

const _Thumbnail({
required this.thumbnail,
required this.icon,
this.size = 50,
});

@override
Widget build(BuildContext context) {
return SizedBox(
width: 50,
height: 50,
width: size,
height: size,
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: ColoredBox(
Expand Down

0 comments on commit 415c7ff

Please sign in to comment.