diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e75cf60e..c49f4258 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -138,6 +138,9 @@ PODS: - OrderedSet (~> 5.0) - flutter_secure_storage (6.0.0): - Flutter + - fluttertoast (0.0.2): + - Flutter + - Toast - GoogleAppMeasurement (10.27.0): - GoogleAppMeasurement/AdIdSupport (= 10.27.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.11) @@ -222,6 +225,7 @@ PODS: - Flutter - FlutterMacOS - SwiftyGif (5.4.5) + - Toast (4.1.1) - url_launcher_ios (0.0.1): - Flutter - video_player_avfoundation (0.0.1): @@ -242,6 +246,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) @@ -277,6 +282,7 @@ SPEC REPOS: - PromisesSwift - SDWebImage - SwiftyGif + - Toast EXTERNAL SOURCES: awesome_notifications: @@ -301,6 +307,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_inappwebview_ios/ios" flutter_secure_storage: :path: ".symlinks/plugins/flutter_secure_storage/ios" + fluttertoast: + :path: ".symlinks/plugins/fluttertoast/ios" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" local_auth_darwin: @@ -346,6 +354,7 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 + fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c GoogleAppMeasurement: f65fc137531af9ad647f1c0a42f3b6a4d3a98049 GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 @@ -363,6 +372,7 @@ SPEC CHECKSUMS: shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 + Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1 diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 14124b70..b2c1a248 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -510,8 +510,6 @@ class ApiManager { result = ApiCallResponse(null, {}, -1, exception: e); } - log('Params: $params'); - log('JsonBody: ${result.jsonBody}'); return result; } } diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart index 42fb5320..50e82310 100644 --- a/lib/backend/notifications/notification_service.dart +++ b/lib/backend/notifications/notification_service.dart @@ -53,21 +53,11 @@ class NotificationService { static Future onActionReceivedMethod( ReceivedAction receivedAction) async { - // debugPrint('onActionReceivedMethod'); - // final payload = receivedAction.payload ?? {}; - // if (payload['navigate'] == 'true') { - // locator().navigateToWithParams(notificationRoute, {'title': payload['title']!, 'body': payload['body']!}); - // } final payload = receivedAction.payload ?? {}; final extra = receivedAction.body; final handleClick = payload['click_action']; final localId = jsonDecode(payload['local']!)['CLI_ID']; - // try { - // localId = jsonDecode(payload['local']!)['CLI_ID']; - // } catch (e) { - // localId = payload['local']['CLI_ID'].toString(); - // } log('payload: $payload'); log('extra: $extra'); diff --git a/lib/blocs/connectivity_bloc/connectivity_bloc.dart b/lib/blocs/connectivity_bloc/connectivity_bloc.dart deleted file mode 100644 index 64c73c0e..00000000 --- a/lib/blocs/connectivity_bloc/connectivity_bloc.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'dart:async'; - -import 'package:bloc/bloc.dart'; -import 'package:connectivity_plus/connectivity_plus.dart'; -import 'package:equatable/equatable.dart'; - -part 'connectivity_event.dart'; -part 'connectivity_state.dart'; - -class ConnectivityBloc extends Bloc { - final Connectivity _connectivity; - late StreamSubscription> _connectivitySubscription; - - ConnectivityBloc(this._connectivity) : super(ConnectivityInitial()) { - on(_onConnectivityChanged); - _connectivitySubscription = _connectivity.onConnectivityChanged.listen( - (List result) { - add(ConnectivityChanged(result.first)); - }, - ); - } - - void _onConnectivityChanged( - ConnectivityChanged event, Emitter emit) { - if (event.result == ConnectivityResult.none) { - emit(ConnectivityFailure()); - } else { - emit(ConnectivitySuccess()); - } - } - - @override - Future close() { - _connectivitySubscription.cancel(); - return super.close(); - } -} diff --git a/lib/blocs/connectivity_bloc/connectivity_event.dart b/lib/blocs/connectivity_bloc/connectivity_event.dart deleted file mode 100644 index d069c479..00000000 --- a/lib/blocs/connectivity_bloc/connectivity_event.dart +++ /dev/null @@ -1,17 +0,0 @@ -part of 'connectivity_bloc.dart'; - -abstract class ConnectivityEvent extends Equatable { - const ConnectivityEvent(); - - @override - List get props => []; -} - -class ConnectivityChanged extends ConnectivityEvent { - final ConnectivityResult result; - - const ConnectivityChanged(this.result); - - @override - List get props => [result]; -} diff --git a/lib/blocs/connectivity_bloc/connectivity_state.dart b/lib/blocs/connectivity_bloc/connectivity_state.dart deleted file mode 100644 index d109a152..00000000 --- a/lib/blocs/connectivity_bloc/connectivity_state.dart +++ /dev/null @@ -1,14 +0,0 @@ -part of 'connectivity_bloc.dart'; - -abstract class ConnectivityState extends Equatable { - const ConnectivityState(); - - @override - List get props => []; -} - -class ConnectivityInitial extends ConnectivityState {} - -class ConnectivitySuccess extends ConnectivityState {} - -class ConnectivityFailure extends ConnectivityState {} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index f68f8317..7bf37a7d 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -87,41 +87,41 @@ class _VisitorNotFoundComponentWidgetState ), Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + const EdgeInsetsDirectional.fromSTEB(5.0, 16.0, 5.0, 10.0), child: Text( FFLocalizations.of(context).getText( '1p9mykbj' /* Usuário não encontrado */, ), - style: FlutterFlowTheme.of(context).headlineMedium.override( + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).headlineSmall.override( fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, + FlutterFlowTheme.of(context).headlineSmallFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), + FlutterFlowTheme.of(context).headlineSmallFamily), ), ), ), Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(10, 0, 10, 10), child: Text( FFLocalizations.of(context).getText( 'kt937sp6' /* O documento inserido não corre... */, ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).labelSmall.override( + fontFamily: FlutterFlowTheme.of(context).labelSmallFamily, color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontStyle: FontStyle.italic, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + FlutterFlowTheme.of(context).labelSmallFamily), ), ), ), Padding( - padding: const EdgeInsets.symmetric(vertical: 10), + padding: const EdgeInsets.symmetric(vertical: 15), child: Align( alignment: const AlignmentDirectional(0.0, 1.0), child: FFButtonWidget( @@ -157,13 +157,13 @@ class _VisitorNotFoundComponentWidgetState iconPadding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + textStyle: FlutterFlowTheme.of(context).labelSmall.override( fontFamily: - FlutterFlowTheme.of(context).titleSmallFamily, + FlutterFlowTheme.of(context).labelSmallFamily, color: Colors.white, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), + FlutterFlowTheme.of(context).labelSmallFamily), ), elevation: 3.0, borderSide: const BorderSide( @@ -171,10 +171,10 @@ class _VisitorNotFoundComponentWidgetState width: 1.0, ), borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + bottomLeft: Radius.circular(10.0), + bottomRight: Radius.circular(10.0), + topLeft: Radius.circular(10.0), + topRight: Radius.circular(10.0), ), ), ), diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart deleted file mode 100644 index ebbcaea4..00000000 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart'; - -import '../../../flutter_flow/flutter_flow_model.dart'; - -import 'package:flutter/material.dart'; - -class ArrowLinkedLocalsComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart deleted file mode 100644 index d0a00a4f..00000000 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; - - -class ArrowLinkedLocalsComponentWidget extends StatefulWidget { - const ArrowLinkedLocalsComponentWidget({super.key}); - - @override - State createState() => - _ArrowLinkedLocalsComponentWidgetState(); -} - -class _ArrowLinkedLocalsComponentWidgetState - extends State { - late ArrowLinkedLocalsComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ArrowLinkedLocalsComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Container(); - } -} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index e8e7c3b0..58db3341 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -1,9 +1,14 @@ -import 'package:cached_network_image/cached_network_image.dart'; +import 'dart:developer'; + +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; import 'package:provider/provider.dart'; import '/backend/api_requests/api_calls.dart'; @@ -14,14 +19,20 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); @override - State createState() => - _BottomArrowLinkedLocalsComponentWidgetState(); + State createState() => _BottomArrowLinkedLocalsComponentWidgetState(); } -class _BottomArrowLinkedLocalsComponentWidgetState - extends State { +class _BottomArrowLinkedLocalsComponentWidgetState extends State { late BottomArrowLinkedLocalsComponentModel _model; + + bool _loading = false; + bool _hasData = false; + + late Future _localsFuture; + List _localsWrap = []; + + @override void setState(VoidCallback callback) { super.setState(callback); @@ -31,8 +42,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState @override void initState() { super.initState(); - _model = - createModel(context, () => BottomArrowLinkedLocalsComponentModel()); + _model = createModel(context, () => BottomArrowLinkedLocalsComponentModel()); + _localsFuture = _fetchLocals(); } @override @@ -42,248 +53,224 @@ class _BottomArrowLinkedLocalsComponentWidgetState super.dispose(); } + void _showNoMoreDataSnackBar(BuildContext context) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), + ), + duration: const Duration(seconds: 3), + backgroundColor: FlutterFlowTheme.of(context).primary, + ), + ); + } + + Future _fetchLocals() async { + try { + setState(() => _loading = true); + var response = await PhpGroup.getLocalsCall.call( + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + ); + + final List locals = response.jsonBody['locais'] ?? []; + + if (locals != null && locals.isNotEmpty) { + setState(() { + _localsWrap.addAll(locals); + _hasData = true; + _loading = false; + }); + + return response; + } + + _showNoMoreDataSnackBar(context); + + setState(() { + _hasData = false; + _loading = false; + }); + + return null; + } catch (e, s) { + setState(() { + _hasData = false; + _loading = false; + }); + } + + } + + Future _fetchResponseLink(String status, String cliID) async { + try { + var response = await PhpGroup.resopndeVinculo.call( + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + cliID: cliID, + tarefa: status + ); + + if (response.jsonBody['error'] == false) { + return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vinculo Ativado com Sucesso", enText: "Link Activated Successfully") }; + } else { + return response.jsonBody; + } + + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vinculo', e, s); + return {'error': true, 'error_msg': FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later." + )}; + } + } + + String _imagePath(dynamic local) { + return 'https://freaccess.com.br/freaccess/Images/Clients/${local['CLI_ID']}.png'; + } + + Map _labelsHashMap(dynamic local) { + return Map.from({ + '${local['CLI_PREFIXO']}:': local['CLI_NOME'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC'] + }); + } + + Map _statusHashMap(dynamic local) { + return Map.from({ + if (local['CLU_STATUS'] == 'A') + FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success + else if (local['CLU_STATUS'] == 'B') + FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error + else + FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning + }); + } + + Widget _item(BuildContext context, dynamic local) { + return CardItemTemplateComponentWidget( + imagePath: _imagePath(local), + labelsHashMap: _labelsHashMap(local), + statusHashMap: [_statusHashMap(local)], + onTapCardItemAction: () async { + + if (local['CLU_STATUS'] == 'A') { + AppState().cliUUID = local['CLI_ID']; + AppState().local = local['CLI_NOME']; + AppState().ownerUUID = local['CLU_OWNER_ID']; + Navigator.pop(context); + } else if (local['CLU_STATUS'] == 'B') { + String message = FFLocalizations.of(context).getVariableText( + ptText: 'Local Bloqueado para Acesso, Entre em Contato com Administração', + enText: 'Location Blocked for Access, Contact Administration' + ); + + if (local['CLU_BLK_MESSAGE'] != null && local['CLU_BLK_MESSAGE'] != '') { + message = local['CLU_BLK_MESSAGE']; + } + + DialogUtil.warning(context, message); + _localsWrap = []; + _localsFuture = _fetchLocals(); + } else { + String localName = local['CLI_NOME']; + showAlertDialog( + context, + FFLocalizations.of(context).getVariableText(ptText: 'Ativar VInculo', enText: 'Activate Link'), + FFLocalizations.of(context).getVariableText(ptText: 'Deseja Aceitar o Vinculo a $localName?', enText: 'Do you wish to accept the link to $localName?'), + () async { + var response = await _fetchResponseLink('A', local['CLI_ID']); + Navigator.pop(context); + if (response['error'] == true) { + DialogUtil.error(context, response['error_msg']); + } else { + DialogUtil.success(context, response['error_msg']); + _localsWrap = []; + _localsFuture = _fetchLocals(); + } + } + ); + } + + }, + ); + } + + Widget _listItems(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + padding: const EdgeInsets.only(top: 15), + child: FutureBuilder( + future: _localsFuture, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemCount: _localsWrap.length, + itemBuilder: (BuildContext context, int index) { + final item = _localsWrap[index]; + return _item(context, item); + }, + ); + }, + ) + ); + } + @override Widget build(BuildContext context) { context.watch(); + double height = MediaQuery.sizeOf(context).height; + return Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: const AlignmentDirectional(0, 1), child: Container( width: double.infinity, - height: 150.0, + height: height - (height * 0.5), decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), + topLeft: Radius.circular(25), + topRight: Radius.circular(25) + ) ), child: Column( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 150.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: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).accent1, - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () {}, - ), - ), - Expanded( - child: FutureBuilder( - future: PhpGroup.getLocalsCall.call( - devUUID: AppState().devUUID, - userUUID: AppState().userUUID, - ), - 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 gridViewGetLocalsResponse = snapshot.data!; - - return Builder( - builder: (context) { - final eachLocals = PhpGroup.getLocalsCall - .locais( - gridViewGetLocalsResponse.jsonBody, - ) - ?.map((e) => e) - .toList() - .toList() ?? - []; - - return GridView.builder( - padding: EdgeInsets.zero, - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - crossAxisSpacing: 10.0, - mainAxisSpacing: 0.0, - childAspectRatio: 1.0, - ), - scrollDirection: Axis.horizontal, - itemCount: eachLocals.length, - itemBuilder: (context, eachLocalsIndex) { - final eachLocalsItem = - eachLocals[eachLocalsIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - AppState().cliUUID = getJsonField( - eachLocalsItem, - r'''$.CLI_ID''', - ).toString(); - setState(() {}); - AppState().local = getJsonField( - eachLocalsItem, - r'''$.CLI_NOME''', - ).toString(); - setState(() {}); - AppState().ownerUUID = getJsonField( - eachLocalsItem, - r'''$.CLU_OWNER_ID''', - ).toString(); - setState(() {}); - Navigator.pop(context); - }, - child: Container( - width: 50.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryText, - borderRadius: - const BorderRadius.only( - bottomLeft: - Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: - Radius.circular(25.0), - topRight: - Radius.circular(25.0), - ), - border: Border.all( - color: FlutterFlowTheme.of( - context) - .secondaryText, - width: 3.0, - ), - ), - 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( - imageUrl: - "https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( - eachLocalsItem, - r'''$.CLI_ID''', - ).toString()}.png", - width: double.infinity, - height: double.infinity, - fit: BoxFit.fill, - alignment: const Alignment( - 0.0, 0.0), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Text( - getJsonField( - eachLocalsItem, - r'''$.CLI_NOME''', - ).toString(), - 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), - ), - ), - ), - ], - ), - ), - ); - }, - ); - }, - ); - }, - ), - ), - ].addToStart(const SizedBox(width: 20.0)), + if (_hasData == false && _loading == false && _localsWrap.isEmpty) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Nenhum Local Encontrado.", + enText: "No local found")), + ) + ], + ), + ) + else if (_hasData == true && _loading == false && _localsWrap.isNotEmpty) + Expanded(child: _listItems(context)), + if (_loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), - ], - ), - ), + ), + ) ], ), ), diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index 1e3be0af..a871fb25 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -72,28 +72,29 @@ class _LocalProfileComponentWidgetState 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( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: const Color(0x00FFFFFF), + context: context, + enableDrag: false, + isDismissible: false, + 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: CachedNetworkImage( imageUrl: valueOrDefault( diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index d3be31a3..e00b2a7e 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:flutter/services.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; @@ -103,7 +104,7 @@ class _VisitorSearchModalTemplateComponentWidgetState textInputAction: TextInputAction.done, obscureText: false, decoration: InputDecoration( - isDense: false, + isDense: true, labelText: FFLocalizations.of(context).getText( 'cjlpru1m' /* Procure pelo documento do visi... */, ), @@ -176,7 +177,8 @@ class _VisitorSearchModalTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), - keyboardType: TextInputType.number, + keyboardType: + const TextInputType.numberWithOptions(signed: true), validator: _model.textControllerValidator.asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), @@ -417,7 +419,7 @@ class _VisitorSearchModalTemplateComponentWidgetState ], ), const SizedBox( - height: 20.0, + height: 30.0, ) ], ), @@ -472,7 +474,9 @@ class _VisitorSearchModalTemplateComponentWidgetState ToastUtil.showToast( message: FFLocalizations.of(context).getVariableText( ptText: 'Visitante já adicionado!', - enText: 'Visitor already added!')); + enText: 'Visitor already added!'), + gravity: ToastGravity.TOP, + backgroundColor: Colors.red); } } else { await showAdaptiveDialog( diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 851cddfd..534b2d04 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -690,8 +690,8 @@ final kTranslationsMap = >>[ // visitorNotFoundComponent { '1p9mykbj': { - 'pt': 'Usuário não encontrado', - 'en': 'User not found', + 'pt': 'Usuário Não Encontrado', + 'en': 'User Not Found', }, 'kt937sp6': { 'pt': diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 83ae2bde..3c7d21bb 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -75,20 +75,15 @@ class _HomePageWidgetState extends State { if (AppState().cliUUID.isEmpty) { showModalBottomSheet( - isScrollControlled: false, + isScrollControlled: true, backgroundColor: Colors.transparent, enableDrag: false, isDismissible: 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(), - ), + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), ); }, ).then((value) => safeSetState(() {})); diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 8dfcc0f8..875400ef 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -148,7 +148,7 @@ class _LiberationHistoryWidgetState extends State { Center( child: Text(FFLocalizations.of(context).getVariableText( ptText: "Nenhuma solicitação encontrada!", - enText: "No visit found")), + enText: "No requests found")), ) ], ), diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 9199a659..f41a44f8 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -33,7 +33,7 @@ class ScheduleCompleteVisitPageModel String convertDateFormat(String dateStr) { try { // Formato original - DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + DateFormat originalFormat = DateFormat('dd/MM/yyyy HH:mm:ss'); // Novo formato DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); @@ -197,7 +197,7 @@ class ScheduleCompleteVisitPageModel textFieldFocusNode1 = FocusNode(); textController1 = TextEditingController( text: dateTimeFormat( - 'd/M/y H:mm:ss', + 'dd/MM/yyyy HH:mm:ss', DateTime.now().add(const Duration(minutes: 10)), // locale: FFLocalizations.of(context).languageCode, )); @@ -206,7 +206,7 @@ class ScheduleCompleteVisitPageModel textFieldFocusNode2 = FocusNode(); textController2 = TextEditingController( text: dateTimeFormat( - 'd/M/y H:mm:ss', + 'dd/MM/yyyy HH:mm:ss', DateTime.now().add(const Duration(days: 1)), // locale: FFLocalizations.of(context).languageCode, )); diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 775160ef..7b50d328 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1114,9 +1114,7 @@ Widget scheduleVisit(BuildContext context, if (value.contains('{') && value.contains('}') && value.contains(':')) { - // log("Valor e um Objeto | Usuário Escolheu o Motivo ${_model.dropDownValue1}"); } else { - // log("Valor e uma String | Usuário Escolheu o Motivo ${_model.dropDownValue1}"); if (reasonsJsonList != null && reasonsJsonList.isNotEmpty) { var item = reasonsJsonList.where( diff --git a/pubspec.yaml b/pubspec.yaml index 8fa32471..1f3c6a80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -79,7 +79,6 @@ dependencies: timeago: 3.6.1 url_launcher: 6.3.0 url_launcher_android: 6.3.3 - bloc: ^8.1.4 url_launcher_ios: 6.3.0 url_launcher_platform_interface: 2.3.2 video_player: 2.8.7