Closed maRci002 closed 6 months ago
It is awesome!!! Thank you for your contribution!
Should I update the changelog?
There are some breaking changes:
textScaleFactor
has been replaced with textScaler
)callback
has been replaced by the isCollapsed
controlleronLinkPressed
and linkTextStyle
That would be amazing! I will upload the new version to pub.dev today Thanks for your effort
I think there aren't any breaking changes:
textScaleFactor
can still be used but is marked with @Deprecated
.callback
can still be called but is also marked as deprecated.Soon I will update PR
LGTM
I am going to push one more commit to update the README, Changelog, and the flagship video. The code is ok which was merged.
closes #53
closes #42
https://github.com/jonataslaw/readmore/assets/8436039/f821568d-69ee-4ad3-a074-b5607b4ca463
https://github.com/jonataslaw/readmore/assets/8436039/3c7fc530-e550-4636-8de7-367cfe6ba9bd
Summary
This pull request introduces the ability to apply custom styling and define tap actions for special text elements such as mentions, hashtags, and URLs within the
ReadMoreText
widget. By leveraging a flexible annotation system, developers can now enhance the interactivity and visual appeal of text content, providing a richer user experience.Features
annotations
parameter inReadMoreText
, which accepts a list ofAnnotation
objects. EachAnnotation
object contains a regular expression to match specific text patterns and a builder function to customize the resultingTextSpan
.ReadMoreText
widget, allowing users to tap on mentions, hashtags, and URLs to perform actions like navigating to a user profile or displaying related content.<@userId>
to a user's name) while retaining custom styles and interactions.isCollapsed
programmatically.Implementation Details
Annotation
class to represent each customizable text pattern. This class includes aRegExp
for pattern matching and aTextSpan Function
for styling and interaction definition.ReadMoreText
widget to accept an optionalannotations
parameter, enabling the application of the definedAnnotation
objects to the widget's text content.ReadMoreTextState
to apply the specified annotations to the text, transforming matches based on the providedRegExp
and builder function within eachAnnotation
.Example Usage