2022-08-06 14:13:28 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-08-07 01:37:12 +02:00
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
2022-08-06 14:13:28 +02:00
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
2022-08-12 11:42:43 +02:00
|
|
|
import 'package:revanced_manager/theme.dart';
|
2022-08-09 01:01:06 +02:00
|
|
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
2022-08-06 23:35:35 +02:00
|
|
|
import 'package:revanced_manager/ui/widgets/available_updates_card.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/installed_apps_card.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/latest_commit_card.dart';
|
2022-08-06 14:13:28 +02:00
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class HomeView extends StatelessWidget {
|
|
|
|
const HomeView({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ViewModelBuilder.reactive(
|
2022-08-09 02:16:33 +02:00
|
|
|
viewModelBuilder: () => HomeViewModel(),
|
2022-08-06 14:13:28 +02:00
|
|
|
builder: (context, model, child) => Scaffold(
|
|
|
|
body: SafeArea(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Padding(
|
2022-08-07 02:13:27 +02:00
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
2022-08-06 14:13:28 +02:00
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
const SizedBox(height: 60),
|
2022-08-07 01:37:12 +02:00
|
|
|
I18nText(
|
|
|
|
'homeView.widgetTitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
|
|
|
fontSize: 28,
|
|
|
|
),
|
2022-08-06 14:13:28 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 23),
|
2022-08-07 01:37:12 +02:00
|
|
|
I18nText(
|
|
|
|
'homeView.updatesSubtitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
2022-08-12 11:42:43 +02:00
|
|
|
fontSize: 20,
|
|
|
|
color: isDark
|
|
|
|
? const Color(0xffD1E1FA)
|
|
|
|
: const Color(0xff384E6E),
|
2022-08-07 01:37:12 +02:00
|
|
|
),
|
2022-08-06 14:13:28 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
2022-08-11 22:17:10 +02:00
|
|
|
LatestCommitCard(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.primary),
|
2022-08-06 14:13:28 +02:00
|
|
|
const SizedBox(height: 14),
|
2022-08-07 01:37:12 +02:00
|
|
|
I18nText(
|
|
|
|
'homeView.patchedSubtitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
2022-08-12 11:42:43 +02:00
|
|
|
fontSize: 20,
|
|
|
|
color: isDark
|
|
|
|
? const Color(0xffD1E1FA)
|
|
|
|
: const Color(0xff384E6E),
|
2022-08-07 01:37:12 +02:00
|
|
|
),
|
2022-08-06 14:13:28 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 14),
|
2022-08-11 22:17:10 +02:00
|
|
|
AvailableUpdatesCard(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.primary,
|
2022-08-11 22:17:10 +02:00
|
|
|
),
|
2022-08-06 14:13:28 +02:00
|
|
|
const SizedBox(height: 15),
|
2022-08-11 22:17:10 +02:00
|
|
|
InstalledAppsCard(
|
2022-08-12 11:42:43 +02:00
|
|
|
color: Theme.of(context).colorScheme.primary,
|
2022-08-11 22:17:10 +02:00
|
|
|
),
|
2022-08-06 14:13:28 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|