Added functionality to create chat

This commit is contained in:
2023-06-08 21:27:51 +02:00
parent 0f3fe75bad
commit 82b10e4eed
4 changed files with 99 additions and 2 deletions

@ -0,0 +1,24 @@
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import '../talkApi.dart';
import 'createRoomParams.dart';
class CreateRoom extends TalkApi<void> {
CreateRoomParams params;
CreateRoom(this.params) : super("v4/room", params);
@override
assemble(String raw) {
}
@override
Future<Response>? request(Uri uri, Object? body, Map<String, String>? headers) {
if(body is CreateRoomParams) {
return http.post(uri, headers: headers, body: body.toJson().map((key, value) => MapEntry(key, value.toString())));
}
return null;
}
}