baseproject

This commit is contained in:
Gaurav Kumar
2025-09-06 19:21:52 +05:30
commit 01be9df2ed
254 changed files with 28342 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import 'package:base_project/data/response/status.dart';
class ApiResponse<T> {
Status? status;
T? data;
String? message;
ApiResponse(this.status, this.data, this.message);
// Named constructor for loading state
ApiResponse.loading() : status = Status.LOADING;
// Named constructor for completed state
ApiResponse.success(this.data) : status = Status.SUCCESS;
// Named constructor for error state
ApiResponse.error(this.message) : status = Status.ERROR;
@override
String toString() {
return "Status: $status \n Message: $message \n Data: $data";
}
}

View File

@@ -0,0 +1 @@
enum Status {LOADING,SUCCESS,ERROR}