image static method

Future<String> image(
  1. String src, {
  2. int? width,
  3. int? height,
  4. int? quality,
  5. bool? domain,
  6. bool? o,
  7. bool? base64,
  8. Map<CockpitImageFilter, int> filter = const <CockpitImageFilter, int>{},
  9. CockpitImageMode mode = CockpitImageMode.thumbnail,
})

Implementation

static Future<String> image(String src,{
  int?    width,
  int?    height,
  int?    quality,
  bool?   domain,
  bool?   o,
  bool?   base64,
  Map<CockpitImageFilter,int> filter = const <CockpitImageFilter,int>{},
  CockpitImageMode mode = CockpitImageMode.thumbnail
}) async {
  var ret = await _getOrSetData<String>("!/cockpit/assets", returnText: true)(
    save : {
      src : src,
      "f":  filter.map((key, value) => MapEntry(_cockpitImageFilter[key]!, "$value")) ,
      "m":  _cockpitImageMode[mode],
      ...(width != null ? {"w":   width } : {}),
      ...(height != null ? {"h":  height } : {}),
      ...(quality != null ? {"q": quality } : {}),
      ...(domain != null ? {"d":  domain } : {}),
      ...(base64 != null ? {"b64":  base64 } : {}),
      ...(o != null ? {"o":  o } : {}),
    });
  return ret.isNotEmpty ? ret.first : "";
}