📅  最后修改于: 2022-03-11 15:00:27.229000             🧑  作者: Mango
NavBar.dart
import 'package:flutter/material.dart';
class NavBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
// Remove padding
padding: EdgeInsets.zero,
children: [
UserAccountsDrawerHeader(
accountName: Text('Oflutter.com'),
accountEmail: Text('example@gmail.com'),
currentAccountPicture: CircleAvatar(
child: ClipOval(
child: Image.network(
'https://oflutter.com/wp-content/uploads/2021/02/girl-profile.png',
fit: BoxFit.cover,
width: 90,
height: 90,
),
),
),
decoration: BoxDecoration(
color: Colors.blue,
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(
'https://oflutter.com/wp-content/uploads/2021/02/profile-bg3.jpg')),
),
),
ListTile(
leading: Icon(Icons.favorite),
title: Text('Favorites'),
onTap: () => null,
),
ListTile(
leading: Icon(Icons.person),
title: Text('Friends'),
onTap: () => null,
),
ListTile(
leading: Icon(Icons.share),
title: Text('Share'),
onTap: () => null,
),
ListTile(
leading: Icon(Icons.notifications),
title: Text('Request'),
),
Divider(),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
onTap: () => null,
),
ListTile(
leading: Icon(Icons.description),
title: Text('Policies'),
onTap: () => null,
),
Divider(),
ListTile(
title: Text('Exit'),
leading: Icon(Icons.exit_to_app),
onTap: () => null,
),
],
),
);
}
}