formatString method

String formatString(
  1. String fullText,
  2. List args
)

Implementation

String formatString(String fullText, List<dynamic> args) {
  final translator = FlutterLocalizationTranslator.of(this);
  fullText = '${translator?.getStringOrKey(fullText)}';
  for (final element in args) {
    final replace = '${translator?.getStringOrKey(element.toString())}';
    fullText = fullText.replaceFirst('%a', replace);
  }
  return fullText;
}