AcmeSoftwareLLC / clean_framework

Flutter implementation of Clean Architecture, see http://www.amazon.com/dp/0134494164/
BSD 3-Clause "New" or "Revised" License
40 stars 18 forks source link

How to create a XXXcontroller with TickerProviderStateMixin? #156

Open lxgogogo opened 1 year ago

lxgogogo commented 1 year ago

If I want to create a AnimationController(vsync) or TabController(length, vsync), where should I initialize it in the framework class? It seems that I can't use with TickerProviderStateMixin in the viewModel, presenter, or useCase classes. Have you considered this issue or did I just miss something?

sarbagyastha commented 1 year ago

You can create your stateful widget with the state ticker and use the widget in UI's build method.

lxgogogo commented 1 year ago

Treat it as a sub-widget of a stateful widget?

If I have a tabController or an AnimationController and want to call xxxcontroller's methods directly in the parent widget, such as tabController.jumpToTab(), animationController.forward(), can you think of any solutions?

This type of business scenario should be very common.

thanks