| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import 'package:flutter/material.dart';
- class MyDrawer extends StatelessWidget {
- const MyDrawer({
- Key? key,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Drawer(
- child: MediaQuery.removePadding(
- context: context,
- //移除抽屉菜单顶部默认留白
- removeTop: true,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(top: 38.0),
- child: Row(
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: ClipOval(
- child: Image.asset(
- "imgs/avatar.png",
- width: 80,
- ),
- ),
- ),
- Text(
- "Wendux",
- style: TextStyle(fontWeight: FontWeight.bold),
- )
- ],
- ),
- ),
- Expanded(
- child: ListView(
- children: <Widget>[
- ListTile(
- leading: const Icon(Icons.add),
- title: const Text('Add account'),
- ),
- ListTile(
- leading: const Icon(Icons.settings),
- title: const Text('Manage accounts'),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
|