mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: Add ReVanced API and implement cache on it and on Github API
This commit is contained in:
@ -7,6 +7,7 @@ import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:revanced_manager/services/root_api.dart';
|
||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
||||
@ -73,7 +74,7 @@ class AppInfoViewModel extends BaseViewModel {
|
||||
label: I18nText('okButton'),
|
||||
onPressed: () {
|
||||
uninstallApp(app);
|
||||
locator<NavigationViewModel>().notifyListeners();
|
||||
locator<HomeViewModel>().notifyListeners();
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
|
@ -30,7 +30,7 @@ class AppSkeletonLoader extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 25,
|
||||
height: 34,
|
||||
width: screenWidth * 0.4,
|
||||
child: SkeletonParagraph(
|
||||
style: const SkeletonParagraphStyle(
|
||||
@ -42,7 +42,7 @@ class AppSkeletonLoader extends StatelessWidget {
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 4),
|
||||
color: Colors.white,
|
||||
height: 25,
|
||||
height: 34,
|
||||
width: screenWidth * 0.6,
|
||||
child: SkeletonParagraph(
|
||||
style: const SkeletonParagraphStyle(
|
||||
|
@ -1,11 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:github/github.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class ContributorsCard extends StatefulWidget {
|
||||
final String title;
|
||||
final List<Contributor> contributors;
|
||||
final List<dynamic> contributors;
|
||||
final double height;
|
||||
|
||||
const ContributorsCard({
|
||||
@ -52,9 +51,9 @@ class _ContributorsCardState extends State<ContributorsCard> {
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
child: GestureDetector(
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse(widget.contributors[index].htmlUrl!)),
|
||||
Uri.parse(widget.contributors[index]['html_url'])),
|
||||
child: Image.network(
|
||||
widget.contributors[index].avatarUrl!,
|
||||
widget.contributors[index]['avatar_url'],
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
|
@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
@ -20,8 +18,7 @@ class LatestCommitCard extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
final GithubAPI _githubAPI = GithubAPI();
|
||||
final HomeViewModel model = locator<HomeViewModel>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -35,10 +32,8 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
Row(
|
||||
children: <Widget>[
|
||||
I18nText('latestCommitCard.patcherLabel'),
|
||||
FutureBuilder<String>(
|
||||
future: _githubAPI.latestCommitTime(
|
||||
_managerAPI.getPatcherRepo(),
|
||||
),
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestPatcherReleaseTime(),
|
||||
builder: (context, snapshot) => Text(
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? FlutterI18n.translate(
|
||||
@ -58,10 +53,8 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
Row(
|
||||
children: <Widget>[
|
||||
I18nText('latestCommitCard.managerLabel'),
|
||||
FutureBuilder<String>(
|
||||
future: _githubAPI.latestCommitTime(
|
||||
_managerAPI.getManagerRepo(),
|
||||
),
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestManagerReleaseTime(),
|
||||
builder: (context, snapshot) =>
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? I18nText(
|
||||
|
@ -49,7 +49,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(format(patchDate, locale: 'en_short')),
|
||||
Text(format(patchDate)),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
|
Reference in New Issue
Block a user