image static method
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,
})
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 : "";
}