Merge pull request #63 from GetStream/capabilities
added mip changes, capabilities changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -177,7 +177,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1140;
|
||||
LastUpgradeCheck = 1020;
|
||||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "The Chromium Authors";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
@@ -245,7 +245,7 @@
|
||||
"${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/connectivity_plus/connectivity_plus.framework",
|
||||
@@ -256,14 +256,14 @@
|
||||
"${BUILT_PRODUCTS_DIR}/image_gallery_saver/image_gallery_saver.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/photo_manager/photo_manager.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/sqlite3/sqlite3.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/sqlite3_flutter_libs/sqlite3_flutter_libs.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/video_compress/video_compress.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/video_player/video_player.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/video_thumbnail/video_thumbnail.framework",
|
||||
@@ -285,14 +285,14 @@
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_gallery_saver.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/photo_manager.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlite3.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlite3_flutter_libs.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_compress.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_thumbnail.framework",
|
||||
@@ -442,7 +442,10 @@
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
@@ -581,7 +584,10 @@
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
@@ -615,7 +621,10 @@
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -85,11 +85,6 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
var userMember = snapshot.data!.firstWhereOrNull(
|
||||
(e) => e.user!.id == StreamChat.of(context).currentUser!.id,
|
||||
);
|
||||
var isOwner = userMember?.role == 'owner';
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
appBar: AppBar(
|
||||
@@ -150,7 +145,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
if (!channel.channel.isDistinct && isOwner)
|
||||
if (channel.channel.ownCapabilities
|
||||
.contains(PermissionType.updateChannelMembers))
|
||||
StreamNeumorphicButton(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
@@ -174,7 +170,9 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
height: 8.0,
|
||||
color: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
),
|
||||
if (isOwner) _buildNameTile(),
|
||||
if (channel.channel.ownCapabilities
|
||||
.contains(PermissionType.updateChannel))
|
||||
_buildNameTile(),
|
||||
_buildOptionListTiles(),
|
||||
],
|
||||
),
|
||||
@@ -365,6 +363,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
enabled: channel.ownCapabilities
|
||||
.contains(PermissionType.updateChannel),
|
||||
focusNode: _focusNode,
|
||||
controller: _nameController,
|
||||
cursorColor:
|
||||
@@ -449,6 +449,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 +458,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 +657,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