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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
100 changed files with 5332 additions and 5592 deletions

View file

@ -1,4 +1,3 @@
import "package:inventree/inventree/model.dart";
import "package:inventree/inventree/part.dart";
@ -6,13 +5,13 @@ import "package:inventree/inventree/part.dart";
* Class representing the BomItem database model
*/
class InvenTreeBomItem extends InvenTreeModel {
InvenTreeBomItem() : super();
InvenTreeBomItem.fromJson(Map<String, dynamic> json) : super.fromJson(json);
@override
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeBomItem.fromJson(json);
InvenTreeModel createFromJson(Map<String, dynamic> json) =>
InvenTreeBomItem.fromJson(json);
@override
String get URL => "bom/";
@ -28,7 +27,7 @@ class InvenTreeBomItem extends InvenTreeModel {
// Extract the 'reference' value associated with this BomItem
String get reference => getString("reference");
// Extract the 'quantity' value associated with this BomItem
double get quantity => getDouble("quantity");
@ -57,8 +56,8 @@ class InvenTreeBomItem extends InvenTreeModel {
}
return null;
}
}
// Extract the ID of the related sub-part
int get subPartId => getInt("sub_part");
}
}