|
1 |
| -import '../../base/model/base_model.dart'; |
2 |
| -import '../../constants/enums/http_request_enum.dart'; |
3 |
| -import 'IResponseModel.dart'; |
| 1 | +import 'package:fluttermvvmtemplate/core/base/model/base_model.dart'; |
| 2 | +import 'package:fluttermvvmtemplate/core/constants/enums/http_request_enum.dart'; |
| 3 | +import 'package:fluttermvvmtemplate/core/init/network/IResponseModel.dart'; |
4 | 4 |
|
5 | 5 | abstract class ICoreDio {
|
6 |
| - Future<IResponseModel<R>> fetch<R, T extends BaseModel>(String path, |
7 |
| - {required HttpTypes type, |
8 |
| - required T parseModel, |
9 |
| - dynamic data, |
10 |
| - Map<String, Object>? queryParameters, |
11 |
| - void Function(int, int)? onReceiveProgress}); |
| 6 | + Future<IResponseModel<R>> fetch<R, T extends BaseModel>( |
| 7 | + String path, { |
| 8 | + required HttpTypes type, |
| 9 | + required T parseModel, |
| 10 | + dynamic data, |
| 11 | + Map<String, Object>? queryParameters, |
| 12 | + void Function(int, int)? onReceiveProgress, |
| 13 | + }); |
12 | 14 | }
|
13 | 15 | // MARK: Null SAfety
|
14 | 16 |
|
15 | 17 | abstract class ICoreDioNullSafety {
|
16 |
| - Future<IResponseModel<R>> send<R, T extends BaseModel>(String path, |
17 |
| - {required HttpTypes type, |
18 |
| - required T parseModel, |
19 |
| - dynamic data, |
20 |
| - Map<String, Object>? queryParameters, |
21 |
| - void Function(int, int)? onReceiveProgress}); |
| 18 | + Future<IResponseModel<R>> send<R, T>( |
| 19 | + String path, { |
| 20 | + required HttpTypes type, |
| 21 | + required BaseModel<T> parseModel, |
| 22 | + dynamic data, |
| 23 | + Map<String, Object>? queryParameters, |
| 24 | + void Function(int, int)? onReceiveProgress, |
| 25 | + }); |
22 | 26 | }
|
23 | 27 |
|
24 | 28 | abstract class ICoreDioFull extends ICoreDio {
|
25 |
| - Future<IResponseModel<R>> fetchNoNetwork<R, T extends BaseModel>(String path, |
26 |
| - {required HttpTypes type, |
27 |
| - required T parseModel, |
28 |
| - dynamic data, |
29 |
| - Map<String, Object>? queryParameters, |
30 |
| - void Function(int, int)? onReceiveProgress}); |
| 29 | + Future<IResponseModel<R>> fetchNoNetwork<R, T extends BaseModel>( |
| 30 | + String path, { |
| 31 | + required HttpTypes type, |
| 32 | + required T parseModel, |
| 33 | + dynamic data, |
| 34 | + Map<String, Object>? queryParameters, |
| 35 | + void Function(int, int)? onReceiveProgress, |
| 36 | + }); |
31 | 37 | }
|
32 | 38 |
|
33 | 39 | // MARK: Nul SAfety
|
34 | 40 | abstract class ICoreDioFullNulSafetyFull extends ICoreDioNullSafety {
|
35 |
| - Future<IResponseModel<R>> fetchNoNetwork<R, T extends BaseModel>(String path, |
36 |
| - {required HttpTypes type, |
37 |
| - required T parseModel, |
38 |
| - dynamic data, |
39 |
| - Map<String, Object>? queryParameters, |
40 |
| - void Function(int, int)? onReceiveProgress}); |
| 41 | + Future<IResponseModel<R>> fetchNoNetwork<R, T extends BaseModel>( |
| 42 | + String path, { |
| 43 | + required HttpTypes type, |
| 44 | + required T parseModel, |
| 45 | + dynamic data, |
| 46 | + Map<String, Object>? queryParameters, |
| 47 | + void Function(int, int)? onReceiveProgress, |
| 48 | + }); |
41 | 49 | }
|
0 commit comments