どうも、ちょげ(@chogetarou)です。
DrawerHeaderに枠線をつける方法を紹介します。
方法

DrawerHeaderに枠線をつけるには、BoxDecorationを使います。
まず、DrawerHeaderの引数「decoration」にBoxDecorationを指定します。
そして、BoxDecorationの引数「border」にBorderクラスを指定します。
枠線の設定は、このBorderクラスで行います。
DrawerHeader(
decoration: BoxDecoration(
border: Border.all(),
),
child: Container(),
),
以下は、使用例です。
使用例
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(),
drawer: Drawer(
child: ListView(
children: [
DrawerHeader(
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 2,
),
),
child: Container(),
margin: EdgeInsets.all(10),
),
],
),
),
),
);
}

コメント