String asString({String? def, bool trim = true}) { def ??= ''; var res = (this ?? def).toString(); if (trim) { res = res.trim(); } return res.isEmpty ? def : res; }