WIP
This commit is contained in:
parent
0f84ee8923
commit
2e337e1e26
|
@ -27,13 +27,6 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget {
|
||||||
final Future Function()? onTapCardItemAction;
|
final Future Function()? onTapCardItemAction;
|
||||||
final List<Widget> buttons;
|
final List<Widget> buttons;
|
||||||
|
|
||||||
// final Future Function(
|
|
||||||
// BuildContext context,
|
|
||||||
// int idDestino,
|
|
||||||
// int idVisita,
|
|
||||||
// String AccessKey,
|
|
||||||
// )? changeStatusAction;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitRequestTemplateComponentWidget> createState() =>
|
State<VisitRequestTemplateComponentWidget> createState() =>
|
||||||
_VisitRequestTemplateComponentWidgetState();
|
_VisitRequestTemplateComponentWidgetState();
|
||||||
|
@ -75,24 +68,13 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
// bool isLoaded = false;
|
|
||||||
// final pending = FFLocalizations.of(context).getVariableText(
|
|
||||||
// enText: 'Pending',
|
|
||||||
// ptText: 'Pendente',
|
|
||||||
// );
|
|
||||||
// final active = FFLocalizations.of(context).getVariableText(
|
|
||||||
// enText: 'Ativo',
|
|
||||||
// ptText: 'Ativo',
|
|
||||||
// );
|
|
||||||
// final canceled = FFLocalizations.of(context).getVariableText(
|
|
||||||
// enText: 'Canceled',
|
|
||||||
// ptText: 'Cancelado',
|
|
||||||
// );
|
|
||||||
|
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
|
final maxWidth = constraints.maxWidth;
|
||||||
|
final maxHeight = constraints.maxHeight;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
width: constraints.maxWidth,
|
width: maxWidth,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(25.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(25.0)),
|
||||||
|
@ -102,8 +84,8 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 150.0,
|
width: maxWidth * 0.3,
|
||||||
height: 150.0,
|
height: maxWidth * 0.3,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
|
@ -121,7 +103,9 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
.map((MapEntry<String, Color> item) {
|
.map((MapEntry<String, Color> item) {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: maxWidth * 0.05,
|
||||||
|
),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
// controller: _model.textControllerStatus,
|
// controller: _model.textControllerStatus,
|
||||||
// focusNode: _model.textFieldFocusNodeStatus,
|
// focusNode: _model.textFieldFocusNodeStatus,
|
||||||
|
@ -148,9 +132,11 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(
|
||||||
.labelMediumFamily),
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMediumFamily,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.labelMedium
|
||||||
|
@ -159,9 +145,11 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts:
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
GoogleFonts.asMap().containsKey(
|
||||||
.labelMediumFamily),
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMediumFamily,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
errorBorder: InputBorder.none,
|
errorBorder: InputBorder.none,
|
||||||
|
@ -179,8 +167,8 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
.bodyMediumFamily),
|
),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
|
@ -196,14 +184,16 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: labelsLinkedHashMap.length,
|
itemCount: labelsLinkedHashMap.length,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
String key = labelsLinkedHashMap.keys.elementAt(index);
|
String key = labelsLinkedHashMap.keys.elementAt(index);
|
||||||
String value = labelsLinkedHashMap[key]!;
|
String value = labelsLinkedHashMap[key]!;
|
||||||
// return Text('key: $key, value: $value');
|
// return Text('key: $key, value: $value');
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 10.0, vertical: 3.0),
|
horizontal: maxWidth * 0.02,
|
||||||
|
vertical: maxHeight * 0.01,
|
||||||
|
),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
initialValue: '$value',
|
initialValue: '$value',
|
||||||
|
@ -285,7 +275,9 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
if (widget.buttons.isNotEmpty)
|
if (widget.buttons.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: maxWidth * 0.02,
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: widget.buttons,
|
children: widget.buttons,
|
||||||
|
|
|
@ -835,13 +835,9 @@ Widget scheduleVisit(
|
||||||
itemBuilder: (context, visitorListViewIndex) {
|
itemBuilder: (context, visitorListViewIndex) {
|
||||||
final visitorListViewItem =
|
final visitorListViewItem =
|
||||||
visitorListView[visitorListViewIndex];
|
visitorListView[visitorListViewIndex];
|
||||||
return InkWell(
|
return Padding(
|
||||||
splashColor: Colors.transparent,
|
padding:
|
||||||
focusColor: Colors.transparent,
|
const EdgeInsets.symmetric(horizontal: 30),
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {},
|
|
||||||
onLongPress: () async {},
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: 70.0,
|
height: 70.0,
|
||||||
|
@ -866,18 +862,18 @@ Widget scheduleVisit(
|
||||||
fadeOutDuration:
|
fadeOutDuration:
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
imageUrl:
|
imageUrl:
|
||||||
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E",
|
||||||
visitorListViewItem,
|
|
||||||
r'''$.VTE_DOCUMENTO''',
|
|
||||||
).toString()}&tipo=E",
|
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Expanded(
|
||||||
getJsonField(
|
child: Padding(
|
||||||
visitorListViewItem,
|
padding: const EdgeInsets.symmetric(
|
||||||
r'''$.VTE_NOME''',
|
horizontal: 8.0),
|
||||||
).toString(),
|
child: Text(
|
||||||
|
getJsonField(visitorListViewItem,
|
||||||
|
r'''$.VTE_NOME''')
|
||||||
|
.toString(),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
|
@ -885,34 +881,28 @@ Widget scheduleVisit(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts
|
||||||
|
.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model
|
_model.removeFromVisitorJsonList(
|
||||||
.removeFromVisitorJsonList(
|
|
||||||
visitorListViewItem);
|
visitorListViewItem);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.close)),
|
icon: const Icon(Icons.close),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
|
||||||
.divide(const SizedBox(width: 30.0))
|
|
||||||
.addToStart(const SizedBox(width: 30.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1602,6 +1592,7 @@ Widget scheduleVisit(
|
||||||
FlutterFlowIconButton(
|
FlutterFlowIconButton(
|
||||||
icon: const Icon(Icons.done),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
log('visitorStrList ${_model.visitorStrList}');
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context)
|
||||||
|
|
Loading…
Reference in New Issue