-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from santa112358/add_scaffold_to_example
Add scaffold to example
- Loading branch information
Showing
7 changed files
with
68 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
## [3.0.2] | ||
|
||
- Fix example | ||
|
||
## [3.0.1] | ||
|
||
- Fix analysis problems | ||
|
||
## [3.0.0] | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:detectable_text_field/detector/sample_regular_expressions.dart'; | ||
import 'package:detectable_text_field/widgets/detectable_text.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class DetectableTextExample extends StatelessWidget { | ||
const DetectableTextExample({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('DetectableText Example'), | ||
), | ||
body: Center( | ||
child: DetectableText( | ||
trimLines: 1, | ||
colorClickableText: Colors.pink, | ||
trimMode: TrimMode.Line, | ||
trimCollapsedText: 'more', | ||
trimExpandedText: '...less', | ||
text: | ||
"Welcome to #Detectable @TextField http://www.google.com this is sample text we are texting the feed text here. Welcome to #Detectable @TextField this is sample text we are texting the feed text here", | ||
detectionRegExp: RegExp( | ||
"(?!\\n)(?:^|\\s)([#@]([$detectionContentLetters]+))|$urlRegexContent", | ||
multiLine: true, | ||
), | ||
onExpansionChanged: (bool readMore) { | ||
debugPrint('Read more >>>>>>> $readMore'); | ||
}, | ||
onTap: (tappedText) async { | ||
debugPrint(tappedText); | ||
if (tappedText.startsWith('#')) { | ||
debugPrint('DetectableText >>>>>>> #'); | ||
} else if (tappedText.startsWith('@')) { | ||
debugPrint('DetectableText >>>>>>> @'); | ||
} else if (tappedText.startsWith('http')) { | ||
debugPrint('DetectableText >>>>>>> http'); | ||
} | ||
}, | ||
basicStyle: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w400, | ||
color: Colors.grey, | ||
), | ||
detectedStyle: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w500, | ||
letterSpacing: 0.5, | ||
color: Colors.blueAccent, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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