From 7ff9f35a14388ab3cac9f0a12c6e5705f8fff425 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 21 Aug 2024 10:04:27 -0300 Subject: [PATCH] showNotificationDialog -> ok --- lib/actions/actions.dart | 8 +- lib/backend/api_requests/api_manager.dart | 6 +- .../firebase_messaging_service.dart | 21 +- .../notifications/notification_service.dart | 288 ++++++++++++++++- .../message_notification_widget.dart | 302 ++++++++---------- lib/shared/utils/log_util.dart | 15 +- pubspec.lock | 36 +-- 7 files changed, 457 insertions(+), 219 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 908e2f2f..1d454af9 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,22 +1,16 @@ -import 'dart:developer'; - +import 'package:flutter/material.dart'; // import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import 'package:hub/custom_code/actions/get_dev_u_u_i_d.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; - -import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/random_data_util.dart'; import 'package:hub/pages/home_page/home_page_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:qr_flutter/qr_flutter.dart'; - import 'package:url_launcher/url_launcher.dart'; import '../shared/utils/log_util.dart'; diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 8c2cd6ea..14124b70 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -7,13 +7,12 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:collection/collection.dart'; -import 'package:http/http.dart' as http; import 'package:equatable/equatable.dart'; +import 'package:http/http.dart' as http; import 'package:http_parser/http_parser.dart'; import 'package:mime_type/mime_type.dart'; import '/flutter_flow/uploaded_file.dart'; - import 'get_streamed_response.dart'; enum ApiCallType { @@ -411,7 +410,6 @@ class ApiManager { ApiCallOptions? options, http.Client? client, }) async { - final callOptions = options ?? ApiCallOptions( callName: callName, @@ -512,6 +510,8 @@ class ApiManager { result = ApiCallResponse(null, {}, -1, exception: e); } + log('Params: $params'); + log('JsonBody: ${result.jsonBody}'); return result; } } diff --git a/lib/backend/notifications/firebase_messaging_service.dart b/lib/backend/notifications/firebase_messaging_service.dart index e6dfd349..727c9762 100644 --- a/lib/backend/notifications/firebase_messaging_service.dart +++ b/lib/backend/notifications/firebase_messaging_service.dart @@ -7,14 +7,17 @@ import 'package:hub/shared/utils/log_util.dart'; import 'notification_service.dart'; - Future handleMessage(RemoteMessage message) async { - NotificationService.show(title: message.notification!.title!, body: message.notification!.body!, payload: Map.from(message.data)); + NotificationService.show( + title: message.notification!.title!, + body: message.notification!.body!, + payload: Map.from(message.data)); } class FirebaseMessagingService { // Singleton instance - static final FirebaseMessagingService _instance = FirebaseMessagingService._internal(); + static final FirebaseMessagingService _instance = + FirebaseMessagingService._internal(); // Factory constructor factory FirebaseMessagingService() => _instance; @@ -29,6 +32,9 @@ class FirebaseMessagingService { _refreshToken(); + _firebaseMessaging.setAutoInitEnabled(false); + _firebaseMessaging.pluginConstants; + FirebaseMessaging.onBackgroundMessage(handleMessage); FirebaseMessaging.onMessage.listen((RemoteMessage message) { @@ -43,14 +49,16 @@ class FirebaseMessagingService { if (deviceToken != null) { AppState().token = deviceToken; - final ApiCallResponse? response = await PhpGroup.updToken.call(token: AppState().token, devid: AppState().devUUID, useruuid: AppState().userUUID); + final ApiCallResponse? response = await PhpGroup.updToken.call( + token: AppState().token, + devid: AppState().devUUID, + useruuid: AppState().userUUID); if (PhpGroup.updToken.error((response?.jsonBody ?? '')) == false) { log('Token Atualizado com Sucesso!'); } else { log('Falha ao Atualizar Token: ${response?.jsonBody}'); } - } else { log('Falha ao Pegar Token do Firebase'); } @@ -62,5 +70,4 @@ class FirebaseMessagingService { void _refreshToken() { _firebaseMessaging.onTokenRefresh.listen((token) => updateDeviceToken); } - -} \ No newline at end of file +} diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart index 1aa9f370..f99e8f99 100644 --- a/lib/backend/notifications/notification_service.dart +++ b/lib/backend/notifications/notification_service.dart @@ -2,7 +2,15 @@ import 'dart:developer'; import 'package:awesome_notifications/awesome_notifications.dart'; import 'package:flutter/material.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; class NotificationService { static Future initialize() async { @@ -43,25 +51,282 @@ class NotificationService { onDismissActionReceivedMethod: onDismissActionReceivedMethod); } - static Future onActionReceivedMethod(ReceivedAction receivedAction) async { + 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'); + switch (handleClick) { + case 'visit_request': + showDialog( + context: AppState().context!, + barrierColor: Colors.transparent, + barrierDismissible: true, + builder: (BuildContext context) { + return Dialog( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.8, + height: MediaQuery.of(context).size.height * 0.6, + child: DetailsComponentWidget( + buttons: [ + FlutterFlowIconButton( + icon: const Icon(Icons.done), + onPressed: () async { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Aprovar Visita', + enText: 'Approve Visit', + ), + ), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: + 'Are you sure you want to approve this visit?', + ), + ), + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + actions: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'No', + ptText: 'Não', + ), + onPressed: () { + Navigator.pop(context); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: + BorderRadius.circular(10)), + ), + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Yes', + ptText: 'Sim', + ), + onPressed: () async { + log("payload: $payload"); + await answersRequest + .call( + context, + payload['referencia'].toString(), + 'L', + 'Mensagem', + payload['idVisitante'].toString(), + ) + .then((value) { + if (value) { + Navigator.pop(context); + Navigator.pop(context); + } else { + Navigator.pop(context); + Navigator.pop(context); + DialogUtil.errorDefault(context); + } + }).catchError((e) { + Navigator.pop(context); + Navigator.pop(context); + DialogUtil.errorDefault(context); + }); + }, + options: FFButtonOptions( + width: 100, + height: 40, + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + borderRadius: BorderRadius.circular(10), + ), + ), + ], + ); + }); + }, + ), + FlutterFlowIconButton( + icon: const Icon(Icons.close), + onPressed: () async { + showAlertDialog( + context, + FFLocalizations.of(context).getVariableText( + ptText: 'Bloquear Visita', + enText: 'Block Visit', + ), + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: + 'Are you sure you want to block this visit?', + ), () async { + await answersRequest + .call( + context, + payload['referencia'].toString(), + 'B', + 'Mensagem', + payload['idVisitante'].toString(), + ) + .then((value) { + if (value) { + Navigator.pop(context); + Navigator.pop(context); + } else { + Navigator.pop(context); + Navigator.pop(context); + DialogUtil.errorDefault(context); + } + }).catchError((e) { + Navigator.pop(context); + Navigator.pop(context); + DialogUtil.errorDefault(context); + }); + }); + }, + ), + ], + labelsHashMap: Map.from({ + FFLocalizations.of(context).getVariableText( + enText: 'Visitor', + ptText: 'Visitante', + ): payload['nomevisita'], + FFLocalizations.of(context).getVariableText( + enText: 'Reason', + ptText: 'Motivo', + ): payload['motivo'], + FFLocalizations.of(context).getVariableText( + enText: 'Message', + ptText: 'Mensagem', + ): payload['mensagem'], + }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${payload['documento'] ?? ''}&tipo=E', + statusHashMap: [ + { + FFLocalizations.of(context).getVariableText( + enText: 'Active', + ptText: 'Ativo', + ): FlutterFlowTheme.of(context).warning, + }, + ], + ), + ), + ); + }); + + break; + case 'access': + showDialog( + context: AppState().context!, + barrierColor: Colors.transparent, + barrierDismissible: true, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: AccessNotificationModalTemplateComponentWidget( + datetime: payload['ACE_DATAHORA'].toString(), + drive: payload['ACI_DESCRICAO'].toString(), + id: payload['USR_TIPO'].toString() == 'O' + ? payload['USR_ID'].toString() == '' + ? '0' + : payload['USR_ID'].toString() + : payload['USR_DOCUMENTO'].toString() == '' + ? '0' + : payload['USR_DOCUMENTO'].toString(), + name: payload['PES_NOME'].toString(), + type: payload['USR_TIPO'], + ), + ); + }); + break; + case 'mensagem': + showDialog( + context: AppState().context!, + barrierColor: Colors.transparent, + barrierDismissible: true, + builder: (BuildContext context) { + return Dialog( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.3, + child: MessageNotificationModalTemplateComponentWidget( + id: localId, + from: payload['remetente'].toString(), + to: payload['destinatario'].toString() == 'O' + ? 'Morador' + : 'Visitante', + message: + extra.toString().isEmpty ? 'Unknown' : extra.toString(), + ), + ), + ); + }); + + break; + default: + log('default'); + break; + } + log("onActionReceivedMethod"); - showAlertDialog(AppState().context!, 'Test', 'Test', () async {}); + // showAlertDialog(AppState().context!, 'Test', 'Test', () async {}); } - static Future onNotificationCreatedMethod(ReceivedNotification receivedNotification) async { + static Future onNotificationCreatedMethod( + ReceivedNotification receivedNotification) async { log('onNotificationCreatedMethod'); } - static Future onNotificationDisplayedMethod(ReceivedNotification receivedNotification) async { + static Future onNotificationDisplayedMethod( + ReceivedNotification receivedNotification) async { log('onNotificationDisplayedMethod'); } - static Future onDismissActionReceivedMethod(ReceivedAction receivedAction) async { + static Future onDismissActionReceivedMethod( + ReceivedAction receivedAction) async { log('onDismissActionReceivedMethod'); } @@ -95,11 +360,10 @@ class NotificationService { actionButtons: actionButtons, schedule: scheduled ? NotificationInterval( - interval: interval, - timeZone: - await AwesomeNotifications().getLocalTimeZoneIdentifier(), - preciseAlarm: true) - : null - ); + interval: interval, + timeZone: + await AwesomeNotifications().getLocalTimeZoneIdentifier(), + preciseAlarm: true) + : null); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index d5b54716..31b859f5 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -1,13 +1,8 @@ -import 'package:hub/app_state.dart'; -import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; - -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { @@ -66,161 +61,84 @@ class _MessageNotificationModalTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - 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: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Mensagem', - enText: 'Message', + return Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + 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: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Mensagem', + enText: 'Message', + ), + 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), ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.message, - color: FlutterFlowTheme.of(context).accent1, + 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), ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController1Validator.asValidator(context), + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.message, + color: FlutterFlowTheme.of(context).accent1, ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textInputAction: TextInputAction.next, - readOnly: true, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of(context).getVariableText( - ptText: 'De', - enText: 'From', - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController2Validator - .asValidator(context), - ), + 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: 24.0)) - .addToEnd(const SizedBox(width: 24.0)), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator.asValidator(context), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, autofocus: false, textInputAction: TextInputAction.next, readOnly: true, @@ -228,8 +146,8 @@ class _MessageNotificationModalTemplateComponentWidgetState decoration: InputDecoration( isDense: true, labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Para', - enText: 'To', + ptText: 'De', + enText: 'From', ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -272,15 +190,71 @@ class _MessageNotificationModalTemplateComponentWidgetState maxLines: null, keyboardType: TextInputType.name, validator: - _model.textController3Validator.asValidator(context), + _model.textController2Validator.asValidator(context), ), ), ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 20.0)) - .addToEnd(const SizedBox(height: 20.0)), + .addToStart(const SizedBox(width: 24.0)) + .addToEnd(const SizedBox(width: 24.0)), ), - ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Para', + enText: 'To', + ), + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController3Validator.asValidator(context), + ), + ), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 20.0)) + .addToEnd(const SizedBox(height: 20.0)), ), ), ); diff --git a/lib/shared/utils/log_util.dart b/lib/shared/utils/log_util.dart index 64a30e12..bcbb66cf 100644 --- a/lib/shared/utils/log_util.dart +++ b/lib/shared/utils/log_util.dart @@ -1,15 +1,14 @@ -import 'dart:developer'; - import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; class LogUtil { - - static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { - FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); + static void requestAPIFailed(String url, String body, String reason, + dynamic error, StackTrace stack) async { + FirebaseCrashlytics.instance + .setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); FirebaseCrashlytics.instance.setCustomKey('Body', body); - await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); + await FirebaseCrashlytics.instance + .recordError(error, stack, reason: reason); } - -} \ No newline at end of file +} diff --git a/pubspec.lock b/pubspec.lock index a0b48174..e7e7760e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -809,18 +809,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -897,10 +897,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" maybe_just_nothing: dependency: transitive description: @@ -913,10 +913,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -1278,10 +1278,10 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: "7b41b6c3507854a159e24ae90a8e3e9cc01eb26a477c118d6dca065b5f55453e" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.4+2" stack_trace: dependency: transitive description: @@ -1334,10 +1334,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" timeago: dependency: "direct main" description: @@ -1502,10 +1502,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: @@ -1542,10 +1542,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb" + sha256: "1942a12224ab31e9508cf00c0c6347b931b023b8a4f0811e5dec3b06f94f117d" url: "https://pub.dev" source: hosted - version: "3.14.0" + version: "3.15.0" win32: dependency: "direct overridden" description: @@ -1587,5 +1587,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0"