getCodeAndName static method

String getCodeAndName(
  1. String? code,
  2. String? name, {
  3. String textNull = '',
})

获取已拼接的code和name

code 代码 name 名称 textNull 为空时展示内容

Implementation

static String getCodeAndName(
  String? code,
  String? name, {
  String textNull = '',
}) {
  if (code is! String && name is! String) {
    return textNull;
  } else {
    return (code is String ? '[ $code ] ' : '') + (name ?? '');
  }
}