city_pickers 0.1.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new92

Language: English

city_pickers #

中国的城市三级联动选择器

Demo #

开始 #

在flutter的项目文件中增加依赖

dependencies:
  ...
    city_pickers:^0.0.1

关于如何运行flutter项目, 参考官方文档documentation.

使用方法 #

Import city_pickers.dart

import 'package:city_pickers/city_pickers.dart';

简单使用方法

...
// type 1
Result result = await CityPickers.showCityPicker(
  context: context,
);
// type 2
Result result2 = await CityPickers.showFullPageCityPicker(
  context: context,
);

CityPickers 静态方法 #

NameTypeDesc
showCityPickerFunction呼出弹出层,显示多级选择器
showFullPageCityPickerFunction呼出一层界面, 显示多级选择器

showCityPicker 参数说明 #

NameTypeDefaultDesc
contextBuildContextnull上下文对象
themeThemeDataTheme.of(context)主题, 可以自定义
locationCodeString110000初始化地址信息, 可以是省, 市, 区的地区码
heightdouble300弹出层的高度, 过高或者过低会导致容器报错
showTypeShowTypeShowType.pca三级联动, 显示类型
barrierOpacitydouble0.5弹出层的背景透明度, 应该是大于0, 小于1
barrierDismissiblebooltrue是否可以通过点击弹出层背景, 关闭弹出层

showFullPageCityPicker 参数说明 #

NameTypeDefaultDesc
contextBuildContextnull上下文对象
themeThemeDataTheme.of(context)主题, 可以自定义
locationCodeString110000初始化地址信息, 可以是省, 市, 区的地区码
showTypeShowTypeShowType.pca三级联动, 显示类型

数据来源 #

National Bureau of Statistics

声明 #

本项目Example部份代码与样式, 参考借鉴Flutter Go, flutter go 是flutter 开发者帮助 APP,包含 flutter 常用 140+ 组件的demo 演示与中文文档

To Do List #

  • [ ] 城市选择器, 借鉴点评
  • [ ] 支持拼音等模糊搜索

0.1.3 #

  • 更新readme中的效果图

0.1.2 #

  • 加入省市县三级全屏效果
  • 更新文档介绍
  • 完善ios选择器的参数

0.0.1 #

  • 加入三级联动
  • 支持配置高度
  • 支持初始化地理位置

example/README.md

city_pickers_example #

Demonstrates how to use the city_pickers.

Quick test #

flutter run

Specific app entry point #

flutter run -t lib/main.dart

Getting Started #

For help getting started with Flutter, view the online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  city_pickers: ^0.1.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:city_pickers/city_pickers.dart';
  
Version Uploaded Documentation Archive
0.1.5 Feb 14, 2019 Go to the documentation of city_pickers 0.1.5 Download city_pickers 0.1.5 archive
0.1.4 Feb 14, 2019 Go to the documentation of city_pickers 0.1.4 Download city_pickers 0.1.4 archive
0.1.3 Feb 13, 2019 Go to the documentation of city_pickers 0.1.3 Download city_pickers 0.1.3 archive
0.1.2 Feb 13, 2019 Go to the documentation of city_pickers 0.1.2 Download city_pickers 0.1.2 archive
0.1.1 Feb 5, 2019 Go to the documentation of city_pickers 0.1.1 Download city_pickers 0.1.1 archive
0.1.0 Feb 5, 2019 Go to the documentation of city_pickers 0.1.0 Download city_pickers 0.1.0 archive
0.0.4 Feb 4, 2019 Go to the documentation of city_pickers 0.0.4 Download city_pickers 0.0.4 archive
0.0.3 Feb 4, 2019 Go to the documentation of city_pickers 0.0.3 Download city_pickers 0.0.3 archive
0.0.2 Feb 4, 2019 Go to the documentation of city_pickers 0.0.2 Download city_pickers 0.0.2 archive
0.0.1 Feb 4, 2019 Go to the documentation of city_pickers 0.0.1 Download city_pickers 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/full_page/full_page.dart. (-1.49 points)

Analysis of lib/src/full_page/full_page.dart reported 3 hints:

line 87 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 95 col 14: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 97 col 12: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/src/city_picker.dart. (-1 points)

Analysis of lib/src/city_picker.dart reported 2 hints:

line 35 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 66 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Format lib/city_pickers.dart.

Run flutter format to format lib/city_pickers.dart.

Format lib/modal/point.dart.

Run flutter format to format lib/modal/point.dart.

Format lib/modal/result.dart.

Run flutter format to format lib/modal/result.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
lpinyin ^1.0.7 1.0.7
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8