feat: Fixed issues with alignment in group info screen and dark theme
This commit is contained in:
@@ -76,6 +76,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
SizedBox(height: 15.0),
|
||||
OptionListTile(
|
||||
title: '@${widget.user.id}',
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
trailing: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
@@ -131,13 +132,18 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
stream: StreamChannel.of(context).channel.isMutedStream,
|
||||
builder: (context, snapshot) {
|
||||
return OptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
title: 'Mute user',
|
||||
leading: StreamSvgIcon.mute(
|
||||
size: 23.0,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: StreamSvgIcon.mute(
|
||||
size: 24.0,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: snapshot.data == null
|
||||
? CircularProgressIndicator()
|
||||
@@ -174,10 +180,15 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
// ),
|
||||
OptionListTile(
|
||||
title: 'Photos & Videos',
|
||||
leading: StreamSvgIcon.pictures(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: StreamSvgIcon.pictures(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: StreamSvgIcon.right(),
|
||||
onTap: () {
|
||||
@@ -206,12 +217,19 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
),
|
||||
OptionListTile(
|
||||
title: 'Files',
|
||||
leading: StreamSvgIcon.files(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: StreamSvgIcon.files(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: StreamSvgIcon.right(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
),
|
||||
trailing: StreamSvgIcon.right(),
|
||||
onTap: () {
|
||||
final channel = StreamChannel.of(context).channel;
|
||||
|
||||
@@ -238,12 +256,19 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
),
|
||||
OptionListTile(
|
||||
title: 'Shared groups',
|
||||
leading: StreamSvgIcon.Icon_group(
|
||||
size: 24.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: StreamSvgIcon.Icon_group(
|
||||
size: 24.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: StreamSvgIcon.right(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
),
|
||||
trailing: StreamSvgIcon.right(),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
@@ -259,9 +284,16 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
Widget _buildDeleteListTile() {
|
||||
return OptionListTile(
|
||||
title: 'Delete Conversation',
|
||||
leading: StreamSvgIcon.delete(
|
||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||
size: 24.0,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body.copyWith(
|
||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||
),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: StreamSvgIcon.delete(
|
||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||
size: 24.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
_showDeleteDialog();
|
||||
|
||||
@@ -70,8 +70,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor:
|
||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
backgroundColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
appBar: AppBar(
|
||||
elevation: 1.0,
|
||||
toolbarHeight: 56.0,
|
||||
@@ -259,7 +258,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
horizontal: 21.0, vertical: 12.0),
|
||||
child: StreamSvgIcon.down(
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.white,
|
||||
StreamChatTheme.of(context).colorTheme.grey,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -306,19 +305,18 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.all(7.0),
|
||||
child: Text(
|
||||
'NAME',
|
||||
style: TextStyle(
|
||||
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
fontSize: 12.0),
|
||||
.withOpacity(0.5)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 9.0,
|
||||
width: 7.0,
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
@@ -326,15 +324,15 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
controller: _nameController,
|
||||
cursorColor: StreamChatTheme.of(context).colorTheme.black,
|
||||
decoration: InputDecoration.collapsed(
|
||||
hintText: 'Add a group name',
|
||||
hintStyle: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
hintText: 'Add a group name',
|
||||
hintStyle: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.bodyBold
|
||||
.copyWith(
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5))),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 0.82,
|
||||
@@ -409,12 +407,16 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
separatorColor:
|
||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
title: 'Mute group',
|
||||
leading: StreamSvgIcon.mute(
|
||||
size: 23.0,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: StreamSvgIcon.mute(
|
||||
size: 24.0,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: snapshot.data == null
|
||||
? CircularProgressIndicator()
|
||||
@@ -435,12 +437,18 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
title: 'Photos & Videos',
|
||||
leading: StreamSvgIcon.pictures(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: StreamSvgIcon.pictures(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: StreamSvgIcon.right(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
),
|
||||
trailing: StreamSvgIcon.right(),
|
||||
onTap: () {
|
||||
var channel = StreamChannel.of(context).channel;
|
||||
|
||||
@@ -469,12 +477,18 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.whiteSnow,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
title: 'Files',
|
||||
leading: StreamSvgIcon.files(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: StreamSvgIcon.files(
|
||||
size: 32.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: StreamSvgIcon.right(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
),
|
||||
trailing: StreamSvgIcon.right(),
|
||||
onTap: () {
|
||||
var channel = StreamChannel.of(context).channel;
|
||||
|
||||
@@ -505,10 +519,16 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
separatorColor:
|
||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
title: 'Leave Group',
|
||||
leading: StreamSvgIcon.userRemove(
|
||||
size: 24.0,
|
||||
color:
|
||||
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: StreamSvgIcon.userRemove(
|
||||
size: 24.0,
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.black
|
||||
.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
trailing: Container(
|
||||
height: 24.0,
|
||||
@@ -767,36 +787,37 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
_buildModalListTile(
|
||||
context,
|
||||
StreamSvgIcon.message(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
size: 24.0,
|
||||
),
|
||||
'Message',
|
||||
() async {
|
||||
var client = StreamChat.of(context).client;
|
||||
if (StreamChat.of(context).user.id != user.id)
|
||||
_buildModalListTile(
|
||||
context,
|
||||
StreamSvgIcon.message(
|
||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||
size: 24.0,
|
||||
),
|
||||
'Message',
|
||||
() async {
|
||||
var client = StreamChat.of(context).client;
|
||||
|
||||
var c = client.channel('messaging', extraData: {
|
||||
'members': [
|
||||
user.id,
|
||||
StreamChat.of(context).user.id,
|
||||
],
|
||||
});
|
||||
var c = client.channel('messaging', extraData: {
|
||||
'members': [
|
||||
user.id,
|
||||
StreamChat.of(context).user.id,
|
||||
],
|
||||
});
|
||||
|
||||
await c.watch();
|
||||
await c.watch();
|
||||
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: c,
|
||||
child: ChannelPage(),
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: c,
|
||||
child: ChannelPage(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
if (!channel.isDistinct &&
|
||||
StreamChat.of(context).user.id != user.id &&
|
||||
isUserAdmin)
|
||||
|
||||
Reference in New Issue
Block a user