19 lines
570 B
Dart
19 lines
570 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
import '../talkApi.dart';
|
|
import 'getPollStateResponse.dart';
|
|
|
|
class GetPollState extends TalkApi<GetPollStateResponse> {
|
|
String token;
|
|
int pollId;
|
|
GetPollState({required this.token, required this.pollId}) : super('v1/poll/$token/$pollId', null);
|
|
|
|
@override
|
|
GetPollStateResponse assemble(String raw) => GetPollStateResponse.fromJson(jsonDecode(raw)['ocs']);
|
|
|
|
@override
|
|
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) => http.get(uri, headers: headers);
|
|
}
|