title: Flutter - Unhandled Exception: type '(dynamic) => Null' is not a subtype of type '(String, dynamic) => void' of 'f'
body: <p>Not sure on reason why I am getting error " Unhandled Exception: type '(dynamic) => Null' is not a subtype of type '(String, dynamic) => void' of 'f' ". Everything seems to be done correctly but still getting error</p>
  
  <pre><code>Json link: https://androidapp.factory2homes.com/api/get-shipping-address-by-user-id/3
  </code></pre>
  
  <pre><code>class ShippingAddressPage extends StatefulWidget {
    @override
    _ShippingAddressPageState createState() =&gt; _ShippingAddressPageState();
  }
  
  class _ShippingAddressPageState extends State&lt;ShippingAddressPage&gt; {
  
    List&lt;Shipping&gt; _shippingAddressList = List&lt;Shipping&gt;();
  
   @override
   void initState() {
     super.initState();
     _getShippingAddressByUserId();
   }
  
  
   _getShippingAddressByUserId() async {
     SharedPreferences _prefs = await SharedPreferences.getInstance();
     int _userId = _prefs.getInt('userId');
     ShippingAddressService _shippingAddressService = ShippingAddressService();
     var result = await _shippingAddressService.getShippingAddressByUserId(_userId);
     var shipping = json.decode(result.body);
     shipping.forEach((shipping){
       var model = Shipping();
       model.id = shipping['id'];
       model.name = shipping['name'];
       model.address = shipping['address'];
       setState(() {
         _shippingAddressList.add(model);
       });
     });
   }
  </code></pre>
  
  <pre><code>E/flutter (26002): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '(dynamic) =&gt; Null' is not a subtype of type '(String, dynamic) =&gt; void' of 'f'
  E/flutter (26002): #0      _ShippingAddressPageState._getShippingAddressByUserId (package:factory2homes/screens/shipping_address_page.dart:32:13)
  E/flutter (26002): &lt;asynchronous suspension&gt;
  E/flutter (26002): #1      _ShippingAddressPageState.initState (package:factory2homes/screens/shipping_address_page.dart:22:4)
  </code></pre>
  
  <pre><code>class ShippingAddressService{
    Repository _repository;
  
    ShippingAddressService(){
      _repository = Repository();
    }
  
    getShippingAddressByUserId(int userId) async {
      return await _repository.httpGetById('get-shipping-address-by-user-id', userId);
    }
  
  }
  </code></pre>