extractHashTags function
Extract hashTags from the text
Implementation
List<String> extractHashTags(String value) {
final decoratedTextColor = Colors.blue;
final detector = Detector(
textStyle: TextStyle(),
decoratedStyle: TextStyle(color: decoratedTextColor));
final detections = detector.getDetections(value);
final taggedDetections = detections
.where((detection) => detection.style!.color == decoratedTextColor)
.toList();
final result = taggedDetections.map((decoration) {
final text = decoration.range.textInside(value);
return text.trim();
}).toList();
return result;
}