I'm bit new in flutter. And I'm having little error on this matter.
I have here a code snippet of where I passed lat and long data from another screen and I want to give acccess on MapsState. But I'm getting a property error The instance member 'widget' can't be accessed in an initializer.
class Maps extends StatefulWidget {
Maps({this.lati, this.longi}) : super();
final double lati;
final double longi;
final String title = "Select Location";
@override
MapsState createState() => MapsState ();
}
class MapsState extends State<Maps> {
//
Completer<GoogleMapController> _controller = Completer();
LatLng _center = LatLng(widget.lati, widget.longi);
final Set<Marker> _markers = {};
LatLng _lastMapPosition = _center;
MapType _currentMapType = MapType.normal;
Please help.