mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
Merge branch 'flutter' of https://github.com/revanced/revanced-manager into flutter
This commit is contained in:
@ -35,29 +35,29 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
||||
child: model.noApps
|
||||
? Center(
|
||||
child: I18nText('appSelectorCard.noAppsLabel'),
|
||||
)
|
||||
: model.apps.isEmpty
|
||||
? const AppSkeletonLoader()
|
||||
: Column(
|
||||
children: <Widget>[
|
||||
SearchBar(
|
||||
showSelectIcon: false,
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorView.searchBarHint',
|
||||
),
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SearchBar(
|
||||
showSelectIcon: false,
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorView.searchBarHint',
|
||||
),
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(
|
||||
child: model.noApps
|
||||
? Center(
|
||||
child: I18nText('appSelectorCard.noAppsLabel'),
|
||||
)
|
||||
: model.apps.isEmpty
|
||||
? const AppSkeletonLoader()
|
||||
: ListView(
|
||||
padding: const EdgeInsets.only(bottom: 80),
|
||||
children: model
|
||||
.getFilteredApps(_query)
|
||||
@ -74,9 +74,9 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -1,34 +1,24 @@
|
||||
import 'package:github/github.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:stacked/stacked.dart';
|
||||
|
||||
class ContributorsViewModel extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
final GithubAPI _githubAPI = GithubAPI();
|
||||
List<Contributor> patcherContributors = [];
|
||||
List<Contributor> patchesContributors = [];
|
||||
List<Contributor> integrationsContributors = [];
|
||||
List<Contributor> cliContributors = [];
|
||||
List<Contributor> managerContributors = [];
|
||||
List<dynamic> patcherContributors = [];
|
||||
List<dynamic> patchesContributors = [];
|
||||
List<dynamic> integrationsContributors = [];
|
||||
List<dynamic> cliContributors = [];
|
||||
List<dynamic> managerContributors = [];
|
||||
|
||||
Future<void> getContributors() async {
|
||||
patcherContributors = await _githubAPI.getContributors(
|
||||
_managerAPI.getPatcherRepo(),
|
||||
);
|
||||
patchesContributors = await _githubAPI.getContributors(
|
||||
_managerAPI.getPatchesRepo(),
|
||||
);
|
||||
integrationsContributors = await _githubAPI.getContributors(
|
||||
_managerAPI.getIntegrationsRepo(),
|
||||
);
|
||||
cliContributors = await _githubAPI.getContributors(
|
||||
_managerAPI.getCliRepo(),
|
||||
);
|
||||
managerContributors = await _githubAPI.getContributors(
|
||||
_managerAPI.getManagerRepo(),
|
||||
);
|
||||
Map<String, List<dynamic>> contributors =
|
||||
await _managerAPI.getContributors();
|
||||
patcherContributors = contributors[_managerAPI.defaultPatcherRepo] ?? [];
|
||||
patchesContributors = contributors[_managerAPI.getPatchesRepo()] ?? [];
|
||||
integrationsContributors =
|
||||
contributors[_managerAPI.getIntegrationsRepo()] ?? [];
|
||||
cliContributors = contributors[_managerAPI.defaultCliRepo] ?? [];
|
||||
managerContributors = contributors[_managerAPI.defaultManagerRepo] ?? [];
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
@ -17,76 +17,81 @@ class HomeView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<HomeViewModel>.reactive(
|
||||
disposeViewModel: false,
|
||||
onModelReady: (model) => model.initialize(),
|
||||
onModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => locator<HomeViewModel>(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
body: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
title: I18nText(
|
||||
'homeView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.headline6!.color,
|
||||
body: RefreshIndicator(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
onRefresh: () => model.forceRefresh(context),
|
||||
child: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
title: I18nText(
|
||||
'homeView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.headline6!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildListDelegate.fixed(
|
||||
<Widget>[
|
||||
I18nText(
|
||||
'homeView.updatesSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
LatestCommitCard(
|
||||
onPressed: () =>
|
||||
model.showUpdateConfirmationDialog(context),
|
||||
),
|
||||
const SizedBox(height: 23),
|
||||
I18nText(
|
||||
'homeView.patchedSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
DashboardChip(
|
||||
label: I18nText('homeView.updatesAvailable'),
|
||||
isSelected: model.showUpdatableApps,
|
||||
onSelected: (value) {
|
||||
model.toggleUpdatableApps(true);
|
||||
},
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildListDelegate.fixed(
|
||||
<Widget>[
|
||||
I18nText(
|
||||
'homeView.updatesSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
DashboardChip(
|
||||
label: I18nText('homeView.installed'),
|
||||
isSelected: !model.showUpdatableApps,
|
||||
onSelected: (value) {
|
||||
model.toggleUpdatableApps(false);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
model.showUpdatableApps
|
||||
? AvailableUpdatesCard()
|
||||
: InstalledAppsCard(),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
LatestCommitCard(
|
||||
onPressed: () =>
|
||||
model.showUpdateConfirmationDialog(context),
|
||||
),
|
||||
const SizedBox(height: 23),
|
||||
I18nText(
|
||||
'homeView.patchedSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
DashboardChip(
|
||||
label: I18nText('homeView.updatesAvailable'),
|
||||
isSelected: model.showUpdatableApps,
|
||||
onSelected: (value) {
|
||||
model.toggleUpdatableApps(true);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
DashboardChip(
|
||||
label: I18nText('homeView.installed'),
|
||||
isSelected: !model.showUpdatableApps,
|
||||
onSelected: (value) {
|
||||
model.toggleUpdatableApps(false);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
model.showUpdatableApps
|
||||
? AvailableUpdatesCard()
|
||||
: InstalledAppsCard(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -1,6 +1,7 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:io';
|
||||
import 'package:app_installer/app_installer.dart';
|
||||
import 'package:cross_connectivity/cross_connectivity.dart';
|
||||
import 'package:device_apps/device_apps.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
@ -23,13 +24,13 @@ class HomeViewModel extends BaseViewModel {
|
||||
final NavigationService _navigationService = locator<NavigationService>();
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||
DateTime? _lastUpdate;
|
||||
bool showUpdatableApps = true;
|
||||
List<PatchedApplication> patchedInstalledApps = [];
|
||||
List<PatchedApplication> patchedUpdatableApps = [];
|
||||
|
||||
Future<void> initialize() async {
|
||||
Future<void> initialize(BuildContext context) async {
|
||||
await flutterLocalNotificationsPlugin.initialize(
|
||||
const InitializationSettings(
|
||||
android: AndroidInitializationSettings('ic_notification'),
|
||||
@ -37,6 +38,17 @@ class HomeViewModel extends BaseViewModel {
|
||||
onSelectNotification: (p) =>
|
||||
DeviceApps.openApp('app.revanced.manager.flutter'),
|
||||
);
|
||||
bool isConnected = await Connectivity().checkConnection();
|
||||
if (!isConnected) {
|
||||
Fluttertoast.showToast(
|
||||
msg: FlutterI18n.translate(
|
||||
context,
|
||||
'homeView.noConnection',
|
||||
),
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.CENTER,
|
||||
);
|
||||
}
|
||||
_getPatchedApps();
|
||||
_managerAPI.reAssessSavedApps().then((_) => _getPatchedApps());
|
||||
}
|
||||
@ -62,10 +74,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
void _getPatchedApps() {
|
||||
patchedInstalledApps = _managerAPI
|
||||
.getPatchedApps()
|
||||
.where((app) => app.hasUpdates == false)
|
||||
.toList();
|
||||
patchedInstalledApps = _managerAPI.getPatchedApps().toList();
|
||||
patchedUpdatableApps = _managerAPI
|
||||
.getPatchedApps()
|
||||
.where((app) => app.hasUpdates == true)
|
||||
@ -99,7 +108,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.CENTER,
|
||||
);
|
||||
File? managerApk = await _managerAPI.downloadManager('.apk');
|
||||
File? managerApk = await _managerAPI.downloadManager();
|
||||
if (managerApk != null) {
|
||||
flutterLocalNotificationsPlugin.show(
|
||||
0,
|
||||
@ -171,4 +180,21 @@ class HomeViewModel extends BaseViewModel {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<String?> getLatestPatcherReleaseTime() async {
|
||||
return _managerAPI.getLatestPatcherReleaseTime();
|
||||
}
|
||||
|
||||
Future<String?> getLatestManagerReleaseTime() async {
|
||||
return _managerAPI.getLatestManagerReleaseTime();
|
||||
}
|
||||
|
||||
Future<void> forceRefresh(BuildContext context) async {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
if (_lastUpdate == null ||
|
||||
_lastUpdate!.difference(DateTime.now()).inSeconds > 60) {
|
||||
_managerAPI.clearAllData();
|
||||
}
|
||||
initialize(context);
|
||||
}
|
||||
}
|
||||
|
@ -60,13 +60,14 @@ class InstallerView extends StatelessWidget {
|
||||
preferredSize: const Size(double.infinity, 1.0),
|
||||
child: LinearProgressIndicator(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.primaryContainer,
|
||||
value: model.progress,
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
padding: const EdgeInsets.all(20.0).copyWith(bottom: 20.0),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildListDelegate.fixed(
|
||||
<Widget>[
|
||||
@ -79,61 +80,64 @@ class InstallerView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16,
|
||||
horizontal: 0,
|
||||
),
|
||||
child: Visibility(
|
||||
visible: !model.isPatching,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Visibility(
|
||||
visible: model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
label: I18nText('installerView.openButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () {
|
||||
model.openApp();
|
||||
model.cleanPatcher();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
isFilled: false,
|
||||
label: I18nText(
|
||||
'installerView.installRootButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () => model.installResult(true),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
label:
|
||||
I18nText('installerView.installButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () => model.installResult(false),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
hasScrollBody: false,
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Visibility(
|
||||
visible: !model.isPatching,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0).copyWith(top: 0.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Visibility(
|
||||
visible: model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
label: I18nText('installerView.openButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () {
|
||||
model.openApp();
|
||||
model.cleanPatcher();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
isFilled: false,
|
||||
label:
|
||||
I18nText('installerView.installRootButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () => model.installResult(true),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !model.isInstalled,
|
||||
child: CustomMaterialButton(
|
||||
label: I18nText('installerView.installButton'),
|
||||
isExpanded: true,
|
||||
onPressed: () => model.installResult(false),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -10,6 +10,7 @@ import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
|
||||
class InstallerViewModel extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
@ -46,10 +47,12 @@ class InstallerViewModel extends BaseViewModel {
|
||||
),
|
||||
);
|
||||
await FlutterBackground.enableBackgroundExecution();
|
||||
} finally {
|
||||
await handlePlatformChannelMethods();
|
||||
await runPatcher();
|
||||
await Wakelock.enable();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
await handlePlatformChannelMethods();
|
||||
await runPatcher();
|
||||
}
|
||||
|
||||
Future<dynamic> handlePlatformChannelMethods() async {
|
||||
@ -119,9 +122,11 @@ class InstallerViewModel extends BaseViewModel {
|
||||
}
|
||||
try {
|
||||
await FlutterBackground.disableBackgroundExecution();
|
||||
} finally {
|
||||
isPatching = false;
|
||||
await Wakelock.disable();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
isPatching = false;
|
||||
}
|
||||
|
||||
void installResult(bool installAsRoot) async {
|
||||
|
@ -37,30 +37,30 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
||||
child: model.patches.isEmpty
|
||||
? Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
children: <Widget>[
|
||||
SearchBar(
|
||||
showSelectIcon: true,
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'patchesSelectorView.searchBarHint',
|
||||
),
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
});
|
||||
},
|
||||
onSelectAll: (value) => model.selectAllPatches(value),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SearchBar(
|
||||
showSelectIcon: true,
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'patchesSelectorView.searchBarHint',
|
||||
),
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
});
|
||||
},
|
||||
onSelectAll: (value) => model.selectAllPatches(value),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(
|
||||
child: model.patches.isEmpty
|
||||
? Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
)
|
||||
: ListView(
|
||||
padding: const EdgeInsets.only(bottom: 80),
|
||||
children: model
|
||||
.getQueriedPatches(_query)
|
||||
@ -160,9 +160,9 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
@ -71,9 +72,14 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
|
||||
List<String> getSupportedVersions(Patch patch) {
|
||||
PatchedApplication app = locator<PatcherViewModel>().selectedApp!;
|
||||
return patch.compatiblePackages
|
||||
.firstWhere((pack) => pack.name == app.packageName)
|
||||
.versions;
|
||||
Package? package = patch.compatiblePackages.firstWhereOrNull(
|
||||
(pack) => pack.name == app.packageName,
|
||||
);
|
||||
if (package != null) {
|
||||
return package.versions;
|
||||
} else {
|
||||
return List.empty();
|
||||
}
|
||||
}
|
||||
|
||||
bool isPatchSupported(Patch patch) {
|
||||
|
@ -1,5 +1,4 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:dynamic_themes/dynamic_themes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -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>().initialize(context);
|
||||
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,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:github/github.dart';
|
||||
import 'package:flutter_cache_manager/file.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.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,11 +53,25 @@ class _ContributorsCardState extends State<ContributorsCard> {
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
child: GestureDetector(
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse(widget.contributors[index].htmlUrl!)),
|
||||
child: Image.network(
|
||||
widget.contributors[index].avatarUrl!,
|
||||
height: 40,
|
||||
width: 40,
|
||||
Uri.parse(
|
||||
widget.contributors[index]['html_url'],
|
||||
),
|
||||
),
|
||||
child: FutureBuilder<File?>(
|
||||
future: DefaultCacheManager().getSingleFile(
|
||||
widget.contributors[index]['avatar_url'],
|
||||
),
|
||||
builder: (context, snapshot) => snapshot.hasData
|
||||
? Image.file(
|
||||
snapshot.data!,
|
||||
height: 40,
|
||||
width: 40,
|
||||
)
|
||||
: Image.network(
|
||||
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