title: Boolean Expression must not be Null: DayView Error
body: <p>Whenever I try to run my flutter web-project, I face the following error:</p>
  <pre><code>  Another exception was thrown: Failed assertion: boolean expression must not be null
  </code></pre>
  <p>The exception caught by flutter is:</p>
  <pre><code>     ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY 
      ╞═══════════════════════════════════════════════════════════
      The following IndexError was thrown building DayView(dirty, state: 
      DayViewPage#76a2d):
      RangeError (index): Index out of range: index should be less than 12: 12
  
      The relevant error-causing widget was:
      DayView
      DayView:file:///C:/Users/verma/Desktop/mess-app- 
      iiitd/aaharweb/lib/src/screens/home_page.dart:845:29
  </code></pre>
  <p>The exception was caught in home_page.dart line, in a Container. The code for container that I wrote is as follows:</p>
  <pre><code>          Container(
                      decoration: BoxDecoration(
                        //        color: Colors.green.shade100,
                        borderRadius: BorderRadius.all(Radius.circular(30.0)),
                      ),
                      width: double.infinity,
                      child: Column(
                        children: [
                          Text(
                            'Coming up',
                            style: h5,
                          ),
                          DayView(
                            date: DateTime.now().day,
                          ),
                            DayView(
                               date:
                                  DateTime.now().add(new Duration(days: 1)).day,
                             ),
                            DayView(
                              date:
                                  DateTime.now().add(new Duration(days: 2)).day,
                            ),
                          ElevatedButton(
                            style: raisedButtonStyle,
                            onPressed: () {
                              createDialogBox(context);
                            },
                            child: Text('QR_CODE'),
                          )
                        ],
                      ),
                    )
  </code></pre>
  <p>The exception was thrown in all the DayView.</p>
  <p>DayView Class:</p>
  <pre><code>  class DayView extends StatefulWidget {
    int date;
  
    DayView({this.date});
  
    @override
    State&lt;StatefulWidget&gt; createState() {
      // TODO: implement createState
      return DayViewPage(date: this.date);
      throw UnimplementedError();
    }
  }
  
  class DayViewPage extends State&lt;DayView&gt; {
    int date;
    DayViewPage({this.date});
  
    @override
    Widget build(BuildContext context) {
      // TODO: implement build
      MarkedDay mday;
  
      if (newMonth &amp;&amp; date &lt; 4) {
        mday = nextmCalender[date];
      } else {
        mday = mCalender[date];
      }
  
      return Row(
        children: [
          Container(
            width: 30,
            child: Padding(
              padding: const EdgeInsets.all(5),
              child: Text(
                date.toString(),
                style: h7,
              ),
            ),
          ),
          Expanded(
            child: GestureDetector(
              onTap: () {
                if (newMonth &amp;&amp; date &lt; 4) {
                  if (nextmCalender[date].ebre) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      nextmCalender[date].bre = !nextmCalender[date].bre;
                      updateCalendar().then((value) {
                        nextoldCalender[date].bre = !nextoldCalender[date].bre;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                } else {
                  if (mCalender[date].ebre) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      mCalender[date].bre = !mCalender[date].bre;
                      updateCalendar().then((value) {
                        oldCalender[date].bre = !oldCalender[date].bre;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                }
              },
              child: Card(
                color: mday.bre ? primaryColor : Colors.white,
                child: Padding(
                  padding: const EdgeInsets.only(
                      left: 3.0, right: 3, top: 4, bottom: 4),
                  child: Text(
                    'Breakfast',
                    style: TextStyle(
                        color: mday.bre ? Colors.white : Colors.black,
                        fontSize: 14),
                  ),
                ),
              ),
            ),
          ),
          Expanded(
            child: GestureDetector(
              onTap: () {
                if (newMonth &amp;&amp; date &lt; 4) {
                  if (nextmCalender[date].elun) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      nextmCalender[date].lun = !nextmCalender[date].lun;
                      updateCalendar().then((value) {
                        nextoldCalender[date].lun = !nextoldCalender[date].lun;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                } else {
                  if (mCalender[date].elun) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      mCalender[date].lun = !mCalender[date].lun;
                      updateCalendar().then((value) {
                        oldCalender[date].lun = !oldCalender[date].lun;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                }
              },
              child: Card(
                color: mday.lun ? primaryColor : Colors.white,
                child: Padding(
                  padding: const EdgeInsets.only(
                      left: 3.0, right: 3, top: 4, bottom: 4),
                  child: Text(
                    'Lunch',
                    style: TextStyle(
                        color: mday.lun ? Colors.white : Colors.black,
                        fontSize: 14),
                  ),
                ),
              ),
            ),
          ),
          Expanded(
            child: GestureDetector(
              onTap: () {
                if (newMonth &amp;&amp; date &lt; 4) {
                  if (nextmCalender[date].esna) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      nextmCalender[date].sna = !nextmCalender[date].sna;
                      updateCalendar().then((value) {
                        nextoldCalender[date].sna = !nextoldCalender[date].sna;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                } else {
                  if (mCalender[date].esna) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      mCalender[date].sna = !mCalender[date].sna;
                      updateCalendar().then((value) {
                        oldCalender[date].sna = !oldCalender[date].sna;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                }
              },
              child: Card(
                color: mday.sna ? primaryColor : Colors.white,
                child: Padding(
                  padding: const EdgeInsets.only(
                      left: 3.0, right: 3, top: 4, bottom: 4),
                  child: Text(
                    'Snacks',
                    style: TextStyle(
                        color: mday.sna ? Colors.white : Colors.black,
                        fontSize: 14),
                  ),
                ),
              ),
            ),
          ),
          Expanded(
            child: GestureDetector(
              onTap: () {
                if (newMonth &amp;&amp; date &lt; 4) {
                  if (nextmCalender[date].edin) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      nextmCalender[date].din = !nextmCalender[date].din;
                      updateCalendar().then((value) {
                        nextoldCalender[date].din = !nextoldCalender[date].din;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                } else {
                  if (mCalender[date].edin) {
                    setState(() {
                      Loader.show(
                        context,
                        progressIndicator: CircularProgressIndicator(
                          backgroundColor: Colors.white,
                        ),
                      );
                      mCalender[date].din = !mCalender[date].din;
                      updateCalendar().then((value) {
                        oldCalender[date].din = !oldCalender[date].din;
                        Loader.hide();
                      });
                    });
                  } else {
                    EasyLoading.showToast('Cannot be changed');
                  }
                }
              },
              child: Card(
                color: mday.din ? primaryColor : Colors.white,
                child: Padding(
                  padding: const EdgeInsets.only(
                      left: 3.0, right: 3, top: 4, bottom: 4),
                  child: Text(
                    'Dinner',
                    style: TextStyle(
                        color: mday.din ? Colors.white : Colors.black,
                        fontSize: 14),
                  ),
                ),
              ),
            ),
          ),
        ],
      );
      throw UnimplementedError();
    }
  }
  </code></pre>
  <p>The same code was running a few days ago, I don't know what went wrong, I also tried flutter clean, and flutter pub get again. But didn't help.</p>