opt static method
Implementation
static Tuple2<String?, String?> opt({String? ser, String? deser}) {
String? s;
String? d;
// final type = ser.type.nullable(ser.nullable);
if (ser != null) {
s = '[if($ph != null) $ser]';
} else {
s = '[if($ph !=null) $ph]';
}
if (deser != null) {
d = "($ph as List?)?.map((e) { return ${deser.replaceAll(ph, 'e')}; }).firstOrNull";
} else {
d = '($ph as List?)?.firstOrNull';
}
return Tuple2(s, d);
}