sy_flutter_amap 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 34

Build Status

sy_flutter_amap #

高德定位flutter插件

目前实现了以下功能

  • 单次定位

使用方法 #

Android #

无需配置

iOS #

在项目的info.plist 添加 NSLocationWhenInUseUsageDescription 及其描述

其它Flutter 插件 #

[0.1.1] 2018-11-28 #

  • initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sy_flutter_amap/sy_flutter_amap.dart';

void main() => runApp(new MyApp());

const iosApiKey = '9e198f3cb0a17cc708020347e8c156ad';
const androidApiKey = 'd218096dc7b73b88f969ffc53bb1c003';

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
            child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: <Widget>[
            new RaisedButton(
              child: Text('检查权限'),
              onPressed: () async {
                await SyFlutterAmap.hasPermission();
              },
            ),
            new RaisedButton(
              child: Text('获取权限'),
              onPressed: () async {
                await SyFlutterAmap.requestPermission();
              },
            ),
            new RaisedButton(
              child: Text('获取位置'),
              onPressed: () async {
                SyLocation loc = await SyFlutterAmap.getLastKnownLocation(
                    iosApiKey: iosApiKey, androidApiKey: androidApiKey);
                if (loc != null) {
                  print(loc.toJon());
                }
              },
            ),
            new RaisedButton(
              child: Text('获取签名'),
              onPressed: () async {
                String s = await SyFlutterAmap.signSha1();
                print(s);
              },
            ),
          ],
        )),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  sy_flutter_amap: ^0.1.1

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:sy_flutter_amap/sy_flutter_amap.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
21
Overall:
Weighted score of the above. [more]
34
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:sy_flutter_amap/sy_flutter_amap.dart]

Package does not support Flutter platform macos

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

Package does not support Flutter platform web

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

Package does not support Flutter platform windows

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

Package not compatible with SDK dart

because of import path [sy_flutter_amap]

Health issues and suggestions

Document public APIs. (-1 points)

31 out of 31 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

Package is getting outdated. (-59.45 points)

The package was last published 83 weeks ago.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.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