WIP
This commit is contained in:
parent
09b339da8d
commit
ccd63168bd
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.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';
|
||||||
|
@ -12,10 +11,7 @@ export 'local_profile_component_model.dart';
|
||||||
////
|
////
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
const LocalProfileComponentWidget({
|
const LocalProfileComponentWidget({required bool localStatus, super.key});
|
||||||
required bool localStatus,
|
|
||||||
super.key
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LocalProfileComponentWidget> createState() =>
|
State<LocalProfileComponentWidget> createState() =>
|
||||||
|
@ -87,35 +83,34 @@ class _LocalProfileComponentWidgetState
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child:
|
child: BottomArrowLinkedLocalsComponentWidget(),
|
||||||
BottomArrowLinkedLocalsComponentWidget(),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
child:
|
child: Image.network(
|
||||||
Image.network(
|
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
|
||||||
width: 80.0,
|
|
||||||
height: 80.0,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
alignment: const Alignment(0.0, 0.0),
|
|
||||||
errorBuilder: (context, error, stackTrace) => Image.network(
|
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
alignment: const Alignment(0.0, 0.0),
|
alignment: const Alignment(0.0, 0.0),
|
||||||
errorBuilder: (context, error, stackTrace) => Image.asset('assets/images/error_image.svg'),
|
errorBuilder: (context, error, stackTrace) =>
|
||||||
),
|
Image.network(
|
||||||
)
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||||
),
|
width: 80.0,
|
||||||
),
|
height: 80.0,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
errorBuilder: (context, error, stackTrace) =>
|
||||||
|
Image.asset('assets/images/error_image.svg'),
|
||||||
|
),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -125,16 +120,15 @@ class _LocalProfileComponentWidgetState
|
||||||
functions.convertToUppercase(FFAppState().local),
|
functions.convertToUppercase(FFAppState().local),
|
||||||
'NOME DO LOCAL',
|
'NOME DO LOCAL',
|
||||||
),
|
),
|
||||||
style:
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
fontFamily: 'Nunito',
|
||||||
fontFamily: 'Nunito',
|
color: FlutterFlowTheme.of(context).info,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
fontSize: 14.0,
|
||||||
fontSize: 14.0,
|
letterSpacing: 0.0,
|
||||||
letterSpacing: 0.0,
|
fontWeight: FontWeight.w500,
|
||||||
fontWeight: FontWeight.w500,
|
useGoogleFonts:
|
||||||
useGoogleFonts:
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
GoogleFonts.asMap().containsKey('Nunito'),
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -84,7 +84,6 @@ Widget buildDetails(
|
||||||
)
|
)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
Navigator.pop(context);
|
|
||||||
if (value == false) {
|
if (value == false) {
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
context,
|
context,
|
||||||
|
@ -105,6 +104,8 @@ Widget buildDetails(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}).catchError((err, stack) {
|
}).catchError((err, stack) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
|
|
@ -91,217 +91,210 @@ class _VisitRequestTemplateComponentWidgetState
|
||||||
|
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
return Padding(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
width: constraints.maxWidth,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
width: constraints.maxWidth,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
decoration: BoxDecoration(
|
borderRadius: const BorderRadius.all(Radius.circular(25.0)),
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(25.0)),
|
child: Column(
|
||||||
),
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
Container(
|
||||||
children: [
|
width: 150.0,
|
||||||
Container(
|
height: 150.0,
|
||||||
width: 150.0,
|
clipBehavior: Clip.antiAlias,
|
||||||
height: 150.0,
|
decoration: const BoxDecoration(
|
||||||
clipBehavior: Clip.antiAlias,
|
shape: BoxShape.circle,
|
||||||
decoration: const BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
fadeInDuration: const Duration(milliseconds: 100),
|
|
||||||
fadeOutDuration: const Duration(milliseconds: 100),
|
|
||||||
imageUrl:
|
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Row(
|
child: CachedNetworkImage(
|
||||||
children: statusLinkedHashMap.expand((linkedHashMap) {
|
fadeInDuration: const Duration(milliseconds: 100),
|
||||||
return linkedHashMap.entries
|
fadeOutDuration: const Duration(milliseconds: 100),
|
||||||
.map((MapEntry<String, Color> item) {
|
imageUrl:
|
||||||
return Expanded(
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
||||||
child: Padding(
|
fit: BoxFit.cover,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
),
|
||||||
child: TextFormField(
|
),
|
||||||
// controller: _model.textControllerStatus,
|
Row(
|
||||||
// focusNode: _model.textFieldFocusNodeStatus,
|
children: statusLinkedHashMap.expand((linkedHashMap) {
|
||||||
autofocus: false,
|
return linkedHashMap.entries
|
||||||
canRequestFocus: false,
|
.map((MapEntry<String, Color> item) {
|
||||||
readOnly: true,
|
return Expanded(
|
||||||
obscureText: false,
|
child: Padding(
|
||||||
decoration: InputDecoration(
|
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||||
isDense: true,
|
child: TextFormField(
|
||||||
enabledBorder: OutlineInputBorder(
|
// controller: _model.textControllerStatus,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
// focusNode: _model.textFieldFocusNodeStatus,
|
||||||
borderSide: BorderSide(
|
autofocus: false,
|
||||||
color: item.value,
|
canRequestFocus: false,
|
||||||
),
|
readOnly: true,
|
||||||
),
|
obscureText: false,
|
||||||
filled: true,
|
decoration: InputDecoration(
|
||||||
fillColor: item.value,
|
isDense: true,
|
||||||
labelText: item.key,
|
enabledBorder: OutlineInputBorder(
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
.labelMedium
|
borderSide: BorderSide(
|
||||||
.override(
|
color: item.value,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
errorBorder: InputBorder.none,
|
|
||||||
focusedErrorBorder: InputBorder.none,
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.info,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
filled: true,
|
||||||
.bodyMedium
|
fillColor: item.value,
|
||||||
|
labelText: item.key,
|
||||||
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
.bodyMediumFamily,
|
.labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
.bodyMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
maxLines: null,
|
.labelMedium
|
||||||
keyboardType: TextInputType.name,
|
.override(
|
||||||
validator: _model.textController1Validator
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
.asValidator(context),
|
.labelMediumFamily,
|
||||||
),
|
color: FlutterFlowTheme.of(context).info,
|
||||||
),
|
letterSpacing: 0.0,
|
||||||
);
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
}).toList();
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
}).toList(),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
ListView.builder(
|
focusedBorder: InputBorder.none,
|
||||||
shrinkWrap: true,
|
errorBorder: InputBorder.none,
|
||||||
itemCount: labelsLinkedHashMap.length,
|
focusedErrorBorder: InputBorder.none,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
suffixIcon: Icon(
|
||||||
itemBuilder: (context, index) {
|
Icons.info,
|
||||||
String key = labelsLinkedHashMap.keys.elementAt(index);
|
color: FlutterFlowTheme.of(context).info,
|
||||||
String value = labelsLinkedHashMap[key]!;
|
|
||||||
// return Text('key: $key, value: $value');
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10.0, vertical: 3.0),
|
|
||||||
child: TextFormField(
|
|
||||||
readOnly: true,
|
|
||||||
initialValue: '$value',
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: key,
|
|
||||||
filled: true,
|
|
||||||
fillColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
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)
|
||||||
.labelMediumFamily,
|
.bodyMediumFamily),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
textAlign: TextAlign.start,
|
||||||
.labelMedium
|
maxLines: null,
|
||||||
.override(
|
keyboardType: TextInputType.name,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
validator: _model.textController1Validator
|
||||||
.labelMediumFamily,
|
.asValidator(context),
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground, // Change border color here
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
}).toList();
|
||||||
),
|
}).toList(),
|
||||||
if (widget.buttons.isNotEmpty)
|
),
|
||||||
Padding(
|
ListView.builder(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
shrinkWrap: true,
|
||||||
child: Row(
|
itemCount: labelsLinkedHashMap.length,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: widget.buttons,
|
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),
|
||||||
|
child: TextFormField(
|
||||||
|
readOnly: true,
|
||||||
|
initialValue: '$value',
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: key,
|
||||||
|
filled: true,
|
||||||
|
fillColor:
|
||||||
|
FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground, // Change border color here
|
||||||
|
),
|
||||||
|
),
|
||||||
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.labelMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
hintStyle: FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.labelMediumFamily,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground, // Change border color here
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground, // Change border color here
|
||||||
|
),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground, // Change border color here
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground, // Change border color here
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (widget.buttons.isNotEmpty)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: widget.buttons,
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
.divide(const SizedBox(height: 20.0))
|
]
|
||||||
.addToEnd(const SizedBox(height: 20.0))
|
.divide(const SizedBox(height: 20.0))
|
||||||
.addToStart(const SizedBox(height: 20.0)),
|
.addToEnd(const SizedBox(height: 20.0))
|
||||||
),
|
.addToStart(const SizedBox(height: 20.0)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -97,38 +97,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
name: 'scheduleCompleteVisitPage',
|
name: 'scheduleCompleteVisitPage',
|
||||||
path: '/scheduleCompleteVisitPage',
|
path: '/scheduleCompleteVisitPage',
|
||||||
builder: (context, params) => ScheduleCompleteVisitPageWidget(
|
builder: (context, params) => ScheduleCompleteVisitPageWidget(
|
||||||
// get current datatime picker dd/mm/aaaa hh:mm:ss
|
|
||||||
// visitStartDateStr: DateTime.now().toString(),
|
|
||||||
// post 1 day
|
|
||||||
// visitEndDateStr: DateTime.now().add(const Duration(days: 1)).toString(),
|
|
||||||
visitorStrList: params.getParam(
|
visitorStrList: params.getParam(
|
||||||
'visitorStrList',
|
'visitorStrList',
|
||||||
ParamType.String,
|
ParamType.String,
|
||||||
),
|
),
|
||||||
visitStartDateStr: params.getParam(
|
|
||||||
'visitStartDateStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitEndDateStr: params.getParam(
|
|
||||||
'visitEndDateStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitReasonStr: params.getParam(
|
|
||||||
'visitReasonStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitLevelStr: params.getParam(
|
|
||||||
'visitLevelStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitTempBol: params.getParam(
|
|
||||||
'visitTempBol',
|
|
||||||
ParamType.bool,
|
|
||||||
),
|
|
||||||
visitObsStr: params.getParam(
|
|
||||||
'visitObsStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitorJsonList: params.getParam<dynamic>(
|
visitorJsonList: params.getParam<dynamic>(
|
||||||
'visitorJsonList',
|
'visitorJsonList',
|
||||||
ParamType.JSON,
|
ParamType.JSON,
|
||||||
|
|
|
@ -20,14 +20,14 @@ void main() async {
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
DeviceOrientation.portraitDown,
|
DeviceOrientation.portraitDown,
|
||||||
]);
|
]);
|
||||||
await initializeApp();
|
await init();
|
||||||
runApp(ChangeNotifierProvider(
|
runApp(ChangeNotifierProvider(
|
||||||
create: (context) => FFAppState(),
|
create: (context) => FFAppState(),
|
||||||
child: const MyApp(),
|
child: const MyApp(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
Future<void> init() async {
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
||||||
await FlutterFlowTheme.initialize();
|
await FlutterFlowTheme.initialize();
|
||||||
|
|
|
@ -330,71 +330,110 @@ Widget liberationHistoryItemCard(
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
showModalBottomSheet(
|
showDialog(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
isDismissible: true,
|
// isDismissible: true,
|
||||||
backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return VisitRequestTemplateComponentWidget(
|
return Dialog(
|
||||||
// vteName: liberationHistoryItem['VTE_NOME'],
|
alignment: Alignment.center,
|
||||||
// vteReason: liberationHistoryItem['NOT_MOTIVO'],
|
child: VisitRequestTemplateComponentWidget(
|
||||||
// vawDate: liberationHistoryItem['NOT_STATUS'] == 'S'
|
// vteName: liberationHistoryItem['VTE_NOME'],
|
||||||
// ? liberationHistoryItem['NOT_DTENVIO']
|
// vteReason: liberationHistoryItem['NOT_MOTIVO'],
|
||||||
// : liberationHistoryItem['NOT_DTRESPOSTA'],
|
// vawDate: liberationHistoryItem['NOT_STATUS'] == 'S'
|
||||||
// vawStatus: liberationHistoryItem['NOT_STATUS'],
|
// ? liberationHistoryItem['NOT_DTENVIO']
|
||||||
// vteMsg: liberationHistoryItem['NOT_MSGENVIO'],
|
// : liberationHistoryItem['NOT_DTRESPOSTA'],
|
||||||
// vteUUID: liberationHistoryItem['VTE_ID'],
|
// vawStatus: liberationHistoryItem['NOT_STATUS'],
|
||||||
// cliUUID: FFAppState().cliUUID,
|
// vteMsg: liberationHistoryItem['NOT_MSGENVIO'],
|
||||||
// msgUUID: liberationHistoryItem['NOT_ID'],
|
// vteUUID: liberationHistoryItem['VTE_ID'],
|
||||||
// vawDestino: liberationHistoryItem['NOT_DESTINO'],
|
// cliUUID: FFAppState().cliUUID,
|
||||||
// vawUUID: liberationHistoryItem['NOT_ID'],
|
// msgUUID: liberationHistoryItem['NOT_ID'],
|
||||||
// vawName: liberationHistoryItem['NOT_NOME'],
|
// vawDestino: liberationHistoryItem['NOT_DESTINO'],
|
||||||
// vawRef: liberationHistoryItem['NOT_ID'],
|
// vawUUID: liberationHistoryItem['NOT_ID'],
|
||||||
labelsHashMap: Map<String, String>.from({
|
// vawName: liberationHistoryItem['NOT_NOME'],
|
||||||
'Nome:': liberationHistoryItem['VTE_NOME'],
|
// vawRef: liberationHistoryItem['NOT_ID'],
|
||||||
'Data:': liberationHistoryItem['NOT_DTENVIO'],
|
labelsHashMap: Map<String, String>.from({
|
||||||
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
|
'Nome:': liberationHistoryItem['VTE_NOME'],
|
||||||
'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'],
|
'Data:': liberationHistoryItem['NOT_DTENVIO'],
|
||||||
// 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'],
|
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
|
||||||
}),
|
'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'],
|
||||||
buttons: [
|
// 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'],
|
||||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
}),
|
||||||
FlutterFlowIconButton(
|
buttons: [
|
||||||
icon: const Icon(Icons.done),
|
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||||
onPressed: () async {
|
FlutterFlowIconButton(
|
||||||
showDialog(
|
icon: const Icon(Icons.done),
|
||||||
context: context,
|
onPressed: () async {
|
||||||
builder: (context) {
|
showDialog(
|
||||||
return AlertDialog(
|
context: context,
|
||||||
title: Text(
|
builder: (context) {
|
||||||
FFLocalizations.of(context).getVariableText(
|
return AlertDialog(
|
||||||
ptText: 'Aprovar Visita',
|
title: Text(
|
||||||
enText: 'Approve Visit',
|
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);
|
content: Text(
|
||||||
},
|
FFLocalizations.of(context).getVariableText(
|
||||||
options: FFButtonOptions(
|
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 {
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
await answersRequest
|
||||||
|
.call(
|
||||||
|
context,
|
||||||
|
liberationHistoryItem['NOT_ID']
|
||||||
|
.toString(),
|
||||||
|
'L',
|
||||||
|
'Mensagem',
|
||||||
|
liberationHistoryItem['VTE_ID']
|
||||||
|
.toString(),
|
||||||
|
)
|
||||||
|
.then((value) {});
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
|
@ -408,86 +447,82 @@ Widget liberationHistoryItemCard(
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10)),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
|
||||||
FFButtonWidget(
|
|
||||||
text:
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Yes',
|
|
||||||
ptText: 'Sim',
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
Navigator.pop(context);
|
|
||||||
await answersRequest
|
|
||||||
.call(
|
|
||||||
context,
|
|
||||||
liberationHistoryItem['NOT_ID']
|
|
||||||
.toString(),
|
|
||||||
'L',
|
|
||||||
'Mensagem',
|
|
||||||
liberationHistoryItem['VTE_ID']
|
|
||||||
.toString(),
|
|
||||||
)
|
|
||||||
.then((value) {});
|
|
||||||
},
|
|
||||||
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,
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
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',
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
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',
|
||||||
),
|
),
|
||||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
onPressed: () async {
|
||||||
FlutterFlowIconButton(
|
await answersRequest.call(
|
||||||
icon: const Icon(Icons.close),
|
context,
|
||||||
onPressed: () async {
|
liberationHistoryItem['NOT_ID']
|
||||||
showDialog(
|
.toString(),
|
||||||
context: context,
|
'B',
|
||||||
builder: (context) {
|
'Mensagem',
|
||||||
return AlertDialog(
|
liberationHistoryItem['VTE_ID']
|
||||||
title: Text(
|
.toString(),
|
||||||
FFLocalizations.of(context).getVariableText(
|
);
|
||||||
ptText: 'Bloquear Visita',
|
},
|
||||||
enText: 'Block Visit',
|
options: FFButtonOptions(
|
||||||
),
|
|
||||||
),
|
|
||||||
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,
|
width: 100,
|
||||||
height: 40,
|
height: 40,
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
|
@ -501,74 +536,44 @@ Widget liberationHistoryItemCard(
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10)),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
|
||||||
FFButtonWidget(
|
|
||||||
text:
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Yes',
|
|
||||||
ptText: 'Sim',
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
await answersRequest.call(
|
|
||||||
context,
|
|
||||||
liberationHistoryItem['NOT_ID'].toString(),
|
|
||||||
'B',
|
|
||||||
'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: [
|
||||||
statusHashMap: [
|
liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||||
liberationHistoryItem['NOT_STATUS'] == 'L'
|
? Map<String, Color>.from({
|
||||||
? Map<String, Color>.from({
|
FFLocalizations.of(context).getVariableText(
|
||||||
FFLocalizations.of(context).getVariableText(
|
ptText: 'Finalizado',
|
||||||
ptText: 'Finalizado',
|
enText: 'Finished',
|
||||||
enText: 'Finished',
|
): FlutterFlowTheme.of(context).success,
|
||||||
): FlutterFlowTheme.of(context).success,
|
})
|
||||||
})
|
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
||||||
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
? Map<String, Color>.from({
|
||||||
? Map<String, Color>.from({
|
FFLocalizations.of(context).getVariableText(
|
||||||
FFLocalizations.of(context).getVariableText(
|
ptText: 'Bloqueado',
|
||||||
ptText: 'Bloqueado',
|
enText: 'Blocked',
|
||||||
enText: 'Blocked',
|
): FlutterFlowTheme.of(context).error,
|
||||||
): FlutterFlowTheme.of(context).error,
|
})
|
||||||
})
|
: Map<String, Color>.from({
|
||||||
: Map<String, Color>.from({
|
FFLocalizations.of(context).getVariableText(
|
||||||
FFLocalizations.of(context).getVariableText(
|
ptText: 'Ativo',
|
||||||
ptText: 'Ativo',
|
enText: 'Active',
|
||||||
enText: 'Active',
|
): FlutterFlowTheme.of(context).warning,
|
||||||
): FlutterFlowTheme.of(context).warning,
|
})
|
||||||
})
|
],
|
||||||
],
|
imageHashMap: Map<String, String>.from({
|
||||||
imageHashMap: Map<String, String>.from({
|
'key': liberationHistoryItem['VTE_ID'],
|
||||||
'key': liberationHistoryItem['VTE_ID'],
|
'value': 'E',
|
||||||
'value': 'E',
|
}),
|
||||||
}),
|
// changeStatusAction: answersRequest,
|
||||||
// changeStatusAction: answersRequest,
|
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
|
||||||
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((_) {
|
).then((_) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
@ -164,11 +165,21 @@ class ScheduleCompleteVisitPageModel
|
||||||
);
|
);
|
||||||
|
|
||||||
textFieldFocusNode1 = FocusNode();
|
textFieldFocusNode1 = FocusNode();
|
||||||
textController1 = TextEditingController();
|
textController1 = TextEditingController(
|
||||||
|
text: dateTimeFormat(
|
||||||
|
'd/M/y H:mm:ss',
|
||||||
|
DateTime.now().add(const Duration(minutes: 10)),
|
||||||
|
// locale: FFLocalizations.of(context).languageCode,
|
||||||
|
));
|
||||||
textController1Validator = _textController1Validator;
|
textController1Validator = _textController1Validator;
|
||||||
|
|
||||||
textFieldFocusNode2 = FocusNode();
|
textFieldFocusNode2 = FocusNode();
|
||||||
textController2 = TextEditingController();
|
textController2 = TextEditingController(
|
||||||
|
text: dateTimeFormat(
|
||||||
|
'd/M/y H:mm:ss',
|
||||||
|
DateTime.now().add(const Duration(days: 1)),
|
||||||
|
// locale: FFLocalizations.of(context).languageCode,
|
||||||
|
));
|
||||||
textController2Validator = _textController2Validator;
|
textController2Validator = _textController2Validator;
|
||||||
|
|
||||||
textFieldFocusNode3 = FocusNode();
|
textFieldFocusNode3 = FocusNode();
|
||||||
|
|
|
@ -29,22 +29,10 @@ class ScheduleCompleteVisitPageWidget extends StatefulWidget {
|
||||||
const ScheduleCompleteVisitPageWidget({
|
const ScheduleCompleteVisitPageWidget({
|
||||||
super.key,
|
super.key,
|
||||||
this.visitorStrList,
|
this.visitorStrList,
|
||||||
this.visitStartDateStr,
|
|
||||||
this.visitEndDateStr,
|
|
||||||
this.visitReasonStr,
|
|
||||||
this.visitLevelStr,
|
|
||||||
this.visitTempBol,
|
|
||||||
this.visitObsStr,
|
|
||||||
this.visitorJsonList,
|
this.visitorJsonList,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? visitorStrList;
|
final String? visitorStrList;
|
||||||
final String? visitStartDateStr;
|
|
||||||
final String? visitEndDateStr;
|
|
||||||
final String? visitReasonStr;
|
|
||||||
final String? visitLevelStr;
|
|
||||||
final bool? visitTempBol;
|
|
||||||
final String? visitObsStr;
|
|
||||||
final List<dynamic>? visitorJsonList;
|
final List<dynamic>? visitorJsonList;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -250,10 +238,7 @@ Widget bodyScheduleCompleteVisit(
|
||||||
scheduleVisit(context, _model, setState, safeSetState),
|
scheduleVisit(context, _model, setState, safeSetState),
|
||||||
wrapWithModel(
|
wrapWithModel(
|
||||||
model: _model,
|
model: _model,
|
||||||
child: VisitHistoryWidget(
|
child: VisitHistoryWidget(),
|
||||||
model: _model,
|
|
||||||
safeSetState: safeSetState,
|
|
||||||
),
|
|
||||||
updateCallback: () {
|
updateCallback: () {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
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/app_state.dart';
|
||||||
|
@ -6,144 +8,174 @@ import 'package:hub/backend/api_requests/api_manager.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_action.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_action.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/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class VisitHistoryWidget extends StatelessWidget {
|
class VisitHistoryWidget extends StatefulWidget {
|
||||||
final ScheduleCompleteVisitPageModel _model;
|
VisitHistoryWidget({
|
||||||
final Function safeSetState;
|
|
||||||
|
|
||||||
const VisitHistoryWidget({
|
|
||||||
Key? key,
|
Key? key,
|
||||||
required ScheduleCompleteVisitPageModel model,
|
}) : super(key: key);
|
||||||
required this.safeSetState,
|
|
||||||
}) : _model = model,
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
_VisitHistoryWidgetState createState() => _VisitHistoryWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VisitHistoryWidgetState extends State<VisitHistoryWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var response = ScheduleCompleteVisitPageModel().visitHistory(
|
||||||
|
requestFn: () => PhpGroup.getVisitsCall.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'getVisitas',
|
||||||
|
pageSize: 100,
|
||||||
|
pageNumber: 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 900.0,
|
height: 900.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
),
|
),
|
||||||
child: Consumer<ScheduleCompleteVisitPageModel>(
|
// child: Consumer<ScheduleCompleteVisitPageModel>(
|
||||||
builder: (context, model, _) {
|
child: StreamBuilder<dynamic>(
|
||||||
return StreamBuilder<ApiCallResponse>(
|
stream: response,
|
||||||
stream: model.visitHistory(
|
builder: (context, snapshot) {
|
||||||
requestFn: () => PhpGroup.getVisitsCall.call(
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
devUUID: FFAppState().devUUID,
|
return Center(
|
||||||
userUUID: FFAppState().userUUID,
|
child: CircularProgressIndicator(
|
||||||
cliID: FFAppState().cliUUID,
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
atividade: 'getVisitas',
|
FlutterFlowTheme.of(context).primary,
|
||||||
pageSize: 100,
|
),
|
||||||
pageNumber: 1,
|
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
builder: (context, snapshot) {
|
} else if (snapshot.hasError) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
return Center(child: Text('Error: ${snapshot.error}'));
|
||||||
return Center(
|
} else if (!snapshot.hasData || snapshot.data!.jsonBody == null) {
|
||||||
child: CircularProgressIndicator(
|
return const Center(child: Text('No visits found'));
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
}
|
||||||
FlutterFlowTheme.of(context).primary,
|
var wrapGetVisitsResponse = snapshot.data!;
|
||||||
),
|
var visitaWrap = PhpGroup.getVisitsCall
|
||||||
),
|
.visitasList(wrapGetVisitsResponse.jsonBody)
|
||||||
);
|
?.toList() ??
|
||||||
} else if (snapshot.hasError) {
|
[];
|
||||||
return Center(child: Text('Error: ${snapshot.error}'));
|
log('updated');
|
||||||
} else if (!snapshot.hasData || snapshot.data!.jsonBody == null) {
|
log('visitaWrap: ${visitaWrap[0]}');
|
||||||
return const Center(child: Text('No visits found'));
|
return ListView.builder(
|
||||||
}
|
itemCount: visitaWrap.length,
|
||||||
final wrapGetVisitsResponse = snapshot.data!;
|
shrinkWrap: true,
|
||||||
final visitaWrap = PhpGroup.getVisitsCall
|
physics: const BouncingScrollPhysics(),
|
||||||
.visitasList(wrapGetVisitsResponse.jsonBody)
|
itemBuilder: (context, index) {
|
||||||
?.toList() ??
|
final visitaWrapItem = visitaWrap[index];
|
||||||
[];
|
return CardItemTemplateComponentWidget(
|
||||||
return ListView.builder(
|
imageHashMap: {
|
||||||
itemCount: visitaWrap.length,
|
'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
|
||||||
shrinkWrap: true,
|
'value': 'E',
|
||||||
physics: const BouncingScrollPhysics(),
|
},
|
||||||
itemBuilder: (context, index) {
|
labelsHashMap: {
|
||||||
final visitaWrapItem = visitaWrap[index];
|
'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
|
||||||
return CardItemTemplateComponentWidget(
|
'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '',
|
||||||
imageHashMap: {
|
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
|
||||||
'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
|
},
|
||||||
'value': 'E',
|
statusHashMap: [
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Ativo',
|
||||||
|
enText: 'Active',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
},
|
},
|
||||||
labelsHashMap: {
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
|
status.finished)
|
||||||
'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '',
|
{
|
||||||
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Finalizado',
|
||||||
|
enText: 'Finished',
|
||||||
|
): FlutterFlowTheme.of(context).success,
|
||||||
},
|
},
|
||||||
statusHashMap: [
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown)
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
{
|
||||||
status.active)
|
FFLocalizations.of(context).getVariableText(
|
||||||
{
|
ptText: 'Desconhecido',
|
||||||
FFLocalizations.of(context).getVariableText(
|
enText: 'Unknown',
|
||||||
ptText: 'Ativo',
|
): FlutterFlowTheme.of(context).alternate,
|
||||||
enText: 'Active',
|
},
|
||||||
): FlutterFlowTheme.of(context).warning,
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
},
|
status.canceled)
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
{
|
||||||
status.finished)
|
FFLocalizations.of(context).getVariableText(
|
||||||
{
|
ptText: 'Cancelado',
|
||||||
FFLocalizations.of(context).getVariableText(
|
enText: 'Canceled',
|
||||||
ptText: 'Finalizado',
|
): FlutterFlowTheme.of(context).error,
|
||||||
enText: 'Finished',
|
},
|
||||||
): FlutterFlowTheme.of(context).success,
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked)
|
||||||
},
|
{
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
FFLocalizations.of(context).getVariableText(
|
||||||
status.unknown)
|
ptText: 'Bloqueado',
|
||||||
{
|
enText: 'Blocked',
|
||||||
FFLocalizations.of(context).getVariableText(
|
): FlutterFlowTheme.of(context).error,
|
||||||
ptText: 'Desconhecido',
|
},
|
||||||
enText: 'Unknown',
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
): FlutterFlowTheme.of(context).alternate,
|
status.inactive)
|
||||||
},
|
{
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
FFLocalizations.of(context).getVariableText(
|
||||||
status.canceled)
|
ptText: 'Inactive',
|
||||||
{
|
enText: 'Inactive',
|
||||||
FFLocalizations.of(context).getVariableText(
|
): FlutterFlowTheme.of(context).error,
|
||||||
ptText: 'Cancelado',
|
},
|
||||||
enText: 'Canceled',
|
],
|
||||||
): FlutterFlowTheme.of(context).error,
|
onTapCardItemAction: () async {
|
||||||
},
|
await showDialog(
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
// isScrollControlled: true,
|
||||||
status.blocked)
|
// isDismissible: true,
|
||||||
{
|
// backgroundColor: Colors.transparent,
|
||||||
FFLocalizations.of(context).getVariableText(
|
useSafeArea: true,
|
||||||
ptText: 'Bloqueado',
|
context: context,
|
||||||
enText: 'Blocked',
|
|
||||||
): FlutterFlowTheme.of(context).error,
|
builder: (context) {
|
||||||
},
|
return Dialog(
|
||||||
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
alignment: Alignment.center,
|
||||||
status.inactive)
|
child: buildDetails(
|
||||||
{
|
visitaWrapItem,
|
||||||
FFLocalizations.of(context).getVariableText(
|
context,
|
||||||
ptText: 'Inactive',
|
changeStatusAction,
|
||||||
enText: 'Inactive',
|
),
|
||||||
): FlutterFlowTheme.of(context).error,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
onTapCardItemAction: () async {
|
|
||||||
showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
isDismissible: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
useSafeArea: true,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return buildDetails(
|
|
||||||
visitaWrapItem,
|
|
||||||
context,
|
|
||||||
changeStatusAction,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
).whenComplete(() async {
|
||||||
|
log('Complete');
|
||||||
|
final newResponseStream =
|
||||||
|
ScheduleCompleteVisitPageModel().visitHistory(
|
||||||
|
requestFn: () => PhpGroup.getVisitsCall.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'getVisitas',
|
||||||
|
pageSize: 100,
|
||||||
|
pageNumber: 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
newResponseStream.listen((newResponse) {
|
||||||
|
log('New response received: $newResponse');
|
||||||
|
if (mounted) {
|
||||||
|
safeSetState(() {
|
||||||
|
response = newResponse.jsonBody;
|
||||||
|
log('Response updated: $response');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
log('Widget is not mounted, skipping state update.');
|
||||||
|
}
|
||||||
|
}).onError((err) {
|
||||||
|
log('Error: $err');
|
||||||
|
});
|
||||||
|
}).catchError((err, stack) {
|
||||||
|
log('Error: $err');
|
||||||
|
log('Stack: $stack');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue