mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 18:55:34 +00:00
Ability to edit Company model
This commit is contained in:
@ -1,6 +1,36 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class StringField extends TextFormField {
|
||||
|
||||
StringField({String label, String hint, String initial, Function onSaved, Function validator, bool allowEmpty = false}) :
|
||||
super(
|
||||
decoration: InputDecoration(
|
||||
labelText: label,
|
||||
hintText: hint
|
||||
),
|
||||
initialValue: initial,
|
||||
onSaved: onSaved,
|
||||
validator: (value) {
|
||||
print("Value: ${value}");
|
||||
if (!allowEmpty && value.isEmpty) {
|
||||
return "Value cannot be empty";
|
||||
}
|
||||
|
||||
if (validator != null) {
|
||||
return validator(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Helper class for quantity values
|
||||
*/
|
||||
class QuantityField extends TextFormField {
|
||||
|
||||
QuantityField({String label = "", String hint = "", String initial = "", double max = null, TextEditingController controller}) :
|
||||
|
Reference in New Issue
Block a user