diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 08fca23b..a88ef9c2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ - - + :static use_modular_headers! @@ -43,3 +44,9 @@ post_install do |installer| end end end + +target 'ImageNotification' do + use_frameworks! :linkage => :static + pod 'Firebase/Messaging' + pod 'GoogleUtilities' +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5f2695cd..19a32d68 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409527A31CDE00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409227A31CDC00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409A27A31CDE00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409A27A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409527A31CDE00820AF7 /* pt */, - 6436409227A31CDC00820AF7 /* en */, + 6436409A27A31CDE00820AF7 /* pt */, + 6436409A27A31CD500820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index ed9b52db..f485c607 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -52,6 +52,11 @@ NSPhotoLibraryUsageDescription In order to upload data, this app requires permission to access the photo library. + UIBackgroundModes + + fetch + remote-notification + UILaunchStoryboardName diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 6631ffa6..2cf02109 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -2,5 +2,7 @@ + aps-environment + development diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 6cbc3c59..a5b0d07b 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,12 +1,7 @@ -import '/application_components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -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( +Future repeatVisitScheduleActionBlock( BuildContext context, { List? visitorJsonList, String? visitorStrList, @@ -56,220 +51,3 @@ Future repeatVisitScheduleAction( }.withoutNulls, ); } - -Future manageStatusColorAction( - BuildContext context, { - required String? visitStatusStr, -}) async { - if (visitStatusStr == 'A') { - return FlutterFlowTheme.of(context).success; - } else if ((visitStatusStr == 'C') || - (visitStatusStr == 'F') || - (visitStatusStr == 'B') || - (visitStatusStr == 'I')) { - return FlutterFlowTheme.of(context).error; - } - - return FlutterFlowTheme.of(context).warning; -} - -Future singInActionApp( - BuildContext context, { - String? emailAdress, - String? password, -}) async { - String? devUUID; - ApiCallResponse? loginCall; - - await Future.wait([ - Future(() async { - FFAppState().email = emailAdress!; - }), - Future(() async { - FFAppState().passwd = password!; - }), - ]); - if ((FFAppState().email != '') && - (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); - FFAppState().devUUID = devUUID!; - loginCall = await PhpGroup.loginCall.call( - email: FFAppState().email, - password: FFAppState().passwd, - uuid: FFAppState().devUUID, - type: FFAppState().device, - description: random_data.randomString( - 10, - 10, - true, - false, - false, - ), - ); - FFAppState().userUUID = PhpGroup.loginCall.userUUID( - (loginCall.jsonBody ?? ''), - )!; - if (PhpGroup.loginCall.error( - (loginCall.jsonBody ?? ''), - ) == - false) { - FFAppState().isLogged = true; - - context.goNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.loginCall.msg( - (loginCall?.jsonBody ?? ''), - )!, - ), - ); - }, - ); - - FFAppState().email = ''; - FFAppState().passwd = ''; - FFAppState().update(() {}); - } - } else { - return; - } -} - -Future signUpActionApp( - BuildContext context, { - required String? name, - String? passwd, - required String? email, - String? device, -}) async { - ApiCallResponse? registerCall; - - if ((email != null && email != '') && - (passwd != null && passwd != '') && - (name != null && name != '')) { - registerCall = await PhpGroup.registerCall.call( - name: name, - password: passwd, - email: email, - token: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - uuid: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - tipo: device, - descricao: random_data.randomString( - 36, - 36, - true, - false, - false, - ), - ); - if (PhpGroup.registerCall.error( - (registerCall.jsonBody ?? ''), - ) == - false) { - return true; - } - - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: const Text('ERROR2'), - content: const Text('ERROR2'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR2 '), - ), - ], - ); - }, - ); - return false; - } else { - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: const Text('ERROR1'), - content: const Text('ERROR1'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR1 '), - ), - ], - ); - }, - ); - return false; - } -} - -Future forgotPasswdAction( - BuildContext context, { - required String? email, -}) async { - ApiCallResponse? forgotPasswd; - - forgotPasswd = await PhpGroup.forgotPasswordCall.call( - email: email, - ); - if (PhpGroup.forgotPasswordCall.error( - (forgotPasswd.jsonBody ?? ''), - ) == - false) { - context.pushNamed( - 'LoginPage', - queryParameters: { - 'device': serializeParam( - FFAppState().device, - ParamType.String, - ), - }.withoutNulls, - ); - } else { - return; - } -} - -Future cachingLoginActionApp(BuildContext context) async { - if (FFAppState().isLogged == true) { - context.pushNamed('homePage'); - } else { - if (isAndroid == true) { - FFAppState().device = 'Android'; - } else if (isiOS == true) { - FFAppState().device = 'iOS'; - } else { - FFAppState().device = 'Web'; - } - } -} diff --git a/lib/application_components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/application_components/organism_components/local_profile_component/local_profile_component_widget.dart index ec4c3b0a..d63fabf0 100644 --- a/lib/application_components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/application_components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -2,7 +2,6 @@ import '/application_components/organism_components/bottom_arrow_linked_locals_c import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/random_data_util.dart' as random_data; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; @@ -44,107 +43,119 @@ class _LocalProfileComponentWidgetState Widget build(BuildContext context) { context.watch(); - return Visibility( - visible: random_data.randomInteger(0, 10) != null, - child: Container( - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Material( - color: Colors.transparent, - elevation: 0.0, - child: Container( - width: double.infinity, - height: 119.0, - decoration: BoxDecoration( - color: const Color(0xFF1AAB5F), - border: Border.all( - color: const Color(0xFF1AAB5F), + return Container( + height: 284.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Material( + color: Colors.transparent, + elevation: 0.0, + child: Container( + width: double.infinity, + height: 119.0, + decoration: BoxDecoration( + color: const Color(0xFF1AAB5F), + border: Border.all( + color: const Color(0xFF1AAB5F), + ), + ), + ), ), ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(2.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: const Color(0x00FFFFFF), - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: double.infinity, - child: - BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(200.0), - child: Image.network( - valueOrDefault( - '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', - ), - 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', - width: 80.0, - height: 80.0, + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Container( + width: 200.0, + height: 200.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(2.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: const Color(0x00FFFFFF), + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const SizedBox( + height: double.infinity, + child: + BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(200.0), + child: Image.network( + valueOrDefault( + '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', + ), + width: 300.0, + height: 200.0, fit: BoxFit.cover, alignment: const Alignment(0.0, 0.0), + errorBuilder: (context, error, stackTrace) => + Image.asset( + 'assets/images/error_image.svg', + width: 300.0, + height: 200.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + ), ), ), ), ), ), ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - valueOrDefault( - functions.convertToUppercase(FFAppState().local), - 'NOME DO LOCAL', - ), - style: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 20.0)) - .addToEnd(const SizedBox(width: 20.0)), + ), ), - ), + ], ), - ), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + valueOrDefault( + functions.convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ], + ), + ], ), ); } diff --git a/lib/application_components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/application_components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index 607e68af..798a0c96 100644 --- a/lib/application_components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ b/lib/application_components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -1,8 +1,10 @@ +import '/application_components/molecular_components/option_selection_modal/option_selection_modal_widget.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:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; import 'menu_list_view_component_model.dart'; export 'menu_list_view_component_model.dart'; @@ -10,13 +12,9 @@ class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, required this.changeMenuStyle, - required this.registerVisitorAction, - required this.scheduleVisitAction, }); final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorAction; - final Future Function()? scheduleVisitAction; @override State createState() => @@ -48,6 +46,8 @@ class _MenuListViewComponentWidgetState @override Widget build(BuildContext context) { + context.watch(); + return Wrap( spacing: 0.0, runSpacing: 0.0, @@ -62,46 +62,42 @@ class _MenuListViewComponentWidgetState padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), child: Container( width: double.infinity, - height: 125.0, + height: 106.0, decoration: const BoxDecoration(), child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), + padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await widget.scheduleVisitAction?.call(); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const OptionSelectionModalWidget(), + ); + }, + ).then((value) => safeSetState(() {})); }, 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -186,34 +182,36 @@ Visita */ ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await widget.registerVisitorAction?.call(); + context.pushNamed( + 'registerVisitorPage', + queryParameters: { + 'userUUID': serializeParam( + FFAppState().userUUID, + ParamType.String, + ), + 'devUUID': serializeParam( + FFAppState().devUUID, + ParamType.String, + ), + }.withoutNulls, + ); }, child: Container( width: 100.0, - height: double.infinity, + height: 0.0, 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -298,26 +296,16 @@ Visitante */ ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -400,26 +388,16 @@ Condomínio */ ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -502,26 +480,108 @@ Pet */ ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), 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, + color: FlutterFlowTheme.of(context).customColor1, + 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( + FFIcons.kvector3, + 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( + 'xlp8dyn6' /* Agendar +Visita */ + , + ), + 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(10.0, 10.0, 0.0, 1.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -603,7 +663,99 @@ de Acesso */ ), ), ), - ].divide(const SizedBox(width: 15.0)), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 1.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( + FFIcons.kfast, + 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( + '45gqx8e0' /* Agenda +Auto-Visita */ + , + ), + 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)), + ), + ), + ), + ), + ], ), ), ), diff --git a/lib/application_components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/application_components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 8fc6e479..85226519 100644 --- a/lib/application_components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/application_components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -10,14 +10,10 @@ export 'menu_staggered_view_component_model.dart'; class MenuStaggeredViewComponentWidget extends StatefulWidget { const MenuStaggeredViewComponentWidget({ super.key, - required this.changeMenuStyleAction, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, + required this.changeMenuStyle, }); - final Future Function()? changeMenuStyleAction; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; + final Future Function()? changeMenuStyle; @override State createState() => @@ -61,7 +57,7 @@ class _MenuStaggeredViewComponentWidgetState children: [ Container( width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.35, + height: 430.0, decoration: const BoxDecoration(), child: Padding( padding: const EdgeInsets.all(16.0), @@ -72,39 +68,38 @@ class _MenuStaggeredViewComponentWidgetState ), crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, - itemCount: 5, + itemCount: 7, shrinkWrap: true, itemBuilder: (context, index) { return [ - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), child: Container( width: 100.0, height: 100.0, 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -141,7 +136,7 @@ class _MenuStaggeredViewComponentWidgetState alignment: const AlignmentDirectional( 0.0, 0.0), child: Icon( - FFIcons.kvector1, + FFIcons.kfast, color: FlutterFlowTheme.of(context) .accent1, @@ -165,8 +160,8 @@ class _MenuStaggeredViewComponentWidgetState const AlignmentDirectional(0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'ee33l0ms' /* Agendar -Visita */ + 'jn7p6pj6' /* Agenda +Auto-Visita */ , ), style: FlutterFlowTheme.of(context) @@ -193,35 +188,34 @@ Visita */ ), ), ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), child: Container( width: 100.0, height: 100.0, 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, + color: FlutterFlowTheme.of(context).customColor1, width: 0.5, ), ), @@ -282,8 +276,8 @@ Visita */ const AlignmentDirectional(0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'ya37l3jt' /* Cadastrar - Visitante */ + 'yymmdtyv' /* Cadastrar +Visitante */ , ), style: FlutterFlowTheme.of(context) @@ -310,318 +304,583 @@ Visita */ ), ), ), - () => Container( - width: 100.0, - height: 100.0, - 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, + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, + 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( + FFIcons.khome, + 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( - 'h8s3adu8' /* Vincular + 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( + 'f2jbm9jz' /* Vincular Condomínio */ - , + , + ), + 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'), + ), ), - 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)), + ].divide(const SizedBox(height: 0.0)), + ), ), ), ), - () => Container( - width: 100.0, - height: 100.0, - 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, + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, + 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( + FFIcons.kpets, + 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( - 'j6tfixen' /* Cadastrar + 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( + 'rs5a7h6m' /* Cadastrar Pet */ - , + , + ), + 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'), + ), ), - 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)), + ].divide(const SizedBox(height: 0.0)), + ), ), ), ), - () => Container( - width: 100.0, - height: 100.0, - 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, + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, + 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( + FFIcons.kvector1, + 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( - '9tli4i2x' /* QR Code -de Acesso */ - , + 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( + 'if2zuaok' /* Agendar +Visita */ + , + ), + 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'), + ), ), - 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)), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => Padding( + padding: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( + FFIcons.kvector3, + 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( + 'r4mjqq6s' /* Agendar +Visita */ + , + ), + 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: EdgeInsets.all(valueOrDefault( + () { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall) { + return 0.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointMedium) { + return 24.0; + } else if (MediaQuery.sizeOf(context).width < + kBreakpointLarge) { + return 24.0; + } else { + return 0.0; + } + }(), + 0.0, + )), + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).customColor1, + 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( + FFIcons.kvector2, + 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( + 'cilu7ief' /* QR Code +de Acesso */ + , + ), + 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)), + ), ), ), ), @@ -655,7 +914,7 @@ de Acesso */ color: FlutterFlowTheme.of(context).primary, ), onPressed: () async { - await widget.changeMenuStyleAction?.call(); + await widget.changeMenuStyle?.call(); }, ), ), diff --git a/lib/application_components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/application_components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 83d530d2..df34ecea 100644 --- a/lib/application_components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/application_components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -921,6 +921,7 @@ class _ScheduleVisitDetailWidgetState extends State { await PhpGroup.postScheduleVisitCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, atividade: 'putVisita', devDesc: widget.visitObsStr, idVisitante: widget.visitorStrList, @@ -931,7 +932,6 @@ class _ScheduleVisitDetailWidgetState extends State { functions.extractIdToStr(widget.visitResonStr!), idNAC: functions.extractIdToStr(widget.visitLevelStr!), obs: widget.visitObsStr, - cliID: FFAppState().cliUUID, ); if (PhpGroup.postScheduleVisitCall.error( (_model.postScheduleVisit?.jsonBody ?? ''), diff --git a/lib/application_components/organism_components/view_visit_detail/view_visit_detail_model.dart b/lib/application_components/organism_components/view_visit_detail/view_visit_detail_model.dart index 32e250ab..883791c9 100644 --- a/lib/application_components/organism_components/view_visit_detail/view_visit_detail_model.dart +++ b/lib/application_components/organism_components/view_visit_detail/view_visit_detail_model.dart @@ -4,10 +4,12 @@ import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget; import 'package:flutter/material.dart'; class ViewVisitDetailModel extends FlutterFlowModel { + /// Local state fields for this component. + + Color? statusColor; + /// State fields for stateful widgets in this component. - // Stores action output result for [Action Block - manageStatusColorAction] action in viewVisitDetail widget. - Color? visitStatusColor; // State field(s) for TextField widget. FocusNode? textFieldFocusNode1; TextEditingController? textController1; diff --git a/lib/application_components/organism_components/view_visit_detail/view_visit_detail_widget.dart b/lib/application_components/organism_components/view_visit_detail/view_visit_detail_widget.dart index a19cff25..d48a2c31 100644 --- a/lib/application_components/organism_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/application_components/organism_components/view_visit_detail/view_visit_detail_widget.dart @@ -4,7 +4,6 @@ import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; @@ -65,14 +64,23 @@ class _ViewVisitDetailWidgetState extends State { // On component load action. SchedulerBinding.instance.addPostFrameCallback((_) async { - _model.visitStatusColor = await action_blocks.manageStatusColorAction( - context, - visitStatusStr: widget.visitStatusStr, - ); + if (widget.visitStatusStr == 'A') { + _model.statusColor = FlutterFlowTheme.of(context).primary; + setState(() {}); + } else if ((widget.visitStatusStr == 'C') || + (widget.visitStatusStr == 'F') || + (widget.visitStatusStr == 'B') || + (widget.visitStatusStr == 'I')) { + _model.statusColor = FlutterFlowTheme.of(context).error; + setState(() {}); + } else { + _model.statusColor = FlutterFlowTheme.of(context).warning; + setState(() {}); + } }); - _model.textController1 ??= TextEditingController( - text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr); + _model.textController1 ??= + TextEditingController(text: widget.visitorStrList); _model.textFieldFocusNode1 ??= FocusNode(); _model.textController2 ??= @@ -759,10 +767,7 @@ class _ViewVisitDetailWidgetState extends State { width: double.infinity, height: 35.0, decoration: BoxDecoration( - color: valueOrDefault( - _model.visitStatusColor, - FlutterFlowTheme.of(context).primary, - ), + color: _model.statusColor, borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(0.0), bottomRight: Radius.circular(0.0), diff --git a/lib/application_components/templates_components/menu_component/menu_component_model.dart b/lib/application_components/templates_components/menu_component/menu_component_model.dart index b7be1afb..1fe72b77 100644 --- a/lib/application_components/templates_components/menu_component/menu_component_model.dart +++ b/lib/application_components/templates_components/menu_component/menu_component_model.dart @@ -1,4 +1,3 @@ -import '/application_components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; import '/application_components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/application_components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -35,23 +34,4 @@ class MenuComponentModel extends FlutterFlowModel { Future changeMenuStyle(BuildContext context) async { isGrid = !isGrid; } - - Future scheduleVisitOptAction(BuildContext context) async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const OptionSelectionModalWidget(), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed('registerVisitorPage'); - } } diff --git a/lib/application_components/templates_components/menu_component/menu_component_widget.dart b/lib/application_components/templates_components/menu_component/menu_component_widget.dart index b03e32ff..b89f8671 100644 --- a/lib/application_components/templates_components/menu_component/menu_component_widget.dart +++ b/lib/application_components/templates_components/menu_component/menu_component_widget.dart @@ -50,14 +50,6 @@ class _MenuComponentWidgetState extends State { await _model.changeMenuStyle(context); setState(() {}); }, - registerVisitorAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, ), ); } else { @@ -66,18 +58,10 @@ class _MenuComponentWidgetState extends State { updateCallback: () => setState(() {}), updateOnChange: true, child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { + changeMenuStyle: () async { await _model.changeMenuStyle(context); setState(() {}); }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, ), ); } diff --git a/lib/application_components/templates_components/visit_history_component/visit_history_component_model.dart b/lib/application_components/templates_components/visit_history_component/visit_history_component_model.dart deleted file mode 100644 index 03f37209..00000000 --- a/lib/application_components/templates_components/visit_history_component/visit_history_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_history_component_widget.dart' show VisitHistoryComponentWidget; -import 'package:flutter/material.dart'; - -class VisitHistoryComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/application_components/templates_components/visit_history_component/visit_history_component_widget.dart b/lib/application_components/templates_components/visit_history_component/visit_history_component_widget.dart deleted file mode 100644 index b33ddd82..00000000 --- a/lib/application_components/templates_components/visit_history_component/visit_history_component_widget.dart +++ /dev/null @@ -1,388 +0,0 @@ -import '/application_components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/application_components/templates_components/visit_details_modal/visit_details_modal_widget.dart'; -import '/backend/api_requests/api_calls.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/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'visit_history_component_model.dart'; -export 'visit_history_component_model.dart'; - -class VisitHistoryComponentWidget extends StatefulWidget { - const VisitHistoryComponentWidget({ - super.key, - this.parameter1, - }); - - final FFUploadedFile? parameter1; - - @override - State createState() => - _VisitHistoryComponentWidgetState(); -} - -class _VisitHistoryComponentWidgetState - extends State { - late VisitHistoryComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => VisitHistoryComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const OptModalWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - }, - ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(14.0), - child: FutureBuilder( - future: PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final gridViewGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitHistory = (PhpGroup.getVisitsCall - .visitasList( - gridViewGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []) - .take(10) - .toList(); - return GridView.builder( - padding: EdgeInsets.zero, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - childAspectRatio: 1.0, - ), - scrollDirection: Axis.vertical, - itemCount: visitHistory.length, - itemBuilder: (context, visitHistoryIndex) { - final visitHistoryItem = - visitHistory[visitHistoryIndex]; - return Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(50.0), - bottomRight: Radius.circular(50.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - child: Stack( - children: [ - Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (functions.jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme.of(context) - .success; - } else if (functions - .jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of(context) - .error; - } else if (functions - .jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme.of(context) - .warning; - } else { - return FlutterFlowTheme.of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context).primary, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(10.0), - bottomRight: Radius.circular(10.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: VisitDetailsModalWidget( - visitStatusStr: getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS ''', - ).toString(), - visitStartDateStr: getJsonField( - visitHistoryItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: getJsonField( - visitHistoryItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: getJsonField( - visitHistoryItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: getJsonField( - visitHistoryItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: getJsonField( - visitHistoryItem, - r'''$.VTE_UNICA ''', - ).toString(), - visitObsStr: getJsonField( - visitHistoryItem, - r'''$.VAW_OBS''', - ).toString(), - visitorImgPath: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitHistoryItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - visitorStrList: getJsonField( - visitHistoryItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: getJsonField( - visitHistoryItem, - r'''$.VAW_ID''', - ).toString(), - visitorJsonList: PhpGroup - .getVisitsCall - .visitasList( - gridViewGetVisitsResponse - .jsonBody, - ), - updateToggleIdx: () async { - setState(() {}); - }, - repeatVisitSchedule: () async {}, - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitHistoryItem, - r'''$.VTE_DOCUMENTO''', - ).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: double.infinity, - height: double.infinity, - fit: BoxFit.cover, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Container( - width: 200.0, - height: 20.0, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (functions.jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme.of(context) - .success; - } else if (functions - .jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { - return FlutterFlowTheme.of(context) - .error; - } else if (functions - .jsonToStr(getJsonField( - visitHistoryItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme.of(context) - .warning; - } else { - return FlutterFlowTheme.of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context).primary, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - getJsonField( - visitHistoryItem, - r'''$.VTE_NOME''', - ).toString(), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .info, - fontSize: 12.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ); - }, - ); - }, - ); - }, - ), - ), - ), - ], - ), - ); - } -} diff --git a/lib/application_components/templates_components/visitor_search_component/visitor_search_component_widget.dart b/lib/application_components/templates_components/visitor_search_component/visitor_search_component_widget.dart index 42495373..15cd8948 100644 --- a/lib/application_components/templates_components/visitor_search_component/visitor_search_component_widget.dart +++ b/lib/application_components/templates_components/visitor_search_component/visitor_search_component_widget.dart @@ -5,7 +5,6 @@ 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 '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'; @@ -326,19 +325,8 @@ class _VisitorSearchComponentWidgetState ClipRRect( borderRadius: BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), + child: Image.asset( + 'assets/images/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', width: 60.0, height: 60.0, fit: BoxFit.cover, diff --git a/lib/application_pages/fast_pass_page/fast_pass_page_model.dart b/lib/application_pages/fast_pass_page/fast_pass_page_model.dart deleted file mode 100644 index 2b4d9d53..00000000 --- a/lib/application_pages/fast_pass_page/fast_pass_page_model.dart +++ /dev/null @@ -1,17 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'fast_pass_page_widget.dart' show FastPassPageWidget; -import 'package:flutter/material.dart'; - -class FastPassPageModel extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - } -} diff --git a/lib/application_pages/fast_pass_page/fast_pass_page_widget.dart b/lib/application_pages/fast_pass_page/fast_pass_page_widget.dart deleted file mode 100644 index 5edf4ae4..00000000 --- a/lib/application_pages/fast_pass_page/fast_pass_page_widget.dart +++ /dev/null @@ -1,44 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'fast_pass_page_model.dart'; -export 'fast_pass_page_model.dart'; - -class FastPassPageWidget extends StatefulWidget { - const FastPassPageWidget({super.key}); - - @override - State createState() => _FastPassPageWidgetState(); -} - -class _FastPassPageWidgetState extends State { - late FastPassPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => FastPassPageModel()); - } - - @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, - ), - ); - } -} diff --git a/lib/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_model.dart b/lib/application_pages/forgot_password_page/forgot_password_page_model.dart similarity index 100% rename from lib/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_model.dart rename to lib/application_pages/forgot_password_page/forgot_password_page_model.dart diff --git a/lib/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_widget.dart b/lib/application_pages/forgot_password_page/forgot_password_page_widget.dart similarity index 97% rename from lib/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_widget.dart rename to lib/application_pages/forgot_password_page/forgot_password_page_widget.dart index 51646517..b30452d5 100644 --- a/lib/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_widget.dart +++ b/lib/application_pages/forgot_password_page/forgot_password_page_widget.dart @@ -52,7 +52,7 @@ class _ForgotPasswordPageWidgetState extends State { children: [ if (isWeb == false) Align( - alignment: const AlignmentDirectional(-1.0, 1.0), + alignment: const AlignmentDirectional(-1.0, -1.0), child: FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, @@ -141,7 +141,7 @@ class _ForgotPasswordPageWidgetState extends State { padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'gfvplb0h' /* ESQUECEU SUA SENHA? */, + 'lpduiuif' /* ESQUECEU SUA SENHA? */, ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', @@ -158,7 +158,7 @@ class _ForgotPasswordPageWidgetState extends State { padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), child: Text( FFLocalizations.of(context).getText( - 'azssgpdi' /* Não se preucupe nós vamos te a... */, + '8t05j98w' /* Não se preucupe nós vamos te a... */, ), style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', @@ -182,7 +182,7 @@ class _ForgotPasswordPageWidgetState extends State { obscureText: false, decoration: InputDecoration( labelText: FFLocalizations.of(context).getText( - '0o139961' /* Email */, + '4gcoci7a' /* Email */, ), labelStyle: FlutterFlowTheme.of(context).labelMedium.override( @@ -195,7 +195,7 @@ class _ForgotPasswordPageWidgetState extends State { .containsKey('Plus Jakarta Sans'), ), hintText: FFLocalizations.of(context).getText( - 'aanw1fp3' /* digite o seu email..... */, + 'a7p2iikz' /* digite o seu email..... */, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( @@ -296,7 +296,7 @@ class _ForgotPasswordPageWidgetState extends State { if (shouldSetState) setState(() {}); }, text: FFLocalizations.of(context).getText( - 'e7hdgc4q' /* Enviar */, + 'z9ghb8dz' /* Enviar */, ), options: FFButtonOptions( width: 270.0, diff --git a/lib/application_pages/home_page/home_page_widget.dart b/lib/application_pages/home_page/home_page_widget.dart index cfe4a776..592e11b6 100644 --- a/lib/application_pages/home_page/home_page_widget.dart +++ b/lib/application_pages/home_page/home_page_widget.dart @@ -14,7 +14,14 @@ import 'home_page_model.dart'; export 'home_page_model.dart'; class HomePageWidget extends StatefulWidget { - const HomePageWidget({super.key}); + const HomePageWidget({ + super.key, + required this.userUUID, + required this.devUUID, + }); + + final String? userUUID; + final String? devUUID; @override State createState() => _HomePageWidgetState(); @@ -829,16 +836,7 @@ class _HomePageWidgetState extends State { FFAppState().isLogged = false; setState(() {}); - context.goNamed( - 'onBoardingPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); + context.pushNamed('WelcomePage'); }, text: FFLocalizations.of(context).getText( 'xx0db4wi' /* Sair */, @@ -846,7 +844,7 @@ class _HomePageWidgetState extends State { options: FFButtonOptions( height: 40.0, padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + 24.0, 0.0, 24.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), color: const Color(0x00D70000), @@ -900,7 +898,7 @@ class _HomePageWidgetState extends State { Expanded( child: Container( width: 100.0, - height: 100.0, + height: 120.0, decoration: const BoxDecoration( color: Color(0xFF1AAB5F), ), @@ -909,9 +907,8 @@ class _HomePageWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: const AlignmentDirectional(0.0, 0.0), child: Container( - height: 50.0, decoration: const BoxDecoration(), child: Align( alignment: const AlignmentDirectional(0.0, 0.0), @@ -935,7 +932,7 @@ class _HomePageWidgetState extends State { icon: const Icon( Icons.menu_rounded, color: Colors.white, - size: 28.0, + size: 34.0, ), onPressed: () async { scaffoldKey.currentState! @@ -1002,35 +999,10 @@ class _HomePageWidgetState extends State { ), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderColor: - FlutterFlowTheme.of(context) - .primary, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context) - .accent1, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - print('IconButton pressed ...'); - }, - ), - ), - ), + Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration(), ), ], ), diff --git a/lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_model.dart b/lib/application_pages/login_page/login_page_model.dart similarity index 65% rename from lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_model.dart rename to lib/application_pages/login_page/login_page_model.dart index 9642203c..92a3fd94 100644 --- a/lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_model.dart +++ b/lib/application_pages/login_page/login_page_model.dart @@ -1,10 +1,12 @@ +import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_in_component_widget.dart' show SignInComponentWidget; +import 'login_page_widget.dart' show LoginPageWidget; import 'package:flutter/material.dart'; -class SignInComponentModel extends FlutterFlowModel { - /// State fields for stateful widgets in this component. +class LoginPageModel extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + final unfocusNode = FocusNode(); // State field(s) for emailAddress widget. FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; @@ -14,6 +16,8 @@ class SignInComponentModel extends FlutterFlowModel { TextEditingController? passwordTextController; late bool passwordVisibility; String? Function(BuildContext, String?)? passwordTextControllerValidator; + // Stores action output result for [Backend Call - API (login)] action in signInButtonLoginForm widget. + ApiCallResponse? smallDisplayApi; @override void initState(BuildContext context) { @@ -22,6 +26,7 @@ class SignInComponentModel extends FlutterFlowModel { @override void dispose() { + unfocusNode.dispose(); emailAddressFocusNode?.dispose(); emailAddressTextController?.dispose(); diff --git a/lib/on_boarding/on_boarding_legacy/login_page/login_page_widget.dart b/lib/application_pages/login_page/login_page_widget.dart similarity index 80% rename from lib/on_boarding/on_boarding_legacy/login_page/login_page_widget.dart rename to lib/application_pages/login_page/login_page_widget.dart index ab64048d..19b87afc 100644 --- a/lib/on_boarding/on_boarding_legacy/login_page/login_page_widget.dart +++ b/lib/application_pages/login_page/login_page_widget.dart @@ -1,12 +1,15 @@ +import '/application_components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/random_data_util.dart' as random_data; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; import 'login_page_model.dart'; export 'login_page_model.dart'; @@ -88,6 +91,8 @@ class _LoginPageWidgetState extends State @override Widget build(BuildContext context) { + context.watch(); + return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) @@ -141,26 +146,28 @@ class _LoginPageWidgetState extends State child: Text( FFLocalizations.of(context) .getText( - '0113wf5c' /* VAMOS LA! ENTRE COM A SUA CONT... */, + 'uem0mca5' /* VAMOS LA! ENTRE COM A SUA CONT... */, ), textAlign: TextAlign.start, - style: FlutterFlowTheme.of( - context) - .displaySmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), + style: + FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.normal, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), ), ), ), @@ -236,7 +243,7 @@ class _LoginPageWidgetState extends State FFLocalizations.of( context) .getText( - 'f2go5a71' /* Email */, + '90ls8ppo' /* Email */, ), labelStyle: FlutterFlowTheme.of( @@ -364,7 +371,7 @@ class _LoginPageWidgetState extends State FFLocalizations.of( context) .getText( - 'paon3y0v' /* Senha */, + 'rvlumyaw' /* Senha */, ), labelStyle: FlutterFlowTheme.of( @@ -507,21 +514,182 @@ class _LoginPageWidgetState extends State child: FFButtonWidget( onPressed: () async { - await action_blocks - .singInActionApp( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); + var shouldSetState = + false; + await Future + .wait([ + Future( + () async { + FFAppState() + .email = + _model + .emailAddressTextController + .text; + setState( + () {}); + }), + Future( + () async { + FFAppState() + .passwd = + _model + .passwordTextController + .text; + setState( + () {}); + }), + ]); + if ((FFAppState() + .email != + '') && + (FFAppState() + .passwd != + '')) { + FFAppState() + .devUUID = + random_data + .randomString( + 36, + 36, + false, + false, + true, + ); + setState(() {}); + _model.smallDisplayApi = + await PhpGroup + .loginCall + .call( + email: + FFAppState() + .email, + password: + FFAppState() + .passwd, + uuid: FFAppState() + .devUUID, + type: FFAppState() + .device, + description: + '', + ); + shouldSetState = + true; + FFAppState() + .userUUID = + PhpGroup + .loginCall + .userUUID( + (_model.smallDisplayApi + ?.jsonBody ?? + ''), + )!; + setState(() {}); + if (PhpGroup + .loginCall + .error( + (_model.smallDisplayApi + ?.jsonBody ?? + ''), + ) == + false) { + FFAppState() + .isLogged = + true; + setState( + () {}); + + context + .goNamed( + 'homePage', + queryParameters: + { + 'userUUID': + serializeParam( + FFAppState() + .userUUID, + ParamType + .String, + ), + 'devUUID': + serializeParam( + FFAppState() + .devUUID, + ParamType + .String, + ), + }.withoutNulls, + extra: { + kTransitionInfoKey: + const TransitionInfo( + hasTransition: + true, + transitionType: + PageTransitionType.fade, + ), + }, + ); + } else { + await showModalBottomSheet( + isScrollControlled: + true, + backgroundColor: + Colors + .transparent, + enableDrag: + false, + 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: + ThrowExceptionWidget( + msg: + PhpGroup.loginCall.msg( + (_model.smallDisplayApi?.jsonBody ?? ''), + )!, + ), + ), + ); + }, + ).then((value) => + safeSetState( + () {})); + + setState(() { + _model + .emailAddressTextController + ?.clear(); + _model + .passwordTextController + ?.clear(); + }); + } + } else { + if (shouldSetState) { + setState( + () {}); + } + return; + } + + if (shouldSetState) { + setState(() {}); + } }, text: FFLocalizations .of(context) .getText( - 'wmbzwstw' /* Entrar */, + '2d3903lt' /* Entrar */, ), options: FFButtonOptions( @@ -596,7 +764,7 @@ class _LoginPageWidgetState extends State text: FFLocalizations .of(context) .getText( - 'j8567afe' /* Cadastrar */, + 'zj6pyujp' /* Cadastrar */, ), options: FFButtonOptions( @@ -682,7 +850,7 @@ class _LoginPageWidgetState extends State text: FFLocalizations .of(context) .getText( - 'y3wd9q18' /* Entrar */, + 'iqhyif1d' /* Entrar */, ), options: FFButtonOptions( @@ -763,7 +931,7 @@ class _LoginPageWidgetState extends State text: FFLocalizations .of(context) .getText( - 'j6ufb6sq' /* Cadastrar */, + '5x5bp2u1' /* Cadastrar */, ), options: FFButtonOptions( @@ -860,7 +1028,7 @@ class _LoginPageWidgetState extends State text: FFLocalizations .of(context) .getText( - 'h85112qs' /* Você esqueceu a sua senha? */, + '1fqjz9q7' /* Você esqueceu a sua senha? */, ), style: TextStyle( color: FlutterFlowTheme @@ -872,7 +1040,7 @@ class _LoginPageWidgetState extends State text: FFLocalizations .of(context) .getText( - 'di48hdaj' /* Recupere aqui */, + '7miyd406' /* Recupere aqui */, ), style: FlutterFlowTheme .of(context) @@ -938,7 +1106,7 @@ class _LoginPageWidgetState extends State ), Text( FFLocalizations.of(context).getText( - 'gx2fp6zq' /* Termo de Uso */, + '63xv5ewj' /* Termo de Uso */, ), style: FlutterFlowTheme.of(context) .bodyMedium diff --git a/lib/on_boarding/on_boarding_legacy/register_page/register_page_model.dart b/lib/application_pages/register_page/register_page_model.dart similarity index 89% rename from lib/on_boarding/on_boarding_legacy/register_page/register_page_model.dart rename to lib/application_pages/register_page/register_page_model.dart index 4583ef8e..46bc3a25 100644 --- a/lib/on_boarding/on_boarding_legacy/register_page/register_page_model.dart +++ b/lib/application_pages/register_page/register_page_model.dart @@ -1,3 +1,4 @@ +import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'register_page_widget.dart' show RegisterPageWidget; import 'package:flutter/material.dart'; @@ -32,6 +33,8 @@ class RegisterPageModel extends FlutterFlowModel { late bool passwordRegisterFormVisibility; String? Function(BuildContext, String?)? passwordRegisterFormTextControllerValidator; + // Stores action output result for [Backend Call - API (register)] action in SignUpButtonRegisterForm widget. + ApiCallResponse? registerCall; @override void initState(BuildContext context) { diff --git a/lib/on_boarding/on_boarding_legacy/register_page/register_page_widget.dart b/lib/application_pages/register_page/register_page_widget.dart similarity index 81% rename from lib/on_boarding/on_boarding_legacy/register_page/register_page_widget.dart rename to lib/application_pages/register_page/register_page_widget.dart index da8f34cc..16a5ef67 100644 --- a/lib/on_boarding/on_boarding_legacy/register_page/register_page_widget.dart +++ b/lib/application_pages/register_page/register_page_widget.dart @@ -1,15 +1,15 @@ +import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/random_data_util.dart' as random_data; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; import 'register_page_model.dart'; export 'register_page_model.dart'; @@ -108,8 +108,6 @@ class _RegisterPageWidgetState extends State @override Widget build(BuildContext context) { - context.watch(); - return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) @@ -160,7 +158,7 @@ class _RegisterPageWidgetState extends State padding: const EdgeInsets.all(4.0), child: Text( FFLocalizations.of(context).getText( - '2d8uulm3' /* INSIRA SEU EMAIL E SENHA, VAMO... */, + 'oxy0n1p4' /* INSIRA SEU EMAIL E SENHA, VAMO... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) @@ -173,7 +171,7 @@ class _RegisterPageWidgetState extends State .primaryText, fontSize: 24.0, letterSpacing: 0.0, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.normal, useGoogleFonts: GoogleFonts .asMap() .containsKey( @@ -256,7 +254,7 @@ class _RegisterPageWidgetState extends State FFLocalizations.of( context) .getText( - '8kjhi406' /* Nome */, + 'w0y3fz89' /* Nome */, ), labelStyle: FlutterFlowTheme .of(context) @@ -398,7 +396,7 @@ class _RegisterPageWidgetState extends State FFLocalizations.of( context) .getText( - 'ro4zkkxp' /* Email */, + '4bfdpd0o' /* Email */, ), labelStyle: FlutterFlowTheme .of(context) @@ -541,7 +539,7 @@ class _RegisterPageWidgetState extends State FFLocalizations.of( context) .getText( - 'lzgobioa' /* Senha */, + 'byjglkpk' /* Senha */, ), labelStyle: FlutterFlowTheme .of(context) @@ -667,25 +665,171 @@ class _RegisterPageWidgetState extends State 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: () async { - await action_blocks - .signUpActionApp( - context, - name: _model - .nameRegisterFormTextController - .text, - passwd: _model - .passwordRegisterFormTextController - .text, - email: _model - .emailRegisterFormTextController - .text, - device: FFAppState().device, - ); + await Future.wait([ + Future(() async { + setState(() { + _model.emailRegisterFormTextController + ?.text = + _model + .emailRegisterFormTextController + .text; + }); + }), + Future(() async { + setState(() { + _model.passwordRegisterFormTextController + ?.text = + _model + .passwordRegisterFormTextController + .text; + }); + }), + Future(() async { + setState(() { + _model.nameRegisterFormTextController + ?.text = + _model + .nameRegisterFormTextController + .text; + }); + }), + ]); + if ((_model.emailRegisterFormTextController.text != '') && + (_model.passwordRegisterFormTextController + .text != + '') && + (_model.nameRegisterFormTextController + .text != + '')) { + _model.registerCall = + await PhpGroup + .registerCall + .call( + name: _model + .nameRegisterFormTextController + .text, + password: _model + .passwordRegisterFormTextController + .text, + email: _model + .emailRegisterFormTextController + .text, + token: random_data + .randomString( + 36, + 36, + false, + false, + true, + ), + uuid: random_data + .randomString( + 36, + 36, + false, + false, + true, + ), + tipo: _model.device, + descricao: random_data + .randomString( + 36, + 36, + true, + false, + false, + ), + ); + if (PhpGroup.registerCall + .error( + (_model.registerCall + ?.jsonBody ?? + ''), + ) == + false) { + context.goNamed( + 'LoginPage', + queryParameters: { + 'device': + serializeParam( + '', + ParamType.String, + ), + }.withoutNulls, + extra: { + kTransitionInfoKey: + const TransitionInfo( + hasTransition: true, + transitionType: + PageTransitionType + .fade, + ), + }, + ); + } else { + await showDialog( + context: context, + builder: + (alertDialogContext) { + return AlertDialog( + title: + const Text('ERROR2'), + content: + const Text('ERROR2'), + actions: [ + TextButton( + onPressed: () => + Navigator.pop( + alertDialogContext), + child: const Text( + 'ERROR2 '), + ), + ], + ); + }, + ); + setState(() { + _model + .passwordRegisterFormTextController + ?.clear(); + _model + .emailRegisterFormTextController + ?.clear(); + _model + .nameRegisterFormTextController + ?.clear(); + }); + } + } else { + await showDialog( + context: context, + builder: + (alertDialogContext) { + return AlertDialog( + title: const Text('ERROR1'), + content: + const Text('ERROR1'), + actions: [ + TextButton( + onPressed: () => + Navigator.pop( + alertDialogContext), + child: const Text( + 'ERROR1 '), + ), + ], + ); + }, + ); + } + + setState(() {}); }, text: FFLocalizations.of(context) .getText( - 'c7sfyeh8' /* Cadastrar-se */, + 'w9vrsnmf' /* Cadastrar-se */, ), options: FFButtonOptions( width: double.infinity, @@ -765,7 +909,7 @@ class _RegisterPageWidgetState extends State FFLocalizations.of( context) .getText( - 'jglpa1tr' /* Você já tem uma conta? */, + 'zep60lcd' /* Você já tem uma conta? */, ), style: TextStyle( color: FlutterFlowTheme @@ -778,7 +922,7 @@ class _RegisterPageWidgetState extends State FFLocalizations.of( context) .getText( - 'hfcm0td9' /* Clique aqui */, + 'tl8k1ld9' /* Clique aqui */, ), style: FlutterFlowTheme.of( @@ -836,7 +980,7 @@ class _RegisterPageWidgetState extends State ), Text( FFLocalizations.of(context).getText( - 'c3kno4t9' /* Termo de Uso */, + 'dbtzii7i' /* Termo de Uso */, ), style: FlutterFlowTheme.of(context) .bodyMedium diff --git a/lib/application_pages/register_visitor_page/register_visitor_page_widget.dart b/lib/application_pages/register_visitor_page/register_visitor_page_widget.dart index cb72f361..bd438bfb 100644 --- a/lib/application_pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/application_pages/register_visitor_page/register_visitor_page_widget.dart @@ -14,7 +14,14 @@ import 'register_visitor_page_model.dart'; export 'register_visitor_page_model.dart'; class RegisterVisitorPageWidget extends StatefulWidget { - const RegisterVisitorPageWidget({super.key}); + const RegisterVisitorPageWidget({ + super.key, + required this.userUUID, + required this.devUUID, + }); + + final String? userUUID; + final String? devUUID; @override State createState() => diff --git a/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 061b4853..e3316b73 100644 --- a/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -1,14 +1,16 @@ -import '/components/select_header_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; import 'schedule_complete_visit_page_widget.dart' show ScheduleCompleteVisitPageWidget; +import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { /// Local state fields for this page. + bool toggleIdx = true; + List visitorJsonList = []; void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); @@ -24,10 +26,11 @@ class ScheduleCompleteVisitPageModel /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - // Model for selectHeaderComponent component. - late SelectHeaderComponentModel selectHeaderComponentModel; - // Stores action output result for [Action Block - toggleCurrentSelectionHeader] action in selectHeaderComponent widget. - bool? toggleIndexValue; + // State field(s) for Carousel widget. + CarouselController? carouselController; + + int carouselCurrentIndex = 1; + // State field(s) for TextField widget. FocusNode? textFieldFocusNode1; TextEditingController? textController1; @@ -52,15 +55,11 @@ class ScheduleCompleteVisitPageModel String? Function(BuildContext, String?)? textController3Validator; @override - void initState(BuildContext context) { - selectHeaderComponentModel = - createModel(context, () => SelectHeaderComponentModel()); - } + void initState(BuildContext context) {} @override void dispose() { unfocusNode.dispose(); - selectHeaderComponentModel.dispose(); textFieldFocusNode1?.dispose(); textController1?.dispose(); @@ -70,23 +69,4 @@ class ScheduleCompleteVisitPageModel textFieldFocusNode3?.dispose(); textController3?.dispose(); } - - /// Action blocks. - Future getVisitorsActionPage( - BuildContext context, { - List? visitorsJsonList, - }) async { - visitorJsonList = visitorsJsonList!.toList().cast(); - } - - Future toggleCurrentSelectionHeader( - BuildContext context, { - required bool? toggleIndexValue, - }) async { - if (toggleIndexValue == true) { - return true; - } - - return false; - } } diff --git a/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 71159cbe..52258ac8 100644 --- a/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/application_pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -4,7 +4,6 @@ import '/application_components/templates_components/visit_details_modal/visit_d import '/application_components/templates_components/visitor_details_modal/visitor_details_modal_widget.dart'; import '/application_components/templates_components/visitor_search_component/visitor_search_component_widget.dart'; import '/backend/api_requests/api_calls.dart'; -import '/components/select_header_component_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -12,8 +11,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/custom_functions.dart' as functions; -import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -83,13 +82,16 @@ class _ScheduleCompleteVisitPageWidgetState } }); - _model.textController1 ??= TextEditingController(); + _model.textController1 ??= TextEditingController( + text: widget.visitStartDateStr != null && widget.visitStartDateStr != '' + ? widget.visitStartDateStr + : ''); _model.textFieldFocusNode1 ??= FocusNode(); _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); - _model.switchValue = true; + _model.switchValue = false; _model.textController3 ??= TextEditingController(); _model.textFieldFocusNode3 ??= FocusNode(); } @@ -112,209 +114,275 @@ class _ScheduleCompleteVisitPageWidgetState 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( - '61lcxdgm' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ), - body: SafeArea( - top: true, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - wrapWithModel( - model: _model.selectHeaderComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: SelectHeaderComponentWidget( - toggleIndexValue: _model.toggleIndexValue, - selectToggle: (toggleIndex) async { - _model.toggleIndexValue = - await _model.toggleCurrentSelectionHeader( - context, - toggleIndexValue: toggleIndex, - ); - - setState(() {}); - }, - ), - ), - if (valueOrDefault( - _model.toggleIndexValue == true, - true, - )) - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Stack( - children: [ - Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, + body: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 30.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + _model.toggleIdx = true; + setState(() {}); + }, + child: Container( + width: 100.0, + height: 40.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(100.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(100.0), ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'qo0pg2at' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'e4w9lbke' /* Criar Agendamento */, + ), + 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), + ), + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + _model.toggleIdx = false; + setState(() {}); + }, + child: Container( + width: 100.0, + height: 40.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(100.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(100.0), + topRight: Radius.circular(0.0), + ), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '47bsumoy' /* Histórico de Visitas */, + ), + 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), + ), + ), + ), + ), + ), + ), + ], + ), + ), + Builder( + builder: (context) { + if (_model.toggleIdx == true) { + return Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 20.0, 0.0, 20.0), + child: Text( + FFLocalizations.of(context).getText( + '15ekd1ge' /* Agendar Visita */, + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito', + fontSize: 21.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ), + ], + ), + ), + Stack( + children: [ + Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Divider( + thickness: 0.5, + color: + FlutterFlowTheme.of(context).accent1, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'qo0pg2at' /* Quais visitantes você deseja c... */, ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = _model - .visitorJsonList - .map((e) => e) - .toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 0, - 20.0, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, - visitorListViewIndex) { - final visitorListViewItem = - visitorListView[ - visitorListViewIndex]; - return InkWell( - splashColor: - Colors.transparent, - focusColor: - Colors.transparent, - hoverColor: - Colors.transparent, - highlightColor: - Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, - 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: - const VisitorDetailsModalWidget(), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - onLongPress: () async { - _model - .removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - child: Container( - width: 100.0, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: - Clip.antiAlias, - decoration: - const BoxDecoration( - shape: - BoxShape.circle, - ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorList = _model + .visitorJsonList + .map((e) => e) + .toList(); + return SizedBox( + width: double.infinity, + height: 180.0, + child: CarouselSlider.builder( + itemCount: visitorList.length, + itemBuilder: (context, + visitorListIndex, _) { + final visitorListItem = + visitorList[ + visitorListIndex]; + return Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 20.0), + child: InkWell( + splashColor: + Colors.transparent, + focusColor: + Colors.transparent, + hoverColor: + Colors.transparent, + highlightColor: + Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: + true, + backgroundColor: + Colors + .transparent, + enableDrag: false, + 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: + const VisitorDetailsModalWidget(), + ), + ); + }, + ).then((value) => + safeSetState( + () {})); + }, + onLongPress: () async { + _model.removeFromVisitorJsonList( + visitorListItem); + setState(() {}); + }, + child: ClipRRect( + borderRadius: + BorderRadius + .circular( + 8.0), child: CachedNetworkImage( fadeInDuration: @@ -329,1310 +397,185 @@ class _ScheduleCompleteVisitPageWidgetState valueOrDefault< String>( 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, + visitorListItem, r'''$.VTE_DOCUMENTO''', ).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: 200.0, + height: 100.0, fit: BoxFit.cover, ), ), - Column( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_TIPO''', - ).toString(), - 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( - width: 30.0)) - .addToStart(const SizedBox( - width: 30.0)), - ), - ), - ); - }, - ); - }, - ), - Stack( - children: [ - Align( - alignment: - const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - enableDrag: false, - 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: - VisitorSearchComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast< - dynamic>(); - setState(() {}); - }, - getDocs: - (docsParam) async { - _model.visitorStrList = - functions.strListToStr( - docsParam! - .toList()); - setState(() {}); - }, - ), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of( - context) - .primary, - size: 30.0, - ), - options: FFButtonOptions( - width: - MediaQuery.sizeOf(context) - .width * - 0.8, - height: 80.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB(14.0, 0.0, - 0.0, 20.0), - color: FlutterFlowTheme.of( - context) - .primaryBackground, - textStyle: FlutterFlowTheme - .of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .titleSmallFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .titleSmallFamily), ), - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .accent4, - width: 1.0, + ); + }, + carouselController: _model + .carouselController ??= + CarouselController(), + options: CarouselOptions( + initialPage: max( + 0, + min( + 1, + visitorList.length - + 1)), + viewportFraction: 0.5, + disableCenter: true, + enlargeCenterPage: true, + enlargeFactor: 0.25, + enableInfiniteScroll: true, + scrollDirection: + Axis.horizontal, + autoPlay: false, + onPageChanged: (index, _) => + _model.carouselCurrentIndex = + index, ), - borderRadius: - BorderRadius.circular( - 8.0), ), - ), - ), + ); + }, ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width * - 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context) - .getText( - 'i0jhuu3e' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium + ], + ), + Stack( + children: [ + Align( + alignment: + const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + enableDrag: false, + 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: + VisitorSearchComponentWidget( + getVisitors: + (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast< + dynamic>(); + setState(() {}); + }, + getDocs: + (docsParam) async { + _model.visitorStrList = + functions.strListToStr( + docsParam! + .toList()); + setState(() {}); + }, + ), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + text: '', + icon: Icon( + Icons.add, + color: + FlutterFlowTheme.of(context) + .primary, + size: 30.0, + ), + options: FFButtonOptions( + width: 300.0, + height: 80.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(14.0, 0.0, + 0.0, 20.0), + color: + FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: + FlutterFlowTheme.of(context) + .titleSmall .override( fontFamily: FlutterFlowTheme.of( context) - .bodyMediumFamily, + .titleSmallFamily, color: FlutterFlowTheme .of(context) .primaryText, + fontSize: 16.0, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of( context) - .bodyMediumFamily), + .titleSmallFamily), ), - ), + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .primary, + width: 1.0, ), + borderRadius: + BorderRadius.circular(8.0), ), ), ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'z4ry3tge' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'hjp5mzbd' /* Inicio da Visita */, - ), - style: FlutterFlowTheme.of( - context) + 0.0, 50.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'i0jhuu3e' /* Clique para adicionar um visit... */, + ), + style: + FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of( context) .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 24.0, - 0.0), - child: TextFormField( - controller: _model - .textController1, - focusNode: _model - .textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: - InputDecoration( - isDense: true, - 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), - ), - hintText: - FFLocalizations.of( - context) - .getText( - 'ce6xryf4' /* Quando você inicia a visita? */, - ), - 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), - lineHeight: - 1.0, - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme - .of(context) - .accent1, - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: - 1.0, - ), - textAlign: - TextAlign.center, - validator: _model - .textController1Validator - .asValidator( - context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 24.0, - 0.0), - child: InkWell( - splashColor: - Colors.transparent, - focusColor: - Colors.transparent, - hoverColor: - Colors.transparent, - highlightColor: - Colors.transparent, - onTap: () async { - final datePicked1Date = - await showDatePicker( - context: context, - initialDate: - getCurrentTimestamp, - firstDate: - getCurrentTimestamp, - lastDate: - DateTime(2050), - builder: (context, - child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: - 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? - datePicked1Time; - if (datePicked1Date != - null) { - datePicked1Time = - await showTimePicker( - context: context, - initialTime: TimeOfDay - .fromDateTime( - getCurrentTimestamp), - builder: (context, - child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: - 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: - 24.0, - ); - }, - ); - } - - if (datePicked1Date != - null && - datePicked1Time != - null) { - safeSetState(() { - _model.datePicked1 = - DateTime( - datePicked1Date - .year, - datePicked1Date - .month, - datePicked1Date - .day, - datePicked1Time! - .hour, - datePicked1Time - .minute, - ); - }); - } - setState(() { - _model.textController1 - ?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model - .datePicked1, - locale: FFLocalizations - .of(context) - .languageCode, - ); - }); - }, - child: Container( - width: - double.infinity, - height: 55.0, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'jwsbk0xu' /* Fim da Visita */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 24.0, - 0.0), - child: TextFormField( - controller: _model - .textController2, - focusNode: _model - .textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: - InputDecoration( - isDense: true, - 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), - ), - hintText: - FFLocalizations.of( - context) - .getText( - 'lyfe46f6' /* Quando a visita terminá? */, - ), - 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), - lineHeight: - 1.0, - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius - .circular( - 8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme - .of(context) - .accent1, - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: - 1.0, - ), - textAlign: - TextAlign.center, - validator: _model - .textController2Validator - .asValidator( - context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 24.0, - 0.0), - child: InkWell( - splashColor: - Colors.transparent, - focusColor: - Colors.transparent, - hoverColor: - Colors.transparent, - highlightColor: - Colors.transparent, - onTap: () async { - final datePicked2Date = - await showDatePicker( - context: context, - initialDate: - getCurrentTimestamp, - firstDate: - getCurrentTimestamp, - lastDate: - DateTime(2050), - builder: (context, - child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: - 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? - datePicked2Time; - if (datePicked2Date != - null) { - datePicked2Time = - await showTimePicker( - context: context, - initialTime: TimeOfDay - .fromDateTime( - getCurrentTimestamp), - builder: (context, - child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: - 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: - 24.0, - ); - }, - ); - } - - if (datePicked2Date != - null && - datePicked2Time != - null) { - safeSetState(() { - _model.datePicked2 = - DateTime( - datePicked2Date - .year, - datePicked2Date - .month, - datePicked2Date - .day, - datePicked2Time! - .hour, - datePicked2Time - .minute, - ); - }); - } - setState(() { - _model.textController2 - ?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model - .datePicked2, - locale: FFLocalizations - .of(context) - .languageCode, - ); - }); - }, - child: Container( - width: - double.infinity, - height: 39.0, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'p81uol2v' /* Quais são os motivos da visita... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'bbauep0b' /* Motivo da Visita */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder< - ApiCallResponse>( - future: PhpGroup.getDadosCall - .call( - devUUID: - FFAppState().devUUID, - userUUID: - FFAppState().userUUID, - cliUUID: - FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme - .of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown< - String>( - controller: _model - .dropDownValueController1 ??= - FormFieldController< - String>( - _model.dropDownValue1 ??= - '', - ), - options: List< - String>.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => - e.toString()) - .toList()), - optionLabels: PhpGroup - .getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse - .jsonBody, - )!, - onChanged: (val) => - setState(() => _model - .dropDownValue1 = - val), - width: double.infinity, - height: double.infinity, - textStyle: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of( - context) - .getText( - 'x1ij847i' /* Escolha um motivo aqui */, - ), - icon: Icon( - Icons - .keyboard_arrow_down_rounded, color: FlutterFlowTheme.of( context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of( - context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional - .fromSTEB( - 16.0, - 0.0, - 16.0, - 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'etzbm8l5' /* Nível de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, + .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() @@ -1641,290 +584,62 @@ class _ScheduleCompleteVisitPageWidgetState context) .bodyMediumFamily), ), - ), - ), ), ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder< - ApiCallResponse>( - future: PhpGroup.getDadosCall - .call( - devUUID: - FFAppState().devUUID, - userUUID: - FFAppState().userUUID, - cliUUID: - FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme - .of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown< - String>( - controller: _model - .dropDownValueController2 ??= - FormFieldController< - String>( - _model.dropDownValue2 ??= - '', - ), - options: List< - String>.from( - PhpGroup.getDadosCall - .levelJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => - e.toString()) - .toList()), - optionLabels: PhpGroup - .getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse - .jsonBody, - )!, - onChanged: (val) => - setState(() => _model - .dropDownValue2 = - val), - width: double.infinity, - height: double.infinity, - textStyle: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of( - context) - .getText( - 'kmgv5j7x' /* Escolha um nível de acesso aqu... */, - ), - icon: Icon( - Icons - .keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of( - context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional - .fromSTEB( - 16.0, - 0.0, - 16.0, - 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), + ), + ], + ), + Divider( + thickness: 0.5, + color: + FlutterFlowTheme.of(context).accent1, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'z4ry3tge' /* Qual o período de validade da ... */, ), - ], + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( + ), + Stack( + children: [ + Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'mddp33o0' /* Visita se encerra após o prime... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '68j9gw4h' /* Visita única */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch.adaptive( - value: _model.switchValue!, - onChanged: (newValue) async { - setState(() => _model - .switchValue = newValue); - }, - activeColor: - FlutterFlowTheme.of(context) - .success, - activeTrackColor: - FlutterFlowTheme.of(context) - .customColor4, - inactiveTrackColor: - FlutterFlowTheme.of(context) - .customColor4, - inactiveThumbColor: - FlutterFlowTheme.of(context) - .error, - ), - ], - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '9rudpkq7' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - 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), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, + 24.0, 50.0, 24.0, 0.0), child: TextFormField( - controller: _model.textController3, + controller: _model.textController1, focusNode: - _model.textFieldFocusNode3, + _model.textFieldFocusNode1, autofocus: false, - textInputAction: - TextInputAction.next, obscureText: false, decoration: InputDecoration( - isDense: true, labelText: FFLocalizations.of(context) .getText( - '4rgpxrfe' /* Observações da Visita */, + '9mg9nv2j' /* Ínicio da Visita */, ), labelStyle: FlutterFlowTheme.of(context) @@ -1949,7 +664,7 @@ class _ScheduleCompleteVisitPageWidgetState hintText: FFLocalizations.of(context) .getText( - '7knytis2' /* Escreva as suas observações aq... */, + 'y5s85khj' /* Quando a visitas se inicia? */, ), hintStyle: FlutterFlowTheme.of(context) @@ -1975,11 +690,11 @@ class _ScheduleCompleteVisitPageWidgetState borderSide: BorderSide( color: FlutterFlowTheme.of( context) - .accent4, + .accent1, width: 0.5, ), borderRadius: - BorderRadius.circular(10.0), + BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( @@ -1989,7 +704,7 @@ class _ScheduleCompleteVisitPageWidgetState width: 0.5, ), borderRadius: - BorderRadius.circular(10.0), + BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( @@ -1999,7 +714,7 @@ class _ScheduleCompleteVisitPageWidgetState width: 0.5, ), borderRadius: - BorderRadius.circular(10.0), + BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( @@ -2010,10 +725,10 @@ class _ScheduleCompleteVisitPageWidgetState width: 0.5, ), borderRadius: - BorderRadius.circular(10.0), + BorderRadius.circular(8.0), ), suffixIcon: Icon( - Icons.text_fields, + Icons.hourglass_top, color: FlutterFlowTheme.of(context) .accent1, @@ -2026,9 +741,6 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() @@ -2037,500 +749,1597 @@ class _ScheduleCompleteVisitPageWidgetState context) .bodyMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, + textAlign: TextAlign.center, validator: _model - .textController3Validator + .textController1Validator .asValidator(context), ), ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 50.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = + await showDatePicker( + context: context, + initialDate: + getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = + await showTimePicker( + context: context, + initialTime: + TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + _model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + setState(() { + _model.textController1?.text = + dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked1, + locale: FFLocalizations.of( + context) + .languageCode, + ); + }); + }, + child: Container( + width: double.infinity, + height: 50.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + Stack( + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 50.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: + _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: + FFLocalizations.of(context) + .getText( + '4o0cbb70' /* Término da Visita */, + ), + 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), + ), + hintText: + FFLocalizations.of(context) + .getText( + 'bhmgddc4' /* Quando a visita terminá? */, + ), + 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( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .accent1, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(8.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.hourglass_bottom, + color: + FlutterFlowTheme.of(context) + .accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model + .textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 50.0, 24.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = + await showDatePicker( + context: context, + initialDate: + getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = + await showTimePicker( + context: context, + initialTime: + TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + _model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + setState(() { + _model.textController2?.text = + dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked2, + locale: FFLocalizations.of( + context) + .languageCode, + ); + }); + }, + child: Container( + width: double.infinity, + height: 50.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + Divider( + thickness: 0.5, + color: + FlutterFlowTheme.of(context).accent1, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'p81uol2v' /* Quais são os motivos da visita... */, + ), + textAlign: TextAlign.start, + 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), + ), + ), ), - ], - ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 20.0, 0.0, 0.0), + child: FutureBuilder< + ApiCallResponse>( + future: + PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: + FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme + .of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + return FlutterFlowDropDown< + String>( + controller: _model + .dropDownValueController1 ??= + FormFieldController< + String>( + _model.dropDownValue1 ??= + '', + ), + options: List.from( + PhpGroup.getDadosCall + .reasonsJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => + e.toString()) + .toList()), + optionLabels: PhpGroup + .getDadosCall + .reasonsMotDescStrList( + dropDownGetDadosResponse + .jsonBody, + )!, + onChanged: (val) => + setState(() => _model + .dropDownValue1 = + val), + width: 300.0, + height: 56.0, + textStyle: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of( + context) + .getText( + 'x1ij847i' /* Escolha um motivo aqui */, + ), + icon: Icon( + Icons + .keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0, + ), + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + elevation: 2.0, + borderColor: + FlutterFlowTheme.of( + context) + .accent1, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional + .fromSTEB(16.0, 4.0, + 16.0, 4.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 20.0, 0.0, 20.0), + child: FutureBuilder< + ApiCallResponse>( + future: + PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: + FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme + .of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + return FlutterFlowDropDown< + String>( + controller: _model + .dropDownValueController2 ??= + FormFieldController< + String>( + _model.dropDownValue2 ??= + '', + ), + options: List.from( + PhpGroup.getDadosCall + .levelJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => + e.toString()) + .toList()), + optionLabels: PhpGroup + .getDadosCall + .levelNACDescricaoStrList( + dropDownGetDadosResponse + .jsonBody, + )!, + onChanged: (val) => + setState(() => _model + .dropDownValue2 = + val), + width: 300.0, + height: 56.0, + textStyle: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of( + context) + .getText( + 'kmgv5j7x' /* Escolha um nível de acesso aqu... */, + ), + icon: Icon( + Icons + .keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0, + ), + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + elevation: 2.0, + borderColor: + FlutterFlowTheme.of( + context) + .accent1, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional + .fromSTEB(16.0, 4.0, + 16.0, 4.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ], + ), + ), + Divider( + thickness: 0.5, + color: + FlutterFlowTheme.of(context).accent1, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'mddp33o0' /* Visita se encerra após o prime... */, + ), + textAlign: TextAlign.start, + 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), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + '68j9gw4h' /* Visita única */, + ), + textAlign: TextAlign.start, + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + Switch.adaptive( + value: _model.switchValue!, + onChanged: (newValue) async { + setState(() => _model + .switchValue = newValue); + }, + activeTrackColor: + FlutterFlowTheme.of(context) + .primary, + inactiveTrackColor: + FlutterFlowTheme.of(context) + .primaryText, + inactiveThumbColor: + FlutterFlowTheme.of(context) + .alternate, + ), + ], + ), + ), + Divider( + thickness: 0.5, + color: + FlutterFlowTheme.of(context).accent1, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + '9rudpkq7' /* Você tem alguma observação sob... */, + ), + textAlign: TextAlign.start, + 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), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 20.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + labelText: + FFLocalizations.of(context) + .getText( + '4rgpxrfe' /* Observações da Visita */, + ), + 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), + ), + hintText: + FFLocalizations.of(context) + .getText( + '7knytis2' /* Escreva as suas observações aq... */, + ), + 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( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.format_color_text, + 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, + validator: _model + .textController3Validator + .asValidator(context), + ), + ), + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], + ), + ), + ), + ], + ), + InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + if ((_model.textController1.text != '') && + (_model.textController2.text != '') && + (_model.dropDownValue1 != null && + _model.dropDownValue1 != '') && + (_model.dropDownValue2 != null && + _model.dropDownValue2 != '')) { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + 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: VisitDetailsModalWidget( + visitStartDateStr: + _model.textController1.text, + visitEndDateStr: + _model.textController2.text, + visitReasonStr: _model.dropDownValue1, + visitLevelStr: _model.dropDownValue2, + visitTempStr: _model.switchValue == true + ? 'Sim' + : 'Não', + visitObsStr: + _model.textController3.text, + visitorStrList: _model.visitorStrList, + visitorJsonList: _model.visitorJsonList, + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + 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: const ThrowExceptionWidget( + msg: 'Campos obrigatórios imcompletos.', + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + }, + child: Container( + width: double.infinity, + height: 40.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + alignment: const AlignmentDirectional(0.0, 1.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Icon( + Icons.save_alt, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + ), + ), + ), + ], + ); + } else { + return Container( + width: double.infinity, + height: 900.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.settings_sharp, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + 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: const OptModalWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + ), + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(14.0), + child: FutureBuilder( + future: PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final gridViewGetVisitsResponse = + snapshot.data!; + return Builder( + builder: (context) { + final visitHistory = + (PhpGroup.getVisitsCall + .visitasList( + gridViewGetVisitsResponse + .jsonBody, + ) + ?.toList() ?? + []) + .take(10) + .toList(); + return GridView.builder( + padding: EdgeInsets.zero, + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + childAspectRatio: 1.0, + ), + scrollDirection: Axis.vertical, + itemCount: visitHistory.length, + itemBuilder: + (context, visitHistoryIndex) { + final visitHistoryItem = + visitHistory[visitHistoryIndex]; + return Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: + Radius.circular(50.0), + bottomRight: + Radius.circular(50.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: + valueOrDefault( + () { + if (functions.jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme + .of(context) + .success; + } else if (functions + .jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme + .of(context) + .error; + } else if (functions + .jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme + .of(context) + .warning; + } else { + return FlutterFlowTheme + .of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(10.0), + bottomRight: + Radius.circular(10.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + ), + InkWell( + splashColor: + Colors.transparent, + focusColor: + Colors.transparent, + hoverColor: + Colors.transparent, + highlightColor: + Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + 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: + VisitDetailsModalWidget( + visitStatusStr: + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS ''', + ).toString(), + visitStartDateStr: + getJsonField( + visitHistoryItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: + getJsonField( + visitHistoryItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: + getJsonField( + visitHistoryItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: + getJsonField( + visitHistoryItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: + getJsonField( + visitHistoryItem, + r'''$.VTE_UNICA ''', + ).toString(), + visitObsStr: + getJsonField( + visitHistoryItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitHistoryItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: + getJsonField( + visitHistoryItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: + getJsonField( + visitHistoryItem, + r'''$.VAW_ID''', + ).toString(), + visitorJsonList: PhpGroup + .getVisitsCall + .visitasList( + gridViewGetVisitsResponse + .jsonBody, + ), + updateToggleIdx: + () async { + _model.toggleIdx = + true; + setState(() {}); + }, + repeatVisitSchedule: + () async {}, + ), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + child: CachedNetworkImage( + 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=${getJsonField( + visitHistoryItem, + r'''$.VTE_DOCUMENTO''', + ).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: double.infinity, + height: double.infinity, + fit: BoxFit.cover, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, -1.0), + child: Container( + width: 200.0, + height: 20.0, + decoration: BoxDecoration( + color: + valueOrDefault( + () { + if (functions.jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme + .of(context) + .success; + } else if (functions + .jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme + .of(context) + .error; + } else if (functions + .jsonToStr( + getJsonField( + visitHistoryItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme + .of(context) + .warning; + } else { + return FlutterFlowTheme + .of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular( + 0.0), + bottomRight: + Radius.circular( + 0.0), + topLeft: + Radius.circular( + 25.0), + topRight: + Radius.circular( + 25.0), + ), + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + getJsonField( + visitHistoryItem, + r'''$.VTE_NOME''', + ).toString(), + textAlign: + TextAlign.center, + style: + FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .info, + fontSize: 12.0, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ); + }, + ); + }, + ); + }, ), ), ), ], ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if ((_model.textController1.text != '') && - (_model.textController2.text != '') && - (_model.dropDownValue1 != null && - _model.dropDownValue1 != '') && - (_model.dropDownValue2 != null && - _model.dropDownValue2 != '')) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - 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: VisitDetailsModalWidget( - visitStartDateStr: - _model.textController1.text, - visitEndDateStr: - _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: _model.switchValue == true - ? 'Sim' - : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - 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: const ThrowExceptionWidget( - msg: 'Campos obrigatórios imcompletos.', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width * 0.5, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(10.0), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - ), - ), - ), - ].addToEnd(const SizedBox(height: 30.0)), - ), - if (valueOrDefault( - _model.toggleIndexValue == false, - true, - )) - Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - 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: const OptModalWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - ), - ], - ), - FutureBuilder( - future: PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return Wrap( - spacing: 2.0, - runSpacing: 1.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: List.generate(visitaWrap.length, - (visitaWrapIndex) { - final visitaWrapItem = - visitaWrap[visitaWrapIndex]; - return 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: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'd34nuw4w' /* Visitante: */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'y8geteyc' /* Lucas Martin Mota */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart(const SizedBox( - width: 10.0)), - ), - Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'gxdykms1' /* Morador: */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Text( - FFLocalizations.of( - context) - .getText( - 'ue7wkm9r' /* Lucas Martin Mota */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ].addToStart(const SizedBox( - width: 10.0)), - ), - Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Text( - FFLocalizations.of( - context) - .getText( - 'zs8s0wd3' /* Validade: */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Text( - FFLocalizations.of( - context) - .getText( - 'z7fset9r' /* 16/10/2024 a 16/10/2024 */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 13.0, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ].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: FlutterFlowTheme - .of(context) - .primary, - borderRadius: - BorderRadius - .circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'fcb5avae' /* Agendamento Ativo */, - ), - 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: 2.0)), - ), - ), - ), - ClipRRect( - borderRadius: - BorderRadius.circular(0.0), - child: Image.network( - 'https://images.unsplash.com/photo-1599566150163-29194dcaad36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYyMDF8MHwxfHNlYXJjaHwxNHx8cGVyc29ufGVufDB8fHx8MTcxNzc4MDk1Mnww&ixlib=rb-4.0.3&q=80&w=1080', - fit: BoxFit.cover, - ), - ), - ], - ), - ), - ); - }), - ); - }, - ); - }, - ), - ], - ), - ), - ], - ), + ); + } + }, + ), + ], ), ), ), diff --git a/lib/application_pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/application_pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index f9c25f93..90e61b98 100644 --- a/lib/application_pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/application_pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -3,8 +3,6 @@ import '/application_components/organism_components/bottom_arrow_linked_locals_c import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.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'; @@ -191,92 +189,93 @@ class _ScheduleProvisionalVisitPageWidgetState ), ), ), - Stack( - children: [ - FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - 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: - const BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFAppState().local, - options: FFButtonOptions( - width: 320.0, - height: 51.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) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 25.0, 0.0, 25.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + 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: + const BottomArrowLinkedLocalsComponentWidget(), ), - borderSide: BorderSide( + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Container( + width: double.infinity, + height: 51.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + borderRadius: BorderRadius.circular(24.0), + border: Border.all( color: FlutterFlowTheme.of(context) .primaryText, width: 0.3, ), - borderRadius: BorderRadius.circular(24.0), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 10.0, 0.0, 0.0), - child: Container( - width: 35.0, - height: 35.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 100), - fadeOutDuration: - const Duration(milliseconds: 100), - imageUrl: valueOrDefault( - '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', + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: 35.0, + height: 35.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + valueOrDefault( + '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', + ), + fit: BoxFit.cover, + ), ), - fit: BoxFit.cover, - ), + Text( + FFAppState().local, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ], ), ), - ], + ), ), ].addToEnd(const SizedBox(height: 20.0)), ), diff --git a/lib/on_boarding/on_boarding_legacy/welcome_page/welcome_page_model.dart b/lib/application_pages/welcome_page/welcome_page_model.dart similarity index 100% rename from lib/on_boarding/on_boarding_legacy/welcome_page/welcome_page_model.dart rename to lib/application_pages/welcome_page/welcome_page_model.dart diff --git a/lib/on_boarding/on_boarding_legacy/welcome_page/welcome_page_widget.dart b/lib/application_pages/welcome_page/welcome_page_widget.dart similarity index 97% rename from lib/on_boarding/on_boarding_legacy/welcome_page/welcome_page_widget.dart rename to lib/application_pages/welcome_page/welcome_page_widget.dart index 1ec859fe..9484ebf9 100644 --- a/lib/on_boarding/on_boarding_legacy/welcome_page/welcome_page_widget.dart +++ b/lib/application_pages/welcome_page/welcome_page_widget.dart @@ -36,13 +36,16 @@ class _WelcomePageWidgetState extends State if (FFAppState().isLogged == true) { context.pushNamed( 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - duration: Duration(milliseconds: 0), + queryParameters: { + 'userUUID': serializeParam( + FFAppState().userUUID, + ParamType.String, ), - }, + 'devUUID': serializeParam( + FFAppState().devUUID, + ParamType.String, + ), + }.withoutNulls, ); } else { if (isAndroid == true) { @@ -144,7 +147,7 @@ class _WelcomePageWidgetState extends State children: [ Text( FFLocalizations.of(context).getText( - 'xflxvs9y' /* UMA EXPERIÊCIA COMPLETA */, + '3pl41wkq' /* UMA EXPERIÊCIA COMPLETA */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) @@ -164,7 +167,7 @@ class _WelcomePageWidgetState extends State alignment: const AlignmentDirectional(0.0, -1.0), child: Text( FFLocalizations.of(context).getText( - '5a86wzd1' /* COM CONFORTO ONDE VOCÊ ESTIVER... */, + '13nhoxpg' /* COM CONFORTO ONDE VOCÊ ESTIVER... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) @@ -262,7 +265,7 @@ class _WelcomePageWidgetState extends State text: FFLocalizations.of(context) .getText( - '65nuva6j' /* Entrar */, + 'zt5uc5g5' /* Entrar */, ), options: FFButtonOptions( width: double.infinity, @@ -320,7 +323,7 @@ class _WelcomePageWidgetState extends State text: FFLocalizations.of(context) .getText( - '9u6oaw01' /* Cadastrar */, + 'jteakpo0' /* Cadastrar */, ), options: FFButtonOptions( width: double.infinity, @@ -395,7 +398,7 @@ class _WelcomePageWidgetState extends State text: FFLocalizations.of( context) .getText( - 'd1qem43w' /* Entrar */, + 'qoc86gvo' /* Entrar */, ), options: FFButtonOptions( width: double.infinity, @@ -456,7 +459,7 @@ class _WelcomePageWidgetState extends State text: FFLocalizations.of( context) .getText( - 'bhowzv2u' /* Cadastrar */, + 'p5tgmj0c' /* Cadastrar */, ), options: FFButtonOptions( width: double.infinity, diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 7204e476..33deadb3 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -21,7 +21,6 @@ class PhpGroup { static PostScheduleVisitorCall postScheduleVisitorCall = PostScheduleVisitorCall(); static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall(); - static DebugCallCall debugCallCall = DebugCallCall(); static GetScheduleVisitCall getScheduleVisitCall = GetScheduleVisitCall(); static GetDadosCall getDadosCall = GetDadosCall(); static GetVisitorByDocCall getVisitorByDocCall = GetVisitorByDocCall(); @@ -30,6 +29,7 @@ class PhpGroup { PostProvVisitSchedulingCall(); static GetVisitsCall getVisitsCall = GetVisitsCall(); static DeleteVisitCall deleteVisitCall = DeleteVisitCall(); + static DebugCall debugCall = DebugCall(); } class LoginCall { @@ -341,7 +341,7 @@ class PostScheduleVisitCall { Future call({ String? devUUID = '', String? userUUID = '', - String? cliID = '', + String? cliUUID = '', String? atividade = '', String? devDesc = '', String? idVisitante = '', @@ -364,64 +364,7 @@ class PostScheduleVisitCall { params: { 'devUUID': devUUID, 'userUUID': userUUID, - 'cliID': cliID, - 'atividade': atividade, - 'idVisitante': idVisitante, - 'dtInicio': dtInicio, - 'dtFim': dtFim, - 'unica': unica, - 'idMotivo': idMotivo, - 'idNAC': idNAC, - 'obs': obs, - 'DevDesc': devDesc, - }, - bodyType: BodyType.X_WWW_FORM_URL_ENCODED, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - alwaysAllowBody: false, - ); - } - - bool? error(dynamic response) => castToType(getJsonField( - response, - r'''$.error''', - )); - String? errorMsg(dynamic response) => castToType(getJsonField( - response, - r'''$.error_msg''', - )); -} - -class DebugCallCall { - Future call({ - String? devUUID = '', - String? userUUID = '', - String? cliID = '', - String? atividade = '', - String? devDesc = '', - String? idVisitante = '', - String? dtInicio = '', - String? dtFim = '', - String? unica = '', - int? idMotivo, - int? idNAC, - String? obs = '', - }) async { - final baseUrl = PhpGroup.getBaseUrl(); - - return ApiManager.instance.makeApiCall( - callName: 'debugCall', - apiUrl: '$baseUrl/jonh.php', - callType: ApiCallType.POST, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - params: { - 'devUUID': devUUID, - 'userUUID': userUUID, - 'cliID': cliID, + 'cliID': cliUUID, 'atividade': atividade, 'DevDesc': devDesc, 'idVisitante': idVisitante, @@ -1420,6 +1363,26 @@ class DeleteVisitCall { )); } +class DebugCall { + Future call() async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'debug', + apiUrl: '$baseUrl/jonh.php', + callType: ApiCallType.POST, + headers: {}, + params: {}, + bodyType: BodyType.JSON, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + alwaysAllowBody: false, + ); + } +} + /// End PHP Group Code class ApiPagingParams { diff --git a/lib/backend/cloud_functions/cloud_functions.dart b/lib/backend/cloud_functions/cloud_functions.dart new file mode 100644 index 00000000..4f4e4d18 --- /dev/null +++ b/lib/backend/cloud_functions/cloud_functions.dart @@ -0,0 +1,23 @@ +import 'package:cloud_functions/cloud_functions.dart'; + +Future> makeCloudCall( + String callName, + Map input, +) async { + try { + final response = await FirebaseFunctions.instance + .httpsCallable(callName, options: HttpsCallableOptions()) + .call(input); + return response.data is Map + ? Map.from(response.data as Map) + : {}; + } on FirebaseFunctionsException catch (e) { + print( + 'Cloud call error!\n' + 'Code: ${e.code}\n' + 'Details: ${e.details}\n' + 'Message: ${e.message}', + ); + return {}; + } +} diff --git a/lib/backend/push_notifications/push_notifications_handler.dart b/lib/backend/push_notifications/push_notifications_handler.dart new file mode 100644 index 00000000..8aec8b70 --- /dev/null +++ b/lib/backend/push_notifications/push_notifications_handler.dart @@ -0,0 +1,154 @@ +import 'dart:async'; + +import 'serialization_util.dart'; +import '../backend.dart'; +import '../../flutter_flow/flutter_flow_theme.dart'; +import '../../flutter_flow/flutter_flow_util.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/material.dart'; + + +final _handledMessageIds = {}; + +class PushNotificationsHandler extends StatefulWidget { + const PushNotificationsHandler({super.key, required this.child}); + + final Widget child; + + @override + _PushNotificationsHandlerState createState() => + _PushNotificationsHandlerState(); +} + +class _PushNotificationsHandlerState extends State { + bool _loading = false; + + Future handleOpenedPushNotification() async { + if (isWeb) { + return; + } + + final notification = await FirebaseMessaging.instance.getInitialMessage(); + if (notification != null) { + await _handlePushNotification(notification); + } + FirebaseMessaging.onMessageOpenedApp.listen(_handlePushNotification); + } + + Future _handlePushNotification(RemoteMessage message) async { + if (_handledMessageIds.contains(message.messageId)) { + return; + } + _handledMessageIds.add(message.messageId); + + if (mounted) { + setState(() => _loading = true); + } + try { + final initialPageName = message.data['initialPageName'] as String; + final initialParameterData = getInitialParameterData(message.data); + final parametersBuilder = parametersBuilderMap[initialPageName]; + if (parametersBuilder != null) { + final parameterData = await parametersBuilder(initialParameterData); + context.pushNamed( + initialPageName, + pathParameters: parameterData.pathParameters, + extra: parameterData.extra, + ); + } + } catch (e) { + print('Error: $e'); + } finally { + if (mounted) { + setState(() => _loading = false); + } + } + } + + @override + void initState() { + super.initState(); + handleOpenedPushNotification(); + } + + @override + Widget build(BuildContext context) => _loading + ? Container( + color: FlutterFlowTheme.of(context).primary, + child: Image.asset( + 'assets/images/logo.svg', + fit: BoxFit.cover, + ), + ) + : widget.child; +} + +class ParameterData { + const ParameterData( + {this.requiredParams = const {}, this.allParams = const {}}); + final Map requiredParams; + final Map allParams; + + Map get pathParameters => Map.fromEntries( + requiredParams.entries + .where((e) => e.value != null) + .map((e) => MapEntry(e.key, e.value!)), + ); + Map get extra => Map.fromEntries( + allParams.entries.where((e) => e.value != null), + ); + + static Future Function(Map) none() => + (data) async => const ParameterData(); +} + +final parametersBuilderMap = + Function(Map)>{ + 'LoginPage': (data) async => ParameterData( + allParams: { + 'device': getParameter(data, 'device'), + }, + ), + 'ForgotPasswordPage': ParameterData.none(), + 'homePage': (data) async => ParameterData( + allParams: { + 'userUUID': getParameter(data, 'userUUID'), + 'devUUID': getParameter(data, 'devUUID'), + }, + ), + 'RegisterPage': ParameterData.none(), + 'WelcomePage': ParameterData.none(), + 'registerVisitorPage': (data) async => ParameterData( + allParams: { + 'userUUID': getParameter(data, 'userUUID'), + 'devUUID': getParameter(data, 'devUUID'), + }, + ), + 'scheduleCompleteVisitPage': (data) async => ParameterData( + allParams: { + 'visitorStrList': getParameter(data, 'visitorStrList'), + 'visitStartDateStr': getParameter(data, 'visitStartDateStr'), + 'visitEndDateStr': getParameter(data, 'visitEndDateStr'), + 'visitReasonStr': getParameter(data, 'visitReasonStr'), + 'visitLevelStr': getParameter(data, 'visitLevelStr'), + 'visitTempBol': getParameter(data, 'visitTempBol'), + 'visitObsStr': getParameter(data, 'visitObsStr'), + }, + ), + 'scheduleProvisionalVisitPage': ParameterData.none(), +}; + +Map getInitialParameterData(Map data) { + try { + final parameterDataStr = data['parameterData']; + if (parameterDataStr == null || + parameterDataStr is! String || + parameterDataStr.isEmpty) { + return {}; + } + return jsonDecode(parameterDataStr) as Map; + } catch (e) { + print('Error parsing parameter data: $e'); + return {}; + } +} diff --git a/lib/backend/push_notifications/push_notifications_util.dart b/lib/backend/push_notifications/push_notifications_util.dart new file mode 100644 index 00000000..0b1abbf9 --- /dev/null +++ b/lib/backend/push_notifications/push_notifications_util.dart @@ -0,0 +1,49 @@ +import 'dart:io' show Platform; + +import 'package:cloud_firestore/cloud_firestore.dart'; + +import '../../auth/firebase_auth/auth_util.dart'; +import '../cloud_functions/cloud_functions.dart'; + +import 'package:flutter/foundation.dart'; +import 'package:stream_transform/stream_transform.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; + +export 'push_notifications_handler.dart'; +export 'serialization_util.dart'; + +class UserTokenInfo { + const UserTokenInfo(this.userPath, this.fcmToken); + final String userPath; + final String fcmToken; +} + +Stream getFcmTokenStream(String userPath) => + Stream.value(!kIsWeb && (Platform.isIOS || Platform.isAndroid)) + .where((shouldGetToken) => shouldGetToken) + .asyncMap( + (_) => FirebaseMessaging.instance.requestPermission().then( + (settings) => settings.authorizationStatus == + AuthorizationStatus.authorized + ? FirebaseMessaging.instance.getToken() + : null, + )) + .switchMap((fcmToken) => Stream.value(fcmToken) + .merge(FirebaseMessaging.instance.onTokenRefresh)) + .where((fcmToken) => fcmToken != null && fcmToken.isNotEmpty) + .map((token) => UserTokenInfo(userPath, token!)); +final fcmTokenUserStream = authenticatedUserStream + .where((user) => user != null) + .map((user) => user!.reference.path) + .distinct() + .switchMap(getFcmTokenStream) + .map( + (userTokenInfo) => makeCloudCall( + 'addFcmToken', + { + 'userDocPath': userTokenInfo.userPath, + 'fcmToken': userTokenInfo.fcmToken, + 'deviceType': Platform.isIOS ? 'iOS' : 'Android', + }, + ), + ); diff --git a/lib/backend/push_notifications/serialization_util.dart b/lib/backend/push_notifications/serialization_util.dart new file mode 100644 index 00000000..cf084b69 --- /dev/null +++ b/lib/backend/push_notifications/serialization_util.dart @@ -0,0 +1,172 @@ +import 'dart:convert'; + +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; + +import '/backend/backend.dart'; +import '/backend/schema/structs/index.dart'; + +import '../../flutter_flow/lat_lng.dart'; +import '../../flutter_flow/place.dart'; +import '../../flutter_flow/uploaded_file.dart'; + +/// SERIALIZATION HELPERS + +String dateTimeRangeToString(DateTimeRange dateTimeRange) { + final startStr = dateTimeRange.start.millisecondsSinceEpoch.toString(); + final endStr = dateTimeRange.end.millisecondsSinceEpoch.toString(); + return '$startStr|$endStr'; +} + +String placeToString(FFPlace place) => jsonEncode({ + 'latLng': place.latLng.serialize(), + 'name': place.name, + 'address': place.address, + 'city': place.city, + 'state': place.state, + 'country': place.country, + 'zipCode': place.zipCode, + }); + +String uploadedFileToString(FFUploadedFile uploadedFile) => + uploadedFile.serialize(); + +/// Converts the input value into a value that can be JSON encoded. +dynamic serializeParameter(dynamic value) { + switch (value.runtimeType) { + case DateTime: + return (value as DateTime).millisecondsSinceEpoch; + case DateTimeRange: + return dateTimeRangeToString(value as DateTimeRange); + case LatLng: + return (value as LatLng).serialize(); + case Color: + return (value as Color).toCssString(); + case FFPlace: + return placeToString(value as FFPlace); + case FFUploadedFile: + return uploadedFileToString(value as FFUploadedFile); + } + + if (value is DocumentReference) { + return value.path; + } + + if (value is FirestoreRecord) { + return (value as dynamic).reference.path; + } + + return value; +} + +String serializeParameterData(Map parameterData) => jsonEncode( + parameterData.map( + (key, value) => MapEntry( + key, + serializeParameter(value), + ), + )..removeWhere((k, v) => v == null), + ); + +/// END SERIALIZATION HELPERS + +/// DESERIALIZATION HELPERS + +DateTimeRange? dateTimeRangeFromString(String dateTimeRangeStr) { + final pieces = dateTimeRangeStr.split('|'); + if (pieces.length != 2) { + return null; + } + return DateTimeRange( + start: DateTime.fromMillisecondsSinceEpoch(int.parse(pieces.first)), + end: DateTime.fromMillisecondsSinceEpoch(int.parse(pieces.last)), + ); +} + +LatLng? latLngFromString(String? latLngStr) { + final pieces = latLngStr?.split(','); + if (pieces == null || pieces.length != 2) { + return null; + } + return LatLng( + double.parse(pieces.first.trim()), + double.parse(pieces.last.trim()), + ); +} + +FFPlace placeFromString(String placeStr) { + final serializedData = jsonDecode(placeStr) as Map; + final data = { + 'latLng': serializedData.containsKey('latLng') + ? latLngFromString(serializedData['latLng'] as String) + : const LatLng(0.0, 0.0), + 'name': serializedData['name'] ?? '', + 'address': serializedData['address'] ?? '', + 'city': serializedData['city'] ?? '', + 'state': serializedData['state'] ?? '', + 'country': serializedData['country'] ?? '', + 'zipCode': serializedData['zipCode'] ?? '', + }; + return FFPlace( + latLng: data['latLng'] as LatLng, + name: data['name'] as String, + address: data['address'] as String, + city: data['city'] as String, + state: data['state'] as String, + country: data['country'] as String, + zipCode: data['zipCode'] as String, + ); +} + +FFUploadedFile uploadedFileFromString(String uploadedFileStr) => + FFUploadedFile.deserialize(uploadedFileStr); + +T? getParameter(Map data, String paramName) { + try { + if (!data.containsKey(paramName)) { + return null; + } + final param = data[paramName]; + switch (T) { + case String: + return param; + case double: + return param.toDouble(); + case DateTime: + return DateTime.fromMillisecondsSinceEpoch(param) as T; + case DateTimeRange: + return dateTimeRangeFromString(param) as T; + case LatLng: + return latLngFromString(param) as T; + case Color: + return fromCssColor(param) as T; + case FFPlace: + return placeFromString(param) as T; + case FFUploadedFile: + return uploadedFileFromString(param) as T; + } + if (param is String) { + return FirebaseFirestore.instance.doc(param) as T; + } + return param; + } catch (e) { + print('Error parsing parameter "$paramName": $e'); + return null; + } +} + +Future getDocumentParameter( + Map data, + String paramName, + RecordBuilder recordBuilder, +) { + if (!data.containsKey(paramName)) { + return Future.value(null); + } + return FirebaseFirestore.instance + .doc(data[paramName]) + .get() + .then((s) => recordBuilder(s)); +} + +/// END DESERIALIZATION HELPERS diff --git a/lib/backend/schema/structs/device_struct.dart b/lib/backend/schema/structs/device_struct.dart deleted file mode 100644 index 03db22f3..00000000 --- a/lib/backend/schema/structs/device_struct.dart +++ /dev/null @@ -1,110 +0,0 @@ -// ignore_for_file: unnecessary_getters_setters - -import '/backend/schema/util/schema_util.dart'; - -import 'index.dart'; -import '/flutter_flow/flutter_flow_util.dart'; - -class DeviceStruct extends BaseStruct { - DeviceStruct({ - String? devUUID, - String? version, - String? description, - }) : _devUUID = devUUID, - _version = version, - _description = description; - - // "devUUID" field. - String? _devUUID; - String get devUUID => _devUUID ?? ''; - set devUUID(String? val) => _devUUID = val; - bool hasDevUUID() => _devUUID != null; - - // "version" field. - String? _version; - String get version => _version ?? ''; - set version(String? val) => _version = val; - bool hasVersion() => _version != null; - - // "description" field. - String? _description; - String get description => _description ?? ''; - set description(String? val) => _description = val; - bool hasDescription() => _description != null; - - static DeviceStruct fromMap(Map data) => DeviceStruct( - devUUID: data['devUUID'] as String?, - version: data['version'] as String?, - description: data['description'] as String?, - ); - - static DeviceStruct? maybeFromMap(dynamic data) => - data is Map ? DeviceStruct.fromMap(data.cast()) : null; - - Map toMap() => { - 'devUUID': _devUUID, - 'version': _version, - 'description': _description, - }.withoutNulls; - - @override - Map toSerializableMap() => { - 'devUUID': serializeParam( - _devUUID, - ParamType.String, - ), - 'version': serializeParam( - _version, - ParamType.String, - ), - 'description': serializeParam( - _description, - ParamType.String, - ), - }.withoutNulls; - - static DeviceStruct fromSerializableMap(Map data) => - DeviceStruct( - devUUID: deserializeParam( - data['devUUID'], - ParamType.String, - false, - ), - version: deserializeParam( - data['version'], - ParamType.String, - false, - ), - description: deserializeParam( - data['description'], - ParamType.String, - false, - ), - ); - - @override - String toString() => 'DeviceStruct(${toMap()})'; - - @override - bool operator ==(Object other) { - return other is DeviceStruct && - devUUID == other.devUUID && - version == other.version && - description == other.description; - } - - @override - int get hashCode => - const ListEquality().hash([devUUID, version, description]); -} - -DeviceStruct createDeviceStruct({ - String? devUUID, - String? version, - String? description, -}) => - DeviceStruct( - devUUID: devUUID, - version: version, - description: description, - ); diff --git a/lib/backend/schema/structs/index.dart b/lib/backend/schema/structs/index.dart index 0c01c05d..bc8583f6 100644 --- a/lib/backend/schema/structs/index.dart +++ b/lib/backend/schema/structs/index.dart @@ -1,4 +1,3 @@ export '/backend/schema/util/schema_util.dart'; export 'action_struct.dart'; -export 'device_struct.dart'; diff --git a/lib/components/image_cropper_model.dart b/lib/components/image_cropper_model.dart deleted file mode 100644 index 3d5fedec..00000000 --- a/lib/components/image_cropper_model.dart +++ /dev/null @@ -1,11 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'image_cropper_widget.dart' show ImageCropperWidget; -import 'package:flutter/material.dart'; - -class ImageCropperModel extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/image_cropper_widget.dart b/lib/components/image_cropper_widget.dart deleted file mode 100644 index 90467078..00000000 --- a/lib/components/image_cropper_widget.dart +++ /dev/null @@ -1,64 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/custom_code/widgets/index.dart' as custom_widgets; -import 'package:flutter/material.dart'; -import 'image_cropper_model.dart'; -export 'image_cropper_model.dart'; - -class ImageCropperWidget extends StatefulWidget { - const ImageCropperWidget({ - super.key, - required this.uploadImageFile, - }); - - final FFUploadedFile? uploadImageFile; - - @override - State createState() => _ImageCropperWidgetState(); -} - -class _ImageCropperWidgetState extends State { - late ImageCropperModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ImageCropperModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Container( - width: 500.0, - height: 500.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).secondaryBackground, - ), - child: SizedBox( - width: double.infinity, - height: double.infinity, - child: custom_widgets.ImageCropper( - width: double.infinity, - height: double.infinity, - imageFile: widget.uploadImageFile, - callBackAction: (url) async { - Navigator.pop(context, url); - }, - ), - ), - ); - } -} diff --git a/lib/components/legacy_local_component_model.dart b/lib/components/legacy_local_component_model.dart deleted file mode 100644 index 65087833..00000000 --- a/lib/components/legacy_local_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'legacy_local_component_widget.dart' show LegacyLocalComponentWidget; -import 'package:flutter/material.dart'; - -class LegacyLocalComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/legacy_local_component_widget.dart b/lib/components/legacy_local_component_widget.dart deleted file mode 100644 index 54c3610d..00000000 --- a/lib/components/legacy_local_component_widget.dart +++ /dev/null @@ -1,167 +0,0 @@ -import '/application_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_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/random_data_util.dart' as random_data; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'legacy_local_component_model.dart'; -export 'legacy_local_component_model.dart'; - -class LegacyLocalComponentWidget extends StatefulWidget { - const LegacyLocalComponentWidget({super.key}); - - @override - State createState() => - _LegacyLocalComponentWidgetState(); -} - -class _LegacyLocalComponentWidgetState - extends State { - late LegacyLocalComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => LegacyLocalComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Visibility( - visible: random_data.randomInteger(0, 10) != null, - child: Container( - height: 284.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Material( - color: Colors.transparent, - elevation: 0.0, - child: Container( - width: double.infinity, - height: 119.0, - decoration: BoxDecoration( - color: const Color(0xFF1AAB5F), - border: Border.all( - color: const Color(0xFF1AAB5F), - ), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Container( - width: 200.0, - height: 200.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(2.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: const Color(0x00FFFFFF), - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: double.infinity, - child: - BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(200.0), - child: Image.network( - valueOrDefault( - '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', - ), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => - Image.asset( - 'assets/images/error_image.svg', - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - ), - ), - ), - ), - ), - ), - ), - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - valueOrDefault( - functions.convertToUppercase(FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/lib/components/select_header_component_model.dart b/lib/components/select_header_component_model.dart deleted file mode 100644 index 4c60514f..00000000 --- a/lib/components/select_header_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'select_header_component_widget.dart' show SelectHeaderComponentWidget; -import 'package:flutter/material.dart'; - -class SelectHeaderComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/select_header_component_widget.dart b/lib/components/select_header_component_widget.dart deleted file mode 100644 index 8f4f9339..00000000 --- a/lib/components/select_header_component_widget.dart +++ /dev/null @@ -1,185 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'select_header_component_model.dart'; -export 'select_header_component_model.dart'; - -class SelectHeaderComponentWidget extends StatefulWidget { - const SelectHeaderComponentWidget({ - super.key, - required this.selectToggle, - bool? toggleIndexValue, - }) : toggleIndexValue = toggleIndexValue ?? true; - - final Future Function(bool toggleIndex)? selectToggle; - final bool toggleIndexValue; - - @override - State createState() => - _SelectHeaderComponentWidgetState(); -} - -class _SelectHeaderComponentWidgetState - extends State { - late SelectHeaderComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SelectHeaderComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - height: 55.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.selectToggle?.call( - true, - ); - }, - child: Container( - width: double.infinity, - height: 50.0, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1gr8ztd5' /* Criar Agendamento */, - ), - 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), - ), - ), - ), - ), - ), - if (widget.toggleIndexValue == true) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 2.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 2.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(100.0), - ), - ), - ), - ], - ), - ), - ), - Expanded( - child: Container( - height: 55.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.selectToggle?.call( - false, - ); - }, - child: Container( - width: double.infinity, - height: 50.0, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xjahsbjw' /* Histórico de Visitas */, - ), - 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), - ), - ), - ), - ), - ), - if (widget.toggleIndexValue == false) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 2.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 2.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(100.0), - ), - ), - ), - ], - ), - ), - ), - ], - ); - } -} diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart deleted file mode 100644 index 6d4843e7..00000000 --- a/lib/custom_code/actions/get_dev_u_u_i_d.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom action code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! - -import 'dart:io'; - -import 'package:device_info_plus/device_info_plus.dart'; - -Future getDevUUID() async { - var deviceInfo = DeviceInfoPlugin(); - if (Platform.isIOS) { - // import 'dart:io' - var iosDeviceInfo = await deviceInfo.iosInfo; - return iosDeviceInfo.identifierForVendor; // unique ID on iOS - } else if (Platform.isAndroid) { - var androidDeviceInfo = await deviceInfo.androidInfo; - print(AndroidDeviceInfo); - return androidDeviceInfo.serialNumber; // unique ID on Android - } -} diff --git a/lib/custom_code/actions/index.dart b/lib/custom_code/actions/index.dart index 2110f043..91a5451a 100644 --- a/lib/custom_code/actions/index.dart +++ b/lib/custom_code/actions/index.dart @@ -1,3 +1,2 @@ export 'convert_image_file_to_base64.dart' show convertImageFileToBase64; export 'convert_to_upload_file.dart' show convertToUploadFile; -export 'get_dev_u_u_i_d.dart' show getDevUUID; diff --git a/lib/custom_code/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart deleted file mode 100644 index 459c718b..00000000 --- a/lib/custom_code/widgets/image_cropper.dart +++ /dev/null @@ -1,179 +0,0 @@ -// Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'index.dart'; // Imports other custom widgets -import '/custom_code/actions/index.dart'; // Imports custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom widget code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! - -import 'package:crop_your_image/crop_your_image.dart'; -import 'package:google_fonts/google_fonts.dart'; -import '/backend/firebase_storage/storage.dart'; - -class ImageCropper extends StatefulWidget { - const ImageCropper({ - super.key, - this.width, - this.height, - this.imageFile, - this.callBackAction, - this.currentUserId, - }); - - final double? width; - final double? height; - final FFUploadedFile? imageFile; - final Future Function(String? url)? callBackAction; - final String? currentUserId; - - @override - State createState() => _ImageCropperState(); -} - -class _ImageCropperState extends State { - bool loading = false; - final _crop_controller = CropController(); - @override - Widget build(BuildContext context) { - return Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: widget.width ?? double.infinity, - height: (widget.height ?? 555) - 80, - child: Center( - child: Crop( - image: Uint8List.fromList(widget.imageFile!.bytes!), - controller: _crop_controller, - onCropped: (image) async { - final path = _getStoragePath(_firebasePathPrefix(), - widget.imageFile!.name!, false, 0); - uploadData(path, image).then((value) { - print('image cropped'); - widget.callBackAction!.call(value!); - loading = false; - }); - // add error handling here - }, - - aspectRatio: 1 / 1, - initialSize: 0.5, - // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ - //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), - withCircleUi: true, - baseColor: Color.fromARGB(255, 0, 3, 22), - maskColor: Colors.white.withAlpha(100), - radius: 20, - - onMoved: (newRect) { - // do something with current cropping area. - }, - onStatusChanged: (status) { - // do something with current CropStatus - }, - cornerDotBuilder: (size, edgeAlignment) => - const DotControl(color: Colors.white), - interactive: true, - // fixArea: true, - ))), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), - child: ElevatedButton( - onPressed: () async { - if (!loading) { - setState(() { - loading = true; - }); - print('Button pressed ...'); - _crop_controller.crop(); - - //widget.loading = true; - } - }, - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - FlutterFlowTheme.of(context).primaryColor, - ), - padding: MaterialStateProperty.all( - EdgeInsets.zero, - ), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(100), - side: BorderSide.none, - ), - ), - ), - child: Container( - width: 250, - height: 50, - alignment: Alignment.center, - child: loading - ? CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation(Colors.white), - ) - : Text( - 'Crop', - style: FlutterFlowTheme.of(context) - .subtitle2 - .override( - fontFamily: 'Lexend', - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .subtitle2Family), - ), - ), - ), - )), - ]), - Positioned( - top: 4, - right: 4, - child: IconButton( - icon: Icon(Icons.close), - onPressed: () => Navigator.pop(context), - )) - ], - ); - } - - String _getStoragePath( - String? pathPrefix, - String filePath, - bool isVideo, [ - int? index, - ]) { - pathPrefix ??= _firebasePathPrefix(); - pathPrefix = _removeTrailingSlash(pathPrefix); - final timestamp = DateTime.now().microsecondsSinceEpoch; - final prefix = 'cropped-'; - // Workaround fixed by https://github.com/flutter/plugins/pull/3685 - // (not yet in stable). - final ext = isVideo ? 'mp4' : filePath.split('.').last; - final indexStr = index != null ? '_$index' : ''; - return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; - } - - String? _removeTrailingSlash(String? path) => - path != null && path.endsWith('/') - ? path.substring(0, path.length - 1) - : path; - - String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; -} -// Set your widget name, define your parameter, and then add the -// boilerplate code using the green button on the right! diff --git a/lib/custom_code/widgets/index.dart b/lib/custom_code/widgets/index.dart deleted file mode 100644 index ec35fd3e..00000000 --- a/lib/custom_code/widgets/index.dart +++ /dev/null @@ -1 +0,0 @@ -export 'image_cropper.dart' show ImageCropper; diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart index 7429aca2..e782c9ed 100644 --- a/lib/flutter_flow/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -66,8 +66,6 @@ abstract class FlutterFlowTheme { late Color customColor1; late Color customColor2; late Color customColor3; - late Color customColor4; - late Color customColor5; @Deprecated('Use displaySmallFamily instead') String get title1Family => displaySmallFamily; @@ -166,7 +164,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color accent1 = const Color(0xFF1AAB5F); late Color accent2 = const Color(0x4D000000); late Color accent3 = const Color(0xFFFFFFFF); - late Color accent4 = const Color(0xFF1AAB5F); + late Color accent4 = const Color(0xFFFFFFFF); late Color success = const Color(0xFF1AAB5F); late Color warning = const Color(0xFFF3C344); late Color error = const Color(0xFFD70000); @@ -175,8 +173,6 @@ class LightModeTheme extends FlutterFlowTheme { late Color customColor1 = const Color(0xFF000000); late Color customColor2 = const Color(0xFF1AAB5F); late Color customColor3 = const Color(0xFFFFFFFF); - late Color customColor4 = const Color(0xFFCFCFCF); - late Color customColor5 = const Color(0xFF979595); } abstract class Typography { @@ -573,8 +569,6 @@ class DarkModeTheme extends FlutterFlowTheme { late Color customColor1 = const Color(0xFFFFFFFF); late Color customColor2 = const Color(0xFFFFFFFF); late Color customColor3 = const Color(0xFF1AAB5F); - late Color customColor4 = const Color(0xFF232323); - late Color customColor5 = const Color(0xFF232323); } extension TextStyleHelper on TextStyle { diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index b4a5794a..b5c2dc8d 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -107,43 +107,43 @@ Locale createLocale(String language) => language.contains('_') final kTranslationsMap = >>[ // LoginPage { - '0113wf5c': { + 'uem0mca5': { 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', }, - 'f2go5a71': { + '90ls8ppo': { 'pt': 'Email', 'en': 'Email', }, - 'paon3y0v': { + 'rvlumyaw': { 'pt': 'Senha', 'en': 'Password', }, - 'wmbzwstw': { + '2d3903lt': { 'pt': 'Entrar', 'en': 'Sign-In', }, - 'j8567afe': { + 'zj6pyujp': { 'pt': 'Cadastrar', 'en': 'Sign-Up', }, - 'y3wd9q18': { + 'iqhyif1d': { 'pt': 'Entrar', 'en': 'Sign-In', }, - 'j6ufb6sq': { + '5x5bp2u1': { 'pt': 'Cadastrar', 'en': 'Sign-Up', }, - 'h85112qs': { + '1fqjz9q7': { 'pt': 'Você esqueceu a sua senha?', 'en': 'Have you forgotten your password?', }, - 'di48hdaj': { + '7miyd406': { 'pt': ' Recupere aqui', 'en': 'recover here', }, - 'gx2fp6zq': { + '63xv5ewj': { 'pt': 'Termo de Uso', 'en': 'Terms of use', }, @@ -154,25 +154,25 @@ final kTranslationsMap = >>[ }, // ForgotPasswordPage { - 'gfvplb0h': { + 'lpduiuif': { 'pt': 'ESQUECEU SUA SENHA?', 'en': 'FORGOT YOUR PASSWORD?', }, - 'azssgpdi': { + '8t05j98w': { 'pt': 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.', 'en': 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, - '0o139961': { + '4gcoci7a': { 'pt': 'Email', 'en': 'Email', }, - 'aanw1fp3': { + 'a7p2iikz': { 'pt': 'digite o seu email.....', 'en': 'enter your email.....', }, - 'e7hdgc4q': { + 'z9ghb8dz': { 'pt': 'Enviar', 'en': 'To send', }, @@ -234,39 +234,39 @@ final kTranslationsMap = >>[ }, // RegisterPage { - '2d8uulm3': { + 'oxy0n1p4': { 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', 'en': 'ENTER YOUR EMAIL AND PASSWORD, LET\'S REGISTER YOU!', }, - '8kjhi406': { + 'w0y3fz89': { 'pt': 'Nome', 'en': 'Name', }, - 'ro4zkkxp': { + '4bfdpd0o': { 'pt': 'Email', 'en': 'Email', }, - 'j5yny8ee': { + 'v0iobs5a': { 'pt': '', 'en': '', }, - 'lzgobioa': { + 'byjglkpk': { 'pt': 'Senha', 'en': 'Password', }, - 'c7sfyeh8': { + 'w9vrsnmf': { 'pt': 'Cadastrar-se', 'en': 'Sign-Up', }, - 'jglpa1tr': { + 'zep60lcd': { 'pt': 'Você já tem uma conta? ', 'en': 'You already have an account?', }, - 'hfcm0td9': { + 'tl8k1ld9': { 'pt': 'Clique aqui', 'en': 'Click here', }, - 'c3kno4t9': { + 'dbtzii7i': { 'pt': 'Termo de Uso', 'en': '', }, @@ -277,27 +277,27 @@ final kTranslationsMap = >>[ }, // WelcomePage { - 'xflxvs9y': { + '3pl41wkq': { 'pt': 'UMA EXPERIÊCIA COMPLETA', 'en': 'A COMPLETE EXPERIENCE', }, - '5a86wzd1': { + '13nhoxpg': { 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', 'en': 'WITH COMFORT WHEREVER YOU ARE.', }, - '65nuva6j': { + 'zt5uc5g5': { 'pt': 'Entrar', 'en': 'Sign-In', }, - '9u6oaw01': { + 'jteakpo0': { 'pt': 'Cadastrar', 'en': 'Sign-Up', }, - 'd1qem43w': { + 'qoc86gvo': { 'pt': 'Entrar', 'en': 'Sign-In', }, - 'bhowzv2u': { + 'p5tgmj0c': { 'pt': 'Cadastrar', 'en': 'Sign-Up', }, @@ -371,39 +371,43 @@ final kTranslationsMap = >>[ }, // scheduleCompleteVisitPage { + 'e4w9lbke': { + 'pt': 'Criar Agendamento', + 'en': 'Create Schedule', + }, + '47bsumoy': { + 'pt': 'Histórico de Visitas', + 'en': 'Visit History', + }, + '15ekd1ge': { + 'pt': 'Agendar Visita', + 'en': 'Schedule Visit', + }, 'qo0pg2at': { 'pt': 'Quais visitantes você deseja cadastrar?', 'en': 'Which visitors do you want to register?', }, 'i0jhuu3e': { 'pt': 'Clique para adicionar um visitante', - 'en': 'Click to add a visitor', + 'en': 'Click to add photo for visitor', }, 'z4ry3tge': { 'pt': 'Qual o período de validade da visita?', 'en': 'Visit Validity Period', }, - 'hjp5mzbd': { - 'pt': 'Inicio da Visita', - 'en': 'Start of Visit', + '9mg9nv2j': { + 'pt': 'Ínicio da Visita', + 'en': 'Start of the Visit', }, - '2in5sljf': { - 'pt': '', + 'y5s85khj': { + 'pt': 'Quando a visitas se inicia?', + 'en': 'When does the visit start?', + }, + '4o0cbb70': { + 'pt': 'Término da Visita', 'en': 'End of Visit', }, - 'ce6xryf4': { - 'pt': 'Quando você inicia a visita?', - 'en': 'When do you start the visit?', - }, - 'jwsbk0xu': { - 'pt': 'Fim da Visita', - 'en': 'End of Visit', - }, - '87rlxmbk': { - 'pt': '', - 'en': 'End of Visit', - }, - 'lyfe46f6': { + 'bhmgddc4': { 'pt': 'Quando a visita terminá?', 'en': 'When will the visit end?', }, @@ -411,10 +415,6 @@ final kTranslationsMap = >>[ 'pt': 'Quais são os motivos da visita?', 'en': 'What are the reasons for the visit?', }, - 'bbauep0b': { - 'pt': 'Motivo da Visita', - 'en': 'End of Visit', - }, 'x1ij847i': { 'pt': 'Escolha um motivo aqui', 'en': 'Choose a reason here', @@ -423,10 +423,6 @@ final kTranslationsMap = >>[ 'pt': 'Search for an item...', 'en': '', }, - 'etzbm8l5': { - 'pt': 'Nível de Acesso', - 'en': 'End of Visit', - }, 'kmgv5j7x': { 'pt': 'Escolha um nível de acesso aqui', 'en': 'Choose an access level here', @@ -455,50 +451,6 @@ final kTranslationsMap = >>[ 'pt': 'Escreva as suas observações aqui', 'en': 'Write your observations here', }, - 'bvioevav': { - 'pt': 'Ativo', - 'en': 'Active', - }, - '295oz5is': { - 'pt': '16/10/2024', - 'en': '16/10/2024', - }, - '07h0w8ki': { - 'pt': '16/10/2024', - 'en': '16/10/2024', - }, - 'd34nuw4w': { - 'pt': 'Visitante:', - 'en': 'Visitor:', - }, - 'y8geteyc': { - 'pt': ' Lucas Martin Mota', - 'en': 'Lucas Martin Mota', - }, - 'gxdykms1': { - 'pt': 'Morador:', - 'en': 'Resident:', - }, - 'ue7wkm9r': { - 'pt': ' Lucas Martin Mota', - 'en': 'Lucas Martin Mota', - }, - 'zs8s0wd3': { - 'pt': 'Validade:', - 'en': 'Validity:', - }, - 'z7fset9r': { - 'pt': ' 16/10/2024 a 16/10/2024', - 'en': ' 16/10/2024 a 16/10/2024', - }, - 'fcb5avae': { - 'pt': 'Agendamento Ativo', - 'en': 'Active Scheduling', - }, - '61lcxdgm': { - 'pt': 'Agendar Visita', - 'en': 'Schedule Visit', - }, 'v3mpyspm': { 'pt': 'scheduleVisit', 'en': '', @@ -559,20 +511,6 @@ final kTranslationsMap = >>[ 'en': '', }, }, - // onBoardingPage - { - '6exl3e75': { - 'pt': 'Home', - 'en': '', - }, - }, - // fastPassPage - { - 'koh6s96f': { - 'pt': 'Home', - 'en': '', - }, - }, // visitorDetailsModal { 'kqzf7nx2': { @@ -821,31 +759,47 @@ final kTranslationsMap = >>[ 'pt': 'Cadastrar \nPet', 'en': 'Register\npet', }, + 'xlp8dyn6': { + 'pt': 'Agendar \nVisita', + 'en': 'To schedule\nVisit', + }, 'l6b9o7yn': { 'pt': 'QR Code \nde Acesso', 'en': 'QR Code\nAccess', }, + '45gqx8e0': { + 'pt': 'Agenda \nAuto-Visita', + 'en': 'Schedule\nSelf-Visit', + }, }, // menuStaggeredViewComponent { - 'ee33l0ms': { - 'pt': 'Agendar \nVisita', - 'en': 'Schedule \nVisit', + 'jn7p6pj6': { + 'pt': 'Agenda \nAuto-Visita', + 'en': 'Schedule\nSelf-Visit', }, - 'ya37l3jt': { - 'pt': 'Cadastrar\n Visitante', - 'en': 'Register\n Visitor', + 'yymmdtyv': { + 'pt': 'Cadastrar\nVisitante', + 'en': 'Register\nVisitor', }, - 'h8s3adu8': { - 'pt': 'Vincular\nCondomínio', + 'f2jbm9jz': { + 'pt': 'Vincular \nCondomínio', 'en': 'Link\nCondominium', }, - 'j6tfixen': { - 'pt': 'Cadastrar\nPet', + 'rs5a7h6m': { + 'pt': 'Cadastrar \nPet', 'en': 'Register\npet', }, - '9tli4i2x': { - 'pt': 'QR Code\nde Acesso', + 'if2zuaok': { + 'pt': 'Agendar \nVisita', + 'en': 'To schedule\nVisit', + }, + 'r4mjqq6s': { + 'pt': 'Agendar \nVisita', + 'en': 'To schedule\nVisit', + }, + 'cilu7ief': { + 'pt': 'QR Code \nde Acesso', 'en': 'QR Code\nAccess', }, }, @@ -860,151 +814,6 @@ final kTranslationsMap = >>[ 'en': 'All', }, }, - // signInComponent - { - '9hbdjxrz': { - 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', - 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', - }, - '1ltg0ylb': { - 'pt': 'Email', - 'en': 'Email', - }, - '2x19ce8k': { - 'pt': 'Senha', - 'en': 'Password', - }, - 'k44tm7wo': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - '14u7ipws': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - '1x926nsn': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'jwvd4ai1': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - '05dx91ku': { - 'pt': 'Você esqueceu a sua senha?', - 'en': 'Have you forgotten your password?', - }, - 'p5c6d54y': { - 'pt': ' Recupere aqui', - 'en': 'recover here', - }, - 'olf967cj': { - 'pt': 'Termo de Uso', - 'en': 'Terms of use', - }, - }, - // signUpComponent - { - '49609olv': { - 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', - 'en': 'ENTER YOUR EMAIL AND PASSWORD, LET\'S REGISTER YOU!', - }, - '3corpwhd': { - 'pt': 'Nome', - 'en': 'Name', - }, - '80wonb69': { - 'pt': 'Email', - 'en': 'Email', - }, - 'ws143wf4': { - 'pt': '', - 'en': '', - }, - '0firji8l': { - 'pt': 'Senha', - 'en': 'Password', - }, - 'rnvdwzei': { - 'pt': 'Cadastrar-se', - 'en': 'Sign-Up', - }, - 'a9smhn5b': { - 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', - }, - '09xv5ctc': { - 'pt': 'Clique aqui', - 'en': 'Click here', - }, - 'huygnka2': { - 'pt': 'Termo de Uso', - 'en': '', - }, - }, - // welcomeComponent - { - 'dsc9tuc8': { - 'pt': 'UMA EXPERIÊCIA COMPLETA', - 'en': 'A COMPLETE EXPERIENCE', - }, - '5bgqn16z': { - 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', - 'en': 'WITH COMFORT WHEREVER YOU ARE.', - }, - 'dynet730': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'hha60cg7': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - 'zvtay8ee': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'o6zob50a': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - }, - // forgotPasswordComponent - { - 'xxm3ajsy': { - 'pt': 'ESQUECEU SUA SENHA?', - 'en': 'FORGOT YOUR PASSWORD?', - }, - 'wu2f7yzo': { - 'pt': - 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.', - 'en': - 'Don\'t worry, we will help you, enter the email registered in the application and click send.', - }, - 'mtz8l7ft': { - 'pt': 'Email', - 'en': 'Email', - }, - 'w7y5wlnv': { - 'pt': 'digite o seu email.....', - 'en': 'enter your email.....', - }, - '74rnd5bu': { - 'pt': 'Enviar', - 'en': 'To send', - }, - }, - // selectHeaderComponent - { - '1gr8ztd5': { - 'pt': 'Criar Agendamento', - 'en': 'Create Schedule', - }, - 'xjahsbjw': { - 'pt': 'Histórico de Visitas', - 'en': 'Visit History', - }, - }, // Miscellaneous { 'i5smty81': { @@ -1015,14 +824,6 @@ final kTranslationsMap = >>[ 'pt': '', 'en': '', }, - '7zjyxhuq': { - 'pt': '', - 'en': '', - }, - 'd86ioepz': { - 'pt': '', - 'en': '', - }, 'lt3ssl76': { 'pt': '', 'en': '', diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index e3a792e2..47cb35a8 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -42,7 +42,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( ), ), ) - : const OnBoardingPageWidget(), + : const WelcomePageWidget(), routes: [ FFRoute( name: '_initialize', @@ -57,7 +57,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( ), ), ) - : const OnBoardingPageWidget(), + : const WelcomePageWidget(), ), FFRoute( name: 'LoginPage', @@ -77,7 +77,16 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => const HomePageWidget(), + builder: (context, params) => HomePageWidget( + userUUID: params.getParam( + 'userUUID', + ParamType.String, + ), + devUUID: params.getParam( + 'devUUID', + ParamType.String, + ), + ), ), FFRoute( name: 'RegisterPage', @@ -92,7 +101,16 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'registerVisitorPage', path: '/registerVisitorPage', - builder: (context, params) => const RegisterVisitorPageWidget(), + builder: (context, params) => RegisterVisitorPageWidget( + userUUID: params.getParam( + 'userUUID', + ParamType.String, + ), + devUUID: params.getParam( + 'devUUID', + ParamType.String, + ), + ), ), FFRoute( name: 'scheduleCompleteVisitPage', @@ -137,16 +155,6 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'scheduleProvisionalVisitPage', path: '/scheduleProvisionalVisitPage', builder: (context, params) => const ScheduleProvisionalVisitPageWidget(), - ), - FFRoute( - name: 'onBoardingPage', - path: '/onBoardingPage', - builder: (context, params) => const OnBoardingPageWidget(), - ), - FFRoute( - name: 'fastPassPage', - path: '/fastPassPage', - builder: (context, params) => const FastPassPageWidget(), ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index d3cc0e80..588d205a 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -1,12 +1,12 @@ // Export pages -export '/on_boarding/on_boarding_legacy/login_page/login_page_widget.dart' +export '/application_pages/login_page/login_page_widget.dart' show LoginPageWidget; -export '/on_boarding/on_boarding_legacy/forgot_password_page/forgot_password_page_widget.dart' +export '/application_pages/forgot_password_page/forgot_password_page_widget.dart' show ForgotPasswordPageWidget; export '/application_pages/home_page/home_page_widget.dart' show HomePageWidget; -export '/on_boarding/on_boarding_legacy/register_page/register_page_widget.dart' +export '/application_pages/register_page/register_page_widget.dart' show RegisterPageWidget; -export '/on_boarding/on_boarding_legacy/welcome_page/welcome_page_widget.dart' +export '/application_pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/application_pages/register_visitor_page/register_visitor_page_widget.dart' show RegisterVisitorPageWidget; @@ -14,7 +14,3 @@ export '/application_pages/schedule_complete_visit_page/schedule_complete_visit_ show ScheduleCompleteVisitPageWidget; export '/application_pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart' show ScheduleProvisionalVisitPageWidget; -export '/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_widget.dart' - show OnBoardingPageWidget; -export '/application_pages/fast_pass_page/fast_pass_page_widget.dart' - show FastPassPageWidget; diff --git a/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_model.dart b/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_model.dart deleted file mode 100644 index f82f5603..00000000 --- a/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_model.dart +++ /dev/null @@ -1,26 +0,0 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'forgot_password_component_widget.dart' - show ForgotPasswordComponentWidget; -import 'package:flutter/material.dart'; - -class ForgotPasswordComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. - ApiCallResponse? req; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - } -} diff --git a/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_widget.dart b/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_widget.dart deleted file mode 100644 index 9f889f97..00000000 --- a/lib/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_widget.dart +++ /dev/null @@ -1,292 +0,0 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'forgot_password_component_model.dart'; -export 'forgot_password_component_model.dart'; - -class ForgotPasswordComponentWidget extends StatefulWidget { - const ForgotPasswordComponentWidget({super.key}); - - @override - State createState() => - _ForgotPasswordComponentWidgetState(); -} - -class _ForgotPasswordComponentWidgetState - extends State { - late ForgotPasswordComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ForgotPasswordComponentModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - } - - @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, - ), - 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( - 'xxm3ajsy' /* ESQUECEU 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( - 'wu2f7yzo' /* Não se preucupe nós vamos te 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'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - 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: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - 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 { - 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; - } - - if (shouldSetState) setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '74rnd5bu' /* 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, - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_model.dart b/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_model.dart deleted file mode 100644 index f66a1974..00000000 --- a/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_model.dart +++ /dev/null @@ -1,45 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import '/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_widget.dart'; -import '/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_widget.dart'; -import '/on_boarding/on_boarding_beta/welcome_component/welcome_component_widget.dart'; -import 'on_boarding_page_widget.dart' show OnBoardingPageWidget; -import 'package:flutter/material.dart'; - -class OnBoardingPageModel extends FlutterFlowModel { - /// Local state fields for this page. - - String toggleIdx = 'welcome'; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - // Model for signInComponent component. - late SignInComponentModel signInComponentModel; - // Model for signUpComponent component. - late SignUpComponentModel signUpComponentModel; - // Model for welcomeComponent component. - late WelcomeComponentModel welcomeComponentModel; - - @override - void initState(BuildContext context) { - signInComponentModel = createModel(context, () => SignInComponentModel()); - signUpComponentModel = createModel(context, () => SignUpComponentModel()); - welcomeComponentModel = createModel(context, () => WelcomeComponentModel()); - } - - @override - void dispose() { - unfocusNode.dispose(); - signInComponentModel.dispose(); - signUpComponentModel.dispose(); - welcomeComponentModel.dispose(); - } - - /// Action blocks. - Future toggleOnBoardingActionPage( - BuildContext context, { - required String? toggleValue, - }) async { - toggleIdx = toggleValue!; - } -} diff --git a/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_widget.dart b/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_widget.dart deleted file mode 100644 index da799597..00000000 --- a/lib/on_boarding/on_boarding_beta/on_boarding_page/on_boarding_page_widget.dart +++ /dev/null @@ -1,131 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_widget.dart'; -import '/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_widget.dart'; -import '/on_boarding/on_boarding_beta/welcome_component/welcome_component_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:provider/provider.dart'; -import 'on_boarding_page_model.dart'; -export 'on_boarding_page_model.dart'; - -class OnBoardingPageWidget extends StatefulWidget { - const OnBoardingPageWidget({super.key}); - - @override - State createState() => _OnBoardingPageWidgetState(); -} - -class _OnBoardingPageWidgetState extends State { - late OnBoardingPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => OnBoardingPageModel()); - - // On page load action. - SchedulerBinding.instance.addPostFrameCallback((_) async { - if (FFAppState().isLogged == true) { - context.pushNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - duration: Duration(milliseconds: 0), - ), - }, - ); - } else { - if (isAndroid == true) { - FFAppState().device = 'Android'; - setState(() {}); - } else if (isiOS == true) { - FFAppState().device = 'iOS'; - setState(() {}); - } else { - FFAppState().device = 'Web'; - setState(() {}); - } - } - }); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - 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, - body: SafeArea( - top: true, - child: Stack( - children: [ - if (_model.toggleIdx == 'SignIn') - wrapWithModel( - model: _model.signInComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: SignInComponentWidget( - toggleOnBoardingPageAction: (toggleValueSignInParam) async { - await _model.toggleOnBoardingActionPage( - context, - toggleValue: toggleValueSignInParam, - ); - setState(() {}); - }, - ), - ), - if (_model.toggleIdx == 'SignUp') - wrapWithModel( - model: _model.signUpComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: SignUpComponentWidget( - toggleOnBoardingPageAction: (toggleValueSignUpParam) async { - await _model.toggleOnBoardingActionPage( - context, - toggleValue: toggleValueSignUpParam, - ); - setState(() {}); - }, - ), - ), - if (_model.toggleIdx == 'welcome') - wrapWithModel( - model: _model.welcomeComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: WelcomeComponentWidget( - toggleOnboardingPageAction: - (toggleValueWelcomeParam) async { - await _model.toggleOnBoardingActionPage( - context, - toggleValue: toggleValueWelcomeParam, - ); - setState(() {}); - }, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_widget.dart b/lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_widget.dart deleted file mode 100644 index b6955b01..00000000 --- a/lib/on_boarding/on_boarding_beta/sign_in_component/sign_in_component_widget.dart +++ /dev/null @@ -1,899 +0,0 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/on_boarding/on_boarding_beta/forgot_password_component/forgot_password_component_widget.dart'; -import '/actions/actions.dart' as action_blocks; -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'sign_in_component_model.dart'; -export 'sign_in_component_model.dart'; - -class SignInComponentWidget extends StatefulWidget { - const SignInComponentWidget({ - super.key, - required this.toggleOnBoardingPageAction, - }); - - final Future Function(String toggleValueSignInParam)? - toggleOnBoardingPageAction; - - @override - State createState() => _SignInComponentWidgetState(); -} - -class _SignInComponentWidgetState extends State - with TickerProviderStateMixin { - late SignInComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SignInComponentModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - - _model.passwordTextController ??= TextEditingController(); - _model.passwordFocusNode ??= FocusNode(); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), - child: Container( - width: 548.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Text( - FFLocalizations.of(context).getText( - '9hbdjxrz' /* VAMOS LA! ENTRE COM A SUA CONT... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 34.0, 0.0, 34.0, 0.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailAddressTextController, - focusNode: - _model.emailAddressFocusNode, - autofocus: false, - textCapitalization: - TextCapitalization.none, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '1ltg0ylb' /* Email */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.emailAddress, - validator: _model - .emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: - _model.passwordTextController, - focusNode: _model.passwordFocusNode, - autofocus: false, - textInputAction: - TextInputAction.send, - obscureText: - !_model.passwordVisibility, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '2x19ce8k' /* Senha */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFF1AAB5F), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordVisibility = - !_model - .passwordVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, - ), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordTextControllerValidator - .asValidator(context), - ), - ), - ), - Builder( - builder: (context) { - if (MediaQuery.sizeOf(context).width < - kBreakpointSmall - ? true - : false) { - return Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && - (_model.passwordTextController - .text == - '')) - ? null - : () async { - await action_blocks - .singInActionApp( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, - text: FFLocalizations.of( - context) - .getText( - 'k44tm7wo' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: - FlutterFlowTheme.of( - context) - .primary, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - 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, - ), - borderRadius: - BorderRadius.circular( - 12.0), - disabledColor: - const Color(0x951AAB5F), - ), - showLoadingIndicator: false, - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget - .toggleOnBoardingPageAction - ?.call( - 'SignUp', - ); - }, - text: FFLocalizations.of( - context) - .getText( - '14u7ipws' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: - FlutterFlowTheme.of( - context) - .customColor1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: FFButtonWidget( - onPressed: () { - print( - 'signInButtonLoginForm pressed ...'); - }, - text: FFLocalizations.of( - context) - .getText( - '1x926nsn' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: - FlutterFlowTheme.of( - context) - .accent1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius - .circular(12.0), - ), - showLoadingIndicator: - false, - ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - context.pushNamed( - 'RegisterPage'); - }, - text: FFLocalizations.of( - context) - .getText( - 'jwvd4ai1' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: - FlutterFlowTheme.of( - context) - .customColor1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius - .circular(12.0), - ), - showLoadingIndicator: - false, - ), - ), - ), - ].divide(const SizedBox(width: 7.0)), - ); - } - }, - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: RichText( - textScaler: - MediaQuery.of(context).textScaler, - text: TextSpan( - children: [ - TextSpan( - text: - FFLocalizations.of(context) - .getText( - '05dx91ku' /* Você esqueceu a sua senha? */, - ), - style: TextStyle( - color: FlutterFlowTheme.of( - context) - .primaryText, - ), - ), - TextSpan( - text: - FFLocalizations.of(context) - .getText( - 'p5c6d54y' /* Recupere aqui */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.normal, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - mouseCursor: - SystemMouseCursors.click, - recognizer: - TapGestureRecognizer() - ..onTap = () async { - await showModalBottomSheet( - isScrollControlled: - true, - backgroundColor: - Colors - .transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordComponentWidget(), - ); - }, - ).then((value) => - safeSetState( - () {})); - }, - ) - ], - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - Text( - FFLocalizations.of(context).getText( - 'olf967cj' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - ], - ), - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_model.dart b/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_model.dart deleted file mode 100644 index 48fa5cb4..00000000 --- a/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_model.dart +++ /dev/null @@ -1,43 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_up_component_widget.dart' show SignUpComponentWidget; -import 'package:flutter/material.dart'; - -class SignUpComponentModel extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - // Stores action output result for [Action Block - signUpActionApp] action in SignUpButtonRegisterForm widget. - bool? signUp; - - @override - void initState(BuildContext context) { - passwordRegisterFormVisibility = false; - } - - @override - void dispose() { - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); - } -} diff --git a/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_widget.dart b/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_widget.dart deleted file mode 100644 index db82a230..00000000 --- a/lib/on_boarding/on_boarding_beta/sign_up_component/sign_up_component_widget.dart +++ /dev/null @@ -1,770 +0,0 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; -import 'package:easy_debounce/easy_debounce.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'sign_up_component_model.dart'; -export 'sign_up_component_model.dart'; - -class SignUpComponentWidget extends StatefulWidget { - const SignUpComponentWidget({ - super.key, - required this.toggleOnBoardingPageAction, - }); - - final Future Function(String toggleValueSignUpParam)? - toggleOnBoardingPageAction; - - @override - State createState() => _SignUpComponentWidgetState(); -} - -class _SignUpComponentWidgetState extends State - with TickerProviderStateMixin { - late SignUpComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SignUpComponentModel()); - - _model.nameRegisterFormTextController ??= TextEditingController(); - _model.nameRegisterFormFocusNode ??= FocusNode(); - _model.nameRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.emailRegisterFormTextController ??= TextEditingController(); - _model.emailRegisterFormFocusNode ??= FocusNode(); - _model.emailRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.passwordRegisterFormTextController ??= TextEditingController(); - _model.passwordRegisterFormFocusNode ??= FocusNode(); - _model.passwordRegisterFormFocusNode!.addListener(() => setState(() {})); - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 669.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Text( - FFLocalizations.of(context).getText( - '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .nameRegisterFormTextController, - focusNode: _model - .nameRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.nameRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [AutofillHints.name], - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '3corpwhd' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.person, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: TextInputType.name, - validator: _model - .nameRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailRegisterFormTextController, - focusNode: _model - .emailRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.emailRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.email - ], - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '80wonb69' /* Email */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .primaryText, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .customColor1, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.emailAddress, - validator: _model - .emailRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordRegisterFormTextController, - focusNode: _model - .passwordRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.passwordRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.password - ], - obscureText: !_model - .passwordRegisterFormVisibility, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '0firji8l' /* Senha */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFF1AAB5F), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordRegisterFormVisibility = - !_model - .passwordRegisterFormVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordRegisterFormVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, - ), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - var shouldSetState = false; - _model.signUp = await action_blocks - .signUpActionApp( - context, - name: _model - .nameRegisterFormTextController - .text, - passwd: _model - .passwordRegisterFormTextController - .text, - email: _model - .emailRegisterFormTextController - .text, - device: FFAppState().device, - ); - shouldSetState = true; - if (_model.signUp == true) { - await widget - .toggleOnBoardingPageAction - ?.call( - 'SignIn', - ); - } else { - if (shouldSetState) { - setState(() {}); - } - return; - } - - if (shouldSetState) { - setState(() {}); - } - }, - text: FFLocalizations.of(context) - .getText( - 'rnvdwzei' /* Cadastrar-se */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: FlutterFlowTheme.of(context) - .accent1, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget - .toggleOnBoardingPageAction - ?.call( - 'SignIn', - ); - }, - child: RichText( - textScaler: MediaQuery.of(context) - .textScaler, - text: TextSpan( - children: [ - TextSpan( - text: FFLocalizations.of( - context) - .getText( - 'a9smhn5b' /* Você já tem uma conta? */, - ), - style: TextStyle( - color: FlutterFlowTheme.of( - context) - .primaryText, - ), - ), - TextSpan( - text: FFLocalizations.of( - context) - .getText( - '09xv5ctc' /* Clique aqui */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ) - ], - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - Text( - FFLocalizations.of(context).getText( - 'huygnka2' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_model.dart b/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_model.dart deleted file mode 100644 index e794a1dc..00000000 --- a/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_model.dart +++ /dev/null @@ -1,11 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'welcome_component_widget.dart' show WelcomeComponentWidget; -import 'package:flutter/material.dart'; - -class WelcomeComponentModel extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_widget.dart b/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_widget.dart deleted file mode 100644 index 125b6ee2..00000000 --- a/lib/on_boarding/on_boarding_beta/welcome_component/welcome_component_widget.dart +++ /dev/null @@ -1,456 +0,0 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'welcome_component_model.dart'; -export 'welcome_component_model.dart'; - -class WelcomeComponentWidget extends StatefulWidget { - const WelcomeComponentWidget({ - super.key, - required this.toggleOnboardingPageAction, - }); - - final Future Function(String toggleValueWelcomeParam)? - toggleOnboardingPageAction; - - @override - State createState() => _WelcomeComponentWidgetState(); -} - -class _WelcomeComponentWidgetState extends State - with TickerProviderStateMixin { - late WelcomeComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => WelcomeComponentModel()); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SafeArea( - child: Container( - width: 648.0, - height: 208.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - FFLocalizations.of(context).getText( - 'dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Text( - FFLocalizations.of(context).getText( - '5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), - ), - ), - ), - Container( - width: 284.0, - height: 200.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', - width: 603.0, - height: double.infinity, - fit: BoxFit.contain, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - boxShadow: const [ - BoxShadow( - blurRadius: 0.0, - color: Colors.transparent, - offset: Offset( - 0.0, - 0.0, - ), - ) - ], - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Builder( - builder: (context) { - if (MediaQuery.sizeOf(context).width < - kBreakpointSmall - ? true - : false) { - return Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget - .toggleOnboardingPageAction - ?.call( - 'SignIn', - ); - }, - text: - FFLocalizations.of(context).getText( - 'dynet730' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of(context) - .info, - 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, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget - .toggleOnboardingPageAction - ?.call( - 'SignUp', - ); - }, - text: - FFLocalizations.of(context).getText( - 'hha60cg7' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: FlutterFlowTheme.of(context) - .customColor1, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of(context) - .customColor3, - 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, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - context.pushNamed( - 'LoginPage', - queryParameters: { - 'device': serializeParam( - '', - ParamType.String, - ), - }.withoutNulls, - ); - }, - text: FFLocalizations.of(context) - .getText( - 'zvtay8ee' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - context.pushNamed('RegisterPage'); - }, - text: FFLocalizations.of(context) - .getText( - 'o6zob50a' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.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: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - 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, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - ].divide(const SizedBox(width: 7.0)), - ); - } - }, - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/on_boarding/on_boarding_legacy/login_page/login_page_model.dart b/lib/on_boarding/on_boarding_legacy/login_page/login_page_model.dart deleted file mode 100644 index d56459f4..00000000 --- a/lib/on_boarding/on_boarding_legacy/login_page/login_page_model.dart +++ /dev/null @@ -1,113 +0,0 @@ -import '/application_components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/custom_code/actions/index.dart' as actions; -import 'login_page_widget.dart' show LoginPageWidget; -import 'package:flutter/material.dart'; - -class LoginPageModel extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - - @override - void initState(BuildContext context) { - passwordVisibility = false; - } - - @override - void dispose() { - unfocusNode.dispose(); - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); - } - - /// Action blocks. - Future signInActionPage( - BuildContext context, { - required String? emailAdress, - required String? passwd, - }) async { - String? devUUID; - ApiCallResponse? loginCall; - - await Future.wait([ - Future(() async { - FFAppState().email = emailAdress!; - }), - Future(() async { - FFAppState().passwd = passwd!; - }), - ]); - if ((FFAppState().email != '') && - (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); - FFAppState().devUUID = devUUID!; - loginCall = await PhpGroup.loginCall.call( - email: FFAppState().email, - password: FFAppState().passwd, - uuid: FFAppState().devUUID, - type: FFAppState().device, - description: '', - ); - FFAppState().userUUID = FFAppState().userUUID; - if (PhpGroup.loginCall.error( - (loginCall.jsonBody ?? ''), - ) == - false) { - FFAppState().isLogged = true; - - context.goNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.loginCall.msg( - (loginCall?.jsonBody ?? ''), - )!, - ), - ), - ); - }, - ); - - FFAppState().email = ''; - FFAppState().passwd = ''; - FFAppState().update(() {}); - } - } else { - FFAppState().email = ''; - FFAppState().passwd = ''; - } - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 19887d02..a0fbd98d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,13 +27,21 @@ dependencies: sdk: flutter auto_size_text: 3.0.0 cached_network_image: 3.3.1 + carousel_slider: 4.2.1 + cloud_functions: 4.6.7 + cloud_functions_platform_interface: 5.5.18 + cloud_functions_web: 4.7.1 collection: 1.18.0 - crop_your_image: 1.0.0 - device_info_plus: 9.1.2 dropdown_button2: 2.3.9 easy_debounce: 2.0.1 equatable: 2.0.5 file_picker: 6.1.1 + firebase_core: 2.26.0 + firebase_core_platform_interface: 5.0.0 + firebase_core_web: 2.11.5 + firebase_messaging: 14.7.18 + firebase_messaging_platform_interface: 4.5.26 + firebase_messaging_web: 3.6.7 flutter_animate: 4.1.1+1 flutter_cache_manager: 3.3.1 flutter_plugin_android_lifecycle: 2.0.17