Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:convert';
- import 'package:qrcode2/model/undangan.dart';
- import 'package:http/http.dart' as http;
- class ApiUndangan {
- static Future<Undangan?> cekUndangan(String sid) async {
- final response = await http.post(
- Uri.parse('https://tamu.id/admin/api-slogin'),
- body: {'sid': sid});
- if (response.statusCode == 200) {
- return Undangan.fromJson(jsonDecode(response.body));
- } else {
- print('error ${response.body}');
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement