2022-07-31 21:46:27 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-09-02 15:35:25 +02:00
|
|
|
import 'package:flutter_i18n/flutter_i18n.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-09-05 04:32:36 +02:00
|
|
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
2022-07-31 21:46:27 +02:00
|
|
|
|
2022-08-01 20:15:55 +02:00
|
|
|
class AvailableUpdatesCard extends StatelessWidget {
|
2022-09-01 12:16:14 +02:00
|
|
|
AvailableUpdatesCard({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>().patchedUpdatableApps;
|
|
|
|
|
2022-07-31 21:46:27 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-10-19 23:15:48 +02:00
|
|
|
return CustomCard(
|
|
|
|
child: Center(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Icon(
|
|
|
|
size: 40,
|
|
|
|
Icons.update_disabled,
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
I18nText(
|
|
|
|
'homeView.WIP',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
textAlign: TextAlign.center,
|
2023-02-19 04:16:49 +01:00
|
|
|
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
2022-10-19 23:15:48 +02:00
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
2022-09-02 01:10:10 +02:00
|
|
|
),
|
|
|
|
),
|
2022-10-19 23:15:48 +02:00
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
// return apps.isEmpty
|
|
|
|
// ? CustomCard(
|
|
|
|
// child: Center(
|
|
|
|
// child: Column(
|
|
|
|
// children: <Widget>[
|
|
|
|
// Icon(
|
|
|
|
// size: 40,
|
|
|
|
// Icons.update_disabled,
|
|
|
|
// color: Theme.of(context).colorScheme.secondary,
|
|
|
|
// ),
|
|
|
|
// const SizedBox(height: 16),
|
|
|
|
// I18nText(
|
|
|
|
// 'homeView.noUpdates',
|
|
|
|
// child: Text(
|
|
|
|
// '',
|
|
|
|
// textAlign: TextAlign.center,
|
2023-02-19 04:16:49 +01:00
|
|
|
// style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
2022-10-19 23:15:48 +02:00
|
|
|
// color: Theme.of(context).colorScheme.secondary,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// : ListView(
|
|
|
|
// shrinkWrap: true,
|
|
|
|
// padding: EdgeInsets.zero,
|
|
|
|
// physics: const NeverScrollableScrollPhysics(),
|
|
|
|
// children: apps
|
|
|
|
// .map((app) => ApplicationItem(
|
|
|
|
// icon: app.icon,
|
|
|
|
// name: app.name,
|
|
|
|
// patchDate: app.patchDate,
|
|
|
|
// changelog: app.changelog,
|
|
|
|
// isUpdatableApp: true,
|
|
|
|
// //TODO: Find a better way to do update functionality
|
|
|
|
// onPressed: () {}
|
|
|
|
// // () =>
|
|
|
|
// // locator<HomeViewModel>().navigateToPatcher(
|
|
|
|
// // app,
|
|
|
|
// // ),
|
|
|
|
// ))
|
|
|
|
// .toList(),
|
|
|
|
// );
|
2022-07-31 21:46:27 +02:00
|
|
|
}
|
|
|
|
}
|