feat: Add QR code page widget

This commit is contained in:
jantunesmesias 2024-07-12 16:30:15 -03:00
commit 6b21d70d4c
28 changed files with 1252 additions and 197 deletions

View File

@ -301,8 +301,8 @@
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6436409927A31CD100820AF7 /* pt */,
6436409727A31CD000820AF7 /* en */,
6436409227A31CD600820AF7 /* pt */,
6436409227A31CDA00820AF7 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";

View File

@ -2098,7 +2098,7 @@ class GetLiberationsCopyCall {
final baseUrl = PhpGroup.getBaseUrl();
return ApiManager.instance.makeApiCall(
callName: 'getLiberations Copy',
callName: 'getMessages',
apiUrl: '$baseUrl/processRequest.php',
callType: ApiCallType.POST,
headers: {

View File

@ -107,6 +107,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
.toList()
.toList() ??
[];
return GridView.builder(
padding: EdgeInsets.zero,
gridDelegate:

View File

@ -159,4 +159,17 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
},
);
}
Future accessQRCodeOptAction(BuildContext context) async {
context.pushNamed(
'qrCodePage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.scale,
alignment: Alignment.bottomCenter,
),
},
);
}
}

View File

@ -70,6 +70,10 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
await _model.liberationHistoryOptAction(context);
setState(() {});
},
accessQRCodeOptAction: () async {
await _model.accessQRCodeOptAction(context);
setState(() {});
},
),
);
} else {
@ -102,6 +106,10 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
await _model.liberationHistoryOptAction(context);
setState(() {});
},
accessQRCodeOptAction: () async {
await _model.accessQRCodeOptAction(context);
setState(() {});
},
),
);
}

View File

