Open romaklym opened 6 months ago
ArLocationWidget Camera View is distorted and looks squashed on iPhone 14 Pro, and other models. Is there a way to fix this, to make it look natural? Thanks!
here is my body:
ArLocationWidget( annotations: annotations, showDebugInfoSensor: false, maxVisibleDistance: 100, showRadar: false, frame: Size.infinite, // radarPosition: RadarPosition.bottomCenter, // radarWidth: MediaQuery.of(context).size.width * 0.2, markerColor: AppColor.primaryColor, scaleWithDistance: true, annotationViewBuilder: (context, annotation) { if (annotation is Annotation && annotation.customWidget != null) { final customWidget = annotation.customWidget as MyCustomWidget; final distance = Geolocator.distanceBetween( widget.userLocation!.latitude, widget.userLocation!.longitude, annotation.position.latitude, annotation.position.longitude, ); if (distance <= maxDistanceToShow) { return GestureDetector( onTap: () { showGeneralDialog( context: context, barrierDismissible: true, barrierLabel: MaterialLocalizations.of(context) .modalBarrierDismissLabel, transitionDuration: const Duration(milliseconds: 300), pageBuilder: (BuildContext buildContext, Animation animation, Animation secondaryAnimation) { return Center( child: AlertDialog( backgroundColor: AppColor.primaryColor, title: Text( customWidget.placeName, style: TextStyle( color: AppColor.darkText, fontWeight: FontWeight.bold, fontFamily: 'KeaniaOne', fontSize: 20.0, ), textAlign: TextAlign.center, ), content: Text( 'This is ${customWidget.placeName}. Distance: ${distance.toStringAsFixed(2)} meters', style: TextStyle( color: AppColor.darkText, fontWeight: FontWeight.bold, fontFamily: 'Inter', fontSize: 16.0, ), textAlign: TextAlign.center, ), actions: <Widget>[ GestureDetector( onTap: () { if (mounted) { Navigator.of(buildContext).pop(); } }, child: Container( decoration: BoxDecoration( gradient: const LinearGradient(colors: [ Color(0xFF56ab2f), Color(0xFFa8e063) ]), borderRadius: BorderRadius.circular(12), border: Border( right: BorderSide( color: Colors.green.shade700, width: 5), // Example border on the right bottom: BorderSide( color: Colors.green.shade700, width: 5), // Example border on the bottom left: BorderSide.none, // No border top: BorderSide.none, // No border ), ), child: Padding( padding: const EdgeInsets.all(8.0), child: Text( 'OK', style: TextStyle( color: AppColor.transparentWhiteColor, fontWeight: FontWeight.bold, fontFamily: 'BalsamiqSans', fontSize: 16, ), ), ), ), ), ], ), ); }, ); }, // child: AnnotationView( // imageAssetPath: customWidget.imageAssetPath, // distance: distance, // ), child: Image.asset( customWidget.imageAssetPath, height: imageHeight, ), ); } } return const SizedBox.shrink(); }, onLocationChange: (Position position) { Future.delayed(const Duration(seconds: 5), () { updateAnnotationsOnLocationChange(position); setState(() {}); }); }, ),
did anyone found a solution for this bug ?
I also have a distortion of the image in the latest Android version for my Samsung S21.
ArLocationWidget Camera View is distorted and looks squashed on iPhone 14 Pro, and other models. Is there a way to fix this, to make it look natural? Thanks!
here is my body: