mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: fix list contributors and add patched apps changelog (wip)
This commit is contained in:
@ -32,5 +32,6 @@ class ContributorsViewModel extends BaseViewModel {
|
||||
ghOrg,
|
||||
managerRepo,
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
@ -65,9 +65,9 @@ class HomeViewModel extends BaseViewModel {
|
||||
if (latestVersion != null) {
|
||||
try {
|
||||
int latestVersionInt =
|
||||
int.parse(latestVersion.replaceFirst('v', '').replaceAll('.', ''));
|
||||
int.parse(latestVersion.replaceAll(RegExp('[^0-9]'), ''));
|
||||
int currentVersionInt =
|
||||
int.parse(currentVersion.replaceFirst('v', '').replaceAll('.', ''));
|
||||
int.parse(currentVersion.replaceAll(RegExp('[^0-9]'), ''));
|
||||
return latestVersionInt > currentVersionInt;
|
||||
} on Exception {
|
||||
return false;
|
||||
|
@ -20,32 +20,33 @@ class AvailableUpdatesCard extends StatelessWidget {
|
||||
children: [
|
||||
FutureBuilder<List<PatchedApplication>>(
|
||||
future: locator<HomeViewModel>().getPatchedApps(true),
|
||||
builder: (context, snapshot) =>
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) => FutureBuilder<String>(
|
||||
future: _managerAPI.getAppChangelog(
|
||||
snapshot.data![index].packageName,
|
||||
),
|
||||
initialData: '',
|
||||
builder: (context, snapshot2) => ApplicationItem(
|
||||
icon: snapshot.data![index].icon,
|
||||
name: snapshot.data![index].name,
|
||||
patchDate: snapshot.data![index].patchDate,
|
||||
changelog: snapshot2.data!,
|
||||
isUpdatableApp: true,
|
||||
onPressed: () =>
|
||||
locator<HomeViewModel>().navigateToPatcher(
|
||||
snapshot.data![index],
|
||||
),
|
||||
),
|
||||
builder: (context, snapshot) => snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty
|
||||
? ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) => FutureBuilder<List<String>>(
|
||||
future: _managerAPI.getAppChangelog(
|
||||
snapshot.data![index].packageName,
|
||||
snapshot.data![index].patchDate,
|
||||
),
|
||||
initialData: List.empty(),
|
||||
builder: (context, snapshot2) => ApplicationItem(
|
||||
icon: snapshot.data![index].icon,
|
||||
name: snapshot.data![index].name,
|
||||
patchDate: snapshot.data![index].patchDate,
|
||||
changelog: '${snapshot2.data!.join('\n')}\n...',
|
||||
isUpdatableApp: true,
|
||||
onPressed: () =>
|
||||
locator<HomeViewModel>().navigateToPatcher(
|
||||
snapshot.data![index],
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -21,31 +21,32 @@ class InstalledAppsCard extends StatelessWidget {
|
||||
children: [
|
||||
FutureBuilder<List<PatchedApplication>>(
|
||||
future: locator<HomeViewModel>().getPatchedApps(false),
|
||||
builder: (context, snapshot) =>
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) => FutureBuilder<String>(
|
||||
future: _managerAPI.getAppChangelog(
|
||||
snapshot.data![index].packageName,
|
||||
),
|
||||
initialData: '',
|
||||
builder: (context, snapshot2) => ApplicationItem(
|
||||
icon: snapshot.data![index].icon,
|
||||
name: snapshot.data![index].name,
|
||||
patchDate: snapshot.data![index].patchDate,
|
||||
changelog: snapshot2.data!,
|
||||
isUpdatableApp: false,
|
||||
onPressed: () => DeviceApps.openApp(
|
||||
snapshot.data![index].packageName,
|
||||
),
|
||||
),
|
||||
builder: (context, snapshot) => snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty
|
||||
? ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) => FutureBuilder<List<String>>(
|
||||
future: _managerAPI.getAppChangelog(
|
||||
snapshot.data![index].packageName,
|
||||
snapshot.data![index].patchDate,
|
||||
),
|
||||
initialData: const ['Loading'],
|
||||
builder: (context, snapshot2) => ApplicationItem(
|
||||
icon: snapshot.data![index].icon,
|
||||
name: snapshot.data![index].name,
|
||||
patchDate: snapshot.data![index].patchDate,
|
||||
changelog: '${snapshot2.data!.join('\n')}\n(...)',
|
||||
isUpdatableApp: false,
|
||||
onPressed: () => DeviceApps.openApp(
|
||||
snapshot.data![index].packageName,
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user