Realtime Geolocation with Flutter, Firebase, and Google Maps. Video Lesson.
fireship-io / 167-flutter-geolocation-firestore Goto Github PK
View Code? Open in Web Editor NEWEpisode 167 - Realtime Geolocation with Flutter, Google Maps, and Firestore
Episode 167 - Realtime Geolocation with Flutter, Google Maps, and Firestore
Realtime Geolocation with Flutter, Firebase, and Google Maps. Video Lesson.
When run flutter run -v, it works. But on flutter run, it display this error, The following _CompileTimeError was thrown building FireMap(dirty, state: FireMapState#0f0b0): I/flutter (13678): 'package:google_tracker/main.dart': error: lib/main.dart:39:9: Error: No named parameter with the I/flutter (13678): name 'trackCameraPosition'. I/flutter (13678): trackCameraPosition: true, I/flutter (13678): ^^^^^^^^^^^^^^^^^^^
Here is my main.dart:
import 'package:google_maps_flutter/google_maps_flutter.dart';
void main() => runApp(MyApp());
GoogleMapController mapController;
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: FireMap(),
),
);
}
}
class FireMap extends StatefulWidget {
State createState() => FireMapState();
}
class FireMapState extends State {
GoogleMapController mapController;
build(context) {
return Stack(children: [
GoogleMap(
initialCameraPosition: CameraPosition(
target: LatLng(9.05785, 7.49508),
zoom: 15,
),
onMapCreated: _onMapCreated,
myLocationEnabled: true,
mapType: MapType.hybrid,
compassEnabled: true,
trackCameraPosition: true,
),
Positioned(
bottom: 50,
right: 10,
child:
FlatButton(
child: Icon(Icons.pin_drop, color: Colors.white),
color: Colors.green,
onPressed: () => _addMarker()
)
)
]);
}
_onMapCreated(GoogleMapController controller) {
setState(() {
mapController = controller;
});
}
}
_addMarker() {
var marker = MarkerOptions(
position: mapController.cameraPosition.target,
icon: BitmapDescriptor.defaultMarker,
infoWindowText: InfoWindowText('Magic Marker', '๐๐๐')
);
mapController.addMarker(marker);
}
How do i solve this, thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.