ObjectBox
This commit is contained in:
1 parent
e548f62bde
commit
f8317be627
60 files changed
+2367
-15049
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import 'package:dart_mq/dart_mq.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/messages/pop_content_view_message.dart';
|
||||
@@ -38,7 +37,9 @@ class _ApproachAreaPageState extends State<ApproachAreaPage>
|
||||
super.initState();
|
||||
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||
final box = MyApp.objectBoxStore.box<Ranking>();
|
||||
final rankings = box.getAll();
|
||||
_ranking = rankings.isNotEmpty ? rankings.first : null;
|
||||
|
||||
_initCompleted = true;
|
||||
|
||||
@@ -224,7 +225,9 @@ class _ApproachAreaPageState extends State<ApproachAreaPage>
|
||||
subscribe(
|
||||
queueId: Constants.messageTopicRankingUpdated,
|
||||
callback: (message) async {
|
||||
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||
final box = MyApp.objectBoxStore.box<Ranking>();
|
||||
final rankings = box.getAll();
|
||||
_ranking = rankings.isNotEmpty ? rankings.first : null;
|
||||
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
|
||||
Reference in new issue
Block a user