kevlatus/flutter_fortune_wheel

catch 22 with auto-route

dgaedcke opened this issue · 2 comments

I see you using auto-route (which I love), but I've not yet learned how to generate a new router.gr.dart when I have build/import errors in my code.

And that missing file is creating build errors ...

Can you either add that generated file to the repo, or teach me how to generate a new one in the presence of build errors??

I just commented out the invalid imports and resulting bad code, generated the route file, and then uncommented those lines. There must be a better way because this would be a real pain in a project with a ton of screens??

On an unrelated subject, your coding skills are far beyond mine and I'm trying to follow how this all works.
I need to build an infinite animated stock-ticker ... the pan and fling features are nice to have but not crucial ... mine should just run forever with price changes coming from a Firebase data stream. Can you advise me as to whether this codebase would be a good foundation for my task, or is too much of it designed for all the gesture handling and not running / animating continuously??

Hi @dgaedcke, you can build the router.gr.dart file, by executing the following command in the example/ directory:
flutter pub run build_runner build

This should only be necessary, when you want to fiddle with the example app, as auto_route is not being used in the package itself.

Regarding that unrelated subject: I think this package is not yet ready for displaying infinite lists, as all FortuneWidgets currently expect a limited number of items to be displayed and they are rendered at all times.
You could make this work with a FortuneWidget by limiting the size of your stock price list to e.g. 50 by always removing the most outdated price as new once come in.
These are just my spontaneous thoughts about that challenge. I hope they help.