revanced-manager/lib/ui/widgets/available_updates_card.dart
Aunali321 106d77ea0c
feat: "New dashboard UI". (#3)
* feat: "New dashboard UI".

* fix: some improvenents

* fix: fix inconsistencies and light theme.

* fix: save patched and installed apps on prefs, improve installer log, improve dashboard with real data (wip)

Co-authored-by: Aunali321 <aunvakil.aa@gmail.com>

* feat: move chips to a separate widget.

Co-authored-by: Alberto Ponces <ponces26@gmail.com>
2022-08-16 14:06:56 +01:00

36 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
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';
import 'package:revanced_manager/ui/widgets/application_item.dart';
class AvailableUpdatesCard extends StatelessWidget {
const AvailableUpdatesCard({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
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(),
),
],
);
}
}