getFormByPath method

Future<FormModel> getFormByPath(
  1. String pathOrId
)

Fetches a single form using its path or ID from Form.io.

Makes a GET /form/:pathOrId request.

pathOrId can be either the path of the form (recommended) or its _id.

Returns a FormModel object.

Throws DioError on failure.

Implementation

Future<FormModel> getFormByPath(String pathOrId) async {
  final response = await client.dio.get('/form/$pathOrId');
  return FormModel.fromJson(response.data as Map<String, dynamic>);
}