player id added, content bytes api
This commit is contained in:
45
lib/view_model/ContentBytesApi/content_bytes_api.dart
Normal file
45
lib/view_model/ContentBytesApi/content_bytes_api.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import '../../Utils/api_urls.dart';
|
||||
import '../../Utils/base_manager.dart';
|
||||
import '../../data/network/network_api_services.dart';
|
||||
|
||||
class ContentBytesApi {
|
||||
Future<ResponseData<dynamic>> getContentBytesCategoriesData() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getContentBytesCategoriesApi, isAuth: true);
|
||||
log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getContentBytesData(dynamic data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.getContentBytesApi,
|
||||
);
|
||||
log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user