-1

// here is my code

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Irr Alert"),
        backgroundColor: Colors.orange,
        leading: IconButton(
          icon: Icon(Icons.menu),
          onPressed: () => SlideDrawer.of(context).toggle(),
        ),
      ),
      body: Container(
        height: MediaQuery.of(context).size.height,
        child: Center(
          child: SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                GestureDetector(
                  onTap: () {
                    Navigator.push(context,
                        MaterialPageRoute(builder: (context) => AddDevice()));
                  },
                  child: Column(
                    children: [
                      Container(
                        child: Image.network(
                          addDevice,
                          height: 150,
                          width: 150,
                        ),
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      Text(
                        "Add Device",
                        style: TextStyle(fontSize: 25),
                      ),
                    ],
                  ),
                ),
                SizedBox(
                  height: 20,
                ),
                GestureDetector(
                  onTap: () {
                    Navigator.push(context,
                        MaterialPageRoute(builder: (context) => ShowDevices()));
                  },
                  child: Column(
                    children: [
                      Image.network(
                        showDevice,
                        height: 150,
                        width: 150,
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      Text(
                        "Show Device",
                        style: TextStyle(fontSize: 25),
                      ),
                    ],
                  ),
                ),
                SizedBox(
                  height: 20,
                ),
                GestureDetector(
                  onTap: () {
                    Navigator.push(context,
                        MaterialPageRoute(builder: (context) => CropDetails()));
                  },
                  child: ClipRRect(
                    borderRadius: BorderRadius.circular(70),
                    child: Image.network(
                      cropSeeds,
                      height: 150,
                      width: 150,
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  "Crop Details",
                  style: TextStyle(fontSize: 25),
                ),
                SizedBox(
                  height: 10,
                ),
              ],
            ),
          ),
        ),
      ),
    );
Faiizii Awan
  • 1,615
  • 1
  • 13
  • 28
sanjana
  • 11
  • 2
  • 1
    You forgot to ask a question - dumping a bunch of code is not helpful as it does not tell what's working and what's the issue you are having... Try to reduce it to a [mcve] - Please read our [ask] page and come back and [edit] this question to improve it – blurfus Jun 17 '21 at 05:20

1 Answers1

0

You are not assign the key to the slide drawer ,

` final GlobalKey scaffoldKey = new GlobalKey();

Scaffold( key: scaffoldKey, drawer: AppDrawer(scaffoldKey), body:Container());

`