added mip changes, capabilities changes
This commit is contained in:
@@ -34,8 +34,8 @@ class ChannelPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ChannelPageState extends State<ChannelPage> {
|
||||
Message? _quotedMessage;
|
||||
FocusNode? _focusNode;
|
||||
MessageInputController _messageInputController = MessageInputController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -50,7 +50,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
}
|
||||
|
||||
void _reply(Message message) {
|
||||
setState(() => _quotedMessage = message);
|
||||
_messageInputController.quotedMessage = message;
|
||||
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
|
||||
_focusNode!.requestFocus();
|
||||
});
|
||||
@@ -144,7 +144,6 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
threadBuilder: (_, parentMessage) {
|
||||
return ThreadPage(parent: parentMessage!);
|
||||
},
|
||||
pinPermissions: ['owner', 'admin', 'member'],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
@@ -177,11 +176,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
),
|
||||
MessageInput(
|
||||
focusNode: _focusNode,
|
||||
quotedMessage: _quotedMessage,
|
||||
onQuotedMessageCleared: () {
|
||||
setState(() => _quotedMessage = null);
|
||||
_focusNode!.unfocus();
|
||||
},
|
||||
messageInputController: _messageInputController,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -150,7 +150,10 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
if (!channel.channel.isDistinct && isOwner)
|
||||
if (!channel.channel.isDistinct &&
|
||||
isOwner &&
|
||||
channel.channel.ownCapabilities
|
||||
.contains(PermissionType.updateChannelMembers))
|
||||
StreamNeumorphicButton(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
@@ -365,6 +368,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
enabled: channel.ownCapabilities
|
||||
.contains(PermissionType.updateChannel),
|
||||
focusNode: _focusNode,
|
||||
controller: _nameController,
|
||||
cursorColor:
|
||||
@@ -449,6 +454,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
// ),
|
||||
// onTap: () {},
|
||||
// ),
|
||||
if (channel.channel.ownCapabilities
|
||||
.contains(PermissionType.muteChannel))
|
||||
StreamBuilder<bool>(
|
||||
stream: StreamChannel.of(context).channel.isMutedStream,
|
||||
builder: (context, snapshot) {
|
||||
@@ -456,7 +463,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
|
||||
return OptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
separatorColor:
|
||||
StreamChatTheme.of(context).colorTheme.disabled,
|
||||
title: AppLocalizations.of(context).muteGroup,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
leading: Padding(
|
||||
@@ -654,7 +662,9 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
if (!channel.channel.isDistinct)
|
||||
if (!channel.channel.isDistinct &&
|
||||
channel.channel.ownCapabilities
|
||||
.contains(PermissionType.leaveChannel))
|
||||
OptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
|
||||
@@ -18,8 +18,14 @@ class ThreadPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ThreadPageState extends State<ThreadPage> {
|
||||
Message? _quotedMessage;
|
||||
FocusNode _focusNode = FocusNode();
|
||||
late MessageInputController _messageInputController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_messageInputController = MessageInputController(message: widget.parent);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -28,7 +34,7 @@ class _ThreadPageState extends State<ThreadPage> {
|
||||
}
|
||||
|
||||
void _reply(Message message) {
|
||||
setState(() => _quotedMessage = message);
|
||||
_messageInputController.quotedMessage = message;
|
||||
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
|
||||
_focusNode.requestFocus();
|
||||
});
|
||||
@@ -60,18 +66,12 @@ class _ThreadPageState extends State<ThreadPage> {
|
||||
},
|
||||
);
|
||||
},
|
||||
pinPermissions: ['owner', 'admin', 'member'],
|
||||
),
|
||||
),
|
||||
if (widget.parent.type != 'deleted')
|
||||
MessageInput(
|
||||
parentMessage: widget.parent,
|
||||
focusNode: _focusNode,
|
||||
quotedMessage: _quotedMessage,
|
||||
onQuotedMessageCleared: () {
|
||||
setState(() => _quotedMessage = null);
|
||||
_focusNode.unfocus();
|
||||
},
|
||||
messageInputController: _messageInputController,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ dependencies:
|
||||
stream_chat_localizations:
|
||||
git:
|
||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||
ref: develop
|
||||
ref: feat/capabilities
|
||||
path: packages/stream_chat_localizations
|
||||
flutter_local_notifications: ^9.0.0
|
||||
flutter_svg: ^0.23.0
|
||||
@@ -42,17 +42,17 @@ dependency_overrides:
|
||||
stream_chat:
|
||||
git:
|
||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||
ref: develop
|
||||
ref: feat/capabilities
|
||||
path: packages/stream_chat
|
||||
stream_chat_flutter_core:
|
||||
git:
|
||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||
ref: develop
|
||||
ref: feat/capabilities
|
||||
path: packages/stream_chat_flutter_core
|
||||
stream_chat_flutter:
|
||||
git:
|
||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||
ref: develop
|
||||
ref: feat/capabilities
|
||||
path: packages/stream_chat_flutter
|
||||
|
||||
flutter:
|
||||
|
||||
Reference in New Issue
Block a user