@ -18,6 +18,7 @@ class MenuListViewComponentWidget extends StatefulWidget {
required this.peopleOnThePropertyOptAction,
required this.acessHistoryOptAction,
required this.liberationHistoryOptAction,
required this.accessQRCodeOptAction,
});
final Future Function()? changeMenuStyle;
@ -26,6 +27,7 @@ class MenuListViewComponentWidget extends StatefulWidget {
final Future Function()? peopleOnThePropertyOptAction;
final Future Function()? acessHistoryOptAction;
final Future Function()? liberationHistoryOptAction;
final Future Function()? accessQRCodeOptAction;
@override
State<MenuListViewComponentWidget> createState() =>
@ -525,6 +527,14 @@ Pet */
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 10.0, 0.0, 20.0),
child: InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
await widget.accessQRCodeOptAction?.call();
},
child: Container(
width: 100.0,
height: double.infinity,
@ -563,6 +573,7 @@ Pet */
Expanded(
child: Align(
alignment:
const AlignmentDirectional(-1.0, 0.0),
child: Padding(
padding:
@ -628,6 +639,7 @@ de Acesso */
),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 10.0, 0.0, 20.0),
@ -830,7 +842,119 @@ Propriedade */
child: Text(
FFLocalizations.of(context)
.getVariableText(
ptText: 'Consultar\nHistóricos',
ptText: 'Consultar\nConsultar
Históricos */
,
),
style: FlutterFlowTheme.of(context)
.titleLarge
.override(
fontFamily: 'Nunito',
color: FlutterFlowTheme.of(context)
.primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Nunito'),
),
),
),
],
),
),
].divide(const SizedBox(height: 0.0)),
),
),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0),
child: InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
await widget.acessHistoryOptAction?.call();
},
child: Container(
width: 100.0,
height: double.infinity,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
boxShadow: [
BoxShadow(
blurRadius: 4.0,
color: FlutterFlowTheme.of(context).customColor5,
offset: const Offset(
0.0,
2.0,
),
)
],
borderRadius: BorderRadius.circular(24.0),
shape: BoxShape.rectangle,
border: Border.all(
color: FlutterFlowTheme.of(context).alternate,
width: 0.5,
),
),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Align(
alignment:
const AlignmentDirectional(-1.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
8.0, 0.0, 0.0, 0.0),
child: Container(
width: 30.0,
height: 30.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context)
.primaryBackground,
shape: BoxShape.circle,
),
alignment:
const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.history_sharp,
color: FlutterFlowTheme.of(context)
.accent1,
size: 24.0,
),
),
),
),
),
],
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Text(
FFLocalizations.of(context).getText(
'589qufkw' /* Históricos',
enText: 'Consult\nHistories',
),
style: FlutterFlowTheme.of(context)

View File

@ -20,6 +20,7 @@ class MenuStaggeredViewComponentWidget extends StatefulWidget {
required this.peopleOnThePropertyOptAction,
required this.accessHistoryOptAction,
required this.liberationHistoryOptAction,
required this.accessQRCodeOptAction,
});
final Future Function()? changeMenuStyleAction;
@ -28,6 +29,7 @@ class MenuStaggeredViewComponentWidget extends StatefulWidget {
final Future Function()? peopleOnThePropertyOptAction;
final Future Function()? accessHistoryOptAction;
final Future Function()? liberationHistoryOptAction;
final Future Function()? accessQRCodeOptAction;
@override
State<MenuStaggeredViewComponentWidget> createState() =>
@ -543,15 +545,25 @@ Pet */
),
),
),
() => Container(
() => InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
await widget.accessQRCodeOptAction?.call();
},
child: Container(
width: 100.0,
height: 100.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
color:
FlutterFlowTheme.of(context).primaryBackground,
boxShadow: [
BoxShadow(
blurRadius: 4.0,
color: FlutterFlowTheme.of(context).customColor5,
color:
FlutterFlowTheme.of(context).customColor5,
offset: const Offset(
0.0,
2.0,
@ -580,11 +592,12 @@ Pet */
children: [
Expanded(
child: Align(
alignment: const AlignmentDirectional(
-1.0, 0.0),
alignment:
const AlignmentDirectional(-1.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional
.fromSTEB(8.0, 0.0, 0.0, 0.0),
padding:
const EdgeInsetsDirectional.fromSTEB(
8.0, 0.0, 0.0, 0.0),
child: Container(
width: 30.0,
height: 30.0,
@ -594,8 +607,7 @@ Pet */
.primaryBackground,
shape: BoxShape.circle,
),
alignment:
const AlignmentDirectional(
alignment: const AlignmentDirectional(
0.0, 0.0),
child: Icon(
FFIcons.kvector2,
@ -649,6 +661,7 @@ de Acesso */
),
),
),
),
() => InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,

View File

@ -55,14 +55,16 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
super.initState();
_model = createModel(context, () => ScheduleVisitDetailModel());
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
_model.textController1 ??=
TextEditingController(text: widget.visitTempStr);
_model.textFieldFocusNode1 ??= FocusNode();
_model.textController2 ??=
TextEditingController(text: widget.visitStartDate);
_model.textFieldFocusNode2 ??= FocusNode();
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
_model.textController3 ??=
TextEditingController(text: widget.visitEndDate);
_model.textFieldFocusNode3 ??= FocusNode();
_model.textController4 ??= TextEditingController(
@ -170,6 +172,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
.toList()
.take(1)
.toList();
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(

View File

@ -96,6 +96,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
);
}
final gridViewGetLocalsResponse = snapshot.data!;
return Builder(
builder: (context) {
final eachLocals = (PhpGroup.getLocalsCall
@ -108,6 +109,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
[])
.take(2)
.toList();
return GridView.builder(
padding: EdgeInsets.zero,
gridDelegate:

View File

@ -1,4 +1,5 @@
import '/backend/api_requests/api_calls.dart';
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart';
@ -224,7 +225,7 @@ class _ForgotPasswordTemplateComponentWidgetState
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).secondaryText,
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
@ -245,23 +246,35 @@ class _ForgotPasswordTemplateComponentWidgetState
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget(
onPressed: () async {
var shouldSetState = false;
_model.req = await PhpGroup.forgotPasswordCall.call(
email: _model.emailAddressTextController.text,
);
shouldSetState = true;
if (PhpGroup.forgotPasswordCall.error(
(_model.req?.jsonBody ?? ''),
) ==
false) {
Navigator.pop(context);
} else {
if (shouldSetState) setState(() {});
return;
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
enableDrag: false,
context: context,
builder: (context) {
return Padding(
padding: MediaQuery.viewInsetsOf(context),
child: ThrowExceptionWidget(
msg: PhpGroup.forgotPasswordCall.msg(
(_model.req?.jsonBody ?? ''),
)!,
),
);
},
).then((value) => safeSetState(() {}));
}
if (shouldSetState) setState(() {});
setState(() {});
},
text: FFLocalizations.of(context).getText(
'74rnd5bu' /* Enviar */,

View File

@ -0,0 +1,38 @@
import '/flutter_flow/flutter_flow_util.dart';
import 'qr_code_pass_key_template_component_widget.dart'
show QrCodePassKeyTemplateComponentWidget;
import 'package:flutter/material.dart';
class QrCodePassKeyTemplateComponentModel
extends FlutterFlowModel<QrCodePassKeyTemplateComponentWidget> {
/// State fields for stateful widgets in this component.
final formKey = GlobalKey<FormState>();
// State field(s) for keyTextField widget.
FocusNode? keyTextFieldFocusNode;
TextEditingController? keyTextFieldTextController;
late bool keyTextFieldVisibility;
String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator;
String? _keyTextFieldTextControllerValidator(
BuildContext context, String? val) {
if (val == null || val.isEmpty) {
return FFLocalizations.of(context).getText(
'f128ajey' /* Field is required */,
);
}
return null;
}
@override
void initState(BuildContext context) {
keyTextFieldVisibility = false;
keyTextFieldTextControllerValidator = _keyTextFieldTextControllerValidator;
}
@override
void dispose() {
keyTextFieldFocusNode?.dispose();
keyTextFieldTextController?.dispose();
}
}

View File

@ -0,0 +1,327 @@
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart';
import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'qr_code_pass_key_template_component_model.dart';
export 'qr_code_pass_key_template_component_model.dart';
class QrCodePassKeyTemplateComponentWidget extends StatefulWidget {
const QrCodePassKeyTemplateComponentWidget({
super.key,
required this.toggleActionStatus,
});
final Future Function(String key)? toggleActionStatus;
@override
State<QrCodePassKeyTemplateComponentWidget> createState() =>
_QrCodePassKeyTemplateComponentWidgetState();
}
class _QrCodePassKeyTemplateComponentWidgetState
extends State<QrCodePassKeyTemplateComponentWidget> {
late QrCodePassKeyTemplateComponentModel _model;
@override
void setState(VoidCallback callback) {
super.setState(callback);
_model.onUpdate();
}
@override
void initState() {
super.initState();
_model = createModel(context, () => QrCodePassKeyTemplateComponentModel());
_model.keyTextFieldTextController ??= TextEditingController();
_model.keyTextFieldFocusNode ??= FocusNode();
_model.keyTextFieldFocusNode!.addListener(() => setState(() {}));
}
@override
void dispose() {
_model.maybeDispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Align(
alignment: const AlignmentDirectional(0.0, 1.0),
child: Container(
width: double.infinity,
height: 300.0,
constraints: const BoxConstraints(
maxWidth: 570.0,
),
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(0.0),
bottomRight: Radius.circular(0.0),
topLeft: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well.
if (responsiveVisibility(
context: context,
phone: false,
tablet: false,
))
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
child: InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
context.safePop();
},
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
const Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0.0, 12.0, 0.0, 12.0),
child: Icon(
Icons.arrow_back_rounded,
color: Color(0xFF15161E),
size: 24.0,
),
),
Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
child: Text(
'',
style:
FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: const Color(0xFF15161E),
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
),
),
],
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text(
FFLocalizations.of(context).getText(
'h1xilful' /* DIGITE A SUA SENHA */,
),
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 24.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text(
FFLocalizations.of(context).getText(
'ujodm2ci' /* Para gerar o QR Code digite a ... */,
),
style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
Form(
key: _model.formKey,
autovalidateMode: AutovalidateMode.always,
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
child: SizedBox(
width: double.infinity,
child: TextFormField(
controller: _model.keyTextFieldTextController,
focusNode: _model.keyTextFieldFocusNode,
onChanged: (_) => EasyDebounce.debounce(
'_model.keyTextFieldTextController',
const Duration(milliseconds: 2000),
() => setState(() {}),
),
autofillHints: const [AutofillHints.password],
textCapitalization: TextCapitalization.none,
textInputAction: TextInputAction.done,
obscureText: !_model.keyTextFieldVisibility,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'rfqrdet7' /* Senha */,
),
labelStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primary,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
hintText: FFLocalizations.of(context).getText(
'zz1haydj' /* digite a sua senha..... */,
),
hintStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent3,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
filled: true,
fillColor: FlutterFlowTheme.of(context).primaryBackground,
contentPadding: const EdgeInsetsDirectional.fromSTEB(
24.0, 24.0, 20.0, 24.0),
suffixIcon: InkWell(
onTap: () => setState(
() => _model.keyTextFieldVisibility =
!_model.keyTextFieldVisibility,
),
focusNode: FocusNode(skipTraversal: true),
child: Icon(
_model.keyTextFieldVisibility
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
color: FlutterFlowTheme.of(context).accent1,
size: 22.0,
),
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
maxLength: 4,
maxLengthEnforcement: MaxLengthEnforcement.none,
buildCounter: (context,
{required currentLength,
required isFocused,
maxLength}) =>
null,
keyboardType: TextInputType.visiblePassword,
cursorColor: FlutterFlowTheme.of(context).primary,
validator: _model.keyTextFieldTextControllerValidator
.asValidator(context),
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]'))
],
),
),
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget(
onPressed: () async {
if (_model.formKey.currentState == null ||
!_model.formKey.currentState!.validate()) {
return;
}
await widget.toggleActionStatus?.call(
_model.keyTextFieldTextController.text,
);
Navigator.pop(context);
},
text: FFLocalizations.of(context).getText(
'2cybbi5p' /* Enviar */,
),
options: FFButtonOptions(
width: 270.0,
height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
iconPadding:
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
color: const Color(0xFF1AAB5F),
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
fontFamily: 'Plus Jakarta Sans',
color: Colors.white,
fontSize: 16.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
),
),
showLoadingIndicator: false,
),
),
),
],
),
),
);
}
}

