Created
January 22, 2021 05:21
-
-
Save GAM3RG33K/b1d156cf41ff8c51c51191efb01ef313 to your computer and use it in GitHub Desktop.
Flutter - Clickable text links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Widget buildClickableTextWithPadding() { | |
| return InkWell( | |
| onTap: () {}, | |
| child: Padding( | |
| padding: const EdgeInsets.symmetric(vertical: 8.0), | |
| child: Text.rich( | |
| TextSpan( | |
| children: [ | |
| TextSpan( | |
| text: 'Edit', | |
| style: TextStyle( | |
| color: Color(0xFF0062CD), | |
| fontSize: 12, | |
| fontWeight: FontWeight.w700, | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| Widget buildClickableText() { | |
| return Text.rich( | |
| TextSpan( | |
| children: [ | |
| TextSpan( | |
| text: 'Edit', | |
| style: TextStyle( | |
| color: Color(0xFF0062CD), | |
| fontSize: 12, | |
| fontWeight: FontWeight.w700, | |
| ), | |
| recognizer: TapGestureRecognizer()..onTap = () {}, | |
| ), | |
| ], | |
| ), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment