The DrawerHeader widget produces a faint line below the DrawerHeader widget. How can I remove this? I've tried the decoration options and the only way I've found so far is to switch from a DrawerHeader to a custom widget, which I'd like to avoid if possible.
The following is code from the Flutter.dev guide, with the DrawerHeader color set to white, so the line is visible.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const appTitle = 'Drawer Demo';
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: appTitle,
home: MyHomePage(title: appTitle),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(title)),
body: const Center(
child: Text('My Page!'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
const DrawerHeader(
decoration: BoxDecoration(
color: Colors.white,
),
child: Text('Drawer Header'),
),
ListTile(
title: const Text('Item 1'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: const Text('Item 2'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
}
}
EDIT: It seems to be added from this line in the drawer_header.dart (std lib) file. Line 85. I don't see anyway to disable it.
border: Border(
bottom: Divider.createBorderSide(context),
),