title: Error: The method 'dependOnInheritedWidgetOfExactType' isn't defined for the class 'BuildContext'
body: <p>Every time I try to debug i get this error, Error: The method 'dependOnInheritedWidgetOfExactType' isn't defined for the class 'BuildContext'.
  I have tried lots of method to solve it cant find my way around it.
  This is the code. Pls anybody with an ideal of dealing with this problem</p>
  
  <pre><code>import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:card_settings/card_settings.dart';
  
  class LoginPage extends StatefulWidget {
    @override
    _LoginPageState createState() =&gt; _LoginPageState();
  }
  
  
  
  
  class _LoginPageState extends State&lt;LoginPage&gt; {
  String title = "Spheria";
    String author = "Cody Leet";
    String url = "http://www.codyleet.com/spheria";
  
    final GlobalKey&lt;FormState&gt; _formKey = GlobalKey&lt;FormState&gt;();
  
    static LoginPage of(BuildContext context) {
      return context.dependOnInheritedWidgetOfExactType&lt;LoginPage&gt;();
    }
  
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
      body:  Form(
          key: _formKey,
          child: CardSettings(
            children: &lt;Widget&gt;[
              CardSettingsHeader(label: 'Favorite Book'),
              CardSettingsText(
                label: 'Title',
                initialValue: title,
                validator: (value) {
                  if (value == null || value.isEmpty) return 'Title is required.';
                },
                onSaved: (value) =&gt; title = value,
              ),
              CardSettingsText(
                label: 'URL',
                initialValue: url,
                validator: (value) {
                  if (!value.startsWith('http:')) return 'Must be a valid website.';
                },
                onSaved: (value) =&gt; url = value,
              ),
            ],
          ),
      ), 
      );
    }
  }
      **Used it in this here
      Pls ignore extra brackets**
  
      import 'package:domesms/screens/Login.dart';
      import 'package:flutter/material.dart';
  
      class MyHomePage extends StatefulWidget {
      final String title ;
  
      MyHomePage({Key key, this.title}) : super(key: key);
  
        @override
      _MyHomePageState createState() =&gt; _MyHomePageState();
      }
  
      class _MyHomePageState extends State {
      @override
      Widget build(BuildContext context) {
  
          return Scaffold(
            appBar: AppBar(title: Text('DOMESMS.COM')),
            body: Center(child: Text('My Page!')),
            drawer: Drawer(
              // Add a ListView to the drawer. This ensures the user can scroll
              // through the options in the drawer if there isn't enough vertical
              // space to fit everything.
              child: ListView(
                // Important: Remove any padding from the ListView.
                padding: EdgeInsets.zero,
                children: &lt;Widget&gt;[
                  UserAccountsDrawerHeader(
                  accountName:  Text('Oludiya Ay`enter code here`odeji'),
                   accountEmail:Text('ayodiya@gmail.com'),
                   currentAccountPicture: CircleAvatar(
                     backgroundImage: AssetImage('images/unisexavatar.png',),
                     backgroundColor: Colors.white,
                     radius: 80
                   ),
                decoration: BoxDecoration(
                  color: Colors.blue,
                ),
              ),
              ListTile(
                leading: Icon(Icons.person,
                color: Colors.cyanAccent),
                title: Text('ACCOUNT DETAILS'),
                onTap: () {
                  // Update the state of the app
                  // ...
                  // Then close the drawer
  
                  Navigator.pop(context);
                  Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) =&gt; LoginPage()));
  
                },
              )
  </code></pre>