add a preview if longpressing preview
This commit is contained in:
@ -3,12 +3,10 @@ import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:openmediacentermobile/api/token.dart';
|
||||
import 'package:openmediacentermobile/log/log.dart';
|
||||
|
||||
class API {
|
||||
static Future<String> query(
|
||||
String apinode, String action, Object payload) async {
|
||||
final Completer<String> cmpl = Completer();
|
||||
final t = await Token.getInstance().getToken();
|
||||
if (t != null) {
|
||||
final resp = await http.post(
|
||||
@ -20,11 +18,9 @@ class API {
|
||||
body: jsonEncode(payload),
|
||||
);
|
||||
|
||||
cmpl.complete(resp.body);
|
||||
return resp.body;
|
||||
} else {
|
||||
cmpl.complete("");
|
||||
return "";
|
||||
}
|
||||
|
||||
return cmpl.future;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user