Skip to content

Commit

Permalink
Merge pull request #45 from santa112358/make_gesture_nullable
Browse files Browse the repository at this point in the history
make gesture nullable in getHashTagTextSpan
  • Loading branch information
santa112358 committed Oct 29, 2020
2 parents ab91932 + dd45b01 commit 2560757
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 2560757

Please sign in to comment.