loadRequest method
Implement internal processing when load, reload, or next is executed.
If Null is returned, the value is not updated.
loadやreload、nextを実行した際の内部処理を実装します。
Nullが返された場合は値をアップデートしません。
Implementation
@protected
Future<Map<String, DynamicMap>?> loadRequest() async {
if (subscriptions.isNotEmpty) {
await Future.forEach<StreamSubscription>(
subscriptions,
(subscription) => subscription.cancel(),
);
subscriptions.clear();
_value.clear();
}
if (modelQuery.adapter.availableListen) {
subscriptions.addAll(
await modelQuery.adapter.listenCollection(databaseQuery),
);
}
return await modelQuery.adapter.loadCollection(databaseQuery);
}