some changes
This commit is contained in:
parent
9bb271f1a3
commit
e30337b167
File diff suppressed because one or more lines are too long
|
@ -1,15 +1,12 @@
|
|||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||
import '/custom_code/actions/index.dart' as actions;
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/actions/actions.dart' as action_blocks;
|
||||
import '/custom_code/actions/index.dart' as actions;
|
||||
import '/flutter_flow/random_data_util.dart' as random_data;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future repeatVisitScheduleAction(
|
||||
BuildContext context, {
|
||||
|
@ -381,8 +378,8 @@ Future<void> snackbar(BuildContext context, {required bool opt}) async {
|
|||
),
|
||||
),
|
||||
backgroundColor: opt
|
||||
? FlutterFlowTheme.of(context).success
|
||||
: FlutterFlowTheme.of(context).error,
|
||||
? FlutterFlowTheme.of(context).success.withOpacity(0.5)
|
||||
: FlutterFlowTheme.of(context).error.withOpacity(0.5),
|
||||
duration: const Duration(seconds: 3),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
|
|
|
@ -2,15 +2,16 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:f_r_e_hub/actions/actions.dart';
|
||||
import 'package:f_r_e_hub/app_state.dart';
|
||||
import 'package:f_r_e_hub/backend/api_requests/api_calls.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
|
||||
class PushNotificationService {
|
||||
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
|
||||
|
@ -385,6 +386,7 @@ class NotificationHandler {
|
|||
vteUUID: message['idVisitante'].toString(),
|
||||
vawRef: message['referencia'].toString(),
|
||||
vawStatus: 'S',
|
||||
changeStatusAction: changeStatusAction,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -141,10 +141,16 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
},
|
||||
activeColor: FlutterFlowTheme.of(context).primary,
|
||||
checkColor: FlutterFlowTheme.of(context).info,
|
||||
checkboxShape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
enableFeedback: true,
|
||||
side: BorderSide(
|
||||
width: 2,
|
||||
width: 10,
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
),
|
||||
controlAffinity:
|
||||
ListTileControlAffinity.leading, // Adiciona esta linha
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -175,7 +181,7 @@ class _OptModalWidgetState extends State<OptModalWidget> {
|
|||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 50.0, 0.0),
|
||||
child: Container(
|
||||
width: 300.0,
|
||||
height: 500.0,
|
||||
height: 450.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
|
|
|
@ -69,6 +69,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
context.watch<FFAppState>();
|
||||
debugPrint('imageHashMap: ${widget.imageHashMap}');
|
||||
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -110,6 +111,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: labelsLinkedHashMap.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
String key =
|
||||
labelsLinkedHashMap.keys.elementAt(index);
|
||||
|
@ -146,7 +148,7 @@ class _CardItemTemplateComponentWidgetState
|
|||
.primaryText,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width:
|
||||
5.0), // Espaçamento entre o label e o valor
|
||||
Text(
|
||||
|
@ -218,7 +220,8 @@ class _CardItemTemplateComponentWidgetState
|
|||
fadeInDuration: const Duration(milliseconds: 500),
|
||||
fadeOutDuration: const Duration(milliseconds: 500),
|
||||
imageUrl: valueOrDefault<String>(
|
||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
||||
// 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
|
|
|
@ -29,6 +29,10 @@ class VisitRequestTemplateComponentModel
|
|||
TextEditingController? textController5;
|
||||
String? Function(BuildContext, String?)? textController5Validator;
|
||||
|
||||
FocusNode? textFieldFocusNodeStatus;
|
||||
TextEditingController? textControllerStatus;
|
||||
String? Function(BuildContext, String?)? textControllerStatusValidator;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
|
@ -48,5 +52,8 @@ class VisitRequestTemplateComponentModel
|
|||
|
||||
textFieldFocusNode5?.dispose();
|
||||
textController5?.dispose();
|
||||
|
||||
textFieldFocusNodeStatus?.dispose();
|
||||
textControllerStatus?.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'visit_request_template_component_model.dart';
|
||||
|
||||
export 'visit_request_template_component_model.dart';
|
||||
|
||||
class VisitRequestTemplateComponentWidget extends StatefulWidget {
|
||||
|
@ -85,6 +85,10 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
|
||||
_model.textController5 ??= TextEditingController();
|
||||
_model.textFieldFocusNode5 ??= FocusNode();
|
||||
|
||||
_model.textControllerStatus ??=
|
||||
TextEditingController(text: widget.vawStatus);
|
||||
_model.textFieldFocusNodeStatus ??= FocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -144,61 +148,61 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 153.0,
|
||||
height: 25.0,
|
||||
decoration: BoxDecoration(
|
||||
color: () {
|
||||
if (widget.vawStatus == 'L') {
|
||||
return FlutterFlowTheme.of(context).primary;
|
||||
} else if (widget.vawStatus == 'B') {
|
||||
return FlutterFlowTheme.of(context).error;
|
||||
} else if (widget.vawStatus == 'S') {
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
} else {
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
}
|
||||
}(),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Text(
|
||||
() {
|
||||
if (widget.vawStatus == 'L') {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
);
|
||||
} else if (widget.vawStatus == 'B') {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Bloqueado',
|
||||
enText: 'Blocked',
|
||||
);
|
||||
} else {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
);
|
||||
}
|
||||
}(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// width: 153.0,
|
||||
// height: 25.0,
|
||||
// decoration: BoxDecoration(
|
||||
// color: () {
|
||||
// if (widget.vawStatus == 'L') {
|
||||
// return FlutterFlowTheme.of(context).primary;
|
||||
// } else if (widget.vawStatus == 'B') {
|
||||
// return FlutterFlowTheme.of(context).error;
|
||||
// } else if (widget.vawStatus == 'S') {
|
||||
// return FlutterFlowTheme.of(context).warning;
|
||||
// } else {
|
||||
// return FlutterFlowTheme.of(context).warning;
|
||||
// }
|
||||
// }(),
|
||||
// borderRadius: BorderRadius.circular(16.0),
|
||||
// ),
|
||||
// child: Align(
|
||||
// alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
// child: Text(
|
||||
// () {
|
||||
// if (widget.vawStatus == 'L') {
|
||||
// return FFLocalizations.of(context)
|
||||
// .getVariableText(
|
||||
// ptText: 'Ativo',
|
||||
// enText: 'Active',
|
||||
// );
|
||||
// } else if (widget.vawStatus == 'B') {
|
||||
// return FFLocalizations.of(context)
|
||||
// .getVariableText(
|
||||
// ptText: 'Bloqueado',
|
||||
// enText: 'Blocked',
|
||||
// );
|
||||
// } else {
|
||||
// return FFLocalizations.of(context)
|
||||
// .getVariableText(
|
||||
// ptText: 'Pendente',
|
||||
// enText: 'Pending',
|
||||
// );
|
||||
// }
|
||||
// }(),
|
||||
// style: FlutterFlowTheme.of(context)
|
||||
// .bodyMedium
|
||||
// .override(
|
||||
// fontFamily: FlutterFlowTheme.of(context)
|
||||
// .bodyMediumFamily,
|
||||
// letterSpacing: 0.0,
|
||||
// useGoogleFonts: GoogleFonts.asMap()
|
||||
// .containsKey(
|
||||
// FlutterFlowTheme.of(context)
|
||||
// .bodyMediumFamily),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
].divide(const SizedBox(height: 5.0)),
|
||||
),
|
||||
]
|
||||
|
@ -367,6 +371,93 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
// _model.textController2Validator.asValidator(context),
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
child: TextFormField(
|
||||
// controller: _model.textControllerStatus,
|
||||
// focusNode: _model.textFieldFocusNodeStatus,
|
||||
autofocus: false,
|
||||
canRequestFocus: false,
|
||||
readOnly: true,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0)),
|
||||
filled: true,
|
||||
fillColor: () {
|
||||
if (widget.vawStatus == 'L') {
|
||||
return FlutterFlowTheme.of(context).primary;
|
||||
} else if (widget.vawStatus == 'B') {
|
||||
return FlutterFlowTheme.of(context).error;
|
||||
} else if (widget.vawStatus == 'S') {
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
} else {
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
}
|
||||
}(),
|
||||
labelText: () {
|
||||
if (widget.vawStatus == 'L') {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
);
|
||||
} else if (widget.vawStatus == 'B') {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloqueado',
|
||||
enText: 'Blocked',
|
||||
);
|
||||
} else {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
);
|
||||
}
|
||||
}(),
|
||||
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),
|
||||
),
|
||||
focusedBorder: InputBorder.none,
|
||||
errorBorder: InputBorder.none,
|
||||
focusedErrorBorder: InputBorder.none,
|
||||
suffixIcon: Icon(
|
||||
Icons.info,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.name,
|
||||
validator:
|
||||
_model.textController1Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 0.0),
|
||||
|
@ -603,6 +694,7 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
_model.textController4Validator.asValidator(context),
|
||||
),
|
||||
),
|
||||
|
||||
if (widget.vawStatus == 'S')
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
|
|
|
@ -65,7 +65,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
|||
name: '_initialize',
|
||||
path: '/',
|
||||
builder: (context, _) => FFAppState().isLogged
|
||||
? const TestPage()
|
||||
? const HomePageWidget()
|
||||
: const WelcomePageWidget(),
|
||||
),
|
||||
FFRoute(
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'firebase_options.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||
|
@ -77,6 +78,15 @@ class _MyAppState extends State<MyApp> {
|
|||
Widget build(BuildContext context) {
|
||||
return MaterialApp.router(
|
||||
title: 'FREHub',
|
||||
builder: (context, widget) => ResponsiveBreakpoints.builder(
|
||||
child: BouncingScrollWrapper.builder(context, widget!),
|
||||
breakpoints: [
|
||||
const Breakpoint(start: 0, end: 450, name: MOBILE),
|
||||
const Breakpoint(start: 451, end: 800, name: TABLET),
|
||||
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
|
||||
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
|
||||
],
|
||||
),
|
||||
localizationsDelegates: const [
|
||||
FFLocalizationsDelegate(),
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
|
|
|
@ -110,109 +110,99 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Image.network(
|
||||
valueOrDefault<String>(
|
||||
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(30, 30, 10, 0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getText(
|
||||
'lyiat6s2' /* NOME DO MORADOR */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily: 'Nunito Sans',
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FontWeight.normal,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
'Nunito Sans'),
|
||||
),
|
||||
),
|
||||
child: Image.network(
|
||||
valueOrDefault<String>(
|
||||
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||
),
|
||||
].divide(const SizedBox(width: 20.0)),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(const SizedBox(width: 10.0))
|
||||
.addToStart(const SizedBox(width: 20.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.0,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: FlutterFlowIconButton(
|
||||
borderRadius: 100.0,
|
||||
borderWidth: 1.0,
|
||||
buttonSize: 40.0,
|
||||
icon: Icon(
|
||||
Icons.close_sharp,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
size: 20.0,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
onPressed: () async {
|
||||
if (scaffoldKey
|
||||
.currentState!.isDrawerOpen ||
|
||||
scaffoldKey.currentState!
|
||||
.isEndDrawerOpen) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
Flexible(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'lyiat6s2' /* NOME DO MORADOR */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyLarge
|
||||
.override(
|
||||
fontFamily: 'Nunito Sans',
|
||||
color:
|
||||
FlutterFlowTheme.of(context)
|
||||
.primaryText,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.normal,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
'Nunito Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(const SizedBox(width: 20.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(const SizedBox(width: 0.0))
|
||||
.around(const SizedBox(width: 0.0)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 30.0,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: FlutterFlowIconButton(
|
||||
borderRadius: 100.0,
|
||||
borderWidth: 1.0,
|
||||
buttonSize: 40.0,
|
||||
icon: Icon(
|
||||
Icons.close_sharp,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.primary,
|
||||
size: 20.0,
|
||||
),
|
||||
onPressed: () async {
|
||||
if (scaffoldKey.currentState!
|
||||
.isDrawerOpen ||
|
||||
scaffoldKey.currentState!
|
||||
.isEndDrawerOpen) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(const SizedBox(width: 0.0))
|
||||
.around(const SizedBox(width: 0.0)),
|
||||
),
|
||||
),
|
||||
].addToStart(const SizedBox(height: 30.0)),
|
||||
),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import 'package:f_r_e_hub/actions/actions.dart';
|
||||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||
import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
||||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
|
@ -107,15 +108,12 @@ Widget bodyLiberationHistoryPage(
|
|||
BuildContext context, LiberationHistoryModel _model) {
|
||||
return SafeArea(
|
||||
top: true,
|
||||
child: Stack(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
liberationDynamicListView(context, _model),
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: searchBarContainer(context, _model)),
|
||||
searchBarContainer(context, _model),
|
||||
Expanded(child: liberationDynamicListView(context, _model)),
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
|
@ -272,7 +270,9 @@ Widget liberationDynamicListView(
|
|||
final liberationHistoryItem = filteredLiberationHistory[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: index == 0 ? 60.0 : 8.0,
|
||||
top: index == 0
|
||||
? MediaQuery.of(context).size.height * 0.075
|
||||
: 8.0,
|
||||
left: 8.0,
|
||||
right: 8.0,
|
||||
bottom: 8.0,
|
||||
|
@ -294,8 +294,37 @@ Widget liberationDynamicListView(
|
|||
|
||||
Widget liberationHistoryItemCard(
|
||||
BuildContext context, dynamic liberationHistoryItem) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
return CardItemTemplateComponentWidget(
|
||||
imageHashMap: Map<String, String>.from({
|
||||
'key': liberationHistoryItem['VTE_ID'],
|
||||
'value': 'E',
|
||||
}),
|
||||
labelsHashMap: Map<String, String>.from({
|
||||
'Nome:': liberationHistoryItem['VTE_NOME'],
|
||||
'Data:': liberationHistoryItem['NOT_DTENVIO'],
|
||||
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
|
||||
}),
|
||||
statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||
? Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Ativo',
|
||||
enText: 'Active',
|
||||
): FlutterFlowTheme.of(context).success,
|
||||
})
|
||||
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
||||
? Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Bloqueado',
|
||||
enText: 'Blocked',
|
||||
): FlutterFlowTheme.of(context).error,
|
||||
})
|
||||
: Map<String, Color>.from({
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
): FlutterFlowTheme.of(context).warning,
|
||||
}),
|
||||
onTapCardItemAction: () async {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
|
@ -345,263 +374,5 @@ Widget liberationHistoryItemCard(
|
|||
});
|
||||
});
|
||||
},
|
||||
child: Card(
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
elevation: 5.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: Container(
|
||||
width: 350.0,
|
||||
height: 115.0,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 10.0, 0.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
child: CachedNetworkImage(
|
||||
fadeInDuration: const Duration(milliseconds: 500),
|
||||
fadeOutDuration: const Duration(milliseconds: 500),
|
||||
imageUrl: valueOrDefault<String>(
|
||||
"https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.VTE_ID''',
|
||||
).toString()}&tipo=E",
|
||||
"https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg",
|
||||
),
|
||||
width: 100.0,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, -1.0),
|
||||
child: Text(
|
||||
getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.VTE_NOME''',
|
||||
).toString(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
fontSize: 15.5,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
.addToStart(const SizedBox(width: 10.0))
|
||||
.addToEnd(const SizedBox(width: 10.0)),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'dkzewokx' /* Date: */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
fontSize: 12.5,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
(functions.jsonToStr(getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.NOT_STATUS''',
|
||||
)) ==
|
||||
'"L"'
|
||||
? getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.NOT_DTRESPOSTA''',
|
||||
)
|
||||
: getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.NOT_DTENVIO''',
|
||||
))
|
||||
.toString(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
fontSize: 12.5,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(const SizedBox(width: 10.0))
|
||||
.addToStart(const SizedBox(width: 10.0)),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'2s9avwbq' /* Motivo: */,
|
||||
),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
fontSize: 12.5,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
getJsonField(
|
||||
liberationHistoryItem,
|
||||
r'''$.NOT_MOTIVO''',
|
||||
).toString(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
fontSize: 12.5,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(const SizedBox(width: 10.0))
|
||||
.addToStart(const SizedBox(width: 10.0)),
|
||||
),
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
10.0, 0.0, 0.0, 0.0),
|
||||
child: Container(
|
||||
width: 200.0,
|
||||
height: 27.0,
|
||||
decoration: BoxDecoration(
|
||||
color: valueOrDefault<Color>(
|
||||
() {
|
||||
if (liberationHistoryItem["NOT_STATUS"] ==
|
||||
'L') {
|
||||
return FlutterFlowTheme.of(context).success;
|
||||
} else if (liberationHistoryItem[
|
||||
"NOT_STATUS"] ==
|
||||
'B') {
|
||||
return FlutterFlowTheme.of(context).error;
|
||||
} else if (liberationHistoryItem[
|
||||
"NOT_STATUS"] ==
|
||||
'S') {
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
} else {
|
||||
return FlutterFlowTheme.of(context).primary;
|
||||
}
|
||||
}(),
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
child: Text(
|
||||
"${() {
|
||||
if (liberationHistoryItem["NOT_STATUS"] ==
|
||||
'L') {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Ativa',
|
||||
enText: 'Active',
|
||||
);
|
||||
} else if (liberationHistoryItem[
|
||||
"NOT_STATUS"] ==
|
||||
'B') {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Bloqueada',
|
||||
enText: 'Blocked',
|
||||
);
|
||||
} else if (liberationHistoryItem[
|
||||
"NOT_STATUS"] ==
|
||||
'S') {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Pendente',
|
||||
enText: 'Pending',
|
||||
);
|
||||
} else {
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(
|
||||
ptText: 'Desconhecida',
|
||||
enText: 'Unknow',
|
||||
);
|
||||
}
|
||||
}()}",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(const SizedBox(height: 3.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import 'package:f_r_e_hub/backend/api_requests/api_manager.dart';
|
||||
import 'package:f_r_e_hub/flutter_flow/request_manager.dart';
|
||||
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/form_field_controller.dart';
|
||||
import 'schedule_complete_visit_page_widget.dart'
|
||||
|
@ -6,6 +9,21 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class ScheduleCompleteVisitPageModel
|
||||
extends FlutterFlowModel<ScheduleCompleteVisitPageWidget> {
|
||||
final _visitHistoryManager = FutureRequestManager<ApiCallResponse>();
|
||||
Future<ApiCallResponse> visitHistory({
|
||||
String? uniqueQueryKey,
|
||||
bool? overrideCache,
|
||||
required Future<ApiCallResponse> Function() requestFn,
|
||||
}) =>
|
||||
_visitHistoryManager.performRequest(
|
||||
uniqueQueryKey: uniqueQueryKey,
|
||||
overrideCache: overrideCache,
|
||||
requestFn: requestFn,
|
||||
);
|
||||
void clearVisitHistoryCache() => _visitHistoryManager.clear();
|
||||
void clearVisitHistoryCacheKey(String? uniqueKey) =>
|
||||
_visitHistoryManager.clearRequest(uniqueKey);
|
||||
|
||||
/// Local state fields for this page.
|
||||
|
||||
List<dynamic> visitorJsonList = [];
|
||||
|
@ -66,6 +84,8 @@ class ScheduleCompleteVisitPageModel
|
|||
|
||||
textFieldFocusNode3?.dispose();
|
||||
textController3?.dispose();
|
||||
|
||||
clearVisitHistoryCache();
|
||||
}
|
||||
|
||||
/// Action blocks.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,18 @@ class TestPage extends StatelessWidget {
|
|||
'Ativo': FlutterFlowTheme.of(context).success,
|
||||
};
|
||||
|
||||
// função set statusHashMap que recebe um String status faz um switch case e retorna um Map<String, Color>
|
||||
Map<String, Color> getStatusHashMap(String status) {
|
||||
switch (status) {
|
||||
case 'Ativo':
|
||||
return {'Ativo': FlutterFlowTheme.of(context).success};
|
||||
case 'Inativo':
|
||||
return {'Inativo': FlutterFlowTheme.of(context).error};
|
||||
default:
|
||||
return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor};
|
||||
}
|
||||
}
|
||||
|
||||
// Ajuste para passar os valores corretos para a URL da imagem
|
||||
final Map<String, String> imageKeyValue = {
|
||||
'key': 'docID',
|
||||
|
|
|
@ -949,6 +949,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
responsive_framework:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: responsive_framework
|
||||
sha256: "52367ab0c3479b3a5342dec3b74a3d47c4cc1b45bb5d38f720c2e002ebccd4ee"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
rfc_6901:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -81,6 +81,7 @@ dependencies:
|
|||
shared_preferences_web: 2.3.0
|
||||
sqflite: 2.3.3+1
|
||||
synchronized: 3.1.0+1
|
||||
responsive_framework: 1.4.0
|
||||
timeago: 3.6.1
|
||||
url_launcher: 6.3.0
|
||||
url_launcher_android: 6.3.3
|
||||
|
|
Loading…
Reference in New Issue