txtIsNullWithTitle function

String txtIsNullWithTitle(
  1. dynamic txt,
  2. dynamic title, {
  3. dynamic nullTxt = "-",
})

Implementation

String txtIsNullWithTitle(txt, title, {nullTxt = "-"}) {
  if (txt == null || txt == "") {
    return nullTxt;
  } else {
    return title + ": " + txt;
  }
}