From d03b3fbdfed834a17073bd2a026bd5f8757b6d6c Mon Sep 17 00:00:00 2001 From: jantunesmessias Date: Thu, 20 Feb 2025 08:52:59 -0300 Subject: [PATCH] resolve conflits --- .../details_component_widget.dart | 410 +++++++++--------- .../backend/api_requests/api_calls.dart | 11 +- .../notification/deep_link_service.dart | 1 + lib/initialization.dart | 2 + .../vehicle_history_screen.dart | 2 +- .../vehicle_model.dart | 16 +- .../vehicles_on_the_property.dart | 2 +- pubspec.yaml | 1 - 8 files changed, 228 insertions(+), 217 deletions(-) diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 67a21e19..6e78a391 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -67,75 +67,114 @@ class _DetailsComponentWidgetState extends State { // CachedNetworkImage.evictFromCache(widget.imagePath ?? ''); final double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); - return Container( - constraints: BoxConstraints( - maxWidth: MediaQuery.of(context).size.width, - maxHeight: MediaQuery.of(context).size.height, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(25.0)), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if (widget.imagePath != null && widget.imagePath != '') - Container( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.3, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, + return Material( + type: MaterialType.transparency, + child: Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width, + maxHeight: MediaQuery.of(context).size.height, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.all(Radius.circular(25.0)), + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + if (widget.imagePath != null && widget.imagePath != '') + Container( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.3, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: widget.imagePath!, + fit: BoxFit.cover, + useOldImageOnUrlChange: true, + ), ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: widget.imagePath!, - fit: BoxFit.cover, - useOldImageOnUrlChange: true, + if (widget.icon != null && widget.icon != '') + Container( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.3, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: widget.icon!, ), - ), - if (widget.icon != null && widget.icon != '') - Container( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.3, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: widget.icon!, - ), - SizedBox(height: MediaQuery.of(context).size.height * 0.03), - Row( - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries - .map((MapEntry item) { - return Expanded( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * 0.05, - ), - child: TextFormField( - autofocus: false, - canRequestFocus: false, - readOnly: true, - initialValue: item.key, - obscureText: false, - decoration: InputDecoration( - isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: item.value, + SizedBox(height: MediaQuery.of(context).size.height * 0.03), + Row( + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Expanded( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * 0.05, + ), + child: TextFormField( + autofocus: false, + canRequestFocus: false, + readOnly: true, + initialValue: item.key, + obscureText: false, + decoration: InputDecoration( + isDense: true, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: item.value, + ), + ), + filled: true, + fillColor: item.value, + // labelText: item.key, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + fontWeight: FontWeight.bold, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), + fontSize: limitedBodyFontSize, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily, + ), + fontSize: limitedBodyFontSize, + ), + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: InputBorder.none, + suffixIcon: Icon( + Icons.info, + color: FlutterFlowTheme.of(context).info, ), ), - filled: true, - fillColor: item.value, - // labelText: item.key, - labelStyle: FlutterFlowTheme.of(context) + style: FlutterFlowTheme.of(context) .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) @@ -149,150 +188,117 @@ class _DetailsComponentWidgetState extends State { ), fontSize: limitedBodyFontSize, ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily, - ), - fontSize: limitedBodyFontSize, - ), - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: InputBorder.none, - suffixIcon: Icon( - Icons.info, - color: FlutterFlowTheme.of(context).info, - ), + textAlign: TextAlign.center, + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), ), - style: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - fontWeight: FontWeight.bold, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( + ), + ); + }).toList(); + }).toList(), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.03), + ListView.builder( + shrinkWrap: true, + itemCount: labelsLinkedHashMap.length, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String key = labelsLinkedHashMap.keys.elementAt(index); + String value = labelsLinkedHashMap[key]!; + // return Text('key: $key, value: $value'); + return TextFormField( + readOnly: true, + initialValue: value, + 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, + ), + fontSize: limitedBodyFontSize, + ), + decoration: InputDecoration( + labelText: key, + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - ), - fontSize: limitedBodyFontSize, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily, ), - textAlign: TextAlign.center, - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), + ), + 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( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here + ), ), ), ); - }).toList(); - }).toList(), - ), - SizedBox(height: MediaQuery.of(context).size.height * 0.03), - ListView.builder( - shrinkWrap: true, - itemCount: labelsLinkedHashMap.length, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - String key = labelsLinkedHashMap.keys.elementAt(index); - String value = labelsLinkedHashMap[key]!; - // return Text('key: $key, value: $value'); - return TextFormField( - readOnly: true, - initialValue: value, - 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, - ), - fontSize: limitedBodyFontSize, - ), - decoration: InputDecoration( - labelText: key, - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - 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: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - errorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, // Change border color here - ), - ), - ), - ); - }, - ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if (widget.buttons!.isNotEmpty || widget.buttons != null) - OverflowBar( - overflowAlignment: OverflowBarAlignment.center, - alignment: MainAxisAlignment.center, - overflowSpacing: 2, - spacing: 2, - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons!, + }, ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), - ], + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + if (widget.buttons!.isNotEmpty || widget.buttons != null) + OverflowBar( + overflowAlignment: OverflowBarAlignment.center, + alignment: MainAxisAlignment.center, + overflowSpacing: 2, + spacing: 2, + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: widget.buttons!, + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + ], + ), ), ), ); diff --git a/lib/features/backend/api_requests/api_calls.dart b/lib/features/backend/api_requests/api_calls.dart index da746b83..78d1444d 100644 --- a/lib/features/backend/api_requests/api_calls.dart +++ b/lib/features/backend/api_requests/api_calls.dart @@ -79,6 +79,9 @@ class FreAccessWSGlobal extends Api { static UpdateVehicle updateVehicle = UpdateVehicle(); static DeleteVehicle deleteVehicle = DeleteVehicle(); static CancelDeleteVehicle cancelDelete = CancelDeleteVehicle(); + static GetPDF getPDF = GetPDF(); + static GetCategories getCategories = GetCategories(); + static GetDocuments getDocuments = GetDocuments(); } class CancelDeleteVehicle { @@ -88,7 +91,7 @@ class CancelDeleteVehicle { required final String model, required final String color, }) async { - final String baseUrl = PhpGroup.getBaseUrl(); + final String baseUrl = FreAccessWSGlobal.getBaseUrl(); final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; final String userUUID = @@ -130,7 +133,7 @@ class DeleteVehicle { required final String model, required final String color, }) async { - final String baseUrl = PhpGroup.getBaseUrl(); + final String baseUrl = FreAccessWSGlobal.getBaseUrl(); final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; final String userUUID = @@ -173,7 +176,7 @@ class RegisterVehicle { final String? color, final String? model, }) async { - final String baseUrl = PhpGroup.getBaseUrl(); + final String baseUrl = FreAccessWSGlobal.getBaseUrl(); final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; @@ -217,7 +220,7 @@ class UpdateVehicle { final String? color, final String? model, }) async { - final String baseUrl = PhpGroup.getBaseUrl(); + final String baseUrl = FreAccessWSGlobal.getBaseUrl(); final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; final String userUUID = diff --git a/lib/features/notification/deep_link_service.dart b/lib/features/notification/deep_link_service.dart index aac0351c..003f1903 100644 --- a/lib/features/notification/deep_link_service.dart +++ b/lib/features/notification/deep_link_service.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:developer'; import 'package:app_links/app_links.dart'; import 'package:flutter/material.dart'; import 'package:hub/features/storage/index.dart'; diff --git a/lib/initialization.dart b/lib/initialization.dart index 82902a36..808d3220 100644 --- a/lib/initialization.dart +++ b/lib/initialization.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:app_tracking_transparency/app_tracking_transparency.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; diff --git a/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart b/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart index ddbf6271..7d6c7eae 100644 --- a/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart +++ b/lib/pages/vehicles_on_the_property/vehicle_history_screen.dart @@ -10,7 +10,7 @@ class VehicleHistoryScreen extends StatefulWidget { class _VehicleHistoryScreenState extends State with Pageable { - final apiCall = PhpGroup.getVehiclesByProperty; + final apiCall = FreAccessWSGlobal.getVehiclesByProperty; int totalOwnerVehicles = 0; final PagingController _pagingController = PagingController(firstPageKey: 1); diff --git a/lib/pages/vehicles_on_the_property/vehicle_model.dart b/lib/pages/vehicles_on_the_property/vehicle_model.dart index 61a53dc5..0a5f23c6 100644 --- a/lib/pages/vehicles_on_the_property/vehicle_model.dart +++ b/lib/pages/vehicles_on_the_property/vehicle_model.dart @@ -7,8 +7,8 @@ import 'package:hub/features/backend/index.dart'; import 'package:hub/features/storage/index.dart'; import 'package:hub/flutter_flow/index.dart'; import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart'; -import 'package:hub/shared/extensions/index.dart'; -import 'package:hub/shared/utils/index.dart'; +import 'package:hub/shared/extensions.dart'; +import 'package:hub/shared/utils.dart'; /// [VehicleModel] is a class that contains the business logic of the vehicle page. class VehicleModel extends FlutterFlowModel @@ -196,7 +196,7 @@ mixin class _BaseVehiclePage { /// [_VehicleRegisterScreenModel] is a mixin that contains the business logic of the vehicle register page. mixin _VehicleRegisterScreenModel on _BaseVehiclePage { Future registerVehicle() async { - final response = await PhpGroup.registerVehicle.call( + final response = await FreAccessWSGlobal.registerVehicle.call( licensePlate: textFieldControllerLicensePlate!.text, color: textFieldControllerColor!.text, model: textFieldControllerModel!.text, @@ -218,7 +218,7 @@ mixin _VehicleRegisterScreenModel on _BaseVehiclePage { /// [_VehicleUpdateScreenModel] is a mixin that contains the business logic of the vehicle update page. mixin _VehicleUpdateScreenModel on _BaseVehiclePage { Future updateVehicle() async { - final response = await PhpGroup.updateVehicle.call( + final response = await FreAccessWSGlobal.updateVehicle.call( licensePlate: textFieldControllerLicensePlate!.text, color: textFieldControllerColor!.text, model: textFieldControllerModel!.text, @@ -403,7 +403,7 @@ mixin _VehicleHistoryScreenModel on _BaseVehiclePage { Future processDeleteRequest(dynamic item) async { log('processDeleteRequest -> item[$item]'); - bool result = await PhpGroup.deleteVehicle + bool result = await FreAccessWSGlobal.deleteVehicle .call( vehicleId: item['vehicleId'], licensePlate: item['licensePlate'], @@ -493,7 +493,7 @@ mixin _VehicleHistoryScreenModel on _BaseVehiclePage { } Future processCancelDeleteRequest(dynamic item) async { - return await PhpGroup.deleteVehicle.call( + return await FreAccessWSGlobal.deleteVehicle.call( vehicleId: item['vehicleId'], licensePlate: item['licensePlate'], model: item['model'], @@ -502,7 +502,7 @@ mixin _VehicleHistoryScreenModel on _BaseVehiclePage { } Future processCancelUpdateRequest(dynamic item) async { - return await PhpGroup.deleteVehicle.call( + return await FreAccessWSGlobal.deleteVehicle.call( vehicleId: item['vehicleId'], licensePlate: item['licensePlate'], model: item['model'], @@ -511,7 +511,7 @@ mixin _VehicleHistoryScreenModel on _BaseVehiclePage { } Future processCancelCreateRequest(dynamic item) async { - return await PhpGroup.cancelDelete.call( + return await FreAccessWSGlobal.cancelDelete.call( vehicleId: item['vehicleId'], licensePlate: item['licensePlate'], model: item['model'], diff --git a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart index 9e51e429..318d05c7 100644 --- a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart +++ b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart @@ -13,7 +13,7 @@ import 'package:hub/features/backend/index.dart'; import 'package:hub/features/module/index.dart'; import 'package:hub/flutter_flow/index.dart'; import 'package:hub/pages/vehicles_on_the_property/vehicle_model.dart'; -import 'package:hub/shared/extensions/index.dart'; +import 'package:hub/shared/extensions.dart'; import 'package:hub/shared/mixins/pageable_mixin.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/license_util.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 0999c417..28d1d316 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,6 @@ name: hub description: . # Descrição do projeto (adicione mais detalhes se necessário) publish_to: "none" # Destino de publicação -publish_to: "none" version: 1.4.0+27