title: Null check operator used on a null value for flutter
body: <p>So I am switching a project to flutter null safety but i am getting Null check operator used on a null value error i tried looking into other similar <a href="https://stackoverflow.com/questions/64278595/null-check-operator-used-on-a-null-value">issue</a> tried but its not working for me the complete error is as following</p>
  <pre><code>The following _CastError was thrown building HomeBanner(dirty, dependencies: [MediaQuery, _InheritedProviderScope&lt;HomeViewModel&gt;], state: _HomeBannerState#2de56):
  Null check operator used on a null value
  
  The relevant error-causing widget was: 
  HomeBanner file:///D:/fabricoMAt/lib/ui/views/home_screen.dart:26:17
  When the exception was thrown, this was the stack: 
  #0      HomeViewModel.initData (package:knoty/business_logic/view_models/home_viewmodel.dart:25:33)
  #1      _HomeBannerState._getImageSliders (package:knoty/ui/widgets/home_banner.dart:30:18)
  #2      _HomeBannerState.build (package:knoty/ui/widgets/home_banner.dart:20:23)
  #3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)
  #4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
  ...
  ====================================================================================================
  
  ======== Exception caught by widgets library =======================================================
  Null check operator used on a null value
  The relevant error-causing widget was: 
  WhomeServices file:///D:/fabricoMAt/lib/ui/views/home_screen.dart:43:17
  </code></pre>
  <p>And so onn this is coming at multiple place and i am not getting any idea how to fix this.</p>
  <pre><code>  HomeViewModel model = Provider.of&lt;HomeViewModel&gt;(context);
  Size screenSize = MediaQuery.of(context).size;
  return model.initData == null   //home_banner line 30
      ? [1, 2, 3, 4]
          .map(
            (item) =&gt; Shimmer.fromColors(
              child: Container(
                margin: EdgeInsets.only(right: 8),
                width: screenSize.width * .7,
                height: screenSize.width * .35,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(
                    Radius.circular(8.0),
                  ),
                  color: Colors.black,
                ),
              ),
              baseColor: Colors.grey.shade300,
              highlightColor: Colors.grey.shade100,
            ),
          )
          .toList()
  </code></pre>
  <p>the other mentioned line</p>
  <pre><code> Init? _initData;
  
   City get selectedCity {
    return _initData!.cities
      .firstWhere((element) =&gt; element.id == _initData!.selectedCityId);
   }
  
   Init get initData =&gt; _initData!;// home_viewmodel.dart 25
  </code></pre>