// team_roles_model.dart class TeamRolesResponse { final bool success; final String message; final List data; final dynamic errors; final int statusCode; final DateTime timestamp; TeamRolesResponse({ required this.success, required this.message, required this.data, this.errors, required this.statusCode, required this.timestamp, }); factory TeamRolesResponse.fromJson(Map json) { return TeamRolesResponse( success: json['success'] as bool, message: json['message'] as String, data: (json['data'] as List) .map((e) => TeamRole.fromJson(e as Map)) .toList(), errors: json['errors'], statusCode: json['statusCode'] as int, timestamp: DateTime.parse(json['timestamp'] as String), ); } Map toJson() { return { 'success': success, 'message': message, 'data': data.map((e) => e.toJson()).toList(), 'errors': errors, 'statusCode': statusCode, 'timestamp': timestamp.toIso8601String(), }; } } class TeamRole { final String id; final String name; final String description; TeamRole({ required this.id, required this.name, required this.description, }); factory TeamRole.fromJson(Map json) { return TeamRole( id: json['id'] as String, name: json['name'] as String, description: json['description'] as String, ); } Map toJson() { return { 'id': id, 'name': name, 'description': description, }; } }