apply method

  1. @override
String apply(
  1. String value
)
override

Implementation

@override
String apply(String value) => values.entries.fold(value, (acc, element) {
      final finalValue = switch (element.value) {
        String() => element.value,
        int() => element.value.toString(),
        _ => throw Exception('Invalid type')
      };

      return acc
          .replaceAll('{${element.key}}', finalValue)
          .replaceAll('{{ ${element.key} }}', finalValue);
    });