【发布时间】:2019-06-22 06:57:00
【问题描述】:
在 Flutter 项目中,我看到了这个 sn-p:_State createState() => _State();ClassName method() => ClassName() 在 Dart 中是什么意思,createState() 方法在哪里定义了所有这些对 Flutter 意味着什么?
完整代码如下:
class Nearby extends StatefulWidget {
@override
_State createState() => _State();
}
class _State extends State<Nearby> {
GoogleMapController mapController;
LatLng _center;
@override
void initState() {
super.initState();
_getCurrentLocation();
}
@override
Widget build(BuildContext context) {
return Container()
}}
【问题讨论】: