getTranslated function
to translate requested string value into selected local language
Implementation
String getTranslated(BuildContext context, var key) {
if (DemoLocalization.of(context) != null) {
return DemoLocalization.of(context)!.translate(key);
} else {
return key.last.toString();
}
}