city_picker 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

city_picker #

pub package

A city picker of china, 中国城市选择器

screenshot #

图片

use #

pubspec.yaml

latest_version: pub package

city_picker: $latest_version

import

import 'package:city_picker/city_picker.dart';

use

    CityResult result = await showCityPicker(context);
    String province = result?.province; // 省
    String city = result?.city; // 市
    String county = result?.county; // 地级市/县

init pick city

    CityResult result = await showCityPicker(context,
     initCity: CityResult()
       ..province = p1 // 省
       ..city = p2 // 市
       ..county = p3); // 地级市/县

城市数据 #

使用 json,数据来源为 python 爬虫爬取python_get_city_datas

真实数据来源国家统计局城乡划分 2018 版

LICENSE #

copyright apache 2.0 for caijinglong

[0.1.4] 更新数据

修复:

  • 更新了几个城市没有三级数据的问题, 问题来源是这几个城市在统计局就没有三级数据, 只有四级数据

[0.1.3] 更新数据

[0.1.2] 更新数据

更新城市数据到 2018 版

更新 sdk 版本约束

[0.1.1] 修复二级三级联动的问题

[0.1.0] first version

第一个版本,支持三级联动选择城市

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  city_picker: ^0.1.4

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

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/src/city_picker.dart.

Run flutter format to format lib/src/city_picker.dart.

Dependencies

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