14 lines
305 B
Dart
14 lines
305 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:http/http.dart' as http;
|
|
|
|
dynamic getJson(String uri) async {
|
|
if (!kIsWeb) {
|
|
uri = "http://127.0.0.1:8000$uri";
|
|
}
|
|
final resp = await http.get(Uri.parse(uri));
|
|
print(resp.body);
|
|
return jsonDecode(resp.body);
|
|
}
|