title: casting int to bool in dart
body: <p>I'm having a list of different types of values exported from JSON. </p>
  
  <pre><code>class StudentDetailsToMarkAttendance {
    int att_on_off_status;
    String name;
    String reg_number;
    int status;
  
    StudentDetailsToMarkAttendance(
        {this.att_on_off_status, this.name, this.reg_number, this.status});
  
    factory StudentDetailsToMarkAttendance.fromJson(Map&lt;String, dynamic&gt; json) {
      return StudentDetailsToMarkAttendance(
        att_on_off_status: json['att_on_off_status'],
        name: json['name'],
        reg_number: json['reg_number'],
        status: json['status'],
      );
    }
  
    Map&lt;String, dynamic&gt; toJson() {
      final Map&lt;String, dynamic&gt; data = new Map&lt;String, dynamic&gt;();
      data['att_on_off_status'] = this.att_on_off_status;
      data['name'] = this.name;
      data['reg_number'] = this.reg_number;
      data['status'] = this.status;
      return data;
    }
  }
  </code></pre>
  
  <p>I am trying to use the value of <strong>status</strong> as the value parameter of <code>Checkbox</code>. I am trying to parse <code>int</code> to <code>String</code> like this.</p>
  
  <pre><code>value:((widget.studentDetailsList[index].status = (1 ? true : false) as int)as bool)
  </code></pre>
  
  <p>but there seems to be a problem with this conversion. I am not getting exact way of converting <code>int</code> to <code>bool</code> in dart.  It says     </p>
  
  <blockquote>
    <p>Conditions must have a static type of 'bool'.</p>
  </blockquote>