create static method

Future<Library> create(
  1. String name,
  2. String path,
  3. CacheController cacheController,
  4. KuebikoHttpClient httpClient,
)

Implementation

static Future<Library> create(String name, String path, CacheController cacheController, KuebikoHttpClient httpClient) async {
  Uri uri = httpClient.config.generateApiUri('/library/create');
  http.Response res = await httpClient.post(
      uri,
      body: {
        'path': path,
        'name': name
      }
  );
  Map json = jsonDecode(res.body);
  return Library(json['library'], name, path, cacheController, httpClient);
}