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

Can a TexView be refreshed / re-rendered? #9

Closed
OscarEReyes opened this issue Jul 2, 2019 · 6 comments
Closed

Can a TexView be refreshed / re-rendered? #9

OscarEReyes opened this issue Jul 2, 2019 · 6 comments

Comments

@OscarEReyes
Copy link

I attempted to place a TexView inside a StreamBuilder that passes some text to be displayed.
The TexView stays unchanged.

Is there a correct way to re-render it?

@shah-xad
Copy link
Owner

shah-xad commented Jul 2, 2019

Sorry currently there is nothing like that, but it would be soon..

@takdw
Copy link

takdw commented Jul 10, 2019

I am having this issue as well. It would be really cool if we could re-render the TeXView when the input data (teXHTML) changes.

@takdw
Copy link

takdw commented Jul 17, 2019

So I have tried wrapping the TeXView in StatefulWidget and also a Consumer widget but I can't force the TeXView to be rebuilt. Is there any way I can achieve this?

@OscarEReyes
Copy link
Author

@takdw
So I managed to get something working, still not sure if it is an efficient solution.

My need was to have the TexView change as the user types text (or presses buttons like a calculator, still working on the input) and have the TexView change to show the appropriate TeX rendered.

Look up the WebView documentation and look into the WebViewController and its loadUrl Method.
I used the BLoC pattern to handle this documentation.

Although I think I ended up using a pure WebViewController and borrowing code from the TexView. When you create a WebView you can get the controller for it. I would have to look into the documentation. Let me know if this helps you get started.

@shah-xad
Copy link
Owner

loadUrl method wont work as that don't support laod from assets, if you want this you have to go to prior version before removing the server. as server makes it to load very slow, so I removed that and customized it to load directly from assets without server..

@shah-xad
Copy link
Owner

shah-xad commented Jul 25, 2019

Now this you can rerender or refresh the TeXView on setState, Please install latest version

flutter_tex: ^1.0.9.

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

No branches or pull requests

3 participants