import 'package:freezed_annotation/freezed_annotation.dart'; part 'api_response.freezed.dart'; part 'api_response.g.dart'; @Freezed(genericArgumentFactories: true) class ApiResponse with _$ApiResponse { const factory ApiResponse({ required bool success, required T data, String? message, @Default(200) int statusCode, }) = _ApiResponse; factory ApiResponse.fromJson( Map json, T Function(Object?) fromJsonT, ) => _$ApiResponseFromJson(json, fromJsonT); }