View File

@ -273,6 +273,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
builder: (context) {
final visitor =
_model.visitors.map((e) => e).toList();
return ListView.builder(
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,

View File

@ -96,7 +96,8 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
TextEditingController(text: widget.visitStartDate);
_model.textFieldFocusNode2 ??= FocusNode();
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
_model.textController3 ??=
TextEditingController(text: widget.visitEndDate);
_model.textFieldFocusNode3 ??= FocusNode();
_model.textController4 ??=

View File

@ -105,3 +105,7 @@ String jsonToStr(dynamic json) {
String jsonString = jsonEncode(json);
return jsonString;
}
double getProgressValue(int percentage) {
return percentage / 100;
}

View File

@ -49,9 +49,7 @@ abstract class FlutterFlowModel<W extends Widget> {
// The widget associated with this model. This is useful for accessing the
// parameters of the widget, for example.
W? _widget;
// This will always be non-null when used, but is nullable to allow us to
// dispose of the widget in the [dispose] method (for garbage collection).
W get widget => _widget!;
W? get widget => _widget;
// Dispose methods
// Whether to dispose this model when the corresponding widget is

View File

@ -591,6 +591,7 @@ extension TextStyleHelper on TextStyle {
bool useGoogleFonts = true,
TextDecoration? decoration,
double? lineHeight,
List<Shadow>? shadows,
}) =>
useGoogleFonts
? GoogleFonts.getFont(
@ -602,6 +603,7 @@ extension TextStyleHelper on TextStyle {
fontStyle: fontStyle ?? this.fontStyle,
decoration: decoration,
height: lineHeight,
shadows: shadows,
)
: copyWith(
fontFamily: fontFamily,
@ -612,5 +614,6 @@ extension TextStyleHelper on TextStyle {
fontStyle: fontStyle,
decoration: decoration,
height: lineHeight,
shadows: shadows,
);
}

View File

@ -459,6 +459,37 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': '',
},
},
// qrCodePage
{
'vd84zgfe': {
'pt': 'Use esse QR Code para acesso',
'en': '',
},
'mxdrsbmy': {
'pt': 'Liberar QR Code',
'en': 'Release QR Code',
},
'6z6kvmhl': {
'pt': 'Certifique-se de que o QRCode está visivel para o leitor',
'en': '',
},
'wkjkxd2e': {
'pt': 'Trocando QR code em',
'en': '',
},
'3bfr2tjr': {
'pt': '20',
'en': '',
},
'ku7jqe53': {
'pt': 'QR Code de Acesso',
'en': 'Access QR Code',
},
'sejj3t8w': {
'pt': 'Home',
'en': '',
},
},
// visitorDetailsModalTemplateComponent
{
'kqzf7nx2': {
@ -767,6 +798,10 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': 'People on\nthe Property',
},
'nxssjz3q': {
'pt': 'Consultar \nHistóricos',
'en': 'Consult \nHistories',
},
'589qufkw': {
'pt': 'Histórico \nde Acesso',
'en': 'Access \nHistory',
},
@ -992,7 +1027,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
},
'74rnd5bu': {
'pt': 'Enviar',
'en': 'To send',
'en': 'Send',
},
},
// visitRequestTemplateComponent
@ -1076,6 +1111,39 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': '',
},
},
// qrCodePassKeyTemplateComponent
{
'h1xilful': {
'pt': 'DIGITE A SUA SENHA',
'en': 'ENTER YOUR PASSWORD',
},
'ujodm2ci': {
'pt':
'Para gerar o QR Code digite a senha cadastrado no aplicativo e clique em enviar.',
'en':
'To generate the QR Code, enter the password registered in the application and click send.',
},
'rfqrdet7': {
'pt': 'Senha',
'en': 'Password',
},
'zz1haydj': {
'pt': 'digite a sua senha.....',
'en': 'enter your password.....',
},
'f128ajey': {
'pt': 'Field is required',
'en': '',
},
'otk0c2pe': {
'pt': 'Please choose an option from the dropdown',
'en': '',
},
'2cybbi5p': {
'pt': 'Enviar',
'en': 'Send',
},
},
// Miscellaneous
{
'i5smty81': {

View File

@ -170,6 +170,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
name: 'welcomePage',
path: '/welcomePage',
builder: (context, params) => const WelcomePageWidget(),
),
FFRoute(
name: 'qrCodePage',
path: '/qrCodePage',
builder: (context, params) => const QrCodePageWidget(),
)
].map((r) => r.toRoute(appStateNotifier)).toList(),
);

