Merge pull request #32 from FRE-Informatica/fix/papinho/v2
Fix/papinho/v2
This commit is contained in:
commit
c25c23634f
Binary file not shown.
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.9 KiB |
|
@ -11,6 +11,7 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/flutter_flow/random_data_util.dart';
|
import 'package:hub/flutter_flow/random_data_util.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../shared/utils/log_util.dart';
|
import '../shared/utils/log_util.dart';
|
||||||
|
@ -153,7 +154,6 @@ Future singInLoginAction(
|
||||||
|
|
||||||
AppState().haveLocal =
|
AppState().haveLocal =
|
||||||
await checkLocals(context: context, model: model);
|
await checkLocals(context: context, model: model);
|
||||||
log('haveLocal in login: ${AppState().haveLocal}');
|
|
||||||
toggleApp(context, AppState().haveLocal!);
|
toggleApp(context, AppState().haveLocal!);
|
||||||
} else {
|
} else {
|
||||||
if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) {
|
if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) {
|
||||||
|
@ -299,7 +299,6 @@ Future toggleSignUpPage(BuildContext context) async {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future toggleApp(BuildContext context, bool haveLocal) async {
|
Future toggleApp(BuildContext context, bool haveLocal) async {
|
||||||
log('haveLocal in toggleApp: $haveLocal');
|
|
||||||
if (haveLocal == true)
|
if (haveLocal == true)
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
'homePage',
|
'homePage',
|
||||||
|
@ -384,7 +383,6 @@ Future<bool> checkLocals({
|
||||||
devUUID: AppState().devUUID,
|
devUUID: AppState().devUUID,
|
||||||
userUUID: AppState().userUUID,
|
userUUID: AppState().userUUID,
|
||||||
);
|
);
|
||||||
log(response.jsonBody.toString());
|
|
||||||
|
|
||||||
// Verificação rápida de erro para evitar processamento desnecessário.
|
// Verificação rápida de erro para evitar processamento desnecessário.
|
||||||
if (response.jsonBody['error']) {
|
if (response.jsonBody['error']) {
|
||||||
|
@ -400,6 +398,21 @@ Future<bool> checkLocals({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> showShare(payload) async {
|
||||||
|
for (var i = 0; i < payload['convites'].length; i++) {
|
||||||
|
log('ADD');
|
||||||
|
await Share.share('''
|
||||||
|
Olá, \*${payload['convites'][i]['VTE_NOME']}\*! Você foi convidado para \*${AppState().local}\*.
|
||||||
|
|
||||||
|
\*Validade do Convite\*:
|
||||||
|
- Início: ${payload['convites'][i]['VAW_DTINICIO']}
|
||||||
|
- Fim: ${payload['convites'][i]['VAW_DTFIM']}
|
||||||
|
|
||||||
|
URL do Convite: https://visita.freaccess.com.br/${payload['convites'][i]['VAW_ID']}/${AppState().cliUUID}/${payload['convites'][i]['VAW_CHAVE']}
|
||||||
|
''');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future answersRequest(BuildContext context, String? ref, String? task,
|
Future answersRequest(BuildContext context, String? ref, String? task,
|
||||||
String? response, String? id) async {
|
String? response, String? id) async {
|
||||||
ApiCallResponse? respondeSolicitacaoCall;
|
ApiCallResponse? respondeSolicitacaoCall;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_model.dart';
|
import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_model.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
class OrderFilterModalWidget extends StatefulWidget {
|
class OrderFilterModalWidget extends StatefulWidget {
|
||||||
final String defaultAdresseeType;
|
final String defaultAdresseeType;
|
||||||
|
@ -25,12 +23,28 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
|
|
||||||
late Map<String, dynamic> selected;
|
late Map<String, dynamic> selected;
|
||||||
final List<Map<String, String>> adresseeTypeOptions = [
|
final List<Map<String, String>> adresseeTypeOptions = [
|
||||||
{'title': 'Morador', 'value': 'MOR'},
|
{
|
||||||
{'title': 'Propriedade', 'value': 'PRO'},
|
'title': FFLocalizations.of(AppState().context!)
|
||||||
|
.getVariableText(enText: 'Resident', ptText: 'Morador'),
|
||||||
|
'value': 'MOR'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'title': FFLocalizations.of(AppState().context!)
|
||||||
|
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
|
||||||
|
'value': 'PRO'
|
||||||
|
},
|
||||||
];
|
];
|
||||||
final List<Map<String, String>> statusOptions = [
|
final List<Map<String, String>> statusOptions = [
|
||||||
{'title': 'Aguardando Retirada', 'value': 'notPickedUp'},
|
{
|
||||||
{'title': 'Retirado', 'value': 'pickedUp'},
|
'title': FFLocalizations.of(AppState().context!).getVariableText(
|
||||||
|
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
|
||||||
|
'value': 'notPickedUp'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'title': FFLocalizations.of(AppState().context!)
|
||||||
|
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
|
||||||
|
'value': 'pickedUp'
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -46,8 +60,12 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
_model = createModel(context, () => OrderFilterModalModel());
|
_model = createModel(context, () => OrderFilterModalModel());
|
||||||
|
|
||||||
selected = {
|
selected = {
|
||||||
'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType],
|
'adresseeType': widget.defaultAdresseeType == '.*'
|
||||||
'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus],
|
? ['MOR', 'PRO']
|
||||||
|
: [widget.defaultAdresseeType],
|
||||||
|
'status': widget.defaultStatus == '.*'
|
||||||
|
? ['notPickedUp', 'pickedUp']
|
||||||
|
: [widget.defaultStatus],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +94,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
Navigator.pop(context, filterResult);
|
Navigator.pop(context, filterResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) {
|
Widget _buildCheckboxListTile(
|
||||||
|
String key, List<Map<String, String>> options, double fontsize) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
@ -113,7 +132,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: fontsize,
|
fontSize: fontsize,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -141,7 +161,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
width: 5,
|
width: 5,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
),
|
),
|
||||||
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha
|
controlAffinity:
|
||||||
|
ListTileControlAffinity.leading, // Adiciona esta linha
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -199,7 +220,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
_buildCheckboxListTile('adresseeType', adresseeTypeOptions, 14),
|
_buildCheckboxListTile(
|
||||||
|
'adresseeType', adresseeTypeOptions, 14),
|
||||||
_buildCheckboxListTile('status', statusOptions, 14),
|
_buildCheckboxListTile('status', statusOptions, 14),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -12,27 +7,26 @@ import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BottomArrowLinkedLocalsComponentWidget> createState() => _BottomArrowLinkedLocalsComponentWidgetState();
|
State<BottomArrowLinkedLocalsComponentWidget> createState() =>
|
||||||
|
_BottomArrowLinkedLocalsComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLinkedLocalsComponentWidget> {
|
class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
|
extends State<BottomArrowLinkedLocalsComponentWidget> {
|
||||||
late BottomArrowLinkedLocalsComponentModel _model;
|
late BottomArrowLinkedLocalsComponentModel _model;
|
||||||
|
|
||||||
|
|
||||||
bool _loading = false;
|
bool _loading = false;
|
||||||
bool _hasData = false;
|
bool _hasData = false;
|
||||||
|
|
||||||
late Future<void> _localsFuture;
|
late Future<void> _localsFuture;
|
||||||
List<dynamic> _localsWrap = [];
|
List<dynamic> _localsWrap = [];
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
|
@ -42,7 +36,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
_model =
|
||||||
|
createModel(context, () => BottomArrowLinkedLocalsComponentModel());
|
||||||
_localsFuture = _fetchLocals();
|
_localsFuture = _fetchLocals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +95,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
_loading = false;
|
_loading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
|
@ -109,22 +103,28 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
devUUID: AppState().devUUID,
|
devUUID: AppState().devUUID,
|
||||||
userUUID: AppState().userUUID,
|
userUUID: AppState().userUUID,
|
||||||
cliID: cliID,
|
cliID: cliID,
|
||||||
tarefa: status
|
tarefa: status);
|
||||||
);
|
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vinculo Ativado com Sucesso", enText: "Link Activated Successfully") };
|
return {
|
||||||
|
'error': false,
|
||||||
|
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Vinculo Ativado com Sucesso",
|
||||||
|
enText: "Link Activated Successfully")
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
DialogUtil.errorDefault(context);
|
DialogUtil.errorDefault(context);
|
||||||
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vinculo', e, s);
|
LogUtil.requestAPIFailed(
|
||||||
return {'error': true, 'error_msg': FFLocalizations.of(context).getVariableText(
|
'responderVinculo.php', '', 'Responder Vinculo', e, s);
|
||||||
|
return {
|
||||||
|
'error': true,
|
||||||
|
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||||
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
||||||
enText: "Failed to perform operation, please try again later."
|
enText: "Failed to perform operation, please try again later.")
|
||||||
)};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,18 +135,25 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
Map<String, String> _labelsHashMap(dynamic local) {
|
Map<String, String> _labelsHashMap(dynamic local) {
|
||||||
return Map<String, String>.from({
|
return Map<String, String>.from({
|
||||||
'${local['CLI_PREFIXO']}:': local['CLI_NOME'],
|
'${local['CLI_PREFIXO']}:': local['CLI_NOME'],
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC']
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:':
|
||||||
|
local['CLU_OWNER_DSC']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Color> _statusHashMap(dynamic local) {
|
Map<String, Color> _statusHashMap(dynamic local) {
|
||||||
return Map<String, Color>.from({
|
return Map<String, Color>.from({
|
||||||
if (local['CLU_STATUS'] == 'A')
|
if (local['CLU_STATUS'] == 'A')
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Ativo',
|
||||||
|
enText: 'Active'): FlutterFlowTheme.of(context).success
|
||||||
else if (local['CLU_STATUS'] == 'B')
|
else if (local['CLU_STATUS'] == 'B')
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Bloqueado',
|
||||||
|
enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
||||||
else
|
else
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Pendente',
|
||||||
|
enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +163,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
labelsHashMap: _labelsHashMap(local),
|
labelsHashMap: _labelsHashMap(local),
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
|
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
AppState().cliUUID = local['CLI_ID'];
|
AppState().cliUUID = local['CLI_ID'];
|
||||||
AppState().local = local['CLI_NOME'];
|
AppState().local = local['CLI_NOME'];
|
||||||
|
@ -164,11 +170,12 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else if (local['CLU_STATUS'] == 'B') {
|
} else if (local['CLU_STATUS'] == 'B') {
|
||||||
String message = FFLocalizations.of(context).getVariableText(
|
String message = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
ptText:
|
||||||
enText: 'Location Blocked for Access, Contact Administration'
|
'Local Bloqueado para Acesso, Entre em Contato com Administração',
|
||||||
);
|
enText: 'Location Blocked for Access, Contact Administration');
|
||||||
|
|
||||||
if (local['CLU_BLK_MESSAGE'] != null && local['CLU_BLK_MESSAGE'] != '') {
|
if (local['CLU_BLK_MESSAGE'] != null &&
|
||||||
|
local['CLU_BLK_MESSAGE'] != '') {
|
||||||
message = local['CLU_BLK_MESSAGE'];
|
message = local['CLU_BLK_MESSAGE'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,8 +186,11 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
String localName = local['CLI_NOME'];
|
String localName = local['CLI_NOME'];
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativar VInculo', enText: 'Activate Link'),
|
FFLocalizations.of(context).getVariableText(
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Deseja Aceitar o Vinculo a $localName?', enText: 'Do you wish to accept the link to $localName?'),
|
ptText: 'Ativar VInculo', enText: 'Activate Link'),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Deseja Aceitar o Vinculo a $localName?',
|
||||||
|
enText: 'Do you wish to accept the link to $localName?'),
|
||||||
() async {
|
() async {
|
||||||
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
@ -191,10 +201,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
_localsWrap = [];
|
_localsWrap = [];
|
||||||
_localsFuture = _fetchLocals();
|
_localsFuture = _fetchLocals();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -218,8 +226,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -236,10 +243,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(25),
|
topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||||
topRight: Radius.circular(25)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
@ -258,7 +262,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty)
|
else if (_hasData == true &&
|
||||||
|
_loading == false &&
|
||||||
|
_localsWrap.isNotEmpty)
|
||||||
Expanded(child: _listItems(context)),
|
Expanded(child: _listItems(context)),
|
||||||
if (_loading == true)
|
if (_loading == true)
|
||||||
Container(
|
Container(
|
||||||
|
@ -271,7 +277,15 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
].addToStart(Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 10),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Escolha um local', enText: 'Choose a location'),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
)))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -133,7 +133,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Provisional\nSchedule',
|
enText: 'Schedule\nProviders',
|
||||||
ptText: 'Agendar\nPrestadores',
|
ptText: 'Agendar\nPrestadores',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -144,19 +144,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Delivery\nSchedule',
|
enText: 'Schedule\nDeliveries',
|
||||||
ptText: 'Agendar\nEntregas',
|
ptText: 'Agendar\nEntregas',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.share_location_outlined,
|
icon: Icons.attach_email_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.fastPassAction(context);
|
await _model.fastPassAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Fast\nVisit',
|
ptText: 'Convidar\nVisitantes',
|
||||||
ptText: 'Agenda\nRápida',
|
enText: 'Invite\nVisitors',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
|
@ -188,19 +188,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Reserva\nde Itens',
|
ptText: 'Reservas',
|
||||||
enText: 'Item\nReservation',
|
enText: 'Reservations',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: FFIcons.khome,
|
icon: Icons.person_add_alt_1_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.registerVisitorOptAction(context);
|
await _model.registerVisitorOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Register\nVisitor',
|
enText: 'Register\nVisitor',
|
||||||
ptText: 'Cadastro\nde Visitante',
|
ptText: 'Cadastrar\nVisitante',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
|
@ -215,14 +215,14 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.groups,
|
icon: Icons.transfer_within_a_station_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.peopleOnThePropertyAction(context);
|
await _model.accessHistoryAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'People on\nthe Property',
|
enText: 'Access\nHistory',
|
||||||
ptText: 'Pessoas na\nPropriedade',
|
ptText: 'Consultar\nAcessos',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
|
@ -236,28 +236,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Consultar\nLiberações',
|
ptText: 'Consultar\nLiberações',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuButtonWidget(
|
|
||||||
icon: Icons.key_outlined,
|
|
||||||
action: () async {
|
|
||||||
await _model.accessHistoryAction(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Access\nHistory',
|
|
||||||
ptText: 'Consultar\nAcessos',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MenuButtonWidget(
|
|
||||||
icon: Icons.people_outline_sharp,
|
|
||||||
action: () async {
|
|
||||||
await _model.visitHistoryAction(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Visit\nHistory',
|
|
||||||
ptText: 'Consultar\nVisitas',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.chat_outlined,
|
icon: Icons.chat_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
@ -269,6 +247,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Consultar\nMensagens',
|
ptText: 'Consultar\nMensagens',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
MenuButtonWidget(
|
||||||
|
icon: Icons.groups,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'People on\nthe Property',
|
||||||
|
ptText: 'Pessoas na\nPropriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
MenuButtonWidget(
|
MenuButtonWidget(
|
||||||
icon: Icons.settings,
|
icon: Icons.settings,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
@ -276,7 +265,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Preferences\nSettings',
|
enText: 'System\n Settings',
|
||||||
ptText: 'Opções\ndo Sistema',
|
ptText: 'Opções\ndo Sistema',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -383,7 +372,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Provisional Schedule',
|
enText: 'Schedule Providers',
|
||||||
ptText: 'Agendar Prestadores',
|
ptText: 'Agendar Prestadores',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -394,19 +383,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Delivery Schedule',
|
enText: 'Schedule Deliveries',
|
||||||
ptText: 'Agendar Entregas',
|
ptText: 'Agendar Entregas',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.share_location_outlined,
|
icon: Icons.attach_email_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.fastPassAction(context);
|
await _model.fastPassAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Fast Visit',
|
ptText: 'Convidar Visitantes',
|
||||||
ptText: 'Agenda Rápida',
|
enText: 'Invite Visitors',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
|
@ -438,19 +427,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Reserva de Itens',
|
ptText: 'Reservas',
|
||||||
enText: 'Item Reservation',
|
enText: 'Reservations',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: FFIcons.khome,
|
icon: Icons.person_add_alt_1_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.registerVisitorOptAction(context);
|
await _model.registerVisitorOptAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Register Visitor',
|
enText: 'Register Visitor',
|
||||||
ptText: 'Cadastro de Visitante',
|
ptText: 'Cadastrar Visitante',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
|
@ -465,29 +454,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.groups,
|
icon: Icons.transfer_within_a_station_outlined,
|
||||||
action: () async {
|
|
||||||
await _model.peopleOnThePropertyAction(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'People on the Property',
|
|
||||||
ptText: 'Pessoas na Propriedade',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MenuCardItem(
|
|
||||||
icon: Icons.group_add_outlined,
|
|
||||||
action: () async {
|
|
||||||
await _model.liberationHistoryAction(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Liberations History',
|
|
||||||
ptText: 'Consultar Liberações',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MenuCardItem(
|
|
||||||
icon: Icons.key_outlined,
|
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.accessHistoryAction(context);
|
await _model.accessHistoryAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
@ -498,14 +465,14 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.people_outline_sharp,
|
icon: Icons.how_to_reg_outlined,
|
||||||
action: () async {
|
action: () async {
|
||||||
await _model.visitHistoryAction(context);
|
await _model.liberationHistoryAction(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Visit History',
|
enText: 'Liberations History',
|
||||||
ptText: 'Consultar Visitas',
|
ptText: 'Consultar Liberações',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
|
@ -519,6 +486,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
ptText: 'Consultar Mensagens',
|
ptText: 'Consultar Mensagens',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
MenuCardItem(
|
||||||
|
icon: Icons.groups,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'People on the Property',
|
||||||
|
ptText: 'Pessoas na Propriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
MenuCardItem(
|
MenuCardItem(
|
||||||
icon: Icons.settings,
|
icon: Icons.settings,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
@ -526,7 +504,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
title: FFLocalizations.of(context).getVariableText(
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Preferences Settings',
|
enText: 'System Settings',
|
||||||
ptText: 'Opções do Sistema',
|
ptText: 'Opções do Sistema',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -545,11 +523,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
];
|
];
|
||||||
}();
|
}();
|
||||||
|
|
||||||
return Padding(
|
return Builder(
|
||||||
padding: const EdgeInsetsDirectional.only(
|
|
||||||
top: 10,
|
|
||||||
),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (widget.style == MenuView.list_grid &&
|
if (widget.style == MenuView.list_grid &&
|
||||||
widget.expandable == true &&
|
widget.expandable == true &&
|
||||||
|
@ -608,7 +582,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
}
|
}
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,9 +107,9 @@ class _MenuListViewComponentWidgetState
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildMenuList(BuildContext context) {
|
Widget buildMenuList(BuildContext context) {
|
||||||
return SizedBox(
|
return Expanded(
|
||||||
width: MediaQuery.of(context).size.width,
|
// width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height,
|
// height: MediaQuery.of(context).size.height,
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|
|
@ -87,7 +87,9 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
]
|
||||||
|
.addToStart(const SizedBox(height: 30))
|
||||||
|
.addToEnd(const SizedBox(height: 30)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/actions/actions.dart';
|
import 'package:hub/actions/actions.dart';
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future<dynamic> Function(BuildContext, int, int, String, String)? changeStatusAction) {
|
Widget buildDetails(
|
||||||
|
dynamic visitaWrapItem,
|
||||||
|
BuildContext context,
|
||||||
|
Future<dynamic> Function(BuildContext, int, int, String, String)?
|
||||||
|
changeStatusAction) {
|
||||||
return DetailsComponentWidget(
|
return DetailsComponentWidget(
|
||||||
buttons: [
|
buttons: [
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // REJECT ACTION
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
|
status.active) // REJECT ACTION
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Cancelar',
|
ptText: 'Cancelar',
|
||||||
|
@ -29,8 +27,8 @@ Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future<dynamic
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Bloquear Visita',
|
ptText: 'Cancelar Visita',
|
||||||
enText: 'Block Visit',
|
enText: 'Cancel Visit',
|
||||||
),
|
),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Você tem certeza que deseja bloquear essa visita?',
|
ptText: 'Você tem certeza que deseja bloquear essa visita?',
|
||||||
|
@ -141,13 +139,13 @@ Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future<dynamic
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Share.share('''
|
Share.share('''
|
||||||
Olá, \*${visitaWrapItem['VTE_NOME']}\*! Você foi convidado para \*${visitaWrapItem['NAC_DESCRICAO']}\*.
|
Olá, \*${visitaWrapItem['VTE_NOME']}\*! Você foi convidado para \*${AppState().local}\*.
|
||||||
|
|
||||||
\*Validade do Convite\*:
|
\*Validade do Convite\*:
|
||||||
- Início: ${visitaWrapItem['VAW_DTINICIO']}
|
- Início: ${visitaWrapItem['VAW_DTINICIO']}
|
||||||
- Fim: ${visitaWrapItem['VAW_DTFIM']}
|
- Fim: ${visitaWrapItem['VAW_DTFIM']}
|
||||||
|
|
||||||
URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']}
|
URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${AppState().cliUUID}/${visitaWrapItem['VAW_CHAVE']}
|
||||||
''');
|
''');
|
||||||
},
|
},
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
|
@ -167,9 +165,20 @@ URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${vi
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
labelsHashMap: Map<String, String>.from({
|
labelsHashMap: Map<String, String>.from({
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': visitaWrapItem['VTE_NOME'] ?? '',
|
'${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:':
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': visitaWrapItem['VAW_DTINICIO'] != '' && visitaWrapItem['VAW_DTINICIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) : '',
|
visitaWrapItem['VTE_NOME'] ?? '',
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '',
|
'${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:':
|
||||||
|
visitaWrapItem['VAW_DTINICIO'] != '' &&
|
||||||
|
visitaWrapItem['VAW_DTINICIO'] != null
|
||||||
|
? ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO'])
|
||||||
|
: '',
|
||||||
|
'${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:':
|
||||||
|
visitaWrapItem['VAW_DTFIM'] != '' &&
|
||||||
|
visitaWrapItem['VAW_DTFIM'] != null
|
||||||
|
? ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM'])
|
||||||
|
: '',
|
||||||
}),
|
}),
|
||||||
imagePath:
|
imagePath:
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
|
||||||
|
|
||||||
class ScheduleProvisionalVisitPageModel
|
class ScheduleProvisionalVisitPageModel
|
||||||
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||||
|
@ -62,6 +61,26 @@ class ScheduleProvisionalVisitPageModel
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DateTime selectedDateTime;
|
||||||
|
DateTime currentDateTime = DateTime.now();
|
||||||
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
|
||||||
|
|
||||||
|
try {
|
||||||
|
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
|
||||||
|
} catch (e) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Formato de data/hora inválido',
|
||||||
|
enText: 'Invalid date/time format',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateTime.isBefore(currentDateTime)) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'A data/hora selecionada é inválida',
|
||||||
|
enText: 'The selected date/time is invalid',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -942,8 +942,9 @@ class _ScheduleProvisionalVisitPageWidgetState
|
||||||
"Agendamento Provisório Realizado com Sucesso!",
|
"Agendamento Provisório Realizado com Sucesso!",
|
||||||
enText:
|
enText:
|
||||||
"Provisional Scheduling Successfully Completed"));
|
"Provisional Scheduling Successfully Completed"));
|
||||||
setState(() {
|
safeSetState(() {
|
||||||
_model.dateTimeTextController?.clear();
|
_model.dateTimeTextController?.clear();
|
||||||
|
|
||||||
_model.personNameTextController
|
_model.personNameTextController
|
||||||
?.clear();
|
?.clear();
|
||||||
_model.notesTextController?.clear();
|
_model.notesTextController?.clear();
|
||||||
|
|
|
@ -1,25 +1,22 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'regisiter_vistor_template_component_widget.dart';
|
import 'regisiter_vistor_template_component_widget.dart';
|
||||||
|
|
||||||
class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
class RegisiterVistorTemplateComponentModel
|
||||||
|
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
Timer? _debounceTimer;
|
Timer? _debounceTimer;
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
bool isDataUploading = false;
|
bool isDataUploading = false;
|
||||||
FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
FFUploadedFile uploadedLocalFile =
|
||||||
|
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
|
|
||||||
void debounce(Function() fn, Duration time) {
|
void debounce(Function() fn, Duration time) {
|
||||||
if (_debounceTimer != null) {
|
if (_debounceTimer != null) {
|
||||||
|
@ -28,6 +25,8 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
_debounceTimer = Timer(time, fn);
|
_debounceTimer = Timer(time, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode1;
|
FocusNode? textFieldFocusNode1;
|
||||||
TextEditingController? textController1;
|
TextEditingController? textController1;
|
||||||
|
@ -97,7 +96,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
TextEditingController? textController4;
|
TextEditingController? textController4;
|
||||||
String? Function(BuildContext, String?)? textController4Validator;
|
String? Function(BuildContext, String?)? textController4Validator;
|
||||||
String? _textController4Validator(BuildContext context, String? val) {
|
String? _textController4Validator(BuildContext context, String? val) {
|
||||||
if (val != null && val.isNotEmpty && ValidatorUtil.isValidEmail(val) == false) {
|
if (val != null &&
|
||||||
|
val.isNotEmpty &&
|
||||||
|
ValidatorUtil.isValidEmail(val) == false) {
|
||||||
return FFLocalizations.of(context).getVariableText(
|
return FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Invalid email',
|
enText: 'Invalid email',
|
||||||
ptText: 'Email inválido',
|
ptText: 'Email inválido',
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:easy_debounce/easy_debounce.dart';
|
import 'package:easy_debounce/easy_debounce.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
import 'package:json_path/fun_sdk.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/custom_code/actions/index.dart' as actions;
|
||||||
import '/flutter_flow/flutter_flow_drop_down.dart';
|
import '/flutter_flow/flutter_flow_drop_down.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
import '/flutter_flow/upload_data.dart';
|
import '/flutter_flow/upload_data.dart';
|
||||||
import '/custom_code/actions/index.dart' as actions;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'regisiter_vistor_template_component_model.dart';
|
import 'regisiter_vistor_template_component_model.dart';
|
||||||
|
|
||||||
export 'regisiter_vistor_template_component_model.dart';
|
export 'regisiter_vistor_template_component_model.dart';
|
||||||
|
@ -44,13 +40,20 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
bool _isVisitorRegistered = false;
|
bool _isVisitorRegistered = false;
|
||||||
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
||||||
|
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
void _resetForm() {
|
||||||
|
_formKey.currentState?.reset();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
||||||
|
|
||||||
_model = createModel(context, () => RegisiterVistorTemplateComponentModel());
|
_model =
|
||||||
|
createModel(context, () => RegisiterVistorTemplateComponentModel());
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController();
|
_model.textController1 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
@ -87,15 +90,19 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController1.text.isEmpty || _model.textController1.text == '') {
|
if (_model.textController1.text.isEmpty ||
|
||||||
|
_model.textController1.text == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') {
|
if (_model.dropDownValue == null ||
|
||||||
|
_model.dropDownValue!.isEmpty ||
|
||||||
|
_model.dropDownValue == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController2.text.isEmpty || _model.textController2.text == '') {
|
if (_model.textController2.text.isEmpty ||
|
||||||
|
_model.textController2.text == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +110,9 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
if (_model.textController4.text.isNotEmpty &&
|
||||||
|
_model.textController4.text != '' &&
|
||||||
|
ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +138,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Form(
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -137,7 +147,8 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 15.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
20.0, 0.0, 0.0, 15.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'zazj5d8b' /* Preencha o formulário com os d... */,
|
'zazj5d8b' /* Preencha o formulário com os d... */,
|
||||||
|
@ -167,6 +178,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
maxLength: 20,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
@ -246,6 +258,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
_model.textController2Validator.asValidator(context),
|
_model.textController2Validator.asValidator(context),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
|
LengthLimitingTextInputFormatter(20)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
_model.textController2.text.isEmpty
|
_model.textController2.text.isEmpty
|
||||||
|
@ -295,11 +308,9 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
onChanged: (_) =>
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
EasyDebounce.debounce(
|
|
||||||
'_model.textFieldFocusNode1',
|
'_model.textFieldFocusNode1',
|
||||||
const Duration(
|
const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
@ -372,8 +383,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
|
maxLength: 80,
|
||||||
keyboardType: TextInputType.name,
|
keyboardType: TextInputType.name,
|
||||||
validator: _model.textController1Validator.asValidator(context),
|
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||||
|
validator:
|
||||||
|
_model.textController1Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -460,10 +474,12 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
24.0, 0.0, 24.0, 0.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
|
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
||||||
|
false)) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -508,7 +524,8 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
// selectedMedia.every((m) =>
|
// selectedMedia.every((m) =>
|
||||||
// validateFileFormat(
|
// validateFileFormat(
|
||||||
// m.storagePath, context))) {
|
// m.storagePath, context))) {
|
||||||
setState(() => _model.isDataUploading = true);
|
setState(
|
||||||
|
() => _model.isDataUploading = true);
|
||||||
var selectedUploadedFiles =
|
var selectedUploadedFiles =
|
||||||
<FFUploadedFile>[];
|
<FFUploadedFile>[];
|
||||||
|
|
||||||
|
@ -520,8 +537,9 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
);
|
);
|
||||||
selectedUploadedFiles = selectedMedia
|
selectedUploadedFiles = selectedMedia
|
||||||
.map((m) => FFUploadedFile(
|
.map((m) => FFUploadedFile(
|
||||||
name:
|
name: m.storagePath
|
||||||
m.storagePath.split('/').last,
|
.split('/')
|
||||||
|
.last,
|
||||||
bytes: m.bytes,
|
bytes: m.bytes,
|
||||||
height: m.dimensions?.height,
|
height: m.dimensions?.height,
|
||||||
width: m.dimensions?.width,
|
width: m.dimensions?.width,
|
||||||
|
@ -557,7 +575,8 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 120.0,
|
height: 120.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 0.0, 20.0),
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
14.0, 0.0, 0.0, 20.0),
|
14.0, 0.0, 0.0, 20.0),
|
||||||
|
@ -645,12 +664,16 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
|
|
||||||
|
maxLength: 25,
|
||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(
|
||||||
RegExp('[0-9, +, -, (, )]')),
|
RegExp('[0-9, +, -, (, )]')),
|
||||||
|
LengthLimitingTextInputFormatter(25)
|
||||||
],
|
],
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
@ -729,15 +752,14 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
onChanged: (_) =>
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
EasyDebounce.debounce(
|
|
||||||
'_model.textFieldFocusNode4',
|
'_model.textFieldFocusNode4',
|
||||||
const Duration(
|
const Duration(milliseconds: 500),
|
||||||
milliseconds: 500),
|
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
maxLength: 80,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
@ -805,11 +827,14 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
validator: _model.textController4Validator.asValidator(context),
|
inputFormatters: [LengthLimitingTextInputFormatter(80)],
|
||||||
|
validator:
|
||||||
|
_model.textController4Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: _isFormValid(context)
|
onPressed: _isFormValid(context)
|
||||||
? () async {
|
? () async {
|
||||||
|
@ -835,29 +860,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
foto: 'base64;jpeg,${_model.imgBase64}',
|
foto: 'base64;jpeg,${_model.imgBase64}',
|
||||||
)
|
)
|
||||||
.onError((e, s) async {
|
.onError((e, s) async {
|
||||||
return await showAdaptiveDialog(
|
return await DialogUtil.errorDefault(context);
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => Navigator.pop(context),
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText:
|
|
||||||
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
|
||||||
enText:
|
|
||||||
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
if (PhpGroup.postScheduleVisitorCall.error(
|
if (PhpGroup.postScheduleVisitorCall.error(
|
||||||
(_model.scheduleVisitor?.jsonBody ?? ''),
|
(_model.scheduleVisitor?.jsonBody ?? ''),
|
||||||
|
@ -895,6 +898,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
_formKey.currentState?.reset();
|
||||||
if (widget.source ==
|
if (widget.source ==
|
||||||
'VisitorNotFoundComponent') {
|
'VisitorNotFoundComponent') {
|
||||||
Navigator.pop(context, true);
|
Navigator.pop(context, true);
|
||||||
|
|
|
@ -154,8 +154,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(3.0),
|
padding: const EdgeInsets.all(3.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context)
|
||||||
'9hbdjxrz' /* VAMOS LA! ENTRE COM A SUA CONT... */,
|
.getVariableText(
|
||||||
|
ptText:
|
||||||
|
'VAMOS LÁ! ENTRE COM A SUA CONTA',
|
||||||
|
enText:
|
||||||
|
'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
|
|
|
@ -235,7 +235,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
Form(
|
Form(
|
||||||
key: _model.formKey,
|
key: _model.formKey,
|
||||||
autovalidateMode:
|
autovalidateMode:
|
||||||
AutovalidateMode.always,
|
AutovalidateMode.onUserInteraction,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
|
@ -255,7 +255,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce(
|
||||||
'_model.nameRegisterFormTextController',
|
'_model.nameRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(
|
||||||
milliseconds: 2000),
|
milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
@ -397,7 +397,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce(
|
||||||
'_model.emailRegisterFormTextController',
|
'_model.emailRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(
|
||||||
milliseconds: 2000),
|
milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
@ -541,7 +541,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce(
|
||||||
'_model.passwordRegisterFormTextController',
|
'_model.passwordRegisterFormTextController',
|
||||||
const Duration(
|
const Duration(
|
||||||
milliseconds: 2000),
|
milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
const _kLocaleStorageKey = '__locale_key__';
|
const _kLocaleStorageKey = '__locale_key__';
|
||||||
|
@ -187,8 +187,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'Service provider',
|
'en': 'Service provider',
|
||||||
},
|
},
|
||||||
'pmezihb4': {
|
'pmezihb4': {
|
||||||
'pt': 'Selecione...',
|
'pt': 'Selecione o tipo de pessoa...',
|
||||||
'en': 'Please select...',
|
'en': 'Please select the type of person...',
|
||||||
},
|
},
|
||||||
'yza6i4t7': {
|
'yza6i4t7': {
|
||||||
'pt': 'Search for an item...',
|
'pt': 'Search for an item...',
|
||||||
|
@ -222,8 +222,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
// scheduleCompleteVisitPage
|
// scheduleCompleteVisitPage
|
||||||
{
|
{
|
||||||
'61lcxdgm': {
|
'61lcxdgm': {
|
||||||
'pt': 'Agendar Visita',
|
'pt': 'Agenda Completa',
|
||||||
'en': 'Schedule Visit',
|
'en': 'Complete Schedule',
|
||||||
},
|
},
|
||||||
'ueth1f4g': {
|
'ueth1f4g': {
|
||||||
'pt': 'Cadastrar Visita',
|
'pt': 'Cadastrar Visita',
|
||||||
|
@ -286,12 +286,12 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'Single visit',
|
'en': 'Single visit',
|
||||||
},
|
},
|
||||||
'eftcs67c': {
|
'eftcs67c': {
|
||||||
'pt': 'Você tem alguma observação sobre está visita?',
|
'pt': 'Você tem alguma observação sobre esta visita?',
|
||||||
'en': 'Do you have any observations about this visit?',
|
'en': 'Do you have any observations about this visit?',
|
||||||
},
|
},
|
||||||
't0q2vuup': {
|
't0q2vuup': {
|
||||||
'pt': 'Observações da Visita',
|
'pt': 'Observações da Visita',
|
||||||
'en': 'Visit Observations',
|
'en': 'Visit Notes',
|
||||||
},
|
},
|
||||||
'w18iztdm': {
|
'w18iztdm': {
|
||||||
'pt': 'Escreva as suas observações aqui',
|
'pt': 'Escreva as suas observações aqui',
|
||||||
|
@ -350,7 +350,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
},
|
},
|
||||||
'cw8b3tbb': {
|
'cw8b3tbb': {
|
||||||
'pt': 'Observação da Visita',
|
'pt': 'Observação da Visita',
|
||||||
'en': 'Notes Visit',
|
'en': 'Visit Notes',
|
||||||
},
|
},
|
||||||
'k4qkbv1f': {
|
'k4qkbv1f': {
|
||||||
'pt': '',
|
'pt': '',
|
||||||
|
@ -411,7 +411,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
// acessHistoryPage
|
// acessHistoryPage
|
||||||
{
|
{
|
||||||
'ch8qymga': {
|
'ch8qymga': {
|
||||||
'pt': 'Histórico de Acesso',
|
'pt': 'Consultar Acessos',
|
||||||
'en': 'Access History',
|
'en': 'Access History',
|
||||||
},
|
},
|
||||||
'2odgr6hg': {
|
'2odgr6hg': {
|
||||||
|
@ -442,7 +442,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'Reason:',
|
'en': 'Reason:',
|
||||||
},
|
},
|
||||||
'784f83pc': {
|
'784f83pc': {
|
||||||
'pt': 'Histórico de Liberação',
|
'pt': 'Consultar Liberações',
|
||||||
'en': 'Liberation History',
|
'en': 'Liberation History',
|
||||||
},
|
},
|
||||||
'1skj43ye': {
|
'1skj43ye': {
|
||||||
|
@ -482,7 +482,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'Release QR Code',
|
'en': 'Release QR Code',
|
||||||
},
|
},
|
||||||
'6z6kvmhl': {
|
'6z6kvmhl': {
|
||||||
'pt': 'Certifique-se de que o QRCode está visivel para o leitor',
|
'pt': 'Certifique-se de que o QRCode está visível para o leitor',
|
||||||
'en': '',
|
'en': '',
|
||||||
},
|
},
|
||||||
'wkjkxd2e': {
|
'wkjkxd2e': {
|
||||||
|
@ -1181,7 +1181,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
},
|
},
|
||||||
'ujodm2ci': {
|
'ujodm2ci': {
|
||||||
'pt':
|
'pt':
|
||||||
'Para gerar o QR Code digite a senha cadastrado no aplicativo e clique em enviar.',
|
'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.',
|
||||||
'en':
|
'en':
|
||||||
'To generate the QR Code, enter the password registered in the application and click send.',
|
'To generate the QR Code, enter the password registered in the application and click send.',
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,7 +23,8 @@ class AcessHistoryPageWidget extends StatefulWidget {
|
||||||
};
|
};
|
||||||
AcessHistoryPageWidget({super.key, required this.opt});
|
AcessHistoryPageWidget({super.key, required this.opt});
|
||||||
@override
|
@override
|
||||||
State<AcessHistoryPageWidget> createState() => _AcessHistoryPageWidgetState(opt);
|
State<AcessHistoryPageWidget> createState() =>
|
||||||
|
_AcessHistoryPageWidgetState(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
|
@ -43,7 +44,8 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
late Future<void> _accessFuture;
|
late Future<void> _accessFuture;
|
||||||
List<dynamic> _accessWrap = [];
|
List<dynamic> _accessWrap = [];
|
||||||
|
|
||||||
_AcessHistoryPageWidgetState(Map<String, String> opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
_AcessHistoryPageWidgetState(Map<String, String> opt)
|
||||||
|
: selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
||||||
selectedTypeSubject.listen((value) {});
|
selectedTypeSubject.listen((value) {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,9 +335,18 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
imagePath:
|
imagePath:
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
|
||||||
labelsHashMap: Map<String, String>.from({
|
labelsHashMap: Map<String, String>.from({
|
||||||
'Nome:': accessHistoryItem['PES_NOME'] ?? '',
|
FFLocalizations.of(context).getVariableText(
|
||||||
'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '',
|
ptText: 'Nome:',
|
||||||
'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '',
|
enText: 'Name:',
|
||||||
|
): accessHistoryItem['PES_NOME'] ?? '',
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Acesso:',
|
||||||
|
enText: 'Access:',
|
||||||
|
): accessHistoryItem['ACE_DATAHORA'] ?? '',
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Setor',
|
||||||
|
enText: 'Sector',
|
||||||
|
): accessHistoryItem['SET_DESCRICAO'] ?? '',
|
||||||
}),
|
}),
|
||||||
statusHashMap: [
|
statusHashMap: [
|
||||||
accessHistoryItem['PES_TIPO'] == 'O'
|
accessHistoryItem['PES_TIPO'] == 'O'
|
||||||
|
|
|
@ -225,7 +225,9 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget createBody() {
|
Widget createBody() {
|
||||||
return Container(
|
return SingleChildScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
child: Container(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: wrapWithModel(
|
child: wrapWithModel(
|
||||||
model: _model.menuComponentModel,
|
model: _model.menuComponentModel,
|
||||||
|
@ -236,6 +238,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
item: MenuItem.button,
|
item: MenuItem.button,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/actions/actions.dart';
|
import 'package:hub/actions/actions.dart';
|
||||||
|
@ -229,7 +231,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.done),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
return answersRequest
|
answersRequest
|
||||||
.call(
|
.call(
|
||||||
context,
|
context,
|
||||||
liberationHistoryItem['NOT_ID'].toString(),
|
liberationHistoryItem['NOT_ID'].toString(),
|
||||||
|
@ -237,8 +239,9 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
'',
|
'',
|
||||||
liberationHistoryItem['VTE_ID'].toString(),
|
liberationHistoryItem['VTE_ID'].toString(),
|
||||||
)
|
)
|
||||||
.then((message) {
|
.then((value) {
|
||||||
if (message.isEmpty) {
|
log('test: $value');
|
||||||
|
if (value) {
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -246,9 +249,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
ptText: 'Visita resolvida com sucesso'),
|
ptText: 'Visita resolvida com sucesso'),
|
||||||
false);
|
false);
|
||||||
} else {
|
} else {
|
||||||
showSnackbar(context, message, true);
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error resolving visit',
|
||||||
|
ptText: 'Erro ao resolver visita'),
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
}).whenComplete(() {
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
_requestWrap = [];
|
_requestWrap = [];
|
||||||
_requestFuture = _fetchRequests();
|
_requestFuture = _fetchRequests();
|
||||||
|
@ -311,46 +319,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((_) {
|
).then((_) {});
|
||||||
() {}();
|
|
||||||
// PushNotificationManager _pushNotificationService =
|
|
||||||
// PushNotificationManager();
|
|
||||||
|
|
||||||
// _pushNotificationService.onMessageReceived.listen((received) {
|
|
||||||
// if (received.data['click_action'] == 'cancel_request') {
|
|
||||||
// _pushNotificationService.dispose();
|
|
||||||
// showSnackbar(
|
|
||||||
// context,
|
|
||||||
// FFLocalizations.of(context).getVariableText(
|
|
||||||
// enText: 'Successfully resolved visit',
|
|
||||||
// ptText: 'Visita resolvida com sucesso'),
|
|
||||||
// false);
|
|
||||||
// context.pushReplacementNamed(
|
|
||||||
// 'liberationHistory',
|
|
||||||
// extra: <String, dynamic>{
|
|
||||||
// kTransitionInfoKey: const TransitionInfo(
|
|
||||||
// hasTransition: true,
|
|
||||||
// transitionType: PageTransitionType.scale,
|
|
||||||
// alignment: Alignment.bottomCenter,
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }).whenComplete(() {
|
|
||||||
// safeSetState(() {
|
|
||||||
// _requestWrap = [];
|
|
||||||
// _requestFuture = _fetchRequests();
|
|
||||||
// });
|
|
||||||
// }).catchError((e, s) {
|
|
||||||
// DialogUtil.errorDefault(context);
|
|
||||||
// LogUtil.requestAPIFailed(
|
|
||||||
// "proccessRequest.php", "", "Consulta de Solitiações", e, s);
|
|
||||||
// safeSetState(() {
|
|
||||||
// _hasData = false;
|
|
||||||
// _loading = false;
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
title: Text(
|
title: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Message History',
|
enText: 'Message History',
|
||||||
ptText: 'Histórico de Mensagens',
|
ptText: 'Consultar Mensagens',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart';
|
import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart';
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
|
@ -25,7 +22,6 @@ class PackageOrderPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PackageOrderPage extends State<PackageOrderPage> {
|
class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
|
|
||||||
late ScrollController _scrollController;
|
late ScrollController _scrollController;
|
||||||
int _pageNumber = 1;
|
int _pageNumber = 1;
|
||||||
final int _pageSize = 10;
|
final int _pageSize = 10;
|
||||||
|
@ -54,8 +50,10 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
|
|
||||||
_orderFuture = _fetchOrders();
|
_orderFuture = _fetchOrders();
|
||||||
|
|
||||||
_scrollController = ScrollController()..addListener(() {
|
_scrollController = ScrollController()
|
||||||
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) {
|
..addListener(() {
|
||||||
|
if (_scrollController.position.atEdge &&
|
||||||
|
_scrollController.position.pixels != 0) {
|
||||||
_loadMoreOrders();
|
_loadMoreOrders();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -94,8 +92,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
pageSize: _pageSize.toString(),
|
pageSize: _pageSize.toString(),
|
||||||
page: _pageNumber.toString(),
|
page: _pageNumber.toString(),
|
||||||
adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType,
|
adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType,
|
||||||
status: _status == '.*' ? 'all' : _status
|
status: _status == '.*' ? 'all' : _status);
|
||||||
);
|
|
||||||
|
|
||||||
final List<dynamic> orders = response.jsonBody['value']['list'] ?? [];
|
final List<dynamic> orders = response.jsonBody['value']['list'] ?? [];
|
||||||
|
|
||||||
|
@ -171,8 +168,12 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: OrderFilterModalWidget(
|
child: OrderFilterModalWidget(
|
||||||
defaultAdresseeType: _selectedTypeSubject.value['adresseeType'] ?? '.*',
|
defaultAdresseeType: _selectedTypeSubject
|
||||||
defaultStatus: _selectedTypeSubject.value['status'] ?? '.*',
|
.value['adresseeType'] ??
|
||||||
|
'.*',
|
||||||
|
defaultStatus:
|
||||||
|
_selectedTypeSubject.value['status'] ??
|
||||||
|
'.*',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -224,7 +225,8 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(
|
title: Text(
|
||||||
FFLocalizations.of(context).getVariableText(enText: 'Orders', ptText: 'Encomendas'),
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'My Orders', ptText: 'Minhas Encomendas'),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
@ -232,8 +234,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
leading: _backButton(context, FlutterFlowTheme.of(context)),
|
leading: _backButton(context, FlutterFlowTheme.of(context)),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
|
@ -295,8 +296,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
return _item(context, order);
|
return _item(context, order);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String _imagePath(dynamic order) {
|
String _imagePath(dynamic order) {
|
||||||
|
@ -306,36 +306,47 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
Map<String, String> _labelsHashMap(dynamic order) {
|
Map<String, String> _labelsHashMap(dynamic order) {
|
||||||
return Map<String, String>.from({
|
return Map<String, String>.from({
|
||||||
if (order['isPending'] == true)
|
if (order['isPending'] == true)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(),
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:':
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'],
|
order['id'].toString(),
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']),
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:':
|
||||||
|
order['customCategory'],
|
||||||
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:':
|
||||||
|
ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', order['dtReceive']),
|
||||||
if (order['isPending'] == false)
|
if (order['isPending'] == false)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']),
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:':
|
||||||
|
ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', order['dtPickUp']),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> _labelsHashMapDialog(dynamic order) {
|
Map<String, String> _labelsHashMapDialog(dynamic order) {
|
||||||
return Map<String, String>.from({
|
return Map<String, String>.from({
|
||||||
if (order['isPending'] == true)
|
if (order['isPending'] == true)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(),
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:':
|
||||||
|
order['id'].toString(),
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'],
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:':
|
||||||
|
order['customCategory'],
|
||||||
if (order['code'] != null)
|
if (order['code'] != null)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:': order['code'],
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:':
|
||||||
|
order['code'],
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:': order['sendedBy'],
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:':
|
||||||
|
order['sendedBy'],
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:': order['receivedBy'],
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:':
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']),
|
order['receivedBy'],
|
||||||
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:':
|
||||||
|
ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', order['dtReceive']),
|
||||||
if (order['isPending'] == false)
|
if (order['isPending'] == false)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:': order['pickedUpBy'],
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:':
|
||||||
|
order['pickedUpBy'],
|
||||||
if (order['isPending'] == false)
|
if (order['isPending'] == false)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']),
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:':
|
||||||
|
ValidatorUtil.toLocalDateTime(
|
||||||
|
'yyyy-MM-dd HH:mm:ss', order['dtPickUp']),
|
||||||
if (order['message'] != null)
|
if (order['message'] != null)
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': order['message']
|
'${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:':
|
||||||
|
order['message']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,13 +354,16 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
return [
|
return [
|
||||||
if (order['isPending'] == true)
|
if (order['isPending'] == true)
|
||||||
Map<String, Color>.from({
|
Map<String, Color>.from({
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning,
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Aguardando Retirada',
|
||||||
|
enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
Map<String, Color>.from({
|
Map<String, Color>.from({
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary,
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Retirado',
|
||||||
|
enText: 'Picked up'): FlutterFlowTheme.of(context).primary,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
if (order['adresseeType'] == 'PRO')
|
if (order['adresseeType'] == 'PRO')
|
||||||
Map<String, Color>.from({
|
Map<String, Color>.from({
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -384,18 +398,22 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
statusHashMap: [
|
statusHashMap: [
|
||||||
if (order['isPending'] == true)
|
if (order['isPending'] == true)
|
||||||
Map<String, Color>.from({
|
Map<String, Color>.from({
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning,
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Aguardando Retirada',
|
||||||
|
enText: 'Waiting Pick up'):
|
||||||
|
FlutterFlowTheme.of(context).warning,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
Map<String, Color>.from({
|
Map<String, Color>.from({
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary,
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Retirado', enText: 'Picked up'):
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
buttons: [],
|
buttons: [],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) {
|
).then((value) {
|
||||||
|
if (value) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
|
@ -59,6 +60,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}).catchError((err, stack) {
|
}).catchError((err, stack) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
|
|
@ -42,8 +42,8 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Preferences',
|
enText: 'System Settings',
|
||||||
ptText: 'Preferências',
|
ptText: 'Opções do Sistema',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
|
|
|
@ -58,7 +58,7 @@ class _ProvisionalScheduleState extends State<ProvisionalSchedule> {
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Provisional Schedule',
|
enText: 'Schedule Providers',
|
||||||
ptText: 'Agendar Prestadores',
|
ptText: 'Agendar Prestadores',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -120,8 +118,8 @@ class _ReceptionPageWidgetState extends State<ReceptionPageWidget> {
|
||||||
.titleSmall
|
.titleSmall
|
||||||
.override(
|
.override(
|
||||||
fontFamily: 'Nunito Sans',
|
fontFamily: 'Nunito Sans',
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.primaryBackground,
|
FlutterFlowTheme.of(context).info,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
|
|
@ -3,8 +3,11 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:hub/actions/actions.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart';
|
||||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
import 'package:hub/flutter_flow/custom_functions.dart';
|
||||||
|
@ -1606,6 +1609,75 @@ Widget scheduleVisit(BuildContext context,
|
||||||
),
|
),
|
||||||
onPressed: _model.isValid()
|
onPressed: _model.isValid()
|
||||||
? () async {
|
? () async {
|
||||||
|
Future<void> scheduleVisit() async {
|
||||||
|
await PhpGroup.postScheduleVisitCall
|
||||||
|
.call(
|
||||||
|
devUUID: AppState().devUUID,
|
||||||
|
userUUID: AppState().userUUID,
|
||||||
|
atividade: 'putVisita',
|
||||||
|
devDesc: _model.textController3.text,
|
||||||
|
idVisitante: _model.visitorStrList,
|
||||||
|
dtInicio: _model
|
||||||
|
.convertDateFormat(_model.textController1.text ?? ''),
|
||||||
|
dtFim: _model
|
||||||
|
.convertDateFormat(_model.textController2.text ?? ''),
|
||||||
|
unica: _model.switchValue == true ? 'Sim' : 'Não',
|
||||||
|
idMotivo: extractIdToStr(_model.dropDownValue1!),
|
||||||
|
idNAC: extractIdToStr(_model.dropDownValue2!),
|
||||||
|
obs: _model.textController3.text,
|
||||||
|
cliID: AppState().cliUUID,
|
||||||
|
)
|
||||||
|
.catchError((e) async {
|
||||||
|
await DialogUtil.errorDefault(context);
|
||||||
|
}).then((value) async {
|
||||||
|
if (PhpGroup.postScheduleVisitCall.error(
|
||||||
|
(value.jsonBody ?? ''),
|
||||||
|
) ==
|
||||||
|
false) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
//MILESTONE
|
||||||
|
_model.dropDownValue1 = null;
|
||||||
|
_model.dropDownValue2 = null;
|
||||||
|
_model.dropDownValueController1 =
|
||||||
|
FormFieldController<String>('');
|
||||||
|
_model.dropDownValueController2 =
|
||||||
|
FormFieldController<String>('');
|
||||||
|
_model.visitorStrList = '';
|
||||||
|
_model.visitorJsonList = [];
|
||||||
|
|
||||||
|
ToastUtil.showToast(
|
||||||
|
message: FFLocalizations.of(context)
|
||||||
|
.getVariableText(
|
||||||
|
ptText: 'Visitante já adicionado!',
|
||||||
|
enText: 'Visitor already added!'),
|
||||||
|
gravity: ToastGravity.TOP,
|
||||||
|
backgroundColor: Colors.green);
|
||||||
|
|
||||||
|
await showShare(value.jsonBody);
|
||||||
|
} else {
|
||||||
|
await DialogUtil.errorDefault(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
safeSetState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_model.visitorJsonList.length > 1) {
|
||||||
|
final title = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Cadastrar Múltiplos Visitantes',
|
||||||
|
enText: 'Register Multiple Visitors',
|
||||||
|
);
|
||||||
|
final content = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Você deseja agendar uma visita para ${_model.visitorJsonList.length} visitantes?',
|
||||||
|
enText:
|
||||||
|
'Do you want to schedule a visit for ${_model.visitorJsonList.length} visitors?',
|
||||||
|
);
|
||||||
|
|
||||||
|
showAlertDialog(context, title, content, scheduleVisit);
|
||||||
|
} else {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
|
@ -1617,21 +1689,6 @@ Widget scheduleVisit(BuildContext context,
|
||||||
child: Dialog(
|
child: Dialog(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
// width: MediaQuery.of(context).size.width,
|
|
||||||
// height: MediaQuery.of(context).size.height * 0.7,
|
|
||||||
// child: VisitDetailsModalTemplateComponentWidget(
|
|
||||||
// visitStartDateStr: _model.textController1.text,
|
|
||||||
// visitEndDateStr: _model.textController2.text,
|
|
||||||
// visitReasonStr: _model.dropDownValue1,
|
|
||||||
// visitLevelStr: _model.dropDownValue2,
|
|
||||||
// visitTempStr:
|
|
||||||
// _model.switchValue == true ? 'Sim' : 'Não',
|
|
||||||
// visitObsStr: _model.textController3.text,
|
|
||||||
// visitorStrList: _model.visitorStrList,
|
|
||||||
// visitorJsonList: _model.visitorJsonList,
|
|
||||||
// updateToggleIdx: () async {},
|
|
||||||
// repeatVisitSchedule: () async {},
|
|
||||||
// ),
|
|
||||||
child: DetailsComponentWidget(
|
child: DetailsComponentWidget(
|
||||||
buttons: [
|
buttons: [
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
|
@ -1641,74 +1698,7 @@ Widget scheduleVisit(BuildContext context,
|
||||||
ptText: 'Confirmar',
|
ptText: 'Confirmar',
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.done),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: scheduleVisit,
|
||||||
showAlertDialog(
|
|
||||||
context,
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText: 'Ativar Visita',
|
|
||||||
enText: 'Activate Visit',
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText:
|
|
||||||
'Você tem certeza que deseja ativar essa visita?',
|
|
||||||
enText:
|
|
||||||
'Are you sure you want to activate this visit?',
|
|
||||||
), () async {
|
|
||||||
await PhpGroup.postScheduleVisitCall
|
|
||||||
.call(
|
|
||||||
devUUID: AppState().devUUID,
|
|
||||||
userUUID: AppState().userUUID,
|
|
||||||
atividade: 'putVisita',
|
|
||||||
devDesc: _model.textController3.text,
|
|
||||||
idVisitante: _model.visitorStrList,
|
|
||||||
dtInicio: _model.convertDateFormat(
|
|
||||||
_model.textController1.text ?? ''),
|
|
||||||
dtFim: _model.convertDateFormat(
|
|
||||||
_model.textController2.text ?? ''),
|
|
||||||
unica: _model.switchValue == true
|
|
||||||
? 'Sim'
|
|
||||||
: 'Não',
|
|
||||||
idMotivo: extractIdToStr(
|
|
||||||
_model.dropDownValue1!),
|
|
||||||
idNAC: extractIdToStr(
|
|
||||||
_model.dropDownValue2!),
|
|
||||||
obs: _model.textController3.text,
|
|
||||||
cliID: AppState().cliUUID,
|
|
||||||
)
|
|
||||||
.catchError((e) async {
|
|
||||||
await DialogUtil.errorDefault(context);
|
|
||||||
}).then((value) async {
|
|
||||||
if (PhpGroup.postScheduleVisitCall
|
|
||||||
.error(
|
|
||||||
(value.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
Navigator.pop(context);
|
|
||||||
showSnackbar(
|
|
||||||
context,
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
enText:
|
|
||||||
'Success in scheduling visit',
|
|
||||||
ptText:
|
|
||||||
'Succeso ao agendar a visita',
|
|
||||||
),
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await DialogUtil.errorDefault(
|
|
||||||
context);
|
|
||||||
Navigator.pop(context);
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
safeSetState(() {});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 130,
|
width: 130,
|
||||||
height: 40,
|
height: 40,
|
||||||
|
@ -1746,8 +1736,9 @@ Widget scheduleVisit(BuildContext context,
|
||||||
?.group(1)
|
?.group(1)
|
||||||
.toString()) ??
|
.toString()) ??
|
||||||
'',
|
'',
|
||||||
'Single Visit':
|
'Single Visit': _model.switchValue == true
|
||||||
_model.switchValue == true ? 'Sim' : 'Não',
|
? 'Sim'
|
||||||
|
: 'Não',
|
||||||
if (_model.textController3.text.isNotEmpty)
|
if (_model.textController3.text.isNotEmpty)
|
||||||
'Observation': _model.textController3.text,
|
'Observation': _model.textController3.text,
|
||||||
},
|
},
|
||||||
|
@ -1756,7 +1747,7 @@ Widget scheduleVisit(BuildContext context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Inativo',
|
ptText: 'Inativo',
|
||||||
enText: 'Inactive',
|
enText: 'Inactive',
|
||||||
): FlutterFlowTheme.of(context).warning,
|
): FlutterFlowTheme.of(context).success,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {},
|
onTapCardItemAction: () async {},
|
||||||
|
@ -1767,6 +1758,7 @@ Widget scheduleVisit(BuildContext context,
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
: null,
|
: null,
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
height: MediaQuery.of(context).size.height * 0.05,
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
|
|
@ -72,8 +72,9 @@ class CustomDrawer extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -87,7 +88,6 @@ class CustomDrawer extends StatelessWidget {
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
|
||||||
Text(
|
Text(
|
||||||
AppState().email,
|
AppState().email,
|
||||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||||
|
@ -162,9 +162,8 @@ class CustomDrawer extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Expanded _buildDrawerBody() {
|
Widget _buildDrawerBody() {
|
||||||
return Expanded(
|
return wrapWithModel(
|
||||||
child: wrapWithModel(
|
|
||||||
model: model.menuComponentModel,
|
model: model.menuComponentModel,
|
||||||
updateCallback: () {},
|
updateCallback: () {},
|
||||||
child: const MenuComponentWidget(
|
child: const MenuComponentWidget(
|
||||||
|
@ -172,7 +171,6 @@ class CustomDrawer extends StatelessWidget {
|
||||||
style: MenuView.list,
|
style: MenuView.list,
|
||||||
item: MenuItem.tile,
|
item: MenuItem.tile,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
pubspec.lock
32
pubspec.lock
|
@ -817,18 +817,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.4"
|
version: "10.0.5"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
version: "3.0.5"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -905,10 +905,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.0"
|
version: "0.11.1"
|
||||||
|
material_symbols_icons:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: material_symbols_icons
|
||||||
|
sha256: b72bf7566d024d51627dce81b1b98539830a0e3ffbb5784989aa3e97c8493160
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2784.0"
|
||||||
maybe_just_nothing:
|
maybe_just_nothing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -921,10 +929,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.0"
|
version: "1.15.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1342,10 +1350,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
version: "0.7.2"
|
||||||
timeago:
|
timeago:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1510,10 +1518,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.1"
|
version: "14.2.4"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -86,6 +86,7 @@ dependencies:
|
||||||
video_player_avfoundation: 2.6.1
|
video_player_avfoundation: 2.6.1
|
||||||
video_player_platform_interface: 6.2.2
|
video_player_platform_interface: 6.2.2
|
||||||
video_player_web: 2.3.1
|
video_player_web: 2.3.1
|
||||||
|
material_symbols_icons: ^4.2784.0
|
||||||
fluttertoast: ^8.2.8
|
fluttertoast: ^8.2.8
|
||||||
|
|
||||||
cupertino_icons: ^1.0.0
|
cupertino_icons: ^1.0.0
|
||||||
|
@ -132,7 +133,7 @@ flutter:
|
||||||
- assets/lottie_animations/
|
- assets/lottie_animations/
|
||||||
- assets/rive_animations/
|
- assets/rive_animations/
|
||||||
- assets/pdfs/
|
- assets/pdfs/
|
||||||
fonts:
|
fonts:
|
||||||
- family: "SF Pro"
|
- family: "SF Pro"
|
||||||
fonts:
|
fonts:
|
||||||
- asset: assets/fonts/SFPRODISPLAYREGULAR.OTF
|
- asset: assets/fonts/SFPRODISPLAYREGULAR.OTF
|
||||||
|
|
Loading…
Reference in New Issue