on method

Widget on({
  1. required Widget ifNull(),
  2. required Widget ifEmpty(),
  3. required Widget ifValue(),
})

Implementation

Widget on({
  required Widget Function() ifNull,
  required Widget Function() ifEmpty,
  required Widget Function() ifValue,
}) {
  if (this == null) {
    return ifNull();
  } else if (this!.isEmpty) {
    return ifEmpty();
  } else {
    return ifValue();
  }
}