Skip to content

Commit

Permalink
Merge tag '0.0.2-core' into develop
Browse files Browse the repository at this point in the history
no message
  • Loading branch information
yohom committed May 11, 2019
2 parents eed0ce2 + 934adf7 commit 4ef1784
Show file tree
Hide file tree
Showing 84 changed files with 65 additions and 1,742 deletions.
9 changes: 7 additions & 2 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.0.1] - TODO: Add release date.
## 0.0.3
* 加入log, misc, permissions

* TODO: Describe initial release.
## 0.0.2
* 抽取`AMap`

## 0.0.1
* 抽取LatLng
3 changes: 3 additions & 0 deletions core/lib/amap_base_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

export 'model/lat_lng.dart';
export 'util/log.dart';
export 'util/misc.dart';
export 'util/permissions.dart';

class AMap {
static final _channel = MethodChannel('me.yohom/amap_base');
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions map/lib/src/common/misc.dart → core/lib/util/misc.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'dart:collection';
import 'dart:io';

import 'package:amap_base_map/amap_base_map.dart';
import 'package:amap_base_map/src/common/log.dart';
import 'package:flutter/material.dart';

import '../amap_base_core.dart';
import 'log.dart';

double devicePixelRatio = 1;

bool isEmpty(Object object) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amap_base_core
description: Fully Functional AMap Flutter Plugin. Based on AndroidView/UiKitView.
version: 0.0.1
version: 0.0.3+1
author: yohom <[email protected]>
homepage: https://github.com/yohom/amap_base_flutter

Expand Down
44 changes: 0 additions & 44 deletions location/lib/amap_base_location.dart
Original file line number Diff line number Diff line change
@@ -1,51 +1,7 @@
library amap_base_location;

import 'dart:async';
import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'src/location/amap_location.dart';

export 'package:amap_base_core/amap_base_core.dart';

export 'src/common/permissions.dart';
export 'src/location/amap_location.dart';
export 'src/location/model/location.dart';
export 'src/location/model/location_client_options.dart';

class AMap {
static final _channel = MethodChannel('me.yohom/amap_base');

static Map<String, List<String>> assetManifest;

static Future init(String key) async {
await _channel.invokeMethod('setKey', {'key': key});

// 加载asset相关信息, 供区分图片分辨率用, 因为native端的加载asset方法无法区分分辨率, 这是一个变通方法
assetManifest =
await rootBundle.loadStructuredData<Map<String, List<String>>>(
'AssetManifest.json',
(String jsonData) {
if (jsonData == null)
return SynchronousFuture<Map<String, List<String>>>(null);

final Map<String, dynamic> parsedJson = json.decode(jsonData);
final Iterable<String> keys = parsedJson.keys;
final Map parsedManifest = Map<String, List<String>>.fromIterables(
keys,
keys.map<List<String>>((key) => List<String>.from(parsedJson[key])),
);
return SynchronousFuture<Map<String, List<String>>>(parsedManifest);
},
);

await AMapLocation().init();
}

@Deprecated('使用init方法初始化的时候设置key')
static Future setKey(String key) {
return _channel.invokeMethod('setKey', {'key': key});
}
}
99 changes: 0 additions & 99 deletions location/lib/src/common/misc.dart

This file was deleted.

2 changes: 1 addition & 1 deletion location/lib/src/location/amap_location.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:convert';

import 'package:amap_base_location/src/common/log.dart';
import 'package:amap_base_core/amap_base_core.dart';
import 'package:amap_base_location/src/location/model/location.dart';
import 'package:amap_base_location/src/location/model/location_client_options.dart';
import 'package:flutter/services.dart';
Expand Down
4 changes: 3 additions & 1 deletion location/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ environment:
dependencies:
flutter:
sdk: flutter
amap_base_core: any
# amap_base_core: ^0.0.3
amap_base_core:
path: ../core

flutter:
plugin:
Expand Down
4 changes: 2 additions & 2 deletions map/example/lib/map/create_map/show_map.screen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:async';

import 'package:amap_base_example/utils/utils.export.dart';
import 'package:amap_base_core/amap_base_core.dart';
import 'package:amap_base_example/widgets/setting.widget.dart';
import 'package:amap_base_map/amap_base_map.dart';
import 'package:decorated_flutter/decorated_flutter.dart';
import 'package:flutter/material.dart';
import 'package:amap_base_core/amap_base_core.dart';

class ShowMapScreen extends StatefulWidget {
ShowMapScreen();
Expand Down
3 changes: 1 addition & 2 deletions map/example/lib/map/draw_on_map/draw_polygon.screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:amap_base_example/utils/misc.dart';
import 'package:amap_base_example/utils/view.dart';
import 'package:amap_base_map/amap_base_map.dart';
import 'package:decorated_flutter/decorated_flutter.dart';
import 'package:flutter/material.dart';

const polygonList = const [
Expand Down
3 changes: 1 addition & 2 deletions map/example/lib/map/draw_on_map/draw_polyline.screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:amap_base_example/utils/misc.dart';
import 'package:amap_base_example/utils/view.dart';
import 'package:amap_base_map/amap_base_map.dart';
import 'package:decorated_flutter/decorated_flutter.dart';
import 'package:flutter/material.dart';

const polylineList = const [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:amap_base_example/utils/log.dart';
import 'package:amap_base_core/amap_base_core.dart';
import 'package:amap_base_example/widgets/dimens.dart';
import 'package:amap_base_map/amap_base_map.dart';
import 'package:flutter/material.dart';
Expand Down
38 changes: 0 additions & 38 deletions map/example/lib/utils/empty_util.dart

This file was deleted.

11 changes: 0 additions & 11 deletions map/example/lib/utils/enums.dart

This file was deleted.

1 change: 0 additions & 1 deletion map/example/lib/utils/functions.dart

This file was deleted.

40 changes: 0 additions & 40 deletions map/example/lib/utils/global.dart

This file was deleted.

6 changes: 0 additions & 6 deletions map/example/lib/utils/lists.dart

This file was deleted.

26 changes: 0 additions & 26 deletions map/example/lib/utils/log.dart

This file was deleted.

Loading

0 comments on commit 4ef1784

Please sign in to comment.