checkString static method

String? checkString(
  1. String? text
)

This function checks if the given text is not null and not empty. Returns the text if it's not null and not empty, otherwise returns null. Example: checkString("Hello") returns "Hello".

Implementation

static String? checkString(String? text) {
  return (text != null && text.isNotEmpty) ? text : null;
}