Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Incr3dible committed Sep 19, 2020
1 parent c3619b5 commit 6bf0b17
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 72 deletions.
77 changes: 41 additions & 36 deletions src/client/lib/pages/changelogPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,17 @@ class ChangelogPageState extends State<ChangelogPage>
builder: (BuildContext context) => ListTile(
title: Text(log.sha),
subtitle: Text(dateString),
onLongPress: () {
setState(() {
if (!compareModeOn) {
compareList.clear();
compareList.add(log);
compareModeOn = true;
}
});
},
onLongPress: log.hasJson
? () {
setState(() {
if (!compareModeOn) {
compareList.clear();
compareList.add(log);
compareModeOn = true;
}
});
}
: null,
onTap: () {
setState(() {
if (compareList.contains(log)) {
Expand All @@ -231,35 +233,38 @@ class ChangelogPageState extends State<ChangelogPage>
});
},
trailing: compareModeOn
? Checkbox(
onChanged: compareList.length == 2 && !compareList.contains(log)
? null
: (bool value) {
setState(() {
if (value) {
compareList.add(log);
? log.hasJson
? Checkbox(
onChanged:
compareList.length == 2 && !compareList.contains(log)
? null
: (bool value) {
setState(() {
if (value) {
compareList.add(log);

if (compareList.length == 2) {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) =>
new FingerprintComparePage(
compareList, gameName),
),
);
if (compareList.length == 2) {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) =>
new FingerprintComparePage(
compareList, gameName),
),
);

setState(() {
compareModeOn = false;
});
}
} else {
compareList.remove(log);
}
});
},
value: compareList.contains(log),
)
setState(() {
compareModeOn = false;
});
}
} else {
compareList.remove(log);
}
});
},
value: compareList.contains(log),
)
: null
: IconButton(
icon: const Icon(Icons.content_copy),
onPressed: () {
Expand Down
63 changes: 33 additions & 30 deletions src/client/lib/pages/statusPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:sc_utility/translationProvider.dart';
import 'package:sc_utility/utils/flutterextentions.dart';
import 'package:sc_utility/widgets/ExpansionListTile.dart';
import '../resources.dart';
import '../api/models/GameStatus.dart';
import '../api/ApiClient.dart';
Expand Down Expand Up @@ -342,39 +343,41 @@ class StatusPageState extends State<StatusPage>
fontSize: 14, fontWeight: FontWeight.w600),
),
),
ListTile(
leading: Icon(
Icons.brightness_1,
color: statusColor,
),
title: const Text("Status"),
subtitle: Text(statusName),
/*trailing: IconButton(
ExpansionListTile(
leading: Icon(
Icons.brightness_1,
color: statusColor,
),
title: const Text("Status"),
subtitle: Text(statusName),
/*trailing: IconButton(
icon: Icon(Icons.report),
onPressed: () {},
),*/
),
status.latestFingerprintVersion == "unknown"
? SizedBox.shrink()
: ListTile(
trailing: Builder(
builder: (context) => IconButton(
icon: const Icon(Icons.history),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) =>
new ChangelogPage(status.gameName)));
},
),
),
leading: const Icon(
Icons.fingerprint,
),
title: Text(status.latestFingerprintVersion),
subtitle: Text(status.latestFingerprintSha),
)
children: status.latestFingerprintVersion == "unknown"
? null
: [
ListTile(
trailing: Builder(
builder: (context) => IconButton(
icon: const Icon(Icons.history),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) =>
new ChangelogPage(
status.gameName)));
},
),
),
leading: const Icon(
Icons.fingerprint,
),
title: Text(status.latestFingerprintVersion),
subtitle: Text(status.latestFingerprintSha),
)
]),
],
)),
),
Expand Down
8 changes: 3 additions & 5 deletions src/client/lib/utils/fingerprintUtils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ class FingerprintUtils {

static Future<Fingerprint> downloadFingerprint(
FingerprintLog log, String gameName) async {
var fingerprintJson = log.hasJson
? await http.get("https://api.incinc.xyz/fingerprint?gameName=" +
var fingerprintJson = await http.get(
"https://api.incinc.xyz/fingerprint?gameName=" +
gameName +
"&sha=" +
log.sha)
: await http
.get(getAssetHostByName(gameName) + log.sha + "/fingerprint.json");
log.sha);

if (fingerprintJson.statusCode == 200)
return Fingerprint.fromJson(json.decode(fingerprintJson.body));
Expand Down
36 changes: 36 additions & 0 deletions src/client/lib/widgets/ExpansionListTile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

class ExpansionListTile extends StatefulWidget {
final Widget trailing;
final Widget title;
final Widget subtitle;
final Widget leading;
final List<Widget> children;

ExpansionListTile(
{this.trailing, this.title, this.subtitle, this.leading, this.children});

@override
ExpansionListTileState createState() => ExpansionListTileState();
}

class ExpansionListTileState extends State<ExpansionListTile> {
@override
Widget build(BuildContext context) {
return widget.children != null
? ExpansionTile(
childrenPadding: EdgeInsets.zero,
title: widget.title,
trailing: widget.trailing,
subtitle: widget.subtitle,
leading: widget.leading,
children: widget.children,
)
: ListTile(
title: widget.title,
trailing: widget.trailing,
subtitle: widget.subtitle,
leading: widget.leading,
);
}
}
2 changes: 1 addition & 1 deletion src/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: A tool for games
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.5.0+30
version: 1.5.2+32

environment:
sdk: ">=2.6.0 <3.0.0"
Expand Down

0 comments on commit 6bf0b17

Please sign in to comment.