isDetected static method

bool isDetected(
  1. String value,
  2. RegExp detectionRegExp
)

Check if the text has detection

Implementation

static bool isDetected(String value, RegExp detectionRegExp) {
  final decoratedTextColor = Colors.blue;
  final result = value.toDetections(
    textStyle: TextStyle(),
    detectedStyle: TextStyle(
      color: decoratedTextColor,
    ),
    detectionRegExp: detectionRegExp,
  );
  final detections = result
      .where((detection) => detection.style!.color == decoratedTextColor)
      .toList();
  return detections.isNotEmpty;
}