skip to Main Content

Flutter : VoidCallback does't work with OnTap but works with OnPressed

I have a StatelessWidget class : class PopupMenu extends StatelessWidget { final VoidCallback editTaskCallback; const PopupMenu({ required this.editTaskCallback, super.key, }); @override Widget build(BuildContext context) { return PopupMenuButton( itemBuilder:(context) => [ PopupMenuItem( onTap: null, child: TextButton.icon( onPressed: editTaskCallback, icon: const Icon(Icons.edit),…

VIEW QUESTION

Can I Use "FutureBuilder()" under Void Method in Flutter

This is My Code. Future<void> SendOrderDetails() async{ Row( children: [ FutureBuilder( future: topcart.getData(), builder: (context, AsyncSnapshot<List<Cart>> snapshot) { for(int i = 0; i<itemcount; i++) { if(itemcount>listModel2.data!.length) { listModel2.data?.add(Model2( ORDER_INFO_ID: 1, PRODUCT_ED_ID: 2, QTY: quantitycalcule.toString(), UNIT_PRICE:'00',// snapshot.data![i].Book_initional_price!.toString(), CHGED_BY:1, CHGED_DATE: DateTime.now().toString(), STATUS:…

VIEW QUESTION
Back To Top
Search