Flutter Navigation Drawer example



Flutter is an open-source mobile application development framework that allows developers to build high-performance, cross-platform apps for both iOS and Android.

One of the key features of Flutter is the ability to easily create navigation drawers. In this article, we will take a look at an example of how to create a navigation drawer in Flutter.

Flutter Drawer

In this tutorial, you learn, how to create a flutter drawer. Flutter Drawer is like a slider menu. When you click this widget opens and looks like a slider widget.

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2

After adding these dependencies, we can now start building our navigation drawer. Open up the main.dart file and replace the existing code with the following code:

Create a flutter navigation drawer:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

@override
class _MyAppState extends State<MyApp> {
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: Text('Title'),
        ),
        drawer: Drawer(
          child: Column(
            children: [
              UserAccountsDrawerHeader(
                margin: EdgeInsets.all(0.0),
                  accountName: Text('Instructive Tech'),
                  accountEmail: Text('[email protected]'),
                  currentAccountPicture: CircleAvatar(
                    backgroundImage: NetworkImage('https://scontent.fdac34-1.fna.fbcdn.net/v/t39.30808-6/271190257_281054324087750_6540061642459300040_n.jpg?_nc_cat=104&ccb=1-5&_nc_sid=09cbfe&_nc_eui2=AeFttG8HoFhQR66PER8P1qlCmYLMf-XZ-6eZgsx_5dn7p_GuyzigLxTlWB6hG8P9_Xyl-vNoVRcDCM4TC4Cq0-OQ&_nc_ohc=AEZU2a_wVEgAX-GrhuG&_nc_zt=23&_nc_ht=scontent.fdac34-1.fna&oh=00_AT8k_MqY1MK22Uyis0AYbw6tmMVMs4_hkAIiuHexRT2jhg&oe=620911D4'),
                  ),
                currentAccountPictureSize: Size(60,60),
              ),
              ListTile(
                title: Text('This is Titel'),
                subtitle: Text('Subtitle'),
                leading: Icon(Icons.home),
              ),
              ListTile(
                title: Text('This is Titel'),
                subtitle: Text('Subtitle'),
                leading: Icon(Icons.account_box_outlined),
              ),
              ListTile(
                title: Text('This is Titel'),
                subtitle: Text('Subtitle'),
                leading: Icon(Icons.info),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Flutter Drawer Tutorial

Flutter Drawer
  • Boost WooCommerce Security: Set Up OTP Login in WordPress
    Passwords, while essential for security, can be vulnerable to hacking and breaches. To add an extra layer of protection for your WooCommerce store, consider implementing an OTP (One-Time Password) login. This guide walks you through the process of setting up an OTP login in WordPress for enhanced security. Why Use OTP Login? Enhanced Security: OTPs …

    Read more …

  • How to Create Woocommerce Flutter App for WordPress free
    Absolutely! Let’s break down how to create a WooCommerce Flutter app for your WordPress store. Here’s a comprehensive outline of the process and essential considerations: 1. Setup Your Development Environment 2. Project Structure 3. Dependencies 4. Core Functionality 5. User Interface (UI) and User Experience 6. Additional Features (Optional) Example Code Snippet (Fetching Products) Important …

    Read more …

  • How to Add a Link to Your Facebook Story in 2024
    Facebook Stories have become an integral part of our social media experience, allowing us to share moments and updates with our friends and followers. But did you know that you can also add links to your Facebook Stories? Adding a link to your story can be a powerful way to drive traffic to your website, …

    Read more …

  • Troubleshooting “Failed to download Laravel from dist” Error
    If you encounter the “Failed to download Laravel from dist” error while working with Laravel 10, it is likely due to the absence of the zip extension and unzip/7z commands on your system. This error prevents the successful download of Laravel from the distribution (dist) repository. What causes this error? The error occurs when the …

    Read more …

  • Solutions for “The file is too large for the destination file system” Error on Pendrive
    If you have ever encountered the frustrating error message “The file is too large for the destination file system” when trying to transfer files to your pendrive, don’t worry! There are a few solutions you can try to resolve this issue. 1. Format the Pendrive: One of the easiest ways to fix this error is …

    Read more …

Read also, the Flutter Slideable widget.

Overall, Flutter Navigation Drawer is a great example of how Flutter empowers developers to create highly customizable, performant, and engaging mobile applications that provide a seamless and intuitive user experience

Leave a Comment