Skip to content

Commit

Permalink
Force refresh-rate and improve grouping settings ux
Browse files Browse the repository at this point in the history
  • Loading branch information
emavgl committed Nov 28, 2023
1 parent 598fb23 commit a8b10df
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.0/","native_build":true,"dependencies":[]}],"android":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/home/emavgl/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":false,"dependencies":["url_launcher_linux"]},{"name":"shared_preferences_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.0/","native_build":true,"dependencies":[]}],"windows":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":["url_launcher_windows"]},{"name":"shared_preferences_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.0/","native_build":true,"dependencies":[]}],"web":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","dependencies":["url_launcher_web"]},{"name":"shared_preferences_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.1/","dependencies":[]},{"name":"system_theme_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme_web-0.0.2/","dependencies":[]},{"name":"url_launcher_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.19/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"system_theme","dependencies":["system_theme_web"]},{"name":"system_theme_web","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2023-11-19 14:57:00.643964","version":"3.10.6"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.0/","native_build":true,"dependencies":[]}],"android":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_displaymode","path":"/home/emavgl/.pub-cache/hosted/pub.dev/flutter_displaymode-0.6.0/","native_build":true,"dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/home/emavgl/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/emavgl/.pub-cache/hosted/pub.dev/sqflite-2.3.0/","native_build":true,"dependencies":[]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":false,"dependencies":["url_launcher_linux"]},{"name":"shared_preferences_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_linux","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.0/","native_build":true,"dependencies":[]}],"windows":[{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","native_build":true,"dependencies":["url_launcher_windows"]},{"name":"shared_preferences_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"system_theme","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme-2.3.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_windows","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.0/","native_build":true,"dependencies":[]}],"web":[{"name":"file_picker","path":"/home/emavgl/.pub-cache/hosted/pub.dev/file_picker-6.1.1/","dependencies":[]},{"name":"package_info_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","dependencies":[]},{"name":"share_plus","path":"/home/emavgl/.pub-cache/hosted/pub.dev/share_plus-7.2.1/","dependencies":["url_launcher_web"]},{"name":"shared_preferences_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.1/","dependencies":[]},{"name":"system_theme_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/system_theme_web-0.0.2/","dependencies":[]},{"name":"url_launcher_web","path":"/home/emavgl/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.19/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_displaymode","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"system_theme","dependencies":["system_theme_web"]},{"name":"system_theme_web","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2023-11-26 18:10:12.574171","version":"3.10.6"}
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:i18n_extension/i18n_widget.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:piggybank/services/service-config.dart';
Expand All @@ -11,8 +12,11 @@ import 'package:shared_preferences/shared_preferences.dart';
main() async {
WidgetsFlutterBinding.ensureInitialized();
PackageInfo packageInfo = await PackageInfo.fromPlatform();
ServiceConfig.packageName = packageInfo.packageName;
ServiceConfig.version = packageInfo.version;
ServiceConfig.isPremium = packageInfo.packageName.endsWith("pro");
ServiceConfig.sharedPreferences = await SharedPreferences.getInstance();
await FlutterDisplayMode.setHighRefreshRate();
runApp(
App(
lightTheme: await MaterialThemeInstance.getLightTheme(),
Expand Down
5 changes: 4 additions & 1 deletion lib/services/service-config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ class ServiceConfig {
static final DatabaseInterface database = SqliteDatabase.instance;
static bool isPremium = false; // set in main.dart
static SharedPreferences? sharedPreferences; // set in main.dart
static SharedPreferences? sharedPreferences;

static String? packageName; // set in main.dart
static String? version; // set in main.dart
}
13 changes: 8 additions & 5 deletions lib/settings/customization-page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,14 @@ class CustomizationPageState extends State<CustomizationPage> {
title: Text("Use `Grouping separator`".i18n),
subtitle: Text("For example, 1000 -> 1,000".i18n),
),
ListTile(
trailing: buildGroupingSeparatorDropdownButton(),
title: Text("Grouping separator".i18n),
subtitle: Text("Overwrite grouping separator".i18n),
),
Visibility(
visible: useGroupSeparator,
child: ListTile(
trailing: buildGroupingSeparatorDropdownButton(),
title: Text("Grouping separator".i18n),
subtitle: Text("Overwrite grouping separator".i18n),
),
)
],
),
);
Expand Down
14 changes: 12 additions & 2 deletions lib/settings/feedback-page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:piggybank/services/service-config.dart';
import 'package:url_launcher/url_launcher.dart';
import './i18n/feedback-page.i18n.dart';

Expand All @@ -10,9 +12,11 @@ class FeedbackPage extends StatelessWidget {
final _biggerFont = const TextStyle(fontSize: 18.0);

_launchURL(String toMailId, String subject, String body) async {
body += "\n\n ${ServiceConfig.packageName}-${ServiceConfig.version}";
var url = 'mailto:$toMailId?subject=$subject&body=$body';
if (await canLaunch(url)) {
await launch(url);
var uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
}
}

Expand Down Expand Up @@ -46,6 +50,12 @@ class FeedbackPage extends StatelessWidget {
child: Text("Send a feedback".i18n.toUpperCase(), style: _biggerFont),
),
),
),
Container(
child: Align(
alignment: Alignment.center,
child: Text("Version: ${ServiceConfig.version}")
),
)
],
),
Expand Down
Loading

0 comments on commit a8b10df

Please sign in to comment.