class ServiceListResponse { final bool success; final String message; final List data; final dynamic errors; final int statusCode; final String timestamp; ServiceListResponse({ required this.success, required this.message, required this.data, this.errors, required this.statusCode, required this.timestamp, }); factory ServiceListResponse.fromJson(Map json) { return ServiceListResponse( success: json['success'] ?? false, message: json['message'] ?? '', data: (json['data'] as List?) ?.map((e) => Service.fromJson(e)) .toList() ?? [], errors: json['errors'], statusCode: json['statusCode'] ?? 0, timestamp: json['timestamp'] ?? '', ); } Map toJson() { return { 'success': success, 'message': message, 'data': data.map((e) => e.toJson()).toList(), 'errors': errors, 'statusCode': statusCode, 'timestamp': timestamp, }; } } class Service { final String id; final String name; final String description; final bool isSystem; final bool isActive; Service({ required this.id, required this.name, required this.description, required this.isSystem, required this.isActive, }); factory Service.fromJson(Map json) { return Service( id: json['id'] ?? '', name: json['name'] ?? '', description: json['description'] ?? '', isSystem: json['isSystem'] ?? false, isActive: json['isActive'] ?? false, ); } Map toJson() { return { 'id': id, 'name': name, 'description': description, 'isSystem': isSystem, 'isActive': isActive, }; } }