-
Notifications
You must be signed in to change notification settings - Fork 222
Update the layouts example #545
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
Conversation
|
Future feature request, I typically use this current example to test out hit testing for layouts when we make changes. This is currently happening frequently as we're developing the new Flutter code. But long-term should not be an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| } | ||
|
|
||
| void _onLoaded(RiveLoaded state) { | ||
| viewModelInstance = state.controller.dataBind(DataBind.auto()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah didn't notice this last time, you can remove this, and instead provide the dataBind property to RiveWidgetBuilder.
Then in onLoad, you can do state.viewModelInstance to access it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh because it's a new commit, that's why I didn't notice this :)
| void dispose() { | ||
| // This widget state owns the file loader, dispose it. | ||
| fileLoader.dispose(); | ||
| viewModelInstance.dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use the builder to create the viewModelInstance you also don't need to dispose it here. The builder will dispose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized this not on Mono! We need to add the change from there.
|
Closing this in favor of a PR in mono. |
Swaps out the current .riv for this one: