{% if method.type == 'upload' %}
import 'dart:io';
{% endif %}
import 'package:{{ language.params.packageName }}/{{ language.params.packageName }}.dart';

Client client = Client()
    {%~ if method.auth|length > 0 %}
    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    {%~ for node in method.auth %}
    {%~ for key,header in node|keys %}
    .set{{header}}('{{node[header]['x-appwrite']['demo'] | raw }}'){% if loop.last %};{% endif%} // {{node[header].description}}
    {%~ endfor %}
    {%~ endfor %}
    {%~ endif %}

{{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client);

{% if method.method != 'delete' and method.type != 'webAuth' %}{% if method.type == 'location' %}UInt8List{% else %}{{ method.responseModel | caseUcfirst | overrideIdentifier }}{% endif %} result = {% endif %}await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %});{% endif %}

    {%~ for parameter in method.parameters.all %}
    {{ parameter.name | caseCamel | overrideIdentifier }}: {% if parameter.enumValues | length > 0 %}{{ parameter.enumName }}.{{ (parameter.enumKeys[0] ?? parameter.enumValues[0]) | caseCamel | replace({'-': ''}) }}{% else %}{{ parameter | paramExample | replace({'<field-name>': (parameter.name | caseCamel) }) | raw }}{% endif %},{% if not parameter.required %} // (optional){% endif %}

    {%~ endfor %}
{% if method.parameters.all | length > 0 %});
{% endif %}