Skip to content

Commit

Permalink
Performance optimizations (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
redsolver committed Jan 31, 2021
1 parent 291a4b1 commit 55d2f96
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 29 deletions.
14 changes: 13 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ class _MyHomePageState extends State<MyHomePage> {
'SkyDroid' +
(currentPage == 0
? (categoryFilter == null ? '' : ' • ${categoryFilter}')
: currentPage == 1 ? ' • Collections' : ' • Settings'),
: currentPage == 1
? ' • Collections'
: ' • Settings'),
)
: TextField(
autofocus: true,
Expand Down Expand Up @@ -999,7 +1001,17 @@ class _MyHomePageState extends State<MyHomePage> {
}
}

int currentMetadataUpdateInstances = 0;

Future<void> updateMetadata(Map name, String type) async {
currentMetadataUpdateInstances++;
// print('wait');
await Future.delayed(
Duration(milliseconds: currentMetadataUpdateInstances * 10));
//print('updateMetadata $currentMetadataUpdateInstances');

currentMetadataUpdateInstances--;
// print('do $currentMetadataUpdateInstances');
/* metaLog(var s) {
print('[${name['name']}] $s');
} */
Expand Down
17 changes: 17 additions & 0 deletions lib/page/collections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,24 @@ class _CollectionsPageState extends State<CollectionsPage> {
collectionNames
.put(rec.name, {'name': rec.name});

showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Loading collection...'),
content: ListTile(
leading: CircularProgressIndicator(),
title: Text(
'This can take up to 30 seconds, depending on the size of the collection',
),
),
),
barrierDismissible: false,
);

await widget.refreshCallback();

Navigator.of(context).pop();

if (mounted) setState(() {});
}),
),
Expand Down
4 changes: 0 additions & 4 deletions lib/util.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
//const dnsUrl = 'https://easyhandshake.com:8053';
import 'package:preferences/preferences.dart';


/* const dnsUrl = 'https://dns.nextdns.io/cb574e';
const skynetPortal = 'https://siasky.net'; */

String get dnsUrl => PrefService.getString('dnsUrl');
String get skynetPortal => PrefService.getString('skynetPortal');

Expand Down
40 changes: 20 additions & 20 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.5.0-nullsafety.3"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0-nullsafety.3"
build:
dependency: transitive
description:
Expand Down Expand Up @@ -112,14 +112,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0-nullsafety.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0-nullsafety.3"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -154,7 +154,7 @@ packages:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0-nullsafety.3"
code_builder:
dependency: transitive
description:
Expand All @@ -168,7 +168,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.3"
version: "1.15.0-nullsafety.5"
convert:
dependency: "direct main"
description:
Expand Down Expand Up @@ -231,7 +231,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0-nullsafety.3"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -400,7 +400,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
version: "0.6.3-nullsafety.3"
json_annotation:
dependency: "direct main"
description:
Expand Down Expand Up @@ -435,7 +435,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.1"
version: "0.12.10-nullsafety.3"
material_design_icons_flutter:
dependency: "direct main"
description:
Expand All @@ -449,7 +449,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.6"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -498,7 +498,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.1"
version: "1.8.0-nullsafety.3"
path_drawing:
dependency: transitive
description:
Expand Down Expand Up @@ -720,7 +720,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.0-nullsafety.4"
sqflite:
dependency: transitive
description:
Expand All @@ -741,14 +741,14 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.6"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0-nullsafety.3"
stream_transform:
dependency: transitive
description:
Expand All @@ -762,7 +762,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0-nullsafety.3"
synchronized:
dependency: transitive
description:
Expand All @@ -776,14 +776,14 @@ packages:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0-nullsafety.3"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.2"
version: "0.2.19-nullsafety.6"
time:
dependency: transitive
description:
Expand Down Expand Up @@ -811,7 +811,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.5"
uni_links:
dependency: "direct main"
description:
Expand Down Expand Up @@ -867,7 +867,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0-nullsafety.5"
video_player:
dependency: transitive
description:
Expand Down Expand Up @@ -939,5 +939,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0-110 <2.11.0"
dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.17.0 <2.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A decentralized domain-based App Store for Android.

publish_to: "none"

version: 0.2.2+22
version: 0.2.3+23

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down
10 changes: 7 additions & 3 deletions skydroid-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ localized:
builds:
- versionName: 0.2.3
versionCode: 23
sha256: 02f9cc1053679d234cbccaa53e7b5582162ad418aa0a9a32181465887e0730e6
apkLink: sia://AAC9rBIFryCJxokyjfvkLOtCnnfjO2yVjugufyMBeO8ypw
- versionName: 0.2.2
versionCode: 22
sha256: ba0ffc0a1c0a1d483b41170fefd1dbf6f8f0bbeabeb2e6fd6140ae756c07ae36
Expand Down Expand Up @@ -54,8 +58,8 @@ builds:
sha256: c62c2d73c0ead2fb1a287eecc6d637c318cb49b8c1543bbd2110d73b78ee7c6a
apkLink: sia://AADzaC8YfqVlUAcSf8-1PdT9mLDb9KRLeV9Pi8y3l8G2KA

currentVersionName: 0.2.2
currentVersionCode: 22
currentVersionName: 0.2.3
currentVersionCode: 23

added: 1597353106000
lastUpdated: 1603993271161
lastUpdated: 1612094613952

0 comments on commit 55d2f96

Please sign in to comment.