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