isDetected function
Check if the text has detection
Implementation
bool isDetected(String value, RegExp detectionRegExp) {
final decoratedTextColor = Colors.blue;
final detector = Detector(
textStyle: TextStyle(),
detectedStyle: TextStyle(
color: decoratedTextColor,
),
detectionRegExp: detectionRegExp,
);
final result = detector.getDetections(value);
final detections = result
.where((detection) => detection.style!.color == decoratedTextColor)
.toList();
return detections.isNotEmpty;
}