I get this error 'type 'Future' is not a subtype of type 'ApplicationMeta'. I create a payment function. payment function type is future<List>. This function returns installedUpiapps in the list. I need to pass an argument to appWidget. But I get this error 'type 'Future' is not a subtype of type 'ApplicationMeta'.
import 'package:flutter/material.dart';
import 'package:upi_pay/upi_pay.dart';
class Homes extends StatelessWidget {
payment() async {
var appMetaList = await UpiPay.getInstalledUpiApplications();
return appMetaList;
}
Widget appWidget(ApplicationMeta appMeta) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
appMeta.iconImage(48), // Logo
Container(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.center,
child: Text(
appMeta.upiApplication.getAppName(),
textAlign: TextAlign.center,
),
),
],
);
}
@override
Widget build(BuildContext context) {
ApplicationMeta as = payment();
return appWidget(as);
}
}
> but appWidget need ApplicationMeta type argument. I cannot pass the argument to appWidget.
– Joshua Jenny Sibbu Jun 13 '21 at 13:14