Enhanced detect bugfix + outdated apps show curr. ver.

This commit is contained in:
Imran Remtulla
2022-12-04 17:08:11 -05:00
parent 66cc7f059f
commit d934ce2e13
2 changed files with 55 additions and 45 deletions

View File

@@ -258,50 +258,60 @@ class AppsPageState extends State<AppsPage> {
.toString() ?? .toString() ??
'100' '100'
])) ]))
: (sortedApps[index].app.installedVersion != null && : (Column(
sortedApps[index].app.installedVersion !=
sortedApps[index].app.latestVersion
? Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text(appsProvider.areDownloadsRunning() SingleChildScrollView(
? tr('pleaseWait')
: '${tr('updateAvailable')}${sortedApps[index].app.trackOnly ? ' ${tr('estimateInBracketsShort')}' : ''}'),
SourceProvider()
.getSource(sortedApps[index].app.url)
.changeLogPageFromStandardUrl(
sortedApps[index].app.url) ==
null
? const SizedBox()
: GestureDetector(
onTap: () {
launchUrlString(
SourceProvider()
.getSource(
sortedApps[index].app.url)
.changeLogPageFromStandardUrl(
sortedApps[index].app.url)!,
mode:
LaunchMode.externalApplication);
},
child: const Text(
'See Changes',
style: TextStyle(
fontStyle: FontStyle.italic,
decoration:
TextDecoration.underline),
)),
],
)
: SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: 80, width: 80,
child: Text( child: Text(
'${sortedApps[index].app.installedVersion ?? tr('notInstalled')}${sortedApps[index].app.trackOnly == true ? ' ${tr('estimateInBrackets')}' : ''}', '${sortedApps[index].app.installedVersion ?? tr('notInstalled')}${sortedApps[index].app.trackOnly == true ? ' ${tr('estimateInBrackets')}' : ''}',
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
textAlign: TextAlign.end, textAlign: TextAlign.end,
)))), ))),
sortedApps[index].app.installedVersion != null &&
sortedApps[index].app.installedVersion !=
sortedApps[index].app.latestVersion
? GestureDetector(
onTap: SourceProvider()
.getSource(
sortedApps[index].app.url)
.changeLogPageFromStandardUrl(
sortedApps[index].app.url) ==
null
? null
: () {
launchUrlString(
SourceProvider()
.getSource(
sortedApps[index].app.url)
.changeLogPageFromStandardUrl(
sortedApps[index]
.app
.url)!,
mode: LaunchMode
.externalApplication);
},
child: Text(
'${tr('updateAvailable')}${sortedApps[index].app.trackOnly ? ' ${tr('estimateInBracketsShort')}' : ''}',
style: TextStyle(
fontStyle: FontStyle.italic,
decoration: SourceProvider()
.getSource(sortedApps[index]
.app
.url)
.changeLogPageFromStandardUrl(
sortedApps[index]
.app
.url) ==
null
? TextDecoration.none
: TextDecoration.underline),
))
: const SizedBox(),
],
)),
onTap: () { onTap: () {
if (selectedApps.isNotEmpty) { if (selectedApps.isNotEmpty) {
toggleAppSelected(sortedApps[index].app); toggleAppSelected(sortedApps[index].app);

View File

@@ -201,7 +201,7 @@ ObtainiumError getObtainiumHttpError(Response res) {
String? extractStandardVersionName(String version, {bool strict = false}) { String? extractStandardVersionName(String version, {bool strict = false}) {
var match = RegExp( var match = RegExp(
'${strict ? '^' : ''}[0-9]+(\\.[0-9]+)*(-(alpha|beta)\\+?[0-9]+)?${strict ? '\$' : ''}') '${strict ? '^' : ''}[0-9]+(\\.[0-9]+)+(-(alpha|beta)\\+?[0-9]+)?${strict ? '\$' : ''}')
.firstMatch(version); .firstMatch(version);
return match != null ? version.substring(match.start, match.end) : null; return match != null ? version.substring(match.start, match.end) : null;
} }