location_picker_fluttify 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 45

位置选择器 #

一个位置选择器, 基于高德地图插件搜索插件, 目标是和微信的位置选择器一模一样的同时, 提供尽可能高的可定制化.

0.0.3 #

  • enhance: 地图移动结束动画在获取到poi之前执行
  • enhance: 更新依赖

0.0.2 #

  • 移动地图后中心跳动
  • 拆分widget, 引入BLoC架构

0.0.1 #

  • mvp

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:location_picker_fluttify/location_picker_fluttify.dart';

Future<void> main() async {
  await enableFluttifyLog(false);
  await AmapCore.init('0a536ec318043a4b61e7b2a8796fba41');
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: HomeScreen());
  }
}

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  String _title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          RaisedButton(
            onPressed: () => _handleShowPicker(context),
            child: Text('地址选择器'),
          ),
          if (_title != null) Text(_title, textAlign: TextAlign.center),
        ],
      ),
    );
  }

  Future<void> _handleShowPicker(BuildContext context) async {
    final poi = await showLocationPicker(
      context,
      poiBuilder: (context, poi) async {
        return CandidatePoi(
          onTap: () => Navigator.pop(context, poi),
          title: Text(
            await poi.title,
            style: TextStyle(color: Colors.black, fontSize: 18),
          ),
          subtitle: Text(
            await poi.address,
            overflow: TextOverflow.ellipsis,
          ),
        );
      },
    );
    poi.title.then((title) => setState(() => _title = title));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  location_picker_fluttify: ^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:location_picker_fluttify/location_picker_fluttify.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
5
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
64
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/src/ui/widget/visual/decorated/decorated_flex.widget.dart. (-0.50 points)

Analysis of lib/src/ui/widget/visual/decorated/decorated_flex.widget.dart reported 1 hint:

line 303 col 32: This function has a return type of 'SizedBox', but doesn't end with a return statement.

Fix lib/src/ui/widget/visual/preferred/free/free_check_box.widget.dart. (-0.50 points)

Analysis of lib/src/ui/widget/visual/preferred/free/free_check_box.widget.dart reported 1 hint:

line 49 col 10: The value of the local variable 'size' isn't used.

Fix lib/src/utils/bloc/bloc_provider.widget.dart. (-0.50 points)

Analysis of lib/src/utils/bloc/bloc_provider.widget.dart reported 1 hint:

line 28 col 17: 'ancestorInheritedElementForWidgetOfExactType' is deprecated and shouldn't be used. Use getElementForInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (amap_map_fluttify, amap_search_fluttify).

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.

The package description is too short. (-6 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.6.0 <3.0.0
after_layout ^1.0.7+2 1.0.7+2
amap_map_fluttify ^0.14.2+e26c0fa 0.14.2+e26c0fa 0.18.2+c038d50
amap_search_fluttify ^0.5.0+acdcd89 0.5.0+acdcd89 0.7.9+481e45c
flutter 0.0.0
permission_handler ^4.0.0 4.4.0+hotfix.2
rxdart ^0.23.1 0.23.1 0.24.0-dev.1
Transitive dependencies
amap_core_fluttify 0.3.0+e26c0fa 0.5.6+3ebdbdc
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
foundation_fluttify 0.3.0 0.4.18
meta 1.1.8
permission_handler_platform_interface 1.0.0
plugin_platform_interface 1.0.2
sky_engine 0.0.99
typed_data 1.1.6
url_launcher 5.4.2
url_launcher_macos 0.0.1+4
url_launcher_platform_interface 1.0.6
url_launcher_web 0.1.1+1
vector_math 2.0.8
Dev dependencies
flutter_test