How to use flutter provider in a statefulWidget?

前端 未结 3 1340
礼貌的吻别
礼貌的吻别 2021-02-10 07:59

I am using flutter_provider for state management. I want to load some items on page(statefulwidget) load from Api. I am showing a loader on page start and want to show the items

3条回答
  •  攒了一身酷
    2021-02-10 08:42

    When using a Provider you don’t need to use a StatefulWidget (as of a tutorial by the Flutter team State management

    You may use the following tutorial to see how to fetch data with a provider and a StatelessWidget: Flutter StateManagement with Provider

提交回复
热议问题