| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import 'package:e2ee_chat/common/global.dart';
- import 'package:e2ee_chat/presenter/login.dart';
- 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: Global.defaultAvatar, //TODO: avatar
- ),
- ),
- Text(
- Global.profile.username!,
- style: TextStyle(fontWeight: FontWeight.bold),
- )
- ],
- ),
- ),
- Expanded(
- child: ListView(
- children: <Widget>[
- ListTile(
- leading: const Icon(Icons.logout),
- title: const Text('logout'),
- onTap: () => LoginPresenter().logout(),
- ),
- ListTile(
- leading: const Icon(Icons.settings),
- title: const Text('Manage accounts'),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
|