2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-07-01 11:20:41 +00:00

Format Code and Add Format Checks to CI (#643)

* Remove unused lib/generated/i18n.dart

* Use `fvm dart format .`

* Add contributing guidelines

* Enforce dart format

* Add `dart format off` directive to generated files
This commit is contained in:
Ben Hagen
2025-06-24 01:55:01 +02:00
committed by GitHub
parent e9db6532e4
commit 4444884afa
100 changed files with 5332 additions and 5592 deletions

View File

@ -6,7 +6,6 @@ import "package:path_provider/path_provider.dart";
import "package:sembast/sembast_io.dart";
import "package:path/path.dart";
// Settings key values
const String INV_HOME_SHOW_SUBSCRIBED = "homeShowSubscribed";
const String INV_HOME_SHOW_PO = "homeShowPo";
@ -62,7 +61,6 @@ const int BARCODE_CONTROLLER_WEDGE = 1;
* Class for storing InvenTree preferences in a NoSql DB
*/
class InvenTreePreferencesDB {
InvenTreePreferencesDB._();
static final InvenTreePreferencesDB _singleton = InvenTreePreferencesDB._();
@ -74,7 +72,6 @@ class InvenTreePreferencesDB {
bool isOpen = false;
Future<Database> get database async {
if (!isOpen) {
// Calling _openDatabase will also complete the completer with database instance
_openDatabase();
@ -101,13 +98,11 @@ class InvenTreePreferencesDB {
}
}
/*
* InvenTree setings manager class.
* Provides functions for loading and saving settings, with provision for default values
*/
class InvenTreeSettingsManager {
factory InvenTreeSettingsManager() {
return _manager;
}
@ -144,7 +139,6 @@ class InvenTreeSettingsManager {
}
Future<dynamic> getValue(String key, dynamic backup) async {
dynamic value = await store.record(key).get(await _db);
// Retrieve value
@ -174,7 +168,6 @@ class InvenTreeSettingsManager {
// Store a key:value pair in the database
Future<void> setValue(String key, dynamic value) async {
// Encode null values as strings
value ??= "__null__";
@ -182,5 +175,6 @@ class InvenTreeSettingsManager {
}
// Ensure we only ever create a single instance of this class
static final InvenTreeSettingsManager _manager = InvenTreeSettingsManager._internal();
static final InvenTreeSettingsManager _manager =
InvenTreeSettingsManager._internal();
}