2022-12-06 23:19:10 +00:00
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
2022-12-09 11:50:58 +00:00
|
|
|
dynamic getJson(String uri) async {
|
2022-12-06 23:19:10 +00:00
|
|
|
if (!kIsWeb) {
|
|
|
|
uri = "http://127.0.0.1:8000$uri";
|
|
|
|
}
|
|
|
|
final resp = await http.get(Uri.parse(uri));
|
2022-12-09 11:50:58 +00:00
|
|
|
print(resp.body);
|
2022-12-06 23:19:10 +00:00
|
|
|
return jsonDecode(resp.body);
|
|
|
|
}
|