Skip to content

Commit 1678138

Browse files
committed
file examples apart from image
1 parent 4a3cf9a commit 1678138

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

templates/flutter/docs/example.md.twig

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,23 @@ void main() { // Init SDK
1717
{% endfor %} ;
1818
{% endif %}
1919
{% if method.type == 'location' %}
20+
// downloading file
21+
Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}
22+
{% if loop.first %}
23+
24+
{% endif %}
25+
{% if parameter.required %}
26+
{{ parameter.name | caseCamel }}: {{ parameter | paramExample }},
27+
{% endif %}
28+
{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %}).then((bytes) {
29+
final file = File('path_to/file.pdf');
30+
file.writeAsBytesSync(bytes)
31+
}).catchError((error) {
32+
print(error.response);
33+
})
2034
}
2135

22-
//displaying image
36+
//displaying image preview
2337
FutureBuilder(
2438
future: {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}
2539
{% if loop.first %}

0 commit comments

Comments
 (0)