Refactor codebase resolving warnings and remove self-package imports
This commit is contained in:
35
lib/model/chatList/chatProps.dart
Normal file
35
lib/model/chatList/chatProps.dart
Normal file
@ -0,0 +1,35 @@
|
||||
import '../../api/apiResponse.dart';
|
||||
import '../../api/marianumcloud/talk/chat/getChatCache.dart';
|
||||
import '../../api/marianumcloud/talk/chat/getChatResponse.dart';
|
||||
import '../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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user