2022-07-31 21:46:27 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-08-07 01:37:12 +02:00
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
2022-07-31 21:46:27 +02:00
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
2022-08-15 19:42:09 +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';
|
|
|
|
import 'package:revanced_manager/ui/widgets/patch_text_button.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
|
|
|
final Color? color;
|
|
|
|
const AvailableUpdatesCard({
|
|
|
|
Key? key,
|
|
|
|
this.color = const Color(0xff1B222B),
|
|
|
|
}) : super(key: key);
|
2022-07-31 21:46:27 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
2022-08-11 22:17:10 +02:00
|
|
|
color: color,
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
2022-08-12 11:42:43 +02:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 12),
|
2022-07-31 21:46:27 +02:00
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
2022-08-12 11:42:43 +02:00
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
I18nText(
|
|
|
|
'availableUpdatesCard.widgetTitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
|
|
|
fontSize: 16,
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
2022-08-07 01:37:12 +02:00
|
|
|
),
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
2022-08-12 11:42:43 +02:00
|
|
|
PatchTextButton(
|
|
|
|
text: FlutterI18n.translate(
|
|
|
|
context,
|
|
|
|
'availableUpdatesCard.patchButton',
|
|
|
|
),
|
|
|
|
onPressed: () => {},
|
|
|
|
backgroundColor: Theme.of(context).colorScheme.secondary,
|
2022-08-07 01:37:12 +02:00
|
|
|
),
|
2022-08-12 11:42:43 +02:00
|
|
|
],
|
|
|
|
),
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
2022-08-15 19:42:09 +02:00
|
|
|
FutureBuilder<List<PatchedApplication>>(
|
|
|
|
future: locator<HomeViewModel>().getPatchedApps(),
|
|
|
|
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,
|
|
|
|
onPressed: () => {},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: Container(),
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
2022-08-07 01:37:12 +02:00
|
|
|
I18nText(
|
|
|
|
'availableUpdatesCard.changelogLabel',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.roboto(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.tertiary,
|
2022-08-07 01:37:12 +02:00
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
Text(
|
2022-08-07 01:37:12 +02:00
|
|
|
'fix: we made the player even worse (you love)',
|
2022-07-31 21:46:27 +02:00
|
|
|
style: GoogleFonts.roboto(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.tertiary,
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
Text(
|
2022-08-07 01:37:12 +02:00
|
|
|
'chore: guhhughghu',
|
2022-07-31 21:46:27 +02:00
|
|
|
style: GoogleFonts.roboto(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.tertiary,
|
2022-07-31 21:46:27 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|