Add validation on part no qty field

main_design2.0
zaid_daoud 2 years ago
parent 0be6013ec5
commit 53b02874a0

@ -27,7 +27,7 @@ extension TextStyles on String {
Text overline(BuildContext context) => getTextWithStyle(this, AppTextStyles.overline, context.isDark ? AppColor.neutral10 : AppColor.neutral20);
Text getTextWithStyle(String string, TextStyle style, Color color) => Text(string, style: style.copyWith(color: color));
Text getTextWithStyle(String string, TextStyle style, Color color) => Text(string ?? "", style: style.copyWith(color: color));
}
extension CustomText on Text {

@ -78,7 +78,7 @@ class _PartNoButtonState extends State<PartNoButton> {
labelText: context.translation.quantity,
textInputType: TextInputType.number,
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral30,
enable: current != null,
enable: current != null && current.sparePart?.id != null,
validator: (value) => value == null || value.isEmpty
? context.translation.requiredField
: Validator.isNumeric(value)

@ -68,7 +68,7 @@ class MultiFilesPickerItem extends StatelessWidget {
} else {
if (!await launchUrl(Uri.parse(file.path), mode: LaunchMode.externalApplication)) {
Fluttertoast.showToast(msg: "UnExpected Error with file.");
throw Exception('Could not launch ');
throw Exception('Could not launch');
}
}
},

Loading…
Cancel
Save