View File

@ -153,6 +153,7 @@ enum ParamType {
FFPlace,
FFUploadedFile,
JSON,
DataStruct,
Enum,
}

View File

@ -23,3 +23,4 @@ export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget;
export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget;
export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget;
export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget;

View File

@ -80,6 +80,7 @@ class _PeopleOnThePropertyPageWidgetState
),
actions: const [],
centerTitle: true,
elevation: 0.0,
),
body: SafeArea(
top: true,
@ -105,6 +106,7 @@ class _PeopleOnThePropertyPageWidgetState
);
}
final columnGetPessoasLocalResponse = snapshot.data!;
return Builder(
builder: (context) {
final getPoepleProperty = PhpGroup.getPessoasLocalCall
@ -113,6 +115,7 @@ class _PeopleOnThePropertyPageWidgetState
)
?.toList() ??
[];
return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,

View File

@ -0,0 +1,32 @@
import '/flutter_flow/flutter_flow_util.dart';
import 'dart:async';
import 'qr_code_page_widget.dart' show QrCodePageWidget;
import 'package:flutter/material.dart';
class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
/// Local state fields for this page.
bool isAccess = false;
String? key;
DateTime? time;
/// State fields for stateful widgets in this page.
final unfocusNode = FocusNode();
@override
void initState(BuildContext context) {}
@override
void dispose() {
unfocusNode.dispose();
}
/// Action blocks.
Future qrCodeEncoder(
BuildContext context, {
required String? key,
}) async {}
}

