feat(sample-app): Migrate sample app to v4
Signed-off-by: xsahil03x <xdsahil@gmail.com>
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import 'package:collection/collection.dart' show IterableExtension;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
|
||||
/*Navigator.push(
|
||||
context,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imessage/message_list_view.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart'
|
||||
show
|
||||
|
||||
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 31
|
||||
ndkVersion '21.4.7075529'
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:example/localizations.dart';
|
||||
import 'package:example/routes/routes.dart';
|
||||
import 'package:example/stream_version.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: FileAttachment(
|
||||
child: StreamFileAttachment(
|
||||
message: media.values.toList()[position],
|
||||
attachment: media.keys.toList()[position],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:example/search_text_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
|
||||
import 'channel_page.dart';
|
||||
import 'chat_info_screen.dart';
|
||||
@@ -39,6 +40,16 @@ class _ChannelList extends State<ChannelList> {
|
||||
});
|
||||
}
|
||||
|
||||
late final _channelListController = StreamChannelListController(
|
||||
client: StreamChat.of(context).client,
|
||||
filter: Filter.in_(
|
||||
'members',
|
||||
[StreamChat.of(context).currentUser!.id],
|
||||
),
|
||||
presence: true,
|
||||
limit: 30,
|
||||
);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -86,7 +97,7 @@ class _ChannelList extends State<ChannelList> {
|
||||
),
|
||||
],
|
||||
body: _isSearchActive
|
||||
? MessageSearchListView(
|
||||
? StreamMessageSearchListView(
|
||||
showErrorTile: true,
|
||||
messageQuery: _channelQuery,
|
||||
filters: Filter.in_('members', [user!.id]),
|
||||
@@ -149,8 +160,99 @@ class _ChannelList extends State<ChannelList> {
|
||||
);
|
||||
},
|
||||
)
|
||||
: ChannelListView(
|
||||
onChannelTap: (channel, _) {
|
||||
: SlidableAutoCloseBehavior(
|
||||
closeWhenOpened: true,
|
||||
child: RefreshIndicator(
|
||||
onRefresh: _channelListController.refresh,
|
||||
child: StreamChannelListView(
|
||||
controller: _channelListController,
|
||||
itemBuilder: (context, channel, tile) {
|
||||
final chatTheme = StreamChatTheme.of(context);
|
||||
final backgroundColor = chatTheme.colorTheme.inputBg;
|
||||
final canDeleteChannel = channel.ownCapabilities
|
||||
.contains(PermissionType.deleteChannel);
|
||||
return Slidable(
|
||||
groupTag: 'channels-actions',
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: canDeleteChannel ? 0.40 : 0.20,
|
||||
motion: const BehindMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
child: Icon(Icons.more_horiz),
|
||||
backgroundColor: backgroundColor,
|
||||
onPressed: (_) {
|
||||
showChannelInfoModalBottomSheet(
|
||||
context: context,
|
||||
channel: channel,
|
||||
onViewInfoTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
final isOneToOne =
|
||||
channel.memberCount == 2 &&
|
||||
channel.isDistinct;
|
||||
return StreamChannel(
|
||||
channel: channel,
|
||||
child: isOneToOne
|
||||
? ChatInfoScreen(
|
||||
messageTheme: chatTheme
|
||||
.ownMessageTheme,
|
||||
user: channel
|
||||
.state!.members
|
||||
.where((m) =>
|
||||
m.userId !=
|
||||
channel
|
||||
.client
|
||||
.state
|
||||
.currentUser!
|
||||
.id)
|
||||
.first
|
||||
.user,
|
||||
)
|
||||
: GroupInfoScreen(
|
||||
messageTheme: chatTheme
|
||||
.ownMessageTheme,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
if (canDeleteChannel)
|
||||
CustomSlidableAction(
|
||||
backgroundColor: backgroundColor,
|
||||
child: StreamSvgIcon.delete(
|
||||
color: chatTheme.colorTheme.accentError,
|
||||
),
|
||||
onPressed: (_) async {
|
||||
final res = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Delete Conversation',
|
||||
question:
|
||||
'Are you sure you want to delete this conversation?',
|
||||
okText: 'Delete',
|
||||
cancelText: 'Cancel',
|
||||
icon: StreamSvgIcon.delete(
|
||||
color: chatTheme.colorTheme.accentError,
|
||||
),
|
||||
);
|
||||
if (res == true) {
|
||||
await _channelListController
|
||||
.deleteChannel(channel);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
child: tile,
|
||||
);
|
||||
},
|
||||
onChannelTap: (channel) {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
Routes.CHANNEL_PAGE,
|
||||
@@ -159,52 +261,43 @@ class _ChannelList extends State<ChannelList> {
|
||||
),
|
||||
);
|
||||
},
|
||||
onStartChatPressed: () {
|
||||
Navigator.pushNamed(context, Routes.NEW_CHAT);
|
||||
},
|
||||
swipeToAction: true,
|
||||
filter: Filter.in_('members', [user!.id]),
|
||||
presence: true,
|
||||
limit: 30,
|
||||
onViewInfoTap: (channel) {
|
||||
Navigator.pop(context);
|
||||
if (channel.memberCount == 2 && channel.isDistinct) {
|
||||
Navigator.push(
|
||||
emptyBuilder: (_) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: StreamChannelListEmptyWidget()),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: ChatInfoScreen(
|
||||
messageTheme:
|
||||
StreamChatTheme.of(context).ownMessageTheme,
|
||||
user: channel.state!.members
|
||||
.where((m) =>
|
||||
m.userId !=
|
||||
channel.client.state.currentUser!.id)
|
||||
.first
|
||||
.user,
|
||||
Routes.NEW_CHAT,
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'Start a chat',
|
||||
style: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.bodyBold
|
||||
.copyWith(
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.accentPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: GroupInfoScreen(
|
||||
messageTheme:
|
||||
StreamChatTheme.of(context).ownMessageTheme,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
Positioned(
|
||||
top: -3,
|
||||
right: -16,
|
||||
child: UnreadIndicator(),
|
||||
child: StreamUnreadIndicator(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -70,7 +70,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
appBar: ChannelListHeader(
|
||||
appBar: StreamChannelListHeader(
|
||||
onNewChatButtonTap: () {
|
||||
Navigator.pushNamed(context, Routes.NEW_CHAT);
|
||||
},
|
||||
@@ -100,11 +100,9 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
body: IndexedStack(
|
||||
index: _currentIndex,
|
||||
children: [
|
||||
ChannelsBloc(
|
||||
child: MessageSearchBloc(
|
||||
MessageSearchBloc(
|
||||
child: ChannelList(),
|
||||
),
|
||||
),
|
||||
UserMentionsPage(),
|
||||
],
|
||||
),
|
||||
@@ -165,7 +163,7 @@ class LeftDrawer extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
UserAvatar(
|
||||
StreamUserAvatar(
|
||||
user: user,
|
||||
showOnlineStatus: false,
|
||||
constraints: BoxConstraints.tight(Size.fromRadius(20)),
|
||||
|
||||
@@ -21,7 +21,7 @@ class ChannelMediaDisplayScreen extends StatefulWidget {
|
||||
|
||||
final ShowMessageCallback? onShowMessage;
|
||||
|
||||
final MessageThemeData messageTheme;
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
const ChannelMediaDisplayScreen({
|
||||
required this.messageTheme,
|
||||
@@ -180,7 +180,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: FullScreenMedia(
|
||||
child: StreamFullScreenMedia(
|
||||
mediaAttachments:
|
||||
media.map((e) => e.attachment).toList(),
|
||||
startIndex: position,
|
||||
@@ -194,7 +194,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
},
|
||||
child: media[position].attachment.type == 'image'
|
||||
? IgnorePointer(
|
||||
child: ImageAttachment(
|
||||
child: StreamImageAttachment(
|
||||
attachment: media[position].attachment,
|
||||
message: media[position].message,
|
||||
showTitle: false,
|
||||
|
||||
@@ -60,7 +60,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
appBar: ChannelHeader(
|
||||
appBar: StreamChannelHeader(
|
||||
showTypingIndicator: false,
|
||||
onImageTap: () async {
|
||||
var channel = StreamChannel.of(context).channel;
|
||||
@@ -108,7 +108,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
Expanded(
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
MessageListView(
|
||||
StreamMessageListView(
|
||||
initialScrollIndex: widget.initialScrollIndex,
|
||||
initialAlignment: widget.initialAlignment,
|
||||
highlightInitialMessage: widget.highlightInitialMessage,
|
||||
@@ -137,7 +137,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
);
|
||||
},
|
||||
deletedBottomRowBuilder: (context, message) {
|
||||
return const VisibleFootnote();
|
||||
return const StreamVisibleFootnote();
|
||||
},
|
||||
);
|
||||
},
|
||||
@@ -155,8 +155,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
.colorTheme
|
||||
.appBg
|
||||
.withOpacity(.9),
|
||||
child: TypingIndicator(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: StreamTypingIndicator(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
@@ -174,7 +173,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
MessageInput(
|
||||
StreamMessageInput(
|
||||
focusNode: _focusNode,
|
||||
messageInputController: _messageInputController,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:collection/collection.dart' show IterableExtension;
|
||||
import 'package:example/localizations.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import 'channel_file_display_screen.dart';
|
||||
@@ -16,7 +14,7 @@ class ChatInfoScreen extends StatefulWidget {
|
||||
/// User in consideration
|
||||
final User? user;
|
||||
|
||||
final MessageThemeData messageTheme;
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
const ChatInfoScreen({
|
||||
Key? key,
|
||||
@@ -54,13 +52,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
height: 8.0,
|
||||
color: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
),
|
||||
if ([
|
||||
'admin',
|
||||
'owner',
|
||||
].contains(channel.state!.members
|
||||
.firstWhereOrNull(
|
||||
(m) => m.userId == channel.client.state.currentUser!.id)
|
||||
?.role))
|
||||
if (channel.ownCapabilities.contains(PermissionType.deleteChannel))
|
||||
_buildDeleteListTile(),
|
||||
],
|
||||
),
|
||||
@@ -78,7 +70,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: UserAvatar(
|
||||
child: StreamUserAvatar(
|
||||
user: widget.user!,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 72.0,
|
||||
@@ -95,7 +87,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
SizedBox(height: 7.0),
|
||||
_buildConnectedTitleState(),
|
||||
SizedBox(height: 15.0),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: '@${widget.user!.id}',
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
trailing: Padding(
|
||||
@@ -148,7 +140,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
builder: (context, snapshot) {
|
||||
mutedBool.value = snapshot.data;
|
||||
|
||||
return OptionListTile(
|
||||
return StreamOptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
title: AppLocalizations.of(context).muteUser,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -201,7 +193,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
// ),
|
||||
// onTap: () {},
|
||||
// ),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: AppLocalizations.of(context).pinnedMessages,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -261,7 +253,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: AppLocalizations.of(context).photosAndVideos,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -321,7 +313,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: AppLocalizations.of(context).files,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -361,7 +353,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: AppLocalizations.of(context).sharedGroups,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -391,7 +383,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
}
|
||||
|
||||
Widget _buildDeleteListTile() {
|
||||
return OptionListTile(
|
||||
return StreamOptionListTile(
|
||||
title: 'Delete Conversation',
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body.copyWith(
|
||||
@@ -632,7 +624,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ChannelAvatar(
|
||||
child: StreamChannelAvatar(
|
||||
channel: channel,
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: 40.0, maxHeight: 40.0),
|
||||
|
||||
@@ -124,7 +124,7 @@ class ChooseUserPage extends StatelessWidget {
|
||||
arguments: HomePageArgs(client),
|
||||
);
|
||||
},
|
||||
leading: UserAvatar(
|
||||
leading: StreamUserAvatar(
|
||||
user: user,
|
||||
constraints: BoxConstraints.tight(
|
||||
Size.fromRadius(20),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:example/localizations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'channel_page.dart';
|
||||
import 'routes/routes.dart';
|
||||
@@ -155,7 +154,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ConnectionStatusBuilder(
|
||||
body: StreamConnectionStatusBuilder(
|
||||
statusBuilder: (context, status) {
|
||||
String statusString = '';
|
||||
bool showStatus = true;
|
||||
@@ -172,7 +171,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
||||
statusString = AppLocalizations.of(context).disconnected;
|
||||
break;
|
||||
}
|
||||
return InfoTile(
|
||||
return StreamInfoTile(
|
||||
showMessage: showStatus,
|
||||
tileAnchor: Alignment.topCenter,
|
||||
childAnchor: Alignment.topCenter,
|
||||
@@ -222,7 +221,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
||||
final user = _selectedUsers[index];
|
||||
return ListTile(
|
||||
key: ObjectKey(user),
|
||||
leading: UserAvatar(
|
||||
leading: StreamUserAvatar(
|
||||
user: user,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 40,
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:collection/collection.dart' show IterableExtension;
|
||||
import 'package:example/localizations.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import 'channel_file_display_screen.dart';
|
||||
@@ -15,7 +14,7 @@ import 'pinned_messages_screen.dart';
|
||||
import 'routes/routes.dart';
|
||||
|
||||
class GroupInfoScreen extends StatefulWidget {
|
||||
final MessageThemeData messageTheme;
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
const GroupInfoScreen({
|
||||
Key? key,
|
||||
@@ -222,7 +221,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
horizontal: 8.0,
|
||||
vertical: 12.0,
|
||||
),
|
||||
child: UserAvatar(
|
||||
child: StreamUserAvatar(
|
||||
user: member.user!,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
height: 40.0,
|
||||
@@ -456,7 +455,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
builder: (context, snapshot) {
|
||||
mutedBool.value = snapshot.data;
|
||||
|
||||
return OptionListTile(
|
||||
return StreamOptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor:
|
||||
StreamChatTheme.of(context).colorTheme.disabled,
|
||||
@@ -493,7 +492,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
onTap: () {},
|
||||
);
|
||||
}),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
title: AppLocalizations.of(context).pinnedMessages,
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||
@@ -553,7 +552,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
title: AppLocalizations.of(context).photosAndVideos,
|
||||
@@ -615,7 +614,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
title: AppLocalizations.of(context).files,
|
||||
@@ -660,7 +659,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
if (!channel.channel.isDistinct &&
|
||||
channel.channel.ownCapabilities
|
||||
.contains(PermissionType.leaveChannel))
|
||||
OptionListTile(
|
||||
StreamOptionListTile(
|
||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||
title: AppLocalizations.of(context).leaveGroup,
|
||||
@@ -730,7 +729,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
child: _buildTextInputSection(modalSetState),
|
||||
),
|
||||
Expanded(
|
||||
child: UserListView(
|
||||
child: StreamUserListView(
|
||||
selectedUsers: {},
|
||||
onUserTap: (user, _) async {
|
||||
_searchController!.clear();
|
||||
@@ -900,7 +899,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: UserAvatar(
|
||||
child: StreamUserAvatar(
|
||||
user: user,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
height: 64.0,
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:example/channel_page.dart';
|
||||
import 'package:example/notifications_service.dart';
|
||||
import 'package:example/routes/app_routes.dart';
|
||||
import 'package:example/routes/routes.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:example/choose_user_page.dart';
|
||||
import 'package:example/home_page.dart';
|
||||
import 'package:example/localizations.dart';
|
||||
import 'package:example/splash_screen.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
|
||||
@@ -130,7 +130,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: ConnectionStatusBuilder(
|
||||
body: StreamConnectionStatusBuilder(
|
||||
statusBuilder: (context, status) {
|
||||
String statusString = '';
|
||||
bool showStatus = true;
|
||||
@@ -147,7 +147,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
statusString = AppLocalizations.of(context).disconnected;
|
||||
break;
|
||||
}
|
||||
return InfoTile(
|
||||
return StreamInfoTile(
|
||||
showMessage: showStatus,
|
||||
tileAnchor: Alignment.topCenter,
|
||||
childAnchor: Alignment.topCenter,
|
||||
@@ -200,7 +200,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
.overlay,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: UserAvatar(
|
||||
child: StreamUserAvatar(
|
||||
showOnlineStatus: false,
|
||||
user: user,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
@@ -288,7 +288,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPanDown: (_) => FocusScope.of(context).unfocus(),
|
||||
child: UsersBloc(
|
||||
child: UserListView(
|
||||
child: StreamUserListView(
|
||||
selectedUsers: _selectedUsers,
|
||||
groupAlphabetically:
|
||||
_isSearchActive ? false : true,
|
||||
@@ -366,7 +366,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
future: channel!.initialized,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data == true) {
|
||||
return MessageListView();
|
||||
return StreamMessageListView();
|
||||
}
|
||||
|
||||
return Center(
|
||||
@@ -384,7 +384,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
MessageInput(
|
||||
StreamMessageInput(
|
||||
focusNode: _messageInputFocusNode,
|
||||
preMessageSending: (message) async {
|
||||
await channel!.watch();
|
||||
|
||||
@@ -88,7 +88,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
)
|
||||
],
|
||||
),
|
||||
body: ConnectionStatusBuilder(
|
||||
body: StreamConnectionStatusBuilder(
|
||||
statusBuilder: (context, status) {
|
||||
String statusString = '';
|
||||
bool showStatus = true;
|
||||
@@ -105,7 +105,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
statusString = AppLocalizations.of(context).disconnected;
|
||||
break;
|
||||
}
|
||||
return InfoTile(
|
||||
return StreamInfoTile(
|
||||
showMessage: showStatus,
|
||||
tileAnchor: Alignment.topCenter,
|
||||
childAnchor: Alignment.topCenter,
|
||||
@@ -136,7 +136,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
UserAvatar(
|
||||
StreamUserAvatar(
|
||||
onlineIndicatorAlignment:
|
||||
Alignment(0.9, 0.9),
|
||||
user: user,
|
||||
@@ -229,7 +229,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPanDown: (_) => FocusScope.of(context).unfocus(),
|
||||
child: UsersBloc(
|
||||
child: UserListView(
|
||||
child: StreamUserListView(
|
||||
selectedUsers: _selectedUsers,
|
||||
pullToRefresh: false,
|
||||
groupAlphabetically: _isSearchActive ? false : true,
|
||||
|
||||
@@ -21,7 +21,7 @@ class PinnedMessagesScreen extends StatefulWidget {
|
||||
|
||||
final ShowMessageCallback? onShowMessage;
|
||||
|
||||
final MessageThemeData messageTheme;
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
const PinnedMessagesScreen({
|
||||
required this.messageTheme,
|
||||
@@ -166,7 +166,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
||||
var text = data[position].message.text ?? '';
|
||||
|
||||
return ListTile(
|
||||
leading: UserAvatar(
|
||||
leading: StreamUserAvatar(
|
||||
user: user,
|
||||
constraints: BoxConstraints.tightFor(
|
||||
width: 40.0,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
mixin SplashScreenStateMixin<T extends StatefulWidget> on State<T>
|
||||
|
||||
@@ -44,13 +44,13 @@ class _ThreadPageState extends State<ThreadPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||
appBar: ThreadHeader(
|
||||
appBar: StreamThreadHeader(
|
||||
parent: widget.parent,
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: MessageListView(
|
||||
child: StreamMessageListView(
|
||||
parentMessage: widget.parent,
|
||||
initialScrollIndex: widget.initialScrollIndex,
|
||||
initialAlignment: widget.initialAlignment,
|
||||
@@ -62,14 +62,14 @@ class _ThreadPageState extends State<ThreadPage> {
|
||||
return defaultMessage.copyWith(
|
||||
onReplyTap: _reply,
|
||||
deletedBottomRowBuilder: (context, message) {
|
||||
return const VisibleFootnote();
|
||||
return const StreamVisibleFootnote();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (widget.parent.type != 'deleted')
|
||||
MessageInput(
|
||||
StreamMessageInput(
|
||||
focusNode: _focusNode,
|
||||
messageInputController: _messageInputController,
|
||||
),
|
||||
|
||||
@@ -10,7 +10,7 @@ class UserMentionsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final user = StreamChat.of(context).currentUser!;
|
||||
return MessageSearchBloc(
|
||||
child: MessageSearchListView(
|
||||
child: StreamMessageSearchListView(
|
||||
filters: Filter.in_('members', [user.id]),
|
||||
messageFilters: Filter.custom(
|
||||
operator: r'$contains',
|
||||
|
||||
Reference in New Issue
Block a user