WIP
This commit is contained in:
parent
6a2bda3b38
commit
87e092a070
|
@ -343,8 +343,9 @@ Future<bool> visitRequestComponentAction(
|
|||
);
|
||||
|
||||
if (respondeSolicitacaoCall.statusCode == 200) {
|
||||
log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID');
|
||||
return true;
|
||||
log('jsonBody: ${respondeSolicitacaoCall.jsonBody}; actionValue: $actionValue; refUUID: $refUUID; responseValue: $responseValue; vteUUID: $vteUUID; status: ${respondeSolicitacaoCall.jsonBody['error']}');
|
||||
|
||||
return !respondeSolicitacaoCall.jsonBody['error'];
|
||||
} else {
|
||||
log('headers: ${respondeSolicitacaoCall.headers}');
|
||||
log('bodyText: ${respondeSolicitacaoCall.bodyText}');
|
||||
|
@ -464,8 +465,10 @@ Future changeStatusAction(
|
|||
if (!context.mounted) return;
|
||||
if (approveVisitRequest == true) {
|
||||
log('Aprovado');
|
||||
context.pop();
|
||||
} else {
|
||||
log('Erro ao aprovar');
|
||||
context.pop();
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
|
|
|
@ -15,6 +15,7 @@ import 'package:hub/backend/api_requests/api_manager.dart';
|
|||
import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
|
||||
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_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_util.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||
|
@ -448,7 +449,176 @@ class NotificationHandler {
|
|||
vteUUID: message['idVisitante'].toString(),
|
||||
vawRef: message['referencia'].toString(),
|
||||
vawStatus: 'S',
|
||||
buttons: [],
|
||||
buttons: [
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.done),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Aprovar Visita',
|
||||
enText: 'Approve Visit',
|
||||
),
|
||||
),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja aprovar essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to approve this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await changeStatusAction.call(
|
||||
context,
|
||||
'L',
|
||||
message['referencia'].toString(),
|
||||
'Mensagem',
|
||||
message['idVisitante'].toString(),
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloquear Visita',
|
||||
enText: 'Block Visit',
|
||||
),
|
||||
),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja bloquear essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to block this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await changeStatusAction.call(
|
||||
context,
|
||||
'B',
|
||||
message['referencia'].toString(),
|
||||
'Mensagem',
|
||||
message['idVisitante'].toString(),
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
labelsHashMap: Map<String, String>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Visitor',
|
||||
|
@ -470,8 +640,8 @@ class NotificationHandler {
|
|||
statusHashMap: [
|
||||
{
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Pending',
|
||||
ptText: 'Pendente',
|
||||
enText: 'Active',
|
||||
ptText: 'Ativo',
|
||||
): FlutterFlowTheme.of(context).warning,
|
||||
},
|
||||
],
|
||||
|
|
|
@ -13,17 +13,16 @@ import 'package:flutter/material.dart';
|
|||
import 'menu_component_model.dart';
|
||||
export 'menu_component_model.dart';
|
||||
|
||||
|
||||
class MenuComponentWidget extends StatefulWidget {
|
||||
const MenuComponentWidget({
|
||||
Key? key,
|
||||
required this.style,
|
||||
required this.item,
|
||||
required this.expandable,
|
||||
});
|
||||
final MenuView style;
|
||||
final MenuItem item;
|
||||
final bool expandable;
|
||||
Key? key,
|
||||
required this.style,
|
||||
required this.item,
|
||||
required this.expandable,
|
||||
});
|
||||
final MenuView style;
|
||||
final MenuItem item;
|
||||
final bool expandable;
|
||||
@override
|
||||
State<MenuComponentWidget> createState() => _MenuComponentWidgetState();
|
||||
}
|
||||
|
@ -31,11 +30,8 @@ class MenuComponentWidget extends StatefulWidget {
|
|||
class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||
late MenuComponentModel _model;
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
@ -44,7 +40,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => MenuComponentModel());
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -57,43 +52,165 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final options = widget.item == MenuItem.button
|
||||
? <MenuEntry>[
|
||||
MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),),
|
||||
? <MenuEntry>[
|
||||
MenuButtonWidget(
|
||||
icon: FFIcons.kvector1,
|
||||
action: () async {
|
||||
await _model.scheduleVisitOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Schedule\nVisit',
|
||||
ptText: 'Agendar\nVisita',
|
||||
),
|
||||
),
|
||||
|
||||
MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),),
|
||||
MenuButtonWidget(
|
||||
icon: FFIcons.khome,
|
||||
action: () async {
|
||||
await _model.registerVisitorOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Register\nVisitor',
|
||||
ptText: 'Cadastro\nde Visitante',
|
||||
),
|
||||
),
|
||||
|
||||
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
||||
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
||||
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||
|
||||
MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),),
|
||||
MenuButtonWidget(
|
||||
icon: Icons.qr_code,
|
||||
action: () async {
|
||||
await _model.accessQRCodeOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'QRCode\nAccess',
|
||||
ptText: 'QRCode\nde Acesso',
|
||||
),
|
||||
),
|
||||
|
||||
MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),),
|
||||
MenuButtonWidget(
|
||||
icon: Icons.people,
|
||||
action: () async {
|
||||
await _model.peopleOnThePropertyAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Poeple on\nthe Property',
|
||||
ptText: 'Pessoas na\nPropriedade',
|
||||
),
|
||||
),
|
||||
|
||||
MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),),
|
||||
MenuButtonWidget(
|
||||
icon: Icons.history_sharp,
|
||||
action: () async {
|
||||
await _model.liberationHistoryOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Consult\nHistories',
|
||||
ptText: 'Consultar\nHistóricos',
|
||||
),
|
||||
),
|
||||
|
||||
MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),),
|
||||
] : <MenuEntry>[
|
||||
MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),),
|
||||
MenuButtonWidget(
|
||||
icon: Icons.settings,
|
||||
action: () async {
|
||||
await _model.preferencesSettings(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Preferences\nSettings',
|
||||
ptText: 'Preferências \nde Configurações',
|
||||
),
|
||||
),
|
||||
]
|
||||
: <MenuEntry>[
|
||||
MenuCardItem(
|
||||
icon: FFIcons.kvector1,
|
||||
action: () async {
|
||||
await _model.scheduleVisitOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Schedule\nVisit',
|
||||
ptText: 'Agendar\nVisita',
|
||||
),
|
||||
),
|
||||
|
||||
MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),),
|
||||
MenuCardItem(
|
||||
icon: FFIcons.khome,
|
||||
action: () async {
|
||||
await _model.registerVisitorOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Register\nVisitor',
|
||||
ptText: 'Cadastro\nde Visitante',
|
||||
),
|
||||
),
|
||||
|
||||
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
||||
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
||||
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||
|
||||
MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),),
|
||||
MenuCardItem(
|
||||
icon: Icons.qr_code,
|
||||
action: () async {
|
||||
await _model.accessQRCodeOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'QRCode\nAccess',
|
||||
ptText: 'QRCode\nde Acesso',
|
||||
),
|
||||
),
|
||||
|
||||
MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),),
|
||||
MenuCardItem(
|
||||
icon: Icons.people,
|
||||
action: () async {
|
||||
await _model.peopleOnThePropertyAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Poeple on\nthe Property',
|
||||
ptText: 'Pessoas\nna Propriedade',
|
||||
),
|
||||
),
|
||||
|
||||
MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),),
|
||||
MenuCardItem(
|
||||
icon: Icons.history_sharp,
|
||||
action: () async {
|
||||
await _model.liberationHistoryOptAction(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Consult\nHistories',
|
||||
ptText: 'Consultar\nHistoricos',
|
||||
),
|
||||
),
|
||||
|
||||
MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),),
|
||||
|
||||
];
|
||||
MenuCardItem(
|
||||
icon: Icons.settings,
|
||||
action: () async {
|
||||
await _model.preferencesSettings(context);
|
||||
setState(() {});
|
||||
},
|
||||
title: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Preferences\nSettings',
|
||||
ptText: 'Preferências\nde Configuração',
|
||||
),
|
||||
),
|
||||
];
|
||||
return Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) {
|
||||
if (widget.style == MenuView.list_grid &&
|
||||
widget.expandable == true &&
|
||||
widget.item == MenuItem.button) {
|
||||
if (_model.isGrid == true) {
|
||||
return wrapWithModel(
|
||||
model: _model.menuListViewComponentModel,
|
||||
|
@ -125,30 +242,32 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){
|
||||
return wrapWithModel(
|
||||
model: _model.menuListViewComponentModel,
|
||||
updateCallback: () => setState(() {}),
|
||||
updateOnChange: true,
|
||||
child: MenuListViewComponentWidget(
|
||||
options: options,
|
||||
expandable: widget.expandable,
|
||||
item: widget.item,
|
||||
changeMenuStyle: () async {
|
||||
await _model.changeMenuStyle(context);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (widget.style == MenuView.list &&
|
||||
widget.expandable == false &&
|
||||
widget.item == MenuItem.card) {
|
||||
return wrapWithModel(
|
||||
model: _model.menuListViewComponentModel,
|
||||
updateCallback: () => setState(() {}),
|
||||
updateOnChange: true,
|
||||
child: MenuListViewComponentWidget(
|
||||
options: options,
|
||||
expandable: widget.expandable,
|
||||
item: widget.item,
|
||||
changeMenuStyle: () async {
|
||||
await _model.changeMenuStyle(context);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future accessQRCodeOptAction(BuildContext context) async {
|
||||
Future accessQRCodeOptAction(BuildContext context) async {
|
||||
context.pushNamed(
|
||||
'qrCodePage',
|
||||
extra: <String, dynamic>{
|
||||
|
@ -160,6 +279,4 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,88 +51,6 @@ Widget buildDetails(
|
|||
vawRef: 'Lorem Ipsus',
|
||||
changeStatusAction: changeStatusAction,
|
||||
buttons: [
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.active) // ACCEPT ACTION
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.done),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Aprovar Visita',
|
||||
enText: 'Approve Visit',
|
||||
),
|
||||
),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja aprovar essa visita?',
|
||||
enText: 'Are you sure you want to approve this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await changeStatusAction?.call(
|
||||
context,
|
||||
'L',
|
||||
visitaWrapItem['VAW_ID'] ?? '',
|
||||
'Mensagem',
|
||||
visitaWrapItem['VTE_DOCUMENTO'] ?? '',
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.active) // REJECT ACTION
|
||||
FlutterFlowIconButton(
|
||||
|
@ -187,13 +105,13 @@ Widget buildDetails(
|
|||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
// await changeStatusAction?.call(
|
||||
// context,
|
||||
// 'B',
|
||||
// visitaWrapItem['VAW_REF'] ?? '',
|
||||
// 'Mensagem',
|
||||
// visitaWrapItem['VTE_ID'] ?? '',
|
||||
// );
|
||||
await changeStatusAction?.call(
|
||||
context,
|
||||
'B',
|
||||
visitaWrapItem['VAW_REF'] ?? '',
|
||||
'Mensagem',
|
||||
visitaWrapItem['VTE_ID'] ?? '',
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
|
@ -215,8 +133,8 @@ Widget buildDetails(
|
|||
});
|
||||
},
|
||||
),
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.finished) // RECALL ACTION
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) !=
|
||||
status.active) // RECALL ACTION
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.refresh),
|
||||
onPressed: () async {
|
||||
|
@ -239,7 +157,7 @@ Widget buildDetails(
|
|||
},
|
||||
),
|
||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||
status.finished) // SHARE ACTION
|
||||
status.active) // SHARE ACTION
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: () async {
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:hub/flutter_flow/custom_functions.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_util.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
@ -310,8 +311,8 @@ Widget liberationHistoryItemCard(
|
|||
liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||
? Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
ptText: 'Finalizado',
|
||||
enText: 'Finished',
|
||||
): FlutterFlowTheme.of(context).success,
|
||||
})
|
||||
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
||||
|
@ -323,12 +324,13 @@ Widget liberationHistoryItemCard(
|
|||
})
|
||||
: Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
): FlutterFlowTheme.of(context).warning,
|
||||
})
|
||||
],
|
||||
onTapCardItemAction: () async {
|
||||
log('LiberationItem: $liberationHistoryItem');
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
|
@ -358,13 +360,188 @@ Widget liberationHistoryItemCard(
|
|||
'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'],
|
||||
// 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'],
|
||||
}),
|
||||
buttons: [],
|
||||
buttons: [
|
||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.done),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Aprovar Visita',
|
||||
enText: 'Approve Visit',
|
||||
),
|
||||
),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja aprovar essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to approve this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await changeStatusAction.call(
|
||||
context,
|
||||
'L',
|
||||
liberationHistoryItem['NOT_ID'].toString(),
|
||||
'Mensagem',
|
||||
liberationHistoryItem['VTE_ID'].toString(),
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||
FlutterFlowIconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloquear Visita',
|
||||
enText: 'Block Visit',
|
||||
),
|
||||
),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText:
|
||||
'Você tem certeza que deseja bloquear essa visita?',
|
||||
enText:
|
||||
'Are you sure you want to block this visit?',
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
FlutterFlowTheme.of(context).primaryBackground,
|
||||
actions: [
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'No',
|
||||
ptText: 'Não',
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
FFButtonWidget(
|
||||
text:
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Yes',
|
||||
ptText: 'Sim',
|
||||
),
|
||||
onPressed: () async {
|
||||
await changeStatusAction.call(
|
||||
context,
|
||||
'B',
|
||||
liberationHistoryItem['NOT_ID'].toString(),
|
||||
'Mensagem',
|
||||
liberationHistoryItem['VTE_ID'].toString(),
|
||||
);
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
statusHashMap: [
|
||||
liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||
? Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
ptText: 'Finalizado',
|
||||
enText: 'Finished',
|
||||
): FlutterFlowTheme.of(context).success,
|
||||
})
|
||||
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
||||
|
@ -376,8 +553,8 @@ Widget liberationHistoryItemCard(
|
|||
})
|
||||
: Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
): FlutterFlowTheme.of(context).warning,
|
||||
})
|
||||
],
|
||||
|
|
|
@ -516,10 +516,10 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
),
|
||||
),
|
||||
);
|
||||
FFAppState().pass = false;
|
||||
// FFAppState().pass = false;
|
||||
}
|
||||
}).catchError((error, StackTrace) {
|
||||
FFAppState().pass = false;
|
||||
// FFAppState().pass = false;
|
||||
log(error.toString());
|
||||
log(StackTrace.toString());
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
|
@ -608,10 +608,10 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
),
|
||||
),
|
||||
);
|
||||
FFAppState().panic = false;
|
||||
// FFAppState().panic = false;
|
||||
}
|
||||
}).catchError((e, s) {
|
||||
FFAppState().panic = false;
|
||||
// FFAppState().panic = false;
|
||||
|
||||
log(e.toString());
|
||||
log(s.toString());
|
||||
|
|
Loading…
Reference in New Issue