White Space Under Navigation Bar In Drawer Using Flutter

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

I was able to get code from another forum that allows me to move my logo up to the left of the nav bar. However, now I have a lot of white space underneath the bar. Is there a code to remove that and the faint gray line that is still there?

White Space Under Navigation Bar In Drawer Using Flutter

Navigation Bar In Drawer
Complete Code For Navigation Bar In Drawer In Flutter
main.dart

import 'dart:math';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Transform',
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.pink,
        title: Text("Navigation Drawer"),
      ),
      drawer: Container(
        width: 200,
        child: new Drawer(
          child: new  ListView(
            children: <Widget>[
              new UserAccountsDrawerHeader(
                accountEmail: new Text("test@gail.com"),
                accountName: new Text("Test"),
                currentAccountPicture: new CircleAvatar(
                  backgroundColor: Colors.pinkAccent,
                  child: new Text("Test"),
                ),
                otherAccountsPictures: <Widget>[
                  new CircleAvatar(
                    backgroundColor: Colors.pink,
                    child: new Text("MH"),
                  )
                ],
              ),
              new ListTile(
                title: new Text("Artiklar",style: TextStyle(color: Colors.black45),),
                leading: new Icon(Icons.web),
              ),
              new ListTile(
                title: new Text("Media",style: TextStyle(color: Colors.black45),),
                leading: new Icon(Icons.wallpaper),
              ),
              new Divider(),
              new ListTile(
                  title: new Text("Inställningar",style: TextStyle(color: Colors.black45),),
                  leading: new Icon(Icons.settings)
              ),
            ],
          ),
        ),
      ),
      body: Center(
        child: Text('Main Body'),
      ),
    );
  }
}

Related Post