Answer the question
In order to leave comments, you need to log in
How to call RefreshIndicator from code?
How to call RefreshIndicator from code on startup or button click?
I am using Provider to manage application state
@override
Widget build(BuildContext context) {
context.read<Data>().httpRequest();
return RefreshIndicator(
onRefresh: () {
return context.read<Data>().httpRequest();
},
child: Column(
children: [
DropdownButton<int>(
hint: Hint(),
items: loansServicecList(context),
onChanged: (int value) {
if (value != context.read<Data>().i) {
context.read<Data>().i = value;
context.read<Data>().httpRequest();
}
},
),
Flexible(
child: ServicesList(),
),
],
),
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question