Erweiterungen
This commit is contained in:
1 parent
286c6537b9
commit
4526dd174f
9 files changed
+160
-93
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
part 'message.g.dart';
|
||||
|
||||
@@ -21,4 +22,14 @@ class Message {
|
||||
factory Message.fromJson(Map<String, dynamic> json) => _$MessageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MessageToJson(this);
|
||||
|
||||
static Future<int> getNextId() async {
|
||||
int currentExport500Id = await Util.preferencesGetInt('next_message_id', 0) as int;
|
||||
|
||||
currentExport500Id += 1;
|
||||
|
||||
Util.preferencesSaveInt("next_message_id", currentExport500Id);
|
||||
|
||||
return currentExport500Id;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user