Skip to content

Commit 6f37805

Browse files
Merge branch 'master' into feat-android-realtime
2 parents 0857e5c + 726b69e commit 6f37805

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2077
-415
lines changed

src/SDK/Language/Dart.php

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function getTypeName($type)
119119
return 'String';
120120
break;
121121
case self::TYPE_FILE:
122-
return 'MultipartFile';
122+
return 'http.MultipartFile';
123123
break;
124124
case self::TYPE_BOOLEAN:
125125
return 'bool';
@@ -208,7 +208,7 @@ public function getParamExample(array $param)
208208
if(empty($example) && $example !== 0 && $example !== false) {
209209
switch ($type) {
210210
case self::TYPE_FILE:
211-
$output .= 'await MultipartFile.fromFile(\'./path-to-files/image.jpg\', \'image.jpg\')';
211+
$output .= 'await MultipartFile.fromPath(\'<field-name>\', \'./path-to-files/image.jpg\', \'image.jpg\')';
212212
break;
213213
case self::TYPE_NUMBER:
214214
case self::TYPE_INTEGER:
@@ -281,14 +281,50 @@ public function getFiles()
281281
],
282282
[
283283
'scope' => 'default',
284-
'destination' => '/lib/client.dart',
285-
'template' => 'dart/lib/client.dart.twig',
284+
'destination' => '/lib/src/client.dart',
285+
'template' => 'dart/lib/src/client.dart.twig',
286286
'minify' => false,
287287
],
288288
[
289289
'scope' => 'default',
290-
'destination' => '/lib/exception.dart',
291-
'template' => 'dart/lib/exception.dart.twig',
290+
'destination' => '/lib/src/client_base.dart',
291+
'template' => 'dart/lib/src/client_base.dart.twig',
292+
'minify' => false,
293+
],
294+
[
295+
'scope' => 'default',
296+
'destination' => '/lib/src/client_browser.dart',
297+
'template' => 'dart/lib/src/client_browser.dart.twig',
298+
'minify' => false,
299+
],
300+
[
301+
'scope' => 'default',
302+
'destination' => '/lib/src/client_io.dart',
303+
'template' => 'dart/lib/src/client_io.dart.twig',
304+
'minify' => false,
305+
],
306+
[
307+
'scope' => 'default',
308+
'destination' => '/lib/src/client_mixin.dart',
309+
'template' => 'dart/lib/src/client_mixin.dart.twig',
310+
'minify' => false,
311+
],
312+
[
313+
'scope' => 'default',
314+
'destination' => '/lib/src/client_stub.dart',
315+
'template' => 'dart/lib/src/client_stub.dart.twig',
316+
'minify' => false,
317+
],
318+
[
319+
'scope' => 'default',
320+
'destination' => '/lib/src/exception.dart',
321+
'template' => 'dart/lib/src/exception.dart.twig',
322+
'minify' => false,
323+
],
324+
[
325+
'scope' => 'default',
326+
'destination' => '/lib/src/response.dart',
327+
'template' => 'dart/lib/src/response.dart.twig',
292328
'minify' => false,
293329
],
294330
[
@@ -305,14 +341,14 @@ public function getFiles()
305341
],
306342
[
307343
'scope' => 'default',
308-
'destination' => '/lib/service.dart',
309-
'template' => 'dart/lib/service.dart.twig',
344+
'destination' => '/lib/src/service.dart',
345+
'template' => 'dart/lib/src/service.dart.twig',
310346
'minify' => false,
311347
],
312348
[
313349
'scope' => 'default',
314-
'destination' => '/lib/enums.dart',
315-
'template' => 'dart/lib/enums.dart.twig',
350+
'destination' => '/lib/src/enums.dart',
351+
'template' => 'dart/lib/src/enums.dart.twig',
316352
'minify' => false,
317353
],
318354
[

src/SDK/Language/Flutter.php

Lines changed: 128 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,128 @@ public function getFiles()
5757
],
5858
[
5959
'scope' => 'default',
60-
'destination' => '/lib/client.dart',
61-
'template' => 'flutter/lib/client.dart.twig',
60+
'destination' => '/lib/src/client.dart',
61+
'template' => 'flutter/lib/src/client.dart.twig',
62+
'minify' => false,
63+
],
64+
[
65+
'scope' => 'default',
66+
'destination' => '/lib/src/client_base.dart',
67+
'template' => 'flutter/lib/src/client_base.dart.twig',
68+
'minify' => false,
69+
],
70+
[
71+
'scope' => 'default',
72+
'destination' => '/lib/src/client_browser.dart',
73+
'template' => 'flutter/lib/src/client_browser.dart.twig',
74+
'minify' => false,
75+
],
76+
[
77+
'scope' => 'default',
78+
'destination' => '/lib/src/client_io.dart',
79+
'template' => 'flutter/lib/src/client_io.dart.twig',
80+
'minify' => false,
81+
],
82+
[
83+
'scope' => 'default',
84+
'destination' => '/lib/src/client_mixin.dart',
85+
'template' => 'flutter/lib/src/client_mixin.dart.twig',
86+
'minify' => false,
87+
],
88+
[
89+
'scope' => 'default',
90+
'destination' => '/lib/src/client_stub.dart',
91+
'template' => 'flutter/lib/src/client_stub.dart.twig',
92+
'minify' => false,
93+
],
94+
[
95+
'scope' => 'default',
96+
'destination' => '/lib/src/realtime.dart',
97+
'template' => 'flutter/lib/src/realtime.dart.twig',
98+
'minify' => false,
99+
],
100+
[
101+
'scope' => 'default',
102+
'destination' => '/lib/src/realtime_base.dart',
103+
'template' => 'flutter/lib/src/realtime_base.dart.twig',
104+
'minify' => false,
105+
],
106+
[
107+
'scope' => 'default',
108+
'destination' => '/lib/src/realtime_browser.dart',
109+
'template' => 'flutter/lib/src/realtime_browser.dart.twig',
110+
'minify' => false,
111+
],
112+
[
113+
'scope' => 'default',
114+
'destination' => '/lib/src/realtime_io.dart',
115+
'template' => 'flutter/lib/src/realtime_io.dart.twig',
116+
'minify' => false,
117+
],
118+
[
119+
'scope' => 'default',
120+
'destination' => '/lib/src/realtime_mixin.dart',
121+
'template' => 'flutter/lib/src/realtime_mixin.dart.twig',
122+
'minify' => false,
123+
],
124+
[
125+
'scope' => 'default',
126+
'destination' => '/lib/src/realtime_stub.dart',
127+
'template' => 'flutter/lib/src/realtime_stub.dart.twig',
128+
'minify' => false,
129+
],
130+
[
131+
'scope' => 'default',
132+
'destination' => '/lib/src/realtime_subscription.dart',
133+
'template' => 'flutter/lib/src/realtime_subscription.dart.twig',
134+
'minify' => false,
135+
],
136+
[
137+
'scope' => 'default',
138+
'destination' => '/lib/src/realtime_message.dart',
139+
'template' => 'flutter/lib/src/realtime_message.dart.twig',
140+
'minify' => false,
141+
],
142+
[
143+
'scope' => 'default',
144+
'destination' => '/lib/src/realtime_response.dart',
145+
'template' => 'flutter/lib/src/realtime_response.dart.twig',
146+
'minify' => false,
147+
],
148+
[
149+
'scope' => 'default',
150+
'destination' => '/lib/src/realtime_response_connected.dart',
151+
'template' => 'flutter/lib/src/realtime_response_connected.dart.twig',
152+
'minify' => false,
153+
],
154+
[
155+
'scope' => 'default',
156+
'destination' => '/lib/src/cookie_manager.dart',
157+
'template' => 'flutter/lib/src/cookie_manager.dart.twig',
158+
'minify' => false,
159+
],
160+
[
161+
'scope' => 'default',
162+
'destination' => '/lib/src/interceptor.dart',
163+
'template' => 'flutter/lib/src/interceptor.dart.twig',
164+
'minify' => false,
165+
],
166+
[
167+
'scope' => 'default',
168+
'destination' => '/lib/src/redirect_browser.dart',
169+
'template' => 'flutter/lib/src/redirect_browser.dart.twig',
170+
'minify' => false,
171+
],
172+
[
173+
'scope' => 'default',
174+
'destination' => '/lib/src/redirect_stub.dart',
175+
'template' => 'flutter/lib/src/redirect_stub.dart.twig',
176+
'minify' => false,
177+
],
178+
[
179+
'scope' => 'default',
180+
'destination' => '/lib/src/response.dart',
181+
'template' => 'flutter/lib/src/response.dart.twig',
62182
'minify' => false,
63183
],
64184
[
@@ -75,20 +195,20 @@ public function getFiles()
75195
],
76196
[
77197
'scope' => 'default',
78-
'destination' => '/lib/service.dart',
79-
'template' => 'flutter/lib/service.dart.twig',
198+
'destination' => '/lib/src/service.dart',
199+
'template' => 'flutter/lib/src/service.dart.twig',
80200
'minify' => false,
81201
],
82202
[
83203
'scope' => 'default',
84-
'destination' => '/lib/enums.dart',
85-
'template' => 'flutter/lib/enums.dart.twig',
204+
'destination' => '/lib/src/enums.dart',
205+
'template' => 'flutter/lib/src/enums.dart.twig',
86206
'minify' => false,
87207
],
88208
[
89209
'scope' => 'default',
90-
'destination' => '/lib/exception.dart',
91-
'template' => 'flutter/lib/exception.dart.twig',
210+
'destination' => '/lib/src/exception.dart',
211+
'template' => 'flutter/lib/src/exception.dart.twig',
92212
'minify' => false,
93213
],
94214
[

templates/dart/docs/example.md.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void main() { // Init SDK
2222

2323
{% endif %}
2424
{% if parameter.required %}
25-
{{ parameter.name | caseCamel }}: {{ parameter | paramExample }},
25+
{{ parameter.name | caseCamel }}: {{ parameter | paramExample | replace({'<field-name>': (parameter.name | caseCamel) }) | raw }},
2626
{% endif %}
2727
{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %});
2828

templates/dart/lib/client.dart.twig

Lines changed: 0 additions & 118 deletions
This file was deleted.

templates/dart/lib/enums.dart.twig

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)