NixyTextFieldController constructor

NixyTextFieldController(
  1. Map<String, TextStyle> patterns,
  2. BuildContext context
)

The NixyTextFieldController class is a custom implementation of the TextEditingController in Dart that supports various text patterns and styles, including URLs, checkboxes, and code blocks.

Implementation

NixyTextFieldController(this.patterns, this.context)
    : pattern = RegExp(
        patterns.keys.map((key) {
          return Patterns.values
              .firstWhere((element) => element.pattern == key)
              .pattern;
        }).join('|'),
        multiLine: true,
      );