Skip to content

Commit

Permalink
Add missing padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedon-dev committed Feb 3, 2025
1 parent 4b6a4d7 commit c6b73ef
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 253 deletions.
257 changes: 134 additions & 123 deletions lib/ui/screens/settings/settings_about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,129 +47,140 @@ class _AboutScreenState extends State<AboutScreen> {
),
body: SafeArea(
child: SizedBox(
child: Column(
children: <Widget>[
ListTile(
leading: const Icon(Icons.abc_outlined),
title: const Text("App name"),
subtitle: Text(packageInfo.appName),
onTap: () async {
if (devSettingsCounter == 6) {
if (kDebugMode) {
logger.w(
"Dev settings permanently enabled in debug releases. Refusing to toggle");
showToast(
"Dev settings permanently enabled in debug releases. Refusing to toggle",
context);
return;
}
bool devSettingsEnabled = (await sharedStorage
.getBool("general_enable_dev_options"))!;
if (devSettingsEnabled) {
// disable tester plugin if leaving debug mode
PluginManager.disablePlugin(
(await getOfficialPluginByName("tester-official"))!);
}
child: Padding(
padding: const EdgeInsets.all(8),
child: Column(
children: <Widget>[
ListTile(
leading: const Icon(Icons.abc_outlined),
title: const Text("App name"),
subtitle: Text(packageInfo.appName),
onTap: () async {
if (devSettingsCounter == 6) {
if (kDebugMode) {
logger.w(
"Dev settings permanently enabled in debug releases. Refusing to toggle");
showToast(
"Dev settings permanently enabled in debug releases. Refusing to toggle",
context);
return;
}
bool devSettingsEnabled = (await sharedStorage
.getBool("general_enable_dev_options"))!;
if (devSettingsEnabled) {
// disable tester plugin if leaving debug mode
PluginManager.disablePlugin(
(await getOfficialPluginByName(
"tester-official"))!);
}

devSettingsEnabled = !devSettingsEnabled;
sharedStorage.setBool(
"general_enable_dev_options", devSettingsEnabled);
// reload plugins to show TesterPlugin in release versions too
PluginManager.discoverAndLoadPlugins();
showToast(
"Dev settings ${devSettingsEnabled ? "enabled" : "disabled"}",
context);
devSettingsCounter = 0;
} else {
devSettingsCounter++;
}
}),
ListTile(
leading: const Icon(Icons.info),
trailing: ElevatedButton(
onPressed: () async {
if (Platform.isLinux) {
showToast(
"Linux updates are handled via flatpak. "
"Check your software center or use cli",
context);
} else {
try {
UpdateManager updateManager = UpdateManager();
if (await updateManager.updateAvailable() == true) {
showUpdateDialog(updateManager, context);
setState(() {});
} else {
showToast("No update available", context);
}
} catch (e, stacktrace) {
logger.e(
"Failed to manually check for update: $e\n$stacktrace");
showToast(
"Failed to manually check for update: $e", context);
}
}
},
child: const Text("Check for update"),
),
title: const Text("Version"),
subtitle: Text("${packageInfo.version} - ${returnAppType()}"),
),
ListTile(
leading: const Icon(Icons.key),
title: const Text("Build signature"),
// TODO: Update source code link
subtitle: Text(packageInfo.buildSignature != ""
? packageInfo.buildSignature
: "None"),
),
ListTile(
leading: const Icon(Icons.code),
title: const Text("Source code"),
// TODO: Update source code link
subtitle: const Text("https://source.hedon-haven.top"),
onTap: () {
launchUrl(Uri.parse("https://source.hedon-haven.top"));
}),
ListTile(
leading: const Icon(Icons.text_snippet),
title: const Text("Show licenses"),
subtitle: const Text("Show all licenses included in this app"),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LicensePage(
applicationName: "Hedon haven",
)))),
ListTile(
leading: const Icon(Icons.bug_report),
title: const Text("Report bug"),
subtitle: const Text(
"Long press anything in the app to report a bug"),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const BugReportScreen(debugObject: {})));
}),
ListTile(
leading: const Icon(Icons.person),
title: const Text("Contributors"),
subtitle: const Text("View all contributors"),
onTap: () {
// This is a rather non-critical link, therefore its not
// url-linked via the hedon-haven.top domain
launchUrl(Uri.parse(
"https://github.com/Hedon-haven/viewer/graphs/contributors"));
}),
ListTile(
leading: const Icon(Icons.attach_money),
title: const Text("Donate"),
subtitle: const Text("Support the development"),
onTap: () =>
launchUrl(Uri.parse("https://donate.hedon-haven.top"))),
],
))));
devSettingsEnabled = !devSettingsEnabled;
sharedStorage.setBool(
"general_enable_dev_options",
devSettingsEnabled);
// reload plugins to show TesterPlugin in release versions too
PluginManager.discoverAndLoadPlugins();
showToast(
"Dev settings ${devSettingsEnabled ? "enabled" : "disabled"}",
context);
devSettingsCounter = 0;
} else {
devSettingsCounter++;
}
}),
ListTile(
leading: const Icon(Icons.info),
trailing: ElevatedButton(
onPressed: () async {
if (Platform.isLinux) {
showToast(
"Linux updates are handled via flatpak. "
"Check your software center or use cli",
context);
} else {
try {
UpdateManager updateManager = UpdateManager();
if (await updateManager.updateAvailable() ==
true) {
showUpdateDialog(updateManager, context);
setState(() {});
} else {
showToast("No update available", context);
}
} catch (e, stacktrace) {
logger.e(
"Failed to manually check for update: $e\n$stacktrace");
showToast(
"Failed to manually check for update: $e",
context);
}
}
},
child: const Text("Check for update"),
),
title: const Text("Version"),
subtitle: Text(
"${packageInfo.version} - ${returnAppType()}"),
),
ListTile(
leading: const Icon(Icons.key),
title: const Text("Build signature"),
// TODO: Update source code link
subtitle: Text(packageInfo.buildSignature != ""
? packageInfo.buildSignature
: "None"),
),
ListTile(
leading: const Icon(Icons.code),
title: const Text("Source code"),
// TODO: Update source code link
subtitle:
const Text("https://source.hedon-haven.top"),
onTap: () {
launchUrl(
Uri.parse("https://source.hedon-haven.top"));
}),
ListTile(
leading: const Icon(Icons.text_snippet),
title: const Text("Show licenses"),
subtitle: const Text(
"Show all licenses included in this app"),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LicensePage(
applicationName: "Hedon haven",
)))),
ListTile(
leading: const Icon(Icons.bug_report),
title: const Text("Report bug"),
subtitle: const Text(
"Long press anything in the app to report a bug"),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const BugReportScreen(
debugObject: {})));
}),
ListTile(
leading: const Icon(Icons.person),
title: const Text("Contributors"),
subtitle: const Text("View all contributors"),
onTap: () {
// This is a rather non-critical link, therefore its not
// url-linked via the hedon-haven.top domain
launchUrl(Uri.parse(
"https://github.com/Hedon-haven/viewer/graphs/contributors"));
}),
ListTile(
leading: const Icon(Icons.attach_money),
title: const Text("Donate"),
subtitle: const Text("Support the development"),
onTap: () => launchUrl(
Uri.parse("https://donate.hedon-haven.top"))),
],
)))));
}
}
Loading

0 comments on commit c6b73ef

Please sign in to comment.