How To Remove Hamburger Icon Using Flutter Android App

admin_img Posted By Bajarangi soft , Posted On 30-10-2020

How can I remove the hamburger button at the top (so that you can only get the drawer through sliding from the side (or through a custom button in the app - that I know how to do))?

How To Remove Hamburger Icon Using Flutter Android App

Remove Hamburger Icon
Complete Code  For Remove Hamburger Icon In Flutter
Main.dart

import 'package:flutter/material.dart';

void main(){
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  static final List<String> _listViewData = [
    "Menu 1",
    "Menu 2",
    "Menu 3",
    "Menu 4",
    "Menu 5",
    "Menu 6",
    "Menu 7",
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
        backgroundColor: Colors.deepPurple,
        title: Text("Remove Hamburger Icon"),
        leading: SizedBox(),
      ),
      drawer: Drawer(
        child: ListView(
          padding: EdgeInsets.all(10.0),
          children: _listViewData
              .map((data) => ListTile(
            title: Text(data),
          ))
              .toList(),
        ),
      ),
      body: Center(
        child: Text('Main Body'),
      ),
    );
  }
}
  

Related Post