Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for text callback #8

Merged
merged 2 commits into from Nov 25, 2020
Merged

Add support for text callback #8

merged 2 commits into from Nov 25, 2020

Conversation

andreaselia
Copy link
Contributor

This fixes #1 to an extent. I don't have any use cases in mind where you'd want a callback for each state so I added support for a single state callback.

My use case for this is having the functionality to have 2 lines of text with an inline read more but when pressed the read more takes you to another screen with the full text rather than expanding the text.

@jonataslaw
Copy link
Owner

Hi, thanks for your contribution.
I removed a typo where it was 'pressed' instead of 'onPressed', and ended up changing the method name for the callback, and entering the display status in the callback.

LGTM

@jonataslaw jonataslaw merged commit 573b742 into jonataslaw:master Nov 25, 2020
@andreaselia andreaselia deleted the patch-1 branch November 26, 2020 16:28
@andreaselia
Copy link
Contributor Author

andreaselia commented Nov 27, 2020

@jonataslaw is it not an issue that the state is always updated no matter what you want to do with the callback?

My use case above would mean that if I were to do something like:

callback: (val) => Navigator.push(context, MaterialPageRoute(builder: (context) {
  return HelpScreen();
})),

It would change state before navigating, and then the state would still be changed afterwards.

Also, on an unrelated note, and I'd appreciate some advice if possible. I do seem to have the issue of "Read more" and the "more" going onto a 3rd line when the line limit is set to 2. It seems to be an issue with constraints.maxWidth as taking away ~3 from this resolves the issue for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How should we add a "expand/collapse" listener?
2 participants