| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | |||||
| class ResourceHelperScreen extends StatefulWidget { | class ResourceHelperScreen extends StatefulWidget { | ||||
| final String type; | final String type; | ||||
| child: Card( | child: Card( | ||||
| child: Material( | child: Material( | ||||
| child: RadioListTile( | child: RadioListTile( | ||||
| title: Text(item.tbSuppliesName.toString()), | |||||
| title: Row( | |||||
| children: [ | |||||
| Expanded(child: Text(item.tbSuppliesName.toString())), | |||||
| Text( | |||||
| "${item.quantity.formatNumtoStringDecimal()} ${item.unit}") | |||||
| ], | |||||
| ), | |||||
| subtitle: Text(item.tbWarehouseName.toString()), | subtitle: Text(item.tbWarehouseName.toString()), | ||||
| value: item, | value: item, | ||||
| groupValue: item.isSelected == false ? null : item, | groupValue: item.isSelected == false ? null : item, | ||||
| Get.snackbar("Vật tư đã hết", "Vui lòng chọn vật tư khác", | Get.snackbar("Vật tư đã hết", "Vui lòng chọn vật tư khác", | ||||
| snackPosition: SnackPosition.BOTTOM); | snackPosition: SnackPosition.BOTTOM); | ||||
| } else { | } else { | ||||
| //close nackbar if open | |||||
| if (Get.isSnackbarOpen) Get.back(); | |||||
| Navigator.of(context).pop(value); | Navigator.of(context).pop(value); | ||||
| } | } | ||||
| }), | }), |