21 lines
613 B
Dart
21 lines
613 B
Dart
|
|
import 'package:skywood/global/request/api_const.dart';
|
|
import 'package:skywood/global/request/app_request.dart';
|
|
import 'package:skywood/utils/models/drama/skywood_home.dart';
|
|
|
|
class PlayClient {
|
|
|
|
static Future<List<SkywoodHome>> getHomeData() {
|
|
return AppRequest.get(ApiStringPlay.getHomeModules).then((value) {
|
|
if (value.isSuccess) {
|
|
List? list = value.data['data']['list'];
|
|
List<SkywoodHome> homeList = [];
|
|
if (list != null) {
|
|
homeList = list.map((e) => SkywoodHome.fromJson(e)).toList();
|
|
}
|
|
return homeList;
|
|
}
|
|
return [];
|
|
});
|
|
}
|
|
} |