fix merge pet
This commit is contained in:
parent
82940f4a5a
commit
e355cd67fb
|
@ -31,6 +31,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
late String petAmountRegister = '0';
|
late String petAmountRegister = '0';
|
||||||
dynamic item;
|
dynamic item;
|
||||||
|
|
||||||
|
late String defaultDropDownText = '';
|
||||||
late final TabController tabBarController;
|
late final TabController tabBarController;
|
||||||
VoidCallback? onUpdatePet;
|
VoidCallback? onUpdatePet;
|
||||||
VoidCallback? onRegisterPet;
|
VoidCallback? onRegisterPet;
|
||||||
|
@ -107,8 +108,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
TextEditingController? textControllerObservation;
|
TextEditingController? textControllerObservation;
|
||||||
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
String? Function(BuildContext, String?)? textControllerObservationValidator;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {
|
void initState(BuildContext context) {
|
||||||
resetInstance();
|
resetInstance();
|
||||||
|
@ -135,10 +134,8 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
textFieldFocusObservation = FocusNode();
|
textFieldFocusObservation = FocusNode();
|
||||||
textControllerObservation = TextEditingController();
|
textControllerObservation = TextEditingController();
|
||||||
|
|
||||||
dropDownValueController1 = FormFieldController<String>(dropDownValue1 ??= 'Selecione uma opção');
|
|
||||||
dropDownValueController2 = FormFieldController<String>(dropDownValue2 ??= 'Selecione uma opção');
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
await initAsync();
|
||||||
devUUID = await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage) ?? '';
|
devUUID = await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? '';
|
userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
|
cliUUID = await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage) ?? '';
|
||||||
|
@ -147,6 +144,19 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> initAsync() async {
|
||||||
|
defaultDropDownText = FFLocalizations.of(buildContext!).getVariableText(
|
||||||
|
enText: 'Select an option',
|
||||||
|
ptText: 'Selecione uma opção',
|
||||||
|
);
|
||||||
|
dropDownValueController1 = FormFieldController<String>(dropDownValue1 ??= defaultDropDownText);
|
||||||
|
dropDownValueController2 = FormFieldController<String>(dropDownValue2 ??= defaultDropDownText);
|
||||||
|
log('() => ): $devUUID');
|
||||||
|
|
||||||
|
safeSetState?.call();
|
||||||
|
log('() => ): $devUUID');
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
tabBarController.dispose();
|
tabBarController.dispose();
|
||||||
|
@ -234,10 +244,22 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropDownValue1 == null || dropDownValue1!.isEmpty || dropDownValue1 == '') {
|
if (dropDownValueController1!.value == defaultDropDownText ||
|
||||||
|
dropDownValueController1!.value == '' ||
|
||||||
|
dropDownValueController1!.value == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (dropDownValue2 == null || dropDownValue2!.isEmpty || dropDownValue2 == '') {
|
if (dropDownValueController2!.value == defaultDropDownText ||
|
||||||
|
dropDownValueController2!.value == '' ||
|
||||||
|
dropDownValueController2!.value == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dropDownValue1 == 'Selecione uma opção' || dropDownValue1 == null || dropDownValue1 == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dropDownValue2 == 'Selecione uma opção' || dropDownValue2 == null || dropDownValue2 == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue