+99
-102
@@ -166,116 +166,113 @@ class _HomePageState extends State<HomePage> {
|
|||||||
|
|
||||||
Drawer _buildDrawer(BuildContext context, User user) {
|
Drawer _buildDrawer(BuildContext context, User user) {
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: Container(
|
child: SafeArea(
|
||||||
color: StreamChatTheme.of(context).colorTheme.white,
|
child: Padding(
|
||||||
child: SafeArea(
|
padding: EdgeInsets.only(
|
||||||
child: Padding(
|
top: MediaQuery.of(context).viewPadding.top + 8,
|
||||||
padding: EdgeInsets.only(
|
),
|
||||||
top: MediaQuery.of(context).viewPadding.top + 8,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
child: Column(
|
Padding(
|
||||||
children: [
|
padding: const EdgeInsets.only(
|
||||||
Padding(
|
bottom: 20.0,
|
||||||
padding: const EdgeInsets.only(
|
left: 8,
|
||||||
bottom: 20.0,
|
|
||||||
left: 8,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
UserAvatar(
|
|
||||||
user: user,
|
|
||||||
showOnlineStatus: false,
|
|
||||||
constraints: BoxConstraints.tight(Size.fromRadius(20)),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 16.0),
|
|
||||||
child: Text(
|
|
||||||
user.name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
child: Row(
|
||||||
leading: StreamSvgIcon.penWrite(
|
children: [
|
||||||
color: StreamChatTheme.of(context)
|
UserAvatar(
|
||||||
.colorTheme
|
user: user,
|
||||||
.black
|
showOnlineStatus: false,
|
||||||
.withOpacity(.5),
|
constraints: BoxConstraints.tight(Size.fromRadius(20)),
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.popAndPushNamed(
|
|
||||||
context,
|
|
||||||
Routes.NEW_CHAT,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
title: Text(
|
|
||||||
'New direct message',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.5,
|
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.only(left: 16.0),
|
||||||
ListTile(
|
child: Text(
|
||||||
leading: StreamSvgIcon.contacts(
|
user.name,
|
||||||
color: StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.black
|
|
||||||
.withOpacity(.5),
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.popAndPushNamed(
|
|
||||||
context,
|
|
||||||
Routes.NEW_GROUP_CHAT,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
title: Text(
|
|
||||||
'New group',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: ListTile(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
|
|
||||||
final secureStorage = FlutterSecureStorage();
|
|
||||||
await secureStorage.deleteAll();
|
|
||||||
|
|
||||||
StreamChat.of(context).client.disconnect(
|
|
||||||
clearUser: true,
|
|
||||||
);
|
|
||||||
|
|
||||||
await Navigator.pushReplacementNamed(
|
|
||||||
context,
|
|
||||||
Routes.CHOOSE_USER,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
leading: StreamSvgIcon.user(
|
|
||||||
color: StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.black
|
|
||||||
.withOpacity(.5),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Sign out',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.5,
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: StreamSvgIcon.penWrite(
|
||||||
|
color: StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.black
|
||||||
|
.withOpacity(.5),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.popAndPushNamed(
|
||||||
|
context,
|
||||||
|
Routes.NEW_CHAT,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
'New direct message',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: StreamSvgIcon.contacts(
|
||||||
|
color: StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.black
|
||||||
|
.withOpacity(.5),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.popAndPushNamed(
|
||||||
|
context,
|
||||||
|
Routes.NEW_GROUP_CHAT,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
'New group',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: ListTile(
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
final secureStorage = FlutterSecureStorage();
|
||||||
|
await secureStorage.deleteAll();
|
||||||
|
|
||||||
|
StreamChat.of(context).client.disconnect(
|
||||||
|
clearUser: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
await Navigator.pushReplacementNamed(
|
||||||
|
context,
|
||||||
|
Routes.CHOOSE_USER,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
leading: StreamSvgIcon.user(
|
||||||
|
color: StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.black
|
||||||
|
.withOpacity(.5),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Sign out',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user