safeTextStyle function

TextStyle safeTextStyle(
  1. TextStyle? style
)

Method to return 'TextStyle'. This method will return a safe text style by providing a fallback to a default text style when no text style is provided.

Implementation

TextStyle safeTextStyle(TextStyle? style) {
  // Use the provided style if it exists, else we use the default TextStyle.
  return style ?? const TextStyle();
}