Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import java.io.FileInputStream
import java.util.Properties
import com.android.build.api.variant.FilterConfiguration.FilterType.*
import com.android.build.gradle.internal.api.ApkVariantOutputImpl

plugins {
id("com.android.application")
Expand Down Expand Up @@ -133,7 +131,7 @@ androidComponents {
onVariants { variant ->
variant.outputs.forEach { output ->
val abiFilter = output.filters.find {
it.filterType == com.android.build.api.variant.VariantOutputConfiguration.FilterType.ABI
it.filterType.name == "ABI"
}
val abiVersionCode = abiFilter?.identifier?.let { abiCodes[it] }

Expand Down
70 changes: 34 additions & 36 deletions lib/pages/apps.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:animations/animations.dart';
import 'dart:convert';
import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
Expand Down Expand Up @@ -178,30 +179,33 @@ class AppsPageState extends State<AppsPage> {

var sourceProvider = SourceProvider();

Future<List<App>> refresh() async {
HapticFeedback.lightImpact();
if (!mounted) return <App>[];

setState(() {
refreshingSince = DateTime.now();
});

try {
return await context.read<AppsProvider>().checkUpdates();
} catch (e) {
showError(e is Map ? e['errors'] : e, context);
return <App>[];
} finally {
if (!mounted) return;
setState(() {
refreshingSince = null;
});
}
}

@override
Widget build(BuildContext context) {
var appsProvider = context.watch<AppsProvider>();
var settingsProvider = context.watch<SettingsProvider>();
var listedApps = appsProvider.getAppValues().toList();

refresh() {
HapticFeedback.lightImpact();
setState(() {
refreshingSince = DateTime.now();
});
return appsProvider
.checkUpdates()
.catchError((e) {
showError(e is Map ? e['errors'] : e, context);
return <App>[];
})
.whenComplete(() {
setState(() {
refreshingSince = null;
});
});
}

if (!appsProvider.loadingApps &&
appsProvider.apps.isNotEmpty &&
settingsProvider.checkJustStarted() &&
Expand Down Expand Up @@ -981,25 +985,19 @@ class AppsPageState extends State<AppsPage> {
borderRadius: BorderRadius.circular(12),
color: Colors.black45,
),
const SizedBox(height: 16),
],
),
if (listedApps[index].downloadProgress != null)
Positioned.fill(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.black45,
),
child: Center(
child: CircularProgressIndicator(
value: listedApps[index].downloadProgress! >= 0
? listedApps[index].downloadProgress! / 100
: null,
),
),
child: Builder(
builder: (_) {
final progress = listedApps[index].downloadProgress;
if (progress == null) return const SizedBox.shrink();
return Center(
child: CircularProgressIndicator(
value: progress >= 0 ? progress / 100 : null,
),
);
},
),
),
),
),
),
);

Expand Down
6 changes: 3 additions & 3 deletions lib/pages/import_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
runSourceSearch(searchSource[0]);
}
},
label: Text(
child: Text(
tr(
'searchX',
args: [lowerCaseIfEnglish(tr('source'))],
Expand Down Expand Up @@ -927,7 +927,7 @@ class _SelectionModalState extends State<SelectionModal> {
onPressed: () {
Navigator.of(context).pop();
},
label: Text(tr('cancel')),
child: Text(tr('cancel')),
),
AppTextButton(
onPressed: entrySelections.values.where((b) => b).isEmpty
Expand All @@ -940,7 +940,7 @@ class _SelectionModalState extends State<SelectionModal> {
.toList(),
);
},
label: Text(
child: Text(
widget.onlyOneSelectionAllowed
? tr('pick')
: tr(
Expand Down
Loading