WIP
This commit is contained in:
parent
784d1d95b8
commit
e5b254eeb8
|
@ -379,6 +379,37 @@ Future<void> snackbar(BuildContext context, {required bool opt}) async {
|
|||
);
|
||||
}
|
||||
|
||||
void checkData() async {
|
||||
final response = await PhpGroup.getDadosCall.call(
|
||||
devUUID: AppState().devUUID,
|
||||
userUUID: AppState().userUUID,
|
||||
cliUUID: AppState().cliUUID,
|
||||
atividade: 'getDados',
|
||||
);
|
||||
|
||||
switch (response.statusCode) {
|
||||
case 200:
|
||||
if (response.jsonBody['error'] == false) {
|
||||
AppState().whatsapp = response.jsonBody['whatsapp'];
|
||||
AppState().provisional = response.jsonBody['provisional'];
|
||||
AppState().name = response.jsonBody['visitado']['VDO_NOME'];
|
||||
} else {
|
||||
if (response.jsonBody['error_msg'] !=
|
||||
r'''Usuario nao possui vinculo ativo com esse condominio''') {
|
||||
log(response.jsonBody['error_msg']);
|
||||
await DialogUtil.warningDefault(context)
|
||||
.whenComplete(() => checkData());
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
await DialogUtil.warningDefault(context).whenComplete(() => checkData());
|
||||
|
||||
safeSetState(() {});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> checkLocals({
|
||||
String? cliUUID,
|
||||
required BuildContext context,
|
||||
|
|
|
@ -60,7 +60,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
@ -77,26 +76,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
|||
model: _model,
|
||||
).then((_) => checkData());
|
||||
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
// if (AppState().cliUUID.isEmpty) {
|
||||
// showModalBottomSheet(
|
||||
// isScrollControlled: true,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// enableDrag: false,
|
||||
// isDismissible: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return Padding(
|
||||
// padding: MediaQuery.viewInsetsOf(context),
|
||||
// child: const BottomArrowLinkedLocalsComponentWidget(),
|
||||
// );
|
||||
// },
|
||||
// ).then((value) => safeSetState(() {}));
|
||||
// } else {
|
||||
// return;
|
||||
// }
|
||||
// });
|
||||
|
||||
_model.textController ??= TextEditingController();
|
||||
_model.textFieldFocusNode ??= FocusNode();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue