I want to take a data from flutter secure storage. But as you know its a async function for get it. So in my widget , how can i take that data ? I cant use await for take it. So how can i take it ? Thanks for response!
Code :
FutureBuilder<PurchasedPackageResponseModel?>(
future: service.getPurchasedPackages(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const Center(
child: CircularProgressIndicator(),
);
}
I want to take data here ==> bool isClientTherapist = (I cant use await here So its giving error.) UserSecureStorage.getField("isClientTherapist");
final model = snapshot.data!.data!;
if (model.isEmpty) {
return const NotBoughtSessionWidget();
}
return const SizedBox();
If i make it stateful widget i can take in initstate. But i using getx and i want to take in stateless widget. Is it possible ?
You can simply add another FutureBuilder inside the first one to await this second call.