factory AppError.fromJson(Map<String, Object?> json) { return AppError(id: json['id'] as String, detail: json['detail'] as String); }