View File

@ -0,0 +1,374 @@
import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart';
import '/flutter_flow/flutter_flow_animations.dart';
import '/flutter_flow/flutter_flow_icon_button.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart';
import 'dart:async';
import '/flutter_flow/custom_functions.dart' as functions;
import 'package:barcode_widget/barcode_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:percent_indicator/percent_indicator.dart';
import 'qr_code_page_model.dart';
export 'qr_code_page_model.dart';
class QrCodePageWidget extends StatefulWidget {
const QrCodePageWidget({super.key});
@override
State<QrCodePageWidget> createState() => _QrCodePageWidgetState();
}
class _QrCodePageWidgetState extends State<QrCodePageWidget>
with TickerProviderStateMixin {
late QrCodePageModel _model;
final scaffoldKey = GlobalKey<ScaffoldState>();
final animationsMap = <String, AnimationInfo>{};
@override
void initState() {
super.initState();
_model = createModel(context, () => QrCodePageModel());
// On page load action.
SchedulerBinding.instance.addPostFrameCallback((_) async {
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
animationsMap['barcodeOnActionTriggerAnimation']!.controller.repeat();
}
});
animationsMap.addAll({
'barcodeOnActionTriggerAnimation': AnimationInfo(
trigger: AnimationTrigger.onActionTrigger,
applyInitialState: true,
effectsBuilder: () => [
VisibilityEffect(duration: 1.ms),
BlurEffect(
curve: Curves.linear,
delay: 0.0.ms,
duration: 600.0.ms,
begin: const Offset(0.0, 0.0),
end: const Offset(4.0, 4.0),
),
],
),
});
setupAnimations(
animationsMap.values.where((anim) =>
anim.trigger == AnimationTrigger.onActionTrigger ||
!anim.applyInitialState),
this,
);
}
@override
void dispose() {
_model.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(_model.unfocusNode)
: FocusScope.of(context).unfocus(),
child: Scaffold(
key: scaffoldKey,
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
appBar: AppBar(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
automaticallyImplyLeading: false,
leading: FlutterFlowIconButton(
borderColor: Colors.transparent,
borderRadius: 30.0,
borderWidth: 1.0,
buttonSize: 60.0,
icon: Icon(
Icons.keyboard_arrow_left,
color: FlutterFlowTheme.of(context).primaryText,
size: 30.0,
),
onPressed: () async {
context.pop();
},
),
title: Text(
FFLocalizations.of(context).getText(
'ku7jqe53' /* QR Code de Acesso */,
),
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 16.0,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).headlineMediumFamily),
),
),
actions: const [],
centerTitle: true,
elevation: 0.0,
),
body: SafeArea(
top: true,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if (_model.isAccess == true)
Text(
FFLocalizations.of(context).getText(
'vd84zgfe' /* Use esse QR Code para acesso */,
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
),
Stack(
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: BarcodeWidget(
data: 'Barcode',
barcode: Barcode.qrCode(),
width: 300.0,
height: 200.0,
color: FlutterFlowTheme.of(context).primaryText,
backgroundColor: Colors.transparent,
errorBuilder: (context, error) => const SizedBox(
width: 300.0,
height: 200.0,
),
drawText: false,
).animateOnActionTrigger(
animationsMap['barcodeOnActionTriggerAnimation']!,
),
),
if (_model.isAccess == true)
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onLongPress: () async {
await _model.qrCodeEncoder(
context,
key: _model.key,
);
setState(() {});
},
child: Container(
width: 200.0,
height: 200.0,
decoration: const BoxDecoration(),
child: Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: FFButtonWidget(
onPressed: () async {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
useSafeArea: true,
context: context,
builder: (context) {
return GestureDetector(
onTap: () => _model
.unfocusNode.canRequestFocus
? FocusScope.of(context)
.requestFocus(_model.unfocusNode)
: FocusScope.of(context).unfocus(),
child: Padding(
padding:
MediaQuery.viewInsetsOf(context),
child:
QrCodePassKeyTemplateComponentWidget(
toggleActionStatus: (key) async {
_model.key = key;
setState(() {});
},
),
),
);
},
).then((value) => safeSetState(() {}));
unawaited(
() async {
await _model.qrCodeEncoder(
context,
key: _model.key,
);
setState(() {});
}(),
);
if (animationsMap[
'barcodeOnActionTriggerAnimation'] !=
null) {
animationsMap[
'barcodeOnActionTriggerAnimation']!
.controller
.reverse();
}
if (animationsMap[
'barcodeOnActionTriggerAnimation'] !=
null) {
animationsMap[
'barcodeOnActionTriggerAnimation']!
.controller
.stop();
}
_model.isAccess = !_model.isAccess;
setState(() {});
},
text: FFLocalizations.of(context).getText(
'mxdrsbmy' /* Liberar QR Code */,
),
options: FFButtonOptions(
height: 40.0,
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
iconPadding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: FlutterFlowTheme.of(context).primary,
textStyle: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily: FlutterFlowTheme.of(context)
.titleSmallFamily,
color: Colors.white,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.titleSmallFamily),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
),
borderRadius: BorderRadius.circular(8.0),
),
),
),
),
),
),
],
),
if (_model.isAccess == true)
Container(
width: 300.0,
decoration: const BoxDecoration(),
child: Visibility(
visible: _model.isAccess == true,
child: Text(
FFLocalizations.of(context).getText(
'6z6kvmhl' /* Certifique-se de que o QRCode ... */,
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
),
),
),
if (_model.isAccess == true)
Container(
width: 250.0,
height: 80.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0),
border: Border.all(
color: FlutterFlowTheme.of(context).primary,
),
),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
10.0, 0.0, 0.0, 0.0),
child: Text(
FFLocalizations.of(context).getText(
'wkjkxd2e' /* Trocando QR code em */,
),
textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodyMediumFamily,
letterSpacing: 0.0,
fontWeight: FontWeight.w600,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 20.0, 0.0),
child: CircularPercentIndicator(
percent: functions.getProgressValue(1),
radius: 30.0,
lineWidth: 7.0,
animation: true,
animateFromLastPercent: true,
progressColor: FlutterFlowTheme.of(context).primary,
backgroundColor:
FlutterFlowTheme.of(context).primaryText,
center: Text(
FFLocalizations.of(context).getText(
'3bfr2tjr' /* 20 */,
),
style: FlutterFlowTheme.of(context)
.headlineSmall
.override(
fontFamily: FlutterFlowTheme.of(context)
.headlineSmallFamily,
fontSize: 14.0,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.headlineSmallFamily),
),
),
startAngle: 20.0,
),
),
),
],
),
),
],
),
),
),
);
}
}

