Skip to content

Commit b95e2ee

Browse files
Merge pull request #426 from appwrite/feat-flutter-examples
2 parents 4a3cf9a + be4c61e commit b95e2ee

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/filename.ext');
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)