checkString static method
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;
}