refactor(ui, core): Deprecate v3
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -4,10 +4,7 @@ import 'package:stream_chat_flutter/src/extension.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
/// Bottom Sheet with options
|
||||
@Deprecated(
|
||||
"'ChannelBottomSheet' is deprecated and shouldn't be used. "
|
||||
"Please use 'StreamChannelBottomSheet' instead.",
|
||||
)
|
||||
@Deprecated("Use 'StreamChannelInfoBottomSheet' instead")
|
||||
class ChannelBottomSheet extends StatefulWidget {
|
||||
/// Constructor for creating bottom sheet
|
||||
const ChannelBottomSheet({Key? key, this.onViewInfoTap}) : super(key: key);
|
||||
@@ -24,7 +21,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
bool _showActions = true;
|
||||
|
||||
late StreamChannelState _streamChannelState;
|
||||
late ChannelPreviewThemeData _channelPreviewThemeData;
|
||||
late StreamChannelPreviewThemeData _channelPreviewThemeData;
|
||||
late StreamChatThemeData _streamChatThemeData;
|
||||
late StreamChatState _streamChatState;
|
||||
|
||||
@@ -58,7 +55,8 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: ChannelName(
|
||||
child: StreamChannelName(
|
||||
channel: channel,
|
||||
textStyle: _streamChatThemeData.textTheme.headlineBold,
|
||||
),
|
||||
),
|
||||
@@ -67,7 +65,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
height: 5,
|
||||
),
|
||||
Center(
|
||||
child: ChannelInfo(
|
||||
child: StreamChannelInfo(
|
||||
showTypingIndicator: false,
|
||||
channel: _streamChannelState.channel,
|
||||
textStyle: _channelPreviewThemeData.subtitleStyle,
|
||||
@@ -79,7 +77,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
if (channel.isDistinct && channel.memberCount == 2)
|
||||
Column(
|
||||
children: [
|
||||
UserAvatar(
|
||||
StreamUserAvatar(
|
||||
user: members
|
||||
.firstWhere(
|
||||
(e) => e.user?.id != userAsMember.user?.id,
|
||||
@@ -122,7 +120,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
UserAvatar(
|
||||
StreamUserAvatar(
|
||||
user: members[index].user!,
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 64,
|
||||
@@ -150,7 +148,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: StreamSvgIcon.user(
|
||||
@@ -163,7 +161,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
if (!channel.isDistinct &&
|
||||
channel.ownCapabilities
|
||||
.contains(PermissionType.leaveChannel))
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: StreamSvgIcon.userRemove(
|
||||
@@ -184,7 +182,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
if (isOwner &&
|
||||
channel.ownCapabilities
|
||||
.contains(PermissionType.deleteChannel))
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: StreamSvgIcon.delete(
|
||||
@@ -203,7 +201,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
});
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: StreamSvgIcon.closeSmall(
|
||||
@@ -224,7 +222,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
void didChangeDependencies() {
|
||||
_streamChannelState = StreamChannel.of(context);
|
||||
_streamChatThemeData = StreamChatTheme.of(context);
|
||||
_channelPreviewThemeData = ChannelPreviewTheme.of(context);
|
||||
_channelPreviewThemeData = StreamChannelPreviewTheme.of(context);
|
||||
_streamChatState = StreamChat.of(context);
|
||||
super.didChangeDependencies();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user