2022-08-06 17:43:28 +05:30
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
2022-08-16 18:36:56 +05:30
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
2024-02-12 02:22:25 +03:00
|
|
|
import 'package:revanced_manager/gen/strings.g.dart';
|
2022-08-09 00:01:06 +01:00
|
|
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
2022-08-21 16:17:44 +05:30
|
|
|
import 'package:revanced_manager/ui/widgets/homeView/installed_apps_card.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/homeView/latest_commit_card.dart';
|
2022-09-02 14:35:25 +01:00
|
|
|
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
|
2022-08-06 17:43:28 +05:30
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class HomeView extends StatelessWidget {
|
2023-11-11 19:07:32 +07:00
|
|
|
const HomeView({super.key});
|
2022-08-06 17:43:28 +05:30
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-16 18:36:56 +05:30
|
|
|
return ViewModelBuilder<HomeViewModel>.reactive(
|
|
|
|
disposeViewModel: false,
|
2023-04-30 00:39:42 +05:30
|
|
|
fireOnViewModelReadyOnce: true,
|
2023-01-30 18:05:06 +05:30
|
|
|
onViewModelReady: (model) => model.initialize(context),
|
2022-08-16 18:36:56 +05:30
|
|
|
viewModelBuilder: () => locator<HomeViewModel>(),
|
2022-08-06 17:43:28 +05:30
|
|
|
builder: (context, model, child) => Scaffold(
|
2022-09-11 02:01:06 +01:00
|
|
|
body: RefreshIndicator(
|
2022-09-12 00:35:41 +01:00
|
|
|
onRefresh: () => model.forceRefresh(context),
|
2022-09-11 02:01:06 +01:00
|
|
|
child: CustomScrollView(
|
|
|
|
slivers: <Widget>[
|
|
|
|
CustomSliverAppBar(
|
2022-09-19 16:24:31 +01:00
|
|
|
isMainView: true,
|
2024-02-12 02:22:25 +03:00
|
|
|
title: Text(
|
|
|
|
t.homeView.widgetTitle,
|
|
|
|
style: GoogleFonts.inter(
|
|
|
|
color: Theme.of(context).textTheme.titleLarge!.color,
|
2022-08-06 17:43:28 +05:30
|
|
|
),
|
2022-08-24 13:22:36 +01:00
|
|
|
),
|
|
|
|
),
|
2022-09-11 02:01:06 +01:00
|
|
|
SliverPadding(
|
2022-09-12 17:30:44 +01:00
|
|
|
padding: const EdgeInsets.all(20.0),
|
2022-09-11 02:01:06 +01:00
|
|
|
sliver: SliverList(
|
|
|
|
delegate: SliverChildListDelegate.fixed(
|
|
|
|
<Widget>[
|
2024-02-12 02:22:25 +03:00
|
|
|
Text(
|
|
|
|
t.homeView.updatesSubtitle,
|
|
|
|
style: Theme.of(context).textTheme.titleLarge,
|
2022-08-07 00:37:12 +01:00
|
|
|
),
|
2022-09-11 02:01:06 +01:00
|
|
|
const SizedBox(height: 10),
|
2023-08-04 02:08:56 +05:45
|
|
|
LatestCommitCard(model: model, parentContext: context),
|
2022-09-11 02:01:06 +01:00
|
|
|
const SizedBox(height: 23),
|
2024-02-12 02:22:25 +03:00
|
|
|
Text(
|
|
|
|
t.homeView.patchedSubtitle,
|
|
|
|
style: Theme.of(context).textTheme.titleLarge,
|
2022-09-11 02:01:06 +01:00
|
|
|
),
|
2023-08-04 03:58:50 +07:00
|
|
|
const SizedBox(height: 10),
|
|
|
|
InstalledAppsCard(),
|
2022-09-11 02:01:06 +01:00
|
|
|
],
|
|
|
|
),
|
2022-08-24 13:22:36 +01:00
|
|
|
),
|
2022-08-06 17:43:28 +05:30
|
|
|
),
|
2022-09-11 02:01:06 +01:00
|
|
|
],
|
|
|
|
),
|
2022-08-06 17:43:28 +05:30
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|