rename package

This commit is contained in:
Kuloud 2023-12-22 21:41:04 +08:00
parent 1fb3d91106
commit f2a4f49e0c
8 changed files with 29 additions and 40 deletions

View File

@ -1,5 +1,4 @@
import 'package:x_amap_base/x_amap_base.dart'; import 'package:x_amap_base/x_amap_base.dart';
import 'package:flutter/cupertino.dart';
/// ///
class CameraPosition { class CameraPosition {
@ -66,7 +65,7 @@ class CameraPosition {
} }
@override @override
int get hashCode => hashValues(bearing, target, tilt, zoom); int get hashCode => Object.hashAll([bearing, target, tilt, zoom]);
@override @override
String toString() => String toString() =>

View File

@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui' show hashValues, Offset; import 'dart:ui' show Offset;
import 'package:amap_map/src/types/base_overlay.dart'; import 'package:amap_map/src/types/base_overlay.dart';
import 'package:x_amap_base/x_amap_base.dart'; import 'package:x_amap_base/x_amap_base.dart';
import 'bitmap.dart'; import 'bitmap.dart';
import 'base_overlay.dart';
/// Marker拖动回调 /// Marker拖动回调
typedef void MarkerDragEndCallback(String id, LatLng endPosition); typedef void MarkerDragEndCallback(String id, LatLng endPosition);
@ -68,7 +67,7 @@ class InfoWindow {
} }
@override @override
int get hashCode => hashValues(title, snippet); int get hashCode => Object.hashAll([title, snippet]);
@override @override
String toString() { String toString() {

View File

@ -1,9 +1,6 @@
import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart' show setEquals; import 'package:flutter/foundation.dart' show setEquals;
import 'types.dart'; import 'types.dart';
import 'marker.dart';
/// Marker的更新项 /// Marker的更新项
class MarkerUpdates { class MarkerUpdates {
@ -82,7 +79,7 @@ class MarkerUpdates {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
if(other is !MarkerUpdates) return false; if (other is! MarkerUpdates) return false;
final MarkerUpdates typedOther = other; final MarkerUpdates typedOther = other;
return setEquals(markersToAdd, typedOther.markersToAdd) && return setEquals(markersToAdd, typedOther.markersToAdd) &&
setEquals(markerIdsToRemove, typedOther.markerIdsToRemove) && setEquals(markerIdsToRemove, typedOther.markerIdsToRemove) &&
@ -91,7 +88,7 @@ class MarkerUpdates {
@override @override
int get hashCode => int get hashCode =>
hashValues(markersToAdd, markerIdsToRemove, markersToChange); Object.hashAll([markersToAdd, markerIdsToRemove, markersToChange]);
@override @override
String toString() { String toString() {

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart' show setEquals; import 'package:flutter/foundation.dart' show setEquals;
import 'types.dart'; import 'types.dart';
@ -85,7 +83,7 @@ class PolygonUpdates {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
if (other is !PolygonUpdates) return false; if (other is! PolygonUpdates) return false;
final PolygonUpdates typedOther = other; final PolygonUpdates typedOther = other;
return setEquals(polygonsToAdd, typedOther.polygonsToAdd) && return setEquals(polygonsToAdd, typedOther.polygonsToAdd) &&
setEquals(polygonIdsToRemove, typedOther.polygonIdsToRemove) && setEquals(polygonIdsToRemove, typedOther.polygonIdsToRemove) &&
@ -94,7 +92,7 @@ class PolygonUpdates {
@override @override
int get hashCode => int get hashCode =>
hashValues(polygonsToAdd, polygonIdsToRemove, polygonsToChange); Object.hashAll([polygonsToAdd, polygonIdsToRemove, polygonsToChange]);
@override @override
String toString() { String toString() {

View File

@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart' show setEquals; import 'package:flutter/foundation.dart' show setEquals;
import 'polyline.dart';
import 'types.dart'; import 'types.dart';
/// [Polyline] /// [Polyline]
@ -87,7 +84,7 @@ class PolylineUpdates {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
if (other is !PolylineUpdates) return false; if (other is! PolylineUpdates) return false;
final PolylineUpdates typedOther = other; final PolylineUpdates typedOther = other;
return setEquals(polylinesToAdd, typedOther.polylinesToAdd) && return setEquals(polylinesToAdd, typedOther.polylinesToAdd) &&
setEquals(polylineIdsToRemove, typedOther.polylineIdsToRemove) && setEquals(polylineIdsToRemove, typedOther.polylineIdsToRemove) &&
@ -96,7 +93,7 @@ class PolylineUpdates {
@override @override
int get hashCode => int get hashCode =>
hashValues(polylinesToAdd, polylineIdsToRemove, polylinesToChange); Object.hashAll([polylinesToAdd, polylineIdsToRemove, polylinesToChange]);
@override @override
String toString() { String toString() {

View File

@ -1,5 +1,5 @@
import 'dart:typed_data'; import 'dart:typed_data';
import 'dart:ui' show Color, hashValues; import 'dart:ui' show Color;
import 'package:x_amap_base/x_amap_base.dart'; import 'package:x_amap_base/x_amap_base.dart';
import 'package:amap_map/amap_map.dart'; import 'package:amap_map/amap_map.dart';
@ -94,7 +94,7 @@ class MinMaxZoomPreference {
} }
@override @override
int get hashCode => hashValues(minZoom, maxZoom); int get hashCode => Object.hashAll([minZoom, maxZoom]);
@override @override
String toString() { String toString() {
@ -190,7 +190,7 @@ class MyLocationStyleOptions {
@override @override
int get hashCode => int get hashCode =>
hashValues(enabled, circleFillColor, circleStrokeColor, icon); Object.hashAll([enabled, circleFillColor, circleStrokeColor, icon]);
} }
/// ///
@ -247,7 +247,7 @@ class CustomStyleOptions {
} }
@override @override
int get hashCode => hashValues(enabled, styleData, styleExtraData); int get hashCode => Object.hashAll([enabled, styleData, styleExtraData]);
CustomStyleOptions clone() { CustomStyleOptions clone() {
return CustomStyleOptions(enabled, return CustomStyleOptions(enabled,

View File

@ -15,9 +15,9 @@ dependencies:
plugin_platform_interface: ^2.0.0 plugin_platform_interface: ^2.0.0
stream_transform: ^2.0.0 stream_transform: ^2.0.0
# x_amap_base: ^1.0.0+2 x_amap_base: ^1.0.0+2
x_amap_base: # x_amap_base:
path: ../x_amap_base # path: ../x_amap_base
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

View File

@ -1,22 +1,21 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
const MethodChannel channel = MethodChannel('amap_map'); // const MethodChannel channel = MethodChannel('amap_map');
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
setUp(() { // setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { // channel.setMockMethodCallHandler((MethodCall methodCall) async {
return '42'; // return '42';
}); // });
});
tearDown(() {
channel.setMockMethodCallHandler(null);
});
// test('getPlatformVersion', () async {
// expect(await AMapWiget.platformVersion, '42');
// }); // });
// tearDown(() {
// channel.setMockMethodCallHandler(null);
// });
// // test('getPlatformVersion', () async {
// // expect(await AMapWiget.platformVersion, '42');
// // });
} }