title: type 'Null' is not a subtype of type 'String' in type cast
body: <blockquote>
  <p>I am making a basic shopping app. I am unable to figure out the mistake I made because my IDE didnt show any error</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/R9CbH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R9CbH.jpg" alt="Error" /></a>
  <a href="https://i.stack.imgur.com/oOQHh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oOQHh.jpg" alt="IDE" /></a></p>
  <blockquote>
  <p>This is the error</p>
  </blockquote>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:provider/provider.dart';
  
  
  class EditProductScreen extends StatefulWidget {
    static const routeName = '/edit-product';
    @override
    _EditProductScreenState createState() =&gt; _EditProductScreenState();
  }
  
  class _EditProductScreenState extends State&lt;EditProductScreen&gt; {
    final _priceFocusNode = FocusNode();
    final _descriptionFocusNode = FocusNode();
    final _imageUrlController = TextEditingController();
    final _imageUrlFocusNode = FocusNode();
    final _form = GlobalKey&lt;FormState&gt;();
    
  </code></pre>
  <p><code>var _editedProduct = Product( id: '', title: '', price: 0, description: '', imageUrl: '', );</code>
  var _initvalues = {
  'title': '',
  'description': '',
  'price': '',
  'imageUrl': ''
  };</p>
  <pre><code>  var _isInit = true;
    var _isLoading = false;
  
    @override
    void initState() {
      _imageUrlFocusNode.addListener(_updateImageUrl);
  
      super.initState();
    }
  </code></pre>
  <blockquote>
  <p>I guess this is where it wrong but my IDE didnt show any though.</p>
  </blockquote>
  <pre><code>  @override
    void didChangeDependencies() { 
      if (_isInit) {
        final productId = ModalRoute.of(context)!.settings.arguments as  String;
        if (productId .isNotEmpty) {
          _editedProduct = Provider.of(context)&lt;Products&gt;(context, listen: false);
          _initvalues = {
            'title': _editedProduct.title,
            'description': _editedProduct.description,
            'price': _editedProduct.price.toString(),
            // 'imageurl': _editedProduct.imageUrl,
            'imageUrl': ''
          };
          _imageUrlController.text = _editedProduct.imageUrl;
        }
      }
      _isInit = false;
      super.didChangeDependencies();
    }
  
   
  
   
  </code></pre>