|
|
@ -30,11 +30,26 @@ class FxMitraAddDialog extends HookConsumerWidget { |
|
|
|
final errorMou = useState<String?>(null); |
|
|
|
final errorMou = useState<String?>(null); |
|
|
|
final errorLogin = useState<String?>(null); |
|
|
|
final errorLogin = useState<String?>(null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final fcPassword = FocusNode(); |
|
|
|
|
|
|
|
final fcRePassword = FocusNode(); |
|
|
|
|
|
|
|
final errorPassword = useState<String?>(null); |
|
|
|
|
|
|
|
final errorRePassword = useState<String?>(null); |
|
|
|
|
|
|
|
|
|
|
|
final ctrlLogin = useTextEditingController(text: ""); |
|
|
|
final ctrlLogin = useTextEditingController(text: ""); |
|
|
|
|
|
|
|
final ctrlPassword = useTextEditingController(text: ""); |
|
|
|
|
|
|
|
final ctrlRePassword = useTextEditingController(text: ""); |
|
|
|
|
|
|
|
|
|
|
|
bool Function() validationError; |
|
|
|
bool Function() validationError; |
|
|
|
validationError = () { |
|
|
|
validationError = () { |
|
|
|
bool haveError = false; |
|
|
|
bool haveError = false; |
|
|
|
|
|
|
|
if (ctrlPassword.text == "") { |
|
|
|
|
|
|
|
errorPassword.value = "Password is mandatory"; |
|
|
|
|
|
|
|
haveError = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ctrlRePassword.text != ctrlPassword.text) { |
|
|
|
|
|
|
|
errorRePassword.value = "Password confirmation error"; |
|
|
|
|
|
|
|
haveError = true; |
|
|
|
|
|
|
|
} |
|
|
|
if (company == null) { |
|
|
|
if (company == null) { |
|
|
|
errorCompany.value = "Company is mandatory"; |
|
|
|
errorCompany.value = "Company is mandatory"; |
|
|
|
haveError = true; |
|
|
|
haveError = true; |
|
|
@ -102,12 +117,31 @@ class FxMitraAddDialog extends HookConsumerWidget { |
|
|
|
errorMessage: errorLogin.value, |
|
|
|
errorMessage: errorLogin.value, |
|
|
|
), |
|
|
|
), |
|
|
|
const SizedBox(height: 10), |
|
|
|
const SizedBox(height: 10), |
|
|
|
|
|
|
|
FxTextField( |
|
|
|
|
|
|
|
ctrl: ctrlPassword, |
|
|
|
|
|
|
|
fc: fcPassword, |
|
|
|
|
|
|
|
hint: "Password", |
|
|
|
|
|
|
|
label: "Password", |
|
|
|
|
|
|
|
obscureText: true, |
|
|
|
|
|
|
|
errorMessage: errorPassword.value, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
const SizedBox(height: 10), |
|
|
|
|
|
|
|
FxTextField( |
|
|
|
|
|
|
|
ctrl: ctrlRePassword, |
|
|
|
|
|
|
|
fc: fcRePassword, |
|
|
|
|
|
|
|
hint: "Retype Password", |
|
|
|
|
|
|
|
label: "Retype Password", |
|
|
|
|
|
|
|
obscureText: true, |
|
|
|
|
|
|
|
errorMessage: errorRePassword.value, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
const SizedBox(height: 10), |
|
|
|
const FxTextField( |
|
|
|
const FxTextField( |
|
|
|
hint: "ID", |
|
|
|
hint: "ID", |
|
|
|
label: "ID", |
|
|
|
label: "ID", |
|
|
|
isReadOnly: true, |
|
|
|
isReadOnly: true, |
|
|
|
isEnabled: false, |
|
|
|
isEnabled: false, |
|
|
|
suffixText: "Auto Generated"), |
|
|
|
suffixText: "Auto Generated", |
|
|
|
|
|
|
|
), |
|
|
|
const SizedBox(height: 10), |
|
|
|
const SizedBox(height: 10), |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.end, |
|
|
|
mainAxisAlignment: MainAxisAlignment.end, |
|
|
@ -128,7 +162,10 @@ class FxMitraAddDialog extends HookConsumerWidget { |
|
|
|
doctorAddressID: |
|
|
|
doctorAddressID: |
|
|
|
doctorAddress!.mDoctorAddressID, |
|
|
|
doctorAddress!.mDoctorAddressID, |
|
|
|
login: ctrlLogin.text, |
|
|
|
login: ctrlLogin.text, |
|
|
|
|
|
|
|
password: ctrlPassword.text, |
|
|
|
|
|
|
|
query: "", |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: const Text("Save"), |
|
|
|
child: const Text("Save"), |
|
|
|