title: Flutter Error :68:14: Error: Getter not found: 'context'. and Unhandled Exception: type 'Null' is not a subtype of type 'BuildContext'
body: <p>i didn't know what is the error means by that.but the thing is i want passing in my funtion of ShowDate Widget inside my Button function here is the code:</p>
  <pre><code>class AddTaskPage extends StatefulWidget {
    const AddTaskPage({Key? key}) : super(key: key);
  
    @override
    _AddTaskPageState createState() =&gt; _AddTaskPageState();
  }
  
  class _AddTaskPageState extends State&lt;AddTaskPage&gt; {
    DateTime _selectedDate = DateTime.now();
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          elevation: 0,
          backgroundColor: context.theme.backgroundColor,
          toolbarHeight: 80,
          leading: GestureDetector(
            child: Icon(Icons.arrow_back_ios),
            onTap: () {
              return Get.back();
            },
          ),
        ),
        body: Container(
          padding: EdgeInsets.only(left: 20, right: 20),
          child: SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  &quot;Add Task&quot;,
                  style: TextStyle(
                      fontSize: 30,
                      fontFamily: &quot;Lato&quot;,
                      fontWeight: FontWeight.bold),
                ),
                MyInputField(title: &quot;Title&quot;, hint: &quot;Enter Your Title&quot;),
                MyInputField(title: &quot;Note&quot;, hint: &quot;Enter Your Note&quot;),
                MyInputField(
                  title: &quot;Date&quot;,
                  hint: DateFormat.yMd().format(_selectedDate),
                  widget: IconButton(
                    icon: Icon(
                      Icons.date_range,
                      color: Colors.red,
                    ),
                    onPressed: () {
                      _getDateFromUser();
                    },
                  ),
                ),
              ],
            ),
          ),
        ),
        backgroundColor: context.theme.backgroundColor,
      );
    }
  }
  
  _getDateFromUser() async {
    DateTime? _pickerDate = await showDatePicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(2015),
      lastDate: DateTime(2121),
    );
  }
  </code></pre>
  <p>And at the bottom it's where the problem is occured with the context properties:</p>
  <pre><code>_getDateFromUser() async {
    DateTime? _pickerDate = await showDatePicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(2015),
      lastDate: DateTime(2121),
    );
  }
  </code></pre>
  <p>when i hover over it with VScode the quickfixes is saying that i need to provide the local variable,it work afterward but when i click the icon button it says the following error in the terminal:</p>
  <pre><code>[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'BuildContext'
  </code></pre>
  <p>how to handle that error ? what is that mean ?</p>