Added Nextcloud base
This commit is contained in:
.idea/libraries
assets/background
flutter_01.loglib
api
apiParams.dartapiRequest.dartapiResponse.dartrequestCache.dart
app.dartmarianumcloud
talk
chat
getChat.dartgetChatCache.dartgetChatParams.dartgetChatParams.g.dartgetChatResponse.dartgetChatResponse.g.dart
room
getRoom.dartgetRoomCache.dartgetRoomParams.dartgetRoomParams.g.dartgetRoomResponse.dartgetRoomResponse.g.dart
talkApi.darttalkError.dartwebdav
talk
webuntis
data
main.dartscreen
macos/Flutter
pubspec.yaml
29
lib/data/chatList/chatListProps.dart
Normal file
29
lib/data/chatList/chatListProps.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomCache.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomResponse.dart';
|
||||
import 'package:marianum_mobile/data/dataHolder.dart';
|
||||
|
||||
import '../../api/apiResponse.dart';
|
||||
|
||||
class ChatListProps extends DataHolder {
|
||||
GetRoomResponse? _getRoomResponse;
|
||||
GetRoomResponse get getRoomsResponse => _getRoomResponse!;
|
||||
|
||||
@override
|
||||
List<ApiResponse?> properties() {
|
||||
return [_getRoomResponse];
|
||||
}
|
||||
|
||||
@override
|
||||
void run() {
|
||||
log("RUN CACHE");
|
||||
GetRoomCache(
|
||||
onUpdate: (GetRoomResponse data) => {
|
||||
_getRoomResponse = data,
|
||||
notifyListeners(),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
35
lib/data/chatList/chatProps.dart
Normal file
35
lib/data/chatList/chatProps.dart
Normal file
@ -0,0 +1,35 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user