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';
|
|
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
|
|
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
2022-08-06 23:35:35 +02:00
|
|
|
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
2022-07-31 21:46:27 +02:00
|
|
|
|
2022-08-01 20:15:55 +02:00
|
|
|
class AvailableUpdatesCard extends StatelessWidget {
|
2022-08-11 22:17:10 +02:00
|
|
|
const AvailableUpdatesCard({
|
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
2022-07-31 21:46:27 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-16 15:06:56 +02:00
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
FutureBuilder<List<PatchedApplication>>(
|
|
|
|
future: locator<HomeViewModel>().getPatchedApps(true),
|
|
|
|
builder: (context, snapshot) =>
|
|
|
|
snapshot.hasData && snapshot.data!.length > 1
|
|
|
|
? ListView.builder(
|
|
|
|
itemBuilder: (context, index) => ApplicationItem(
|
|
|
|
icon: snapshot.data![index].icon,
|
|
|
|
name: snapshot.data![index].name,
|
|
|
|
patchDate: snapshot.data![index].patchDate,
|
|
|
|
isUpdatableApp: true,
|
|
|
|
onPressed: () => {},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
),
|
|
|
|
],
|
2022-07-31 21:46:27 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|