city_pickers 0.0.3 copy "city_pickers: ^0.0.3" to clipboard
city_pickers: ^0.0.3 copied to clipboard

outdated

city picker, 三级联动

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:city_pickers/city_pickers.dart';
import 'package:flutter/cupertino.dart';
void main() => runApp(MyApp());


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      debugShowCheckedModeBanner: false,
      home: Main(),
    );
  }
}


class Main extends StatefulWidget {
  @override
  _MainState createState() => _MainState();
}

class _MainState extends State<Main> {
  String _result;

  @override
  void initState() {
    super.initState();
  }

  show(context) async {
    Result temp  = await CityPickers.showCityPicker(
      context: context,
      locationCode: '640221',
      height: 400,
    );
    setState(() {
      _result = "${temp.toString()}";
    });
  }
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: Column(
              children: <Widget>[
                Text("result: ${_result.toString()}"),
                RaisedButton(
                  onPressed: () {this.show(context);
                  },
                  child: Text("select"),
                ),
              ],
            )
        ),
      ),
    );
  }
}
87
likes
0
pub points
93%
popularity

Publisher

unverified uploader

city picker, 三级联动

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, lpinyin

More

Packages that depend on city_pickers