getLanguage method Null safety

String getLanguage(
  1. ConsentMessageLanguageModel? message
)

Implementation

String getLanguage(ConsentMessageLanguageModel? message) {
  if (message == null) {
    return "";
  }

  switch (widget.language) {
    case "th":
      return message.TH;
    case "en":
      return message.EN;
    default:
      return message.TH;
  }
}