added service project job details screen

This commit is contained in:
Vaibhav Surve 2025-11-17 11:08:50 +05:30
parent ffd18a9e40
commit 7ee65115be
2 changed files with 3 additions and 28 deletions

View File

@ -2,7 +2,8 @@ class ApiEndpoints {
static const String baseUrl = "https://stageapi.marcoaiot.com/api"; static const String baseUrl = "https://stageapi.marcoaiot.com/api";
// static const String baseUrl = "https://api.marcoaiot.com/api"; // static const String baseUrl = "https://api.marcoaiot.com/api";
// static const String baseUrl = "https://devapi.marcoaiot.com/api"; // static const String baseUrl = "https://devapi.marcoaiot.com/api";
// static const String baseUrl = "https://mapi.marcoaiot.com/api"; // static const String baseUrl = "https://mapi.marcoaiot.com/api";
static const String getMasterCurrencies = "/Master/currencies/list"; static const String getMasterCurrencies = "/Master/currencies/list";
static const String getMasterExpensesCategories = static const String getMasterExpensesCategories =

View File

@ -310,8 +310,7 @@ class ApiService {
/// Edit a Service Project Job /// Edit a Service Project Job
static Future<bool> editServiceProjectJobApi({ static Future<bool> editServiceProjectJobApi({
required String jobId, required String jobId,
required List<Map<String, dynamic>> required List<Map<String, dynamic>> operations,
operations,
}) async { }) async {
final endpoint = "${ApiEndpoints.editServiceProjectJob}/$jobId"; final endpoint = "${ApiEndpoints.editServiceProjectJob}/$jobId";
@ -505,35 +504,20 @@ class ApiService {
} }
/// Get details of a single service project /// Get details of a single service project
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId");
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi( static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async { String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId"; final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId"); logSafe("Fetching details for Service Project ID: $projectId");
try {
final response = await _getRequest(endpoint);
try { try {
final response = await _getRequest(endpoint); final response = await _getRequest(endpoint);
if (response == null) {
logSafe("Service Project Detail request failed: null response",
level: LogLevel.error);
return null;
}
if (response == null) { if (response == null) {
logSafe("Service Project Detail request failed: null response", logSafe("Service Project Detail request failed: null response",
level: LogLevel.error); level: LogLevel.error);
return null; return null;
} }
final jsonResponse = _parseResponseForAllData(
response,
label: "Service Project Detail",
);
final jsonResponse = _parseResponseForAllData( final jsonResponse = _parseResponseForAllData(
response, response,
label: "Service Project Detail", label: "Service Project Detail",
@ -547,19 +531,9 @@ class ApiService {
level: LogLevel.error); level: LogLevel.error);
logSafe("StackTrace: $stack", level: LogLevel.debug); logSafe("StackTrace: $stack", level: LogLevel.debug);
} }
if (jsonResponse != null) {
return ServiceProjectDetailModel.fromJson(jsonResponse);
}
} catch (e, stack) {
logSafe("Exception during getServiceProjectDetailApi: $e",
level: LogLevel.error);
logSafe("StackTrace: $stack", level: LogLevel.debug);
}
return null; return null;
} }
return null;
}
/// Get Service Project List /// Get Service Project List
static Future<ServiceProjectListModel?> getServiceProjectsListApi({ static Future<ServiceProjectListModel?> getServiceProjectsListApi({