get method

void get(
  1. String path, {
  2. Map<String, String>? headers,
  3. Map<String, String>? params,
  4. bool withLoading = true,
  5. dynamic fromJson(
    1. Map<String, dynamic>
    )?,
})

GET request to API

Perform a GET request to API with specific path, you can send the headers, params and a fromJson method to parse the result json to a specific object.

Implementation

void get(
  String path, {
  Map<String, String>? headers,
  Map<String, String>? params,
  bool withLoading = true,
  dynamic Function(Map<String, dynamic>)? fromJson,
}) =>
    add(
      RestEvent.get(
        path,
        params: params,
        fromJson: fromJson,
        headers: headers,
        withLoading: withLoading,
      ),
    );