title: Error: (The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.) in Flutter
body: <p>I'm new to flutter and getting an Error in passing the String and looked everywhere and finally adding this in StackOverflow</p>
  <p>the error is</p>
  <p><code>Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.</code></p>
  <pre><code>void errorSnackBar(BuildContext context, String? text) {
    ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
      duration: new Duration(seconds: 4),
      content: new Row(
        children: &lt;Widget&gt;[
          Icon(
            Icons.error,
            color: Colors.red,
          ),
          Padding(
            padding: const EdgeInsets.fromLTRB(10.0, 0, 0, 0),
            child: new Text(text),
          ),
        ],
      ),
    ));
  }
  </code></pre>