View File

@ -95,6 +95,7 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
),
actions: const [],
centerTitle: true,
elevation: 0.0,
),
body: SafeArea(
top: true,

View File

@ -3,6 +3,8 @@ 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 '/flutter_flow/request_manager.dart';
import 'schedule_complete_visit_page_widget.dart'
show ScheduleCompleteVisitPageWidget;
import 'package:flutter/material.dart';
@ -69,6 +71,23 @@ class ScheduleCompleteVisitPageModel
TextEditingController? textController3;
String? Function(BuildContext, String?)? textController3Validator;
/// Query cache managers for this widget.
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);
@override
void initState(BuildContext context) {}

View File

@ -89,7 +89,7 @@ class _ScheduleProvisionalVisitPageWidgetState
),
actions: const [],
centerTitle: true,
elevation: 2.0,
elevation: 0.0,
),
body: SingleChildScrollView(
child: Column(

View File

@ -26,6 +26,7 @@ dependencies:
flutter_localizations:
sdk: flutter
auto_size_text: 3.0.0
barcode_widget: 2.0.3
cached_network_image: 3.3.1
firebase_core: 3.1.0
flutter_inappwebview: 6.0.0
@ -73,6 +74,7 @@ dependencies:
path_provider_android: 2.2.5
path_provider_foundation: 2.4.0
path_provider_platform_interface: 2.1.2
percent_indicator: 4.2.2
plugin_platform_interface: 2.1.8
provider: 6.1.2
shared_preferences: 2.2.3