fix: map and image editor related issues

This commit is contained in:
Prateek Sunal
2025-06-16 14:46:51 +05:30
parent 2f4c3c7777
commit b67fcdb9ed
4 changed files with 10 additions and 15 deletions

View File

@@ -82,6 +82,7 @@ class _MapViewState extends State<MapView> {
}
: null,
initialCenter: widget.center,
backgroundColor: const Color.fromARGB(255, 246, 246, 246),
minZoom: widget.minZoom,
maxZoom: widget.maxZoom,
interactionOptions: InteractionOptions(
@@ -96,9 +97,7 @@ class _MapViewState extends State<MapView> {
),
),
onPositionChanged: (position, hasGesture) {
if (position.pixelBounds != null) {
onChange(position.bounds!);
}
onChange(position.visibleBounds);
},
),
children: [

View File

@@ -29,7 +29,6 @@ class OSMTileLayer extends StatelessWidget {
return TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
backgroundColor: Colors.transparent,
userAgentPackageName: _userAgent,
tileProvider: CachedNetworkTileProvider(),
);
@@ -46,7 +45,6 @@ class OSMFranceTileLayer extends StatelessWidget {
fallbackUrl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
tileProvider: CachedNetworkTileProvider(),
backgroundColor: const Color.fromARGB(255, 246, 246, 246),
userAgentPackageName: _userAgent,
panBuffer: 1,
);
@@ -101,7 +99,6 @@ class MapBoxTilesLayer extends StatelessWidget {
"https://api.mapbox.com/styles/v1/{mb_user}/{mb_style_id}/tiles/{z}/{x}/{y}?access_token={mb_token}",
fallbackUrl: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
backgroundColor: Colors.transparent,
userAgentPackageName: _userAgent,
tileProvider: CachedNetworkTileProvider(),
additionalOptions: const {

View File

@@ -300,10 +300,8 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
return;
}
final EditActionDetails action = state.editAction!;
final double radian = action.rotateAngle;
final degree = action.rotateDegrees.toInt();
final bool flipHorizontal = action.flipY;
final bool flipVertical = action.flipX;
final Uint8List img = state.rawImageData;
// ignore: unnecessary_null_comparison
@@ -316,11 +314,11 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
final ImageEditorOption option = ImageEditorOption();
option.addOption(ClipOption.fromRect(rect));
option.addOption(
FlipOption(horizontal: flipHorizontal, vertical: flipVertical),
);
if (action.hasRotateAngle) {
option.addOption(RotateOption(radian.toInt()));
if (action.flipY) {
option.addOption(const FlipOption(horizontal: true, vertical: false));
}
if (action.hasRotateDegrees) {
option.addOption(RotateOption(degree));
}
option.addOption(ColorOption.saturation(_saturation!));
@@ -419,7 +417,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
}
void rotate(bool right) {
editorKey.currentState?.rotate(right: right);
editorKey.currentState?.rotate(degree: right ? 90 : -90);
}
Widget _buildSat() {

View File

@@ -51,6 +51,7 @@ class _UpdateLocationDataWidgetState extends State<UpdateLocationDataWidget> {
options: MapOptions(
interactionOptions:
const InteractionOptions(enableMultiFingerGestureRace: true),
backgroundColor: const Color.fromARGB(255, 246, 246, 246),
initialZoom: 3,
maxZoom: 18.0,
minZoom: 2.8,