title: Flutter Google Maps Failed assertion: line 24 pos 16: 'target != null': is not true
body: <p>I am trying to get the current location of user by using Google Maps API and this is the below error I have:</p>
  <pre><code>======== Exception caught by widgets library =======================================================
  The following assertion was thrown building BlocBuilder&lt;MapCubit, MapStates&gt;(dirty, state: _BlocBuilderBaseState&lt;MapCubit, MapStates&gt;#8c0c9):
  'package:google_maps_flutter_platform_interface/src/types/camera.dart': Failed assertion: line 24 pos 16: 'target != null': is not true.
  </code></pre>
  <p>and this is the below Screen which contains the map:</p>
  <pre><code>import 'package:airforce/modules/map/cubit/map_cubit.dart';
  import 'package:airforce/modules/map/cubit/map_states.dart';
  import 'package:airforce/shared/cubit/app_cubit.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter_bloc/flutter_bloc.dart';
  import 'package:google_maps_flutter/google_maps_flutter.dart';
  
  class MapScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return BlocProvider(
        create: (context) =&gt; MapCubit()..getUserLocation(),
        child: BlocConsumer&lt;MapCubit, MapStates&gt;(
          listener: (context, state) {},
          builder: (context, state) {
            return GoogleMap(
              initialCameraPosition: CameraPosition(
                target: MapCubit.initialPosition,
              ),
              myLocationEnabled: true,
            );
          },
        ),
      );
    }
  }
  </code></pre>
  <p>and this is the below cubit I have which have the method which gets the current user location:</p>
  <pre><code>import 'package:airforce/modules/map/cubit/map_states.dart';
  import 'package:bloc/bloc.dart';
  import 'package:flutter_bloc/flutter_bloc.dart';
  import 'package:geocoding/geocoding.dart';
  import 'package:geolocator/geolocator.dart';
  import 'package:google_maps_flutter/google_maps_flutter.dart';
  
  class MapCubit extends Cubit&lt;MapStates&gt; {
    MapCubit() : super(MapInitialState());
  
    static MapCubit get(context) =&gt; BlocProvider.of(context);
  
  
    static LatLng initialPosition;
    static LatLng lastMapPosition = initialPosition;
  
    void getUserLocation() async {
      Position position = await Geolocator.getCurrentPosition(
          desiredAccuracy: LocationAccuracy.high);
      List&lt;Placemark&gt; placemarks = await placemarkFromCoordinates(
          position.latitude, position.longitude);
      initialPosition = LatLng(position.latitude, position.longitude);
      emit(GetUserCurrentLocation());
      print('${placemarks[0].name}');
    }
  }
  </code></pre>
  <p>and this is the below MpState:</p>
  <pre><code>abstract class MapStates {}
  
  class MapInitialState extends MapStates {}
  
  class GetUserCurrentLocation extends MapStates {}
  </code></pre>