35 lines
851 B
Dart
35 lines
851 B
Dart
import 'package:marianum_mobile/api/apiResponse.dart';
|
|
import 'package:marianum_mobile/api/marianumcloud/talk/chat/getChatCache.dart';
|
|
import 'package:marianum_mobile/api/marianumcloud/talk/chat/getChatResponse.dart';
|
|
import 'package:marianum_mobile/data/dataHolder.dart';
|
|
|
|
class ChatProps extends DataHolder {
|
|
String _queryToken = "";
|
|
|
|
GetChatResponse? _getChatResponse;
|
|
GetChatResponse get getChatResponse => _getChatResponse!;
|
|
|
|
@override
|
|
List<ApiResponse?> properties() {
|
|
return [_getChatResponse];
|
|
}
|
|
|
|
@override
|
|
void run() {
|
|
notifyListeners();
|
|
GetChatCache(
|
|
chatToken: _queryToken,
|
|
onUpdate: (GetChatResponse data) => {
|
|
_getChatResponse = data,
|
|
notifyListeners(),
|
|
}
|
|
);
|
|
}
|
|
|
|
void setQueryToken(String token) {
|
|
_queryToken = token;
|
|
_getChatResponse = null;
|
|
run();
|
|
}
|
|
|
|
} |