2022-08-22 01:55:54 +02:00
|
|
|
import 'package:device_apps/device_apps.dart';
|
2022-07-31 21:46:27 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-08-16 15:06:56 +02:00
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
2022-08-30 03:07:28 +02:00
|
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
2022-08-16 15:06:56 +02:00
|
|
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
2022-08-21 12:47:44 +02:00
|
|
|
import 'package:revanced_manager/ui/widgets/shared/application_item.dart';
|
2022-07-31 21:46:27 +02:00
|
|
|
|
2022-08-01 20:15:55 +02:00
|
|
|
class InstalledAppsCard extends StatelessWidget {
|
2022-08-30 03:07:28 +02:00
|
|
|
InstalledAppsCard({
|
2022-08-11 22:17:10 +02:00
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
2022-07-31 21:46:27 +02:00
|
|
|
|
2022-08-30 03:07:28 +02:00
|
|
|
final List<PatchedApplication> apps =
|
|
|
|
locator<HomeViewModel>().patchedInstalledApps;
|
|
|
|
|
2022-07-31 21:46:27 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-29 16:01:51 +02:00
|
|
|
return ListView(
|
|
|
|
shrinkWrap: true,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
2022-08-30 03:07:28 +02:00
|
|
|
children: apps
|
2022-08-29 16:01:51 +02:00
|
|
|
.map((app) => ApplicationItem(
|
|
|
|
icon: app.icon,
|
|
|
|
name: app.name,
|
|
|
|
patchDate: app.patchDate,
|
|
|
|
changelog: app.changelog,
|
|
|
|
isUpdatableApp: false,
|
|
|
|
onPressed: () => DeviceApps.openApp(app.packageName),
|
|
|
|
))
|
|
|
|
.toList(),
|
2022-07-31 21:46:27 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|