6.06

kxzzow發表於2024-06-13

//檢視影片

Future<List> fetchVideoList() async {
Dio dio = Dio();
String url = "http://192.168.211.14:9090/user/video1";

try {
Response response = await dio.get(url);
if (response.statusCode == 200) {
List<dynamic> records = response.data;
return records;
} else {
throw Exception('Failed to load column records');
}
} catch (error) {
throw Exception('Failed to connect to server: $error');
}
}



Future<List> k2(String key) async {
Dio dio = Dio();
String url = "http://192.168.205.1:9090/user/k2";
Map<String, dynamic> data = {
"user_name": key

};
try {
Response response = await dio.get(url);
if (response.statusCode == 200) {
List<dynamic> records = response.data;
return records;
} else {
throw Exception('Failed to load column records');
}
} catch (error) {
throw Exception('Failed to connect to server: $error');
}
}