flutter_amap_plugin 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 53

flutter_amap_plugin #

A Flutter plugin that provides a AMap Maps widget.

Base on PlatformView.

Usage #

git:

flutter_amap_plugin:
    git:
      url: https://github.com/shunFSKi/flutter_amap_plugin.git
      ref: develop

pub:

pubspec.yaml add
flutter_amap_plugin

Getting Started #

SetKey #

iOS

FlutterAmapPlugin.initAMapIOSKey('AMapAPPKey_iOS')

Android

flutter_amap_plugin/example/android/app/src/main/AndroidManifest.xml

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="flutter_amap_plugin_example"
    android:icon="@mipmap/ic_launcher">
    <meta-data
        android:name="com.amap.api.v2.apikey"
        android:value="AMapAPPKey_Android">
    </meta-data>
    ...
 </application>

config #

iOS

info.plist

<key>io.flutter.embedded_views_preview</key>
	<true/>
open Capabilities/Background Modes/Location updates

Android

Just config amap key, nothing else

Languages And SDK #

Languages

Java
swift -- 5.0
Dart -- 2.3.0

SDK

Flutter -- stable 1.5
iOS:
'AMapNavi-NO-IDFA', '6.7.0'
'AMapLocation-NO-IDFA', '2.6.2'
'HandyJSON', '5.0.0-beta.1'

Android:
'com.amap.api:navi-3dmap:6.5.0_3dmap6.5.0'
'com.amap.api:search:6.5.0.1'
'com.amap.api:location:4.4.0'
'com.google.code.gson:gson:2.2.4'
'com.mylhyl:acp:1.2.0'

Preview #

0.0.1 #

  • TODO: Describe initial release.

0.0.2 #

  • FIX: 修复安卓端标记点击index返回错误问题
  • ADD: 添加单次定位信息获取

0.0.3 #

  • ADD: 添加导航语音,添加安卓导航组件,iOS稳定性

example/lib/main.dart

import 'package:flutter/material.dart';
import './home_page.dart';
import 'package:flutter_amap_plugin/flutter_amap_plugin.dart';

Future main() async {
  final result = await FlutterAmapPlugin.initAMapIOSKey(
      '43b92ce7414d30f4dc7d07ae3db596dd');
  print(result);
  runApp(AMapPluginApp());
}

class AMapPluginApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
      theme: ThemeData(primaryColor: Color(0xff1E1E1E)),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_amap_plugin: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_amap_plugin/flutter_amap_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
12
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_amap_plugin/flutter_amap_plugin.dart]

Package does not support Flutter platform macos

Because of import path [package:flutter_amap_plugin/flutter_amap_plugin.dart]

Package does not support Flutter platform web

Because of import path [package:flutter_amap_plugin/flutter_amap_plugin.dart]

Package does not support Flutter platform windows

Because of import path [package:flutter_amap_plugin/flutter_amap_plugin.dart]

Package not compatible with SDK dart

because of import path [flutter_amap_plugin]

Health suggestions

Fix lib/amap_location/amap_location_controller.dart. (-1 points)

Analysis of lib/amap_location/amap_location_controller.dart reported 2 hints:

line 6 col 8: Unused import: '../common/coordinate.dart'.

line 21 col 38: This function has a return type of 'Future

Fix lib/amap_map/amap_map_controller.dart. (-0.50 points)

Analysis of lib/amap_map/amap_map_controller.dart reported 1 hint:

line 28 col 38: This function has a return type of 'Future

Fix lib/amap_nav/amap_nav_controller.dart. (-0.50 points)

Analysis of lib/amap_nav/amap_nav_controller.dart reported 1 hint:

line 46 col 38: This function has a return type of 'Future

Fix additional 6 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/amap_search/amap_convert/amap_convert_controller.dart (1 hint)
  • lib/amap_search/amap_route/amap_route_controller.dart (1 hint)
  • lib/amap_map/amap_map_options.dart (Run flutter format to format lib/amap_map/amap_map_options.dart.)
  • lib/amap_nav/amap_nav_view.dart (Run flutter format to format lib/amap_nav/amap_nav_view.dart.)
  • lib/common/amap_base.dart (Run flutter format to format lib/common/amap_base.dart.)
  • lib/common/coordinate.dart (Run flutter format to format lib/common/coordinate.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test