import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({super.key}); @override StatecreateState() => _MyAppState(); } class _MyAppState extends State { late GoogleMapController mapController; final LatLng _center = const LatLng(22.29301284148933, 73.12225873737414); void _onMapCreated(GoogleMapController controller) { mapController = controller; } @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( useMaterial3: true, colorSchemeSeed: Colors.green[500], ), home: Scaffold( appBar: AppBar( title: const Text('Navrachana University'), elevation: 2, ), body: GoogleMap( onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( target: _center, zoom: 8.0, ), ), ), ); } }
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="Replace with your API Key"/>