Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apk picker list tile should have 3 rows #628

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading