title: How to fix argument type 'int?' can't be assigned to the parameter type 'num'
body: <p>I am trying to do a computation. But my value is from a <code>int?</code> and it not letting me to do it. the error is <code>The argument type 'int?' can't be assigned to the parameter type 'num'.</code> I don't understand.</p>
  <p>Here is my code:</p>
  <pre><code>  String goal= &quot;1000&quot;;
    String workout = &quot;0&quot;;
    String remaining = &quot;&quot;;
    int? _total;
  
    @override
    void initState() {
      super.initState();
      dbHelper = DbHelper();
      _calcTotal();
    }
  
    void _calcTotal() async{
      var total = (await dbHelper.calcTotal())[0]['total'];
      print(total);
      setState(() =&gt; _total = total);
    } 
  
  
  
  int resulttext = int.parse(goal) - _total + int.parse(workout);
  remaining = resulttext.toString();
  </code></pre>