feat(add city picker demo):

This commit is contained in:
sanfan.hx
2019-02-05 22:28:50 +08:00
parent 53a7d718a0
commit 63b9dc694e
5 changed files with 58 additions and 5 deletions

View File

@ -8,14 +8,37 @@
//
import 'package:flutter/material.dart';
import 'package:city_pickers/city_pickers.dart';
class Demo extends StatefulWidget {
class CityPickerDemo extends StatefulWidget {
_Demo createState() => _Demo();
}
class _Demo extends State<Demo> {
class _Demo extends State<CityPickerDemo> {
String _result;
show(context) async {
Result temp = await CityPickers.showCityPicker(
context: context,
// locationCode: '640221',
height: 400,
);
setState(() {
_result = "${temp.toString()}";
});
}
Widget build(BuildContext context) {
return Container();
return Center(
child: Column(
children: <Widget>[
Text("result: ${_result.toString()}"),
RaisedButton(
onPressed: () {this.show(context);
},
child: Text("select"),
),
],
)
);
}
}