mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +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:
parent
e9db6532e4
commit
4444884afa
100 changed files with 5332 additions and 5592 deletions
|
|
@ -5,10 +5,10 @@ import "package:inventree/inventree/model.dart";
|
|||
*/
|
||||
|
||||
class InvenTreeNotification extends InvenTreeModel {
|
||||
|
||||
InvenTreeNotification() : super();
|
||||
|
||||
InvenTreeNotification.fromJson(Map<String, dynamic> json) : super.fromJson(json);
|
||||
InvenTreeNotification.fromJson(Map<String, dynamic> json)
|
||||
: super.fromJson(json);
|
||||
|
||||
@override
|
||||
InvenTreeNotification createFromJson(Map<String, dynamic> json) {
|
||||
|
|
@ -20,15 +20,12 @@ class InvenTreeNotification extends InvenTreeModel {
|
|||
|
||||
@override
|
||||
Map<String, String> defaultListFilters() {
|
||||
|
||||
// By default, only return 'unread' notifications
|
||||
return {
|
||||
"read": "false",
|
||||
};
|
||||
return {"read": "false"};
|
||||
}
|
||||
|
||||
String get message => getString("message");
|
||||
|
||||
|
||||
DateTime? get creationDate {
|
||||
if (jsondata.containsKey("creation")) {
|
||||
return DateTime.tryParse((jsondata["creation"] ?? "") as String);
|
||||
|
|
@ -41,7 +38,6 @@ class InvenTreeNotification extends InvenTreeModel {
|
|||
* Dismiss this notification (mark as read)
|
||||
*/
|
||||
Future<void> dismiss() async {
|
||||
|
||||
if (api.apiVersion >= 82) {
|
||||
// "Modern" API endpoint operates a little differently
|
||||
await update(values: {"read": "true"});
|
||||
|
|
@ -49,5 +45,4 @@ class InvenTreeNotification extends InvenTreeModel {
|
|||
await api.post("${url}read/");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue