Skip to content

Commit

Permalink
make gesture nullable in getHashTagTextSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
santa112358 committed Oct 29, 2020
1 parent ea51202 commit dd45b01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TextSpan getHashTagTextSpan({
@required TextStyle decoratedStyle,
@required TextStyle basicStyle,
@required String source,
@required Function(String) onTap,
Function(String) onTap,
bool decorateAtSign = false,
}) {
final decorations = Decorator(
Expand All @@ -62,7 +62,7 @@ TextSpan getHashTagTextSpan({
TextSpan(
style: item.style,
text: item.range.textInside(source),
recognizer: TapGestureRecognizer()
recognizer: (onTap == null) ? null : TapGestureRecognizer()
..onTap = () {
final decoration = decorations[index];
if (decoration.style == decoratedStyle) {
Expand Down

0 comments on commit dd45b01

Please sign in to comment.