@@ -25,10 +25,7 @@ import '../typedefs.dart';
25
25
abstract class _JsonFunctionTargetBase <RequestType > extends FunctionTarget {
26
26
final RequestType Function (Object ) _fromJson;
27
27
28
- const _JsonFunctionTargetBase (
29
- String target,
30
- this ._fromJson,
31
- ) : super (target);
28
+ _JsonFunctionTargetBase (this ._fromJson);
32
29
33
30
Future <RequestType > _toRequestType (Request request) async {
34
31
final type = mediaTypeFromRequest (request);
@@ -42,32 +39,28 @@ abstract class JsonFunctionTarget<RequestType, ResponseType>
42
39
extends _JsonFunctionTargetBase <RequestType > {
43
40
final JsonHandler <RequestType , ResponseType > _function;
44
41
45
- const JsonFunctionTarget ._(
46
- String target,
42
+ JsonFunctionTarget ._(
47
43
this ._function,
48
44
RequestType Function (Object ) fromJson,
49
- ) : super (target, fromJson);
45
+ ) : super (fromJson);
50
46
51
- const factory JsonFunctionTarget (
52
- String target,
47
+ factory JsonFunctionTarget (
53
48
JsonHandler <RequestType , ResponseType > function,
54
49
RequestType Function (Object ) fromJson,
55
50
) = _JsonFunctionTarget <RequestType , ResponseType >;
56
51
57
- const factory JsonFunctionTarget .voidResult (
58
- String target,
52
+ factory JsonFunctionTarget .voidResult (
59
53
JsonHandler <RequestType , ResponseType > function,
60
54
RequestType Function (Object ) fromJson,
61
55
) = _VoidJsonFunctionTarget <RequestType , ResponseType >;
62
56
}
63
57
64
58
class _JsonFunctionTarget <RequestType , ResponseType >
65
59
extends JsonFunctionTarget <RequestType , ResponseType > {
66
- const _JsonFunctionTarget (
67
- String target,
60
+ _JsonFunctionTarget (
68
61
JsonHandler <RequestType , ResponseType > function,
69
62
RequestType Function (Object ) fromJson,
70
- ) : super ._(target, function, fromJson);
63
+ ) : super ._(function, fromJson);
71
64
72
65
@override
73
66
FutureOr <Response > handler (Request request) async {
@@ -84,11 +77,10 @@ class _JsonFunctionTarget<RequestType, ResponseType>
84
77
85
78
class _VoidJsonFunctionTarget <RequestType , ResponseType >
86
79
extends JsonFunctionTarget <RequestType , ResponseType > {
87
- const _VoidJsonFunctionTarget (
88
- String target,
80
+ _VoidJsonFunctionTarget (
89
81
JsonHandler <RequestType , ResponseType > function,
90
82
RequestType Function (Object ) fromJson,
91
- ) : super ._(target, function, fromJson);
83
+ ) : super ._(function, fromJson);
92
84
93
85
@override
94
86
FutureOr <Response > handler (Request request) async {
@@ -102,32 +94,28 @@ abstract class JsonWithContextFunctionTarget<RequestType, ResponseType>
102
94
extends _JsonFunctionTargetBase <RequestType > {
103
95
final JsonWithContextHandler <RequestType , ResponseType > _function;
104
96
105
- const JsonWithContextFunctionTarget ._(
106
- String target,
97
+ JsonWithContextFunctionTarget ._(
107
98
this ._function,
108
99
RequestType Function (Object ) fromJson,
109
- ) : super (target, fromJson);
100
+ ) : super (fromJson);
110
101
111
- const factory JsonWithContextFunctionTarget (
112
- String target,
102
+ factory JsonWithContextFunctionTarget (
113
103
JsonWithContextHandler <RequestType , ResponseType > function,
114
104
RequestType Function (Object ) fromJson,
115
105
) = _JsonWithContextFunctionTarget <RequestType , ResponseType >;
116
106
117
- const factory JsonWithContextFunctionTarget .voidResult (
118
- String target,
107
+ factory JsonWithContextFunctionTarget .voidResult (
119
108
JsonWithContextHandler <RequestType , ResponseType > function,
120
109
RequestType Function (Object ) fromJson,
121
110
) = _VoidJsonWithContextFunctionTarget <RequestType , ResponseType >;
122
111
}
123
112
124
113
class _JsonWithContextFunctionTarget <RequestType , ResponseType >
125
114
extends JsonWithContextFunctionTarget <RequestType , ResponseType > {
126
- const _JsonWithContextFunctionTarget (
127
- String target,
115
+ _JsonWithContextFunctionTarget (
128
116
JsonWithContextHandler <RequestType , ResponseType > function,
129
117
RequestType Function (Object ) fromJson,
130
- ) : super ._(target, function, fromJson);
118
+ ) : super ._(function, fromJson);
131
119
132
120
@override
133
121
FutureOr <Response > handler (Request request) async {
@@ -150,11 +138,10 @@ class _JsonWithContextFunctionTarget<RequestType, ResponseType>
150
138
151
139
class _VoidJsonWithContextFunctionTarget <RequestType , ResponseType >
152
140
extends JsonWithContextFunctionTarget <RequestType , ResponseType > {
153
- const _VoidJsonWithContextFunctionTarget (
154
- String target,
141
+ _VoidJsonWithContextFunctionTarget (
155
142
JsonWithContextHandler <RequestType , ResponseType > function,
156
143
RequestType Function (Object ) fromJson,
157
- ) : super ._(target, function, fromJson);
144
+ ) : super ._(function, fromJson);
158
145
159
146
@override
160
147
FutureOr <Response > handler (Request request) async {
0 commit comments