refactor(ui, core): Deprecate v3
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -24,7 +24,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: FileAttachment(
|
||||
child: StreamFileAttachment(
|
||||
size: const Size(
|
||||
300,
|
||||
300,
|
||||
|
||||
@@ -136,7 +136,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byType(UnreadIndicator), findsOneWidget);
|
||||
expect(find.byType(StreamUnreadIndicator), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: ChannelHeader(),
|
||||
body: StreamChannelHeader(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
expect(find.text('test'), findsOneWidget);
|
||||
expect(find.byType(ChannelAvatar), findsOneWidget);
|
||||
expect(find.byType(StreamBackButton), findsOneWidget);
|
||||
expect(find.byType(ChannelInfo), findsOneWidget);
|
||||
expect(find.byType(StreamChannelInfo), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -124,7 +124,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: ChannelHeader(
|
||||
body: StreamChannelHeader(
|
||||
showConnectionStateTile: true,
|
||||
),
|
||||
),
|
||||
@@ -132,8 +132,12 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
expect(tester.widget<InfoTile>(find.byType(InfoTile)).showMessage, true);
|
||||
expect(tester.widget<InfoTile>(find.byType(InfoTile)).message,
|
||||
expect(
|
||||
tester
|
||||
.widget<StreamInfoTile>(find.byType(StreamInfoTile))
|
||||
.showMessage,
|
||||
true);
|
||||
expect(tester.widget<StreamInfoTile>(find.byType(StreamInfoTile)).message,
|
||||
'Disconnected');
|
||||
},
|
||||
);
|
||||
@@ -190,7 +194,7 @@ void main() {
|
||||
channel: channel,
|
||||
showLoading: false,
|
||||
child: const Scaffold(
|
||||
body: ChannelHeader(
|
||||
body: StreamChannelHeader(
|
||||
showConnectionStateTile: true,
|
||||
),
|
||||
),
|
||||
@@ -200,8 +204,12 @@ void main() {
|
||||
|
||||
await tester.pump();
|
||||
|
||||
expect(tester.widget<InfoTile>(find.byType(InfoTile)).showMessage, true);
|
||||
expect(tester.widget<InfoTile>(find.byType(InfoTile)).message,
|
||||
expect(
|
||||
tester
|
||||
.widget<StreamInfoTile>(find.byType(StreamInfoTile))
|
||||
.showMessage,
|
||||
true);
|
||||
expect(tester.widget<StreamInfoTile>(find.byType(StreamInfoTile)).message,
|
||||
'Reconnecting...');
|
||||
},
|
||||
);
|
||||
@@ -257,7 +265,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: ChannelHeader(
|
||||
body: StreamChannelHeader(
|
||||
leading: Text('leading'),
|
||||
subtitle: Text('subtitle'),
|
||||
actions: [
|
||||
@@ -273,7 +281,7 @@ void main() {
|
||||
expect(find.text('test'), findsNothing);
|
||||
expect(find.byType(StreamBackButton), findsNothing);
|
||||
expect(find.byType(ChannelAvatar), findsNothing);
|
||||
expect(find.byType(ChannelInfo), findsNothing);
|
||||
expect(find.byType(StreamChannelInfo), findsNothing);
|
||||
expect(find.text('leading'), findsOneWidget);
|
||||
expect(find.text('title'), findsOneWidget);
|
||||
expect(find.text('subtitle'), findsOneWidget);
|
||||
@@ -331,7 +339,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: ChannelHeader(
|
||||
body: StreamChannelHeader(
|
||||
showTypingIndicator: false,
|
||||
showBackButton: false,
|
||||
),
|
||||
@@ -343,10 +351,14 @@ void main() {
|
||||
expect(find.byType(StreamBackButton), findsNothing);
|
||||
expect(
|
||||
tester
|
||||
.widget<ChannelInfo>(find.byType(ChannelInfo))
|
||||
.widget<StreamChannelInfo>(find.byType(StreamChannelInfo))
|
||||
.showTypingIndicator,
|
||||
false);
|
||||
expect(tester.widget<InfoTile>(find.byType(InfoTile)).showMessage, false);
|
||||
expect(
|
||||
tester
|
||||
.widget<StreamInfoTile>(find.byType(StreamInfoTile))
|
||||
.showMessage,
|
||||
false);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -405,7 +417,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: ChannelHeader(
|
||||
body: StreamChannelHeader(
|
||||
onBackPressed: () => backPressed = true,
|
||||
onImageTap: () => imageTapped = true,
|
||||
onTitleTap: () => titleTapped = true,
|
||||
|
||||
@@ -169,7 +169,8 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
final image = tester.widget<GroupAvatar>(find.byType(GroupAvatar));
|
||||
final image =
|
||||
tester.widget<StreamGroupAvatar>(find.byType(StreamGroupAvatar));
|
||||
final otherMembers = members.where((it) => it.userId != currentUser.id);
|
||||
expect(
|
||||
image.members.map((it) => it.user?.id),
|
||||
|
||||
@@ -22,14 +22,15 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: const Scaffold(
|
||||
body: ChannelListHeader(),
|
||||
body: StreamChannelListHeader(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final userAvatar = tester.widget<UserAvatar>(find.byType(UserAvatar));
|
||||
final userAvatar =
|
||||
tester.widget<StreamUserAvatar>(find.byType(StreamUserAvatar));
|
||||
expect(userAvatar.user, clientState.currentUser);
|
||||
expect(find.byType(StreamNeumorphicButton), findsOneWidget);
|
||||
expect(find.text('Stream Chat'), findsOneWidget);
|
||||
@@ -52,7 +53,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: const Scaffold(
|
||||
body: ChannelListHeader(
|
||||
body: StreamChannelListHeader(
|
||||
showConnectionStateTile: true,
|
||||
),
|
||||
),
|
||||
@@ -81,7 +82,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: const Scaffold(
|
||||
body: ChannelListHeader(
|
||||
body: StreamChannelListHeader(
|
||||
showConnectionStateTile: true,
|
||||
),
|
||||
),
|
||||
@@ -110,7 +111,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: Scaffold(
|
||||
body: ChannelListHeader(
|
||||
body: StreamChannelListHeader(
|
||||
titleBuilder: (context, status, client) => const Text('TITLE'),
|
||||
subtitle: const Text('SUBTITLE'),
|
||||
leading: const Text('LEADING'),
|
||||
@@ -150,7 +151,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: Scaffold(
|
||||
body: ChannelListHeader(
|
||||
body: StreamChannelListHeader(
|
||||
preNavigationCallback: () {
|
||||
tapped = true;
|
||||
},
|
||||
@@ -161,7 +162,7 @@ void main() {
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
await tester.tap(find.byType(UserAvatar));
|
||||
await tester.tap(find.byType(StreamUserAvatar));
|
||||
expect(tapped, true);
|
||||
},
|
||||
);
|
||||
@@ -183,7 +184,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: Scaffold(
|
||||
body: ChannelListHeader(
|
||||
body: StreamChannelListHeader(
|
||||
onUserAvatarTap: (u) {
|
||||
tapped++;
|
||||
},
|
||||
@@ -197,7 +198,7 @@ void main() {
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
await tester.tap(find.byType(UserAvatar));
|
||||
await tester.tap(find.byType(StreamUserAvatar));
|
||||
await tester.tap(find.byType(StreamNeumorphicButton));
|
||||
expect(tapped, 2);
|
||||
},
|
||||
|
||||
@@ -71,7 +71,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: ChannelPreview(
|
||||
body: StreamChannelPreview(
|
||||
channel: channel,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -19,7 +19,7 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: Scaffold(
|
||||
body: DateDivider(
|
||||
body: StreamDateDivider(
|
||||
dateTime: DateTime.now(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -20,8 +20,8 @@ void main() {
|
||||
home: StreamChat(
|
||||
client: client,
|
||||
child: const Scaffold(
|
||||
body: DeletedMessage(
|
||||
messageTheme: MessageThemeData(
|
||||
body: StreamDeletedMessage(
|
||||
messageTheme: StreamMessageThemeData(
|
||||
createdAtStyle: TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: Center(
|
||||
child: DeletedMessage(
|
||||
child: StreamDeletedMessage(
|
||||
messageTheme: theme.ownMessageTheme,
|
||||
),
|
||||
),
|
||||
@@ -128,7 +128,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: Center(
|
||||
child: DeletedMessage(
|
||||
child: StreamDeletedMessage(
|
||||
messageTheme: theme.ownMessageTheme,
|
||||
),
|
||||
),
|
||||
@@ -181,7 +181,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: Center(
|
||||
child: DeletedMessage(
|
||||
child: StreamDeletedMessage(
|
||||
messageTheme: theme.ownMessageTheme,
|
||||
reverse: true,
|
||||
shape: RoundedRectangleBorder(
|
||||
|
||||
@@ -68,7 +68,7 @@ void main() {
|
||||
client: client,
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: FullScreenMedia(
|
||||
child: StreamFullScreenMedia(
|
||||
mediaAttachments: [
|
||||
Attachment(
|
||||
type: 'image',
|
||||
|
||||
@@ -25,7 +25,8 @@ void main() {
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: GradientAvatar(name: 'demo user', userId: 'demo123'),
|
||||
child: StreamGradientAvatar(
|
||||
name: 'demo user', userId: 'demo123'),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -33,7 +34,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byType(GradientAvatar), findsOneWidget);
|
||||
expect(find.byType(StreamGradientAvatar), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -47,7 +48,8 @@ void main() {
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: GradientAvatar(name: 'demo user', userId: 'demo123'),
|
||||
child:
|
||||
StreamGradientAvatar(name: 'demo user', userId: 'demo123'),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -68,7 +70,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: GradientAvatar(name: 'demo', userId: 'demo1'),
|
||||
child: StreamGradientAvatar(name: 'demo', userId: 'demo1'),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -89,7 +91,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: GradientAvatar(
|
||||
child: StreamGradientAvatar(
|
||||
name: 'd123@/d de:\$as',
|
||||
userId: 'demo123',
|
||||
),
|
||||
@@ -113,7 +115,8 @@ void main() {
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: GradientAvatar(name: '123@/d \$as', userId: 'demo123'),
|
||||
child: StreamGradientAvatar(
|
||||
name: '123@/d \$as', userId: 'demo123'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -37,7 +37,7 @@ void main() {
|
||||
child: WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: Scaffold(
|
||||
body: GalleryFooter(
|
||||
body: StreamGalleryFooter(
|
||||
message: Message(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -22,7 +22,7 @@ void main() {
|
||||
child: const Scaffold(
|
||||
body: Portal(
|
||||
child: SizedBox(
|
||||
child: InfoTile(
|
||||
child: StreamInfoTile(
|
||||
showMessage: true,
|
||||
message: 'message',
|
||||
child: Text('test'),
|
||||
@@ -52,7 +52,7 @@ void main() {
|
||||
child: const Scaffold(
|
||||
body: Portal(
|
||||
child: SizedBox(
|
||||
child: InfoTile(
|
||||
child: StreamInfoTile(
|
||||
showMessage: false,
|
||||
message: 'message',
|
||||
child: Text('test'),
|
||||
|
||||
@@ -34,7 +34,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
message: Message(
|
||||
text: 'test',
|
||||
user: User(
|
||||
@@ -88,7 +88,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
showCopyMessage: false,
|
||||
showReplyMessage: false,
|
||||
showThreadReplyMessage: false,
|
||||
@@ -143,7 +143,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
text: 'test',
|
||||
@@ -153,7 +153,7 @@ void main() {
|
||||
),
|
||||
messageTheme: streamTheme.ownMessageTheme,
|
||||
customActions: [
|
||||
MessageAction(
|
||||
StreamMessageAction(
|
||||
leading: const Icon(Icons.check),
|
||||
title: const Text('title'),
|
||||
onTap: (m) {
|
||||
@@ -203,7 +203,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
onReplyTap: (m) {
|
||||
tapped = true;
|
||||
@@ -254,7 +254,7 @@ void main() {
|
||||
child: SizedBox(
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
onThreadReplyTap: (m) {
|
||||
tapped = true;
|
||||
@@ -309,7 +309,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
text: 'test',
|
||||
@@ -330,7 +330,7 @@ void main() {
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(MessageInput), findsOneWidget);
|
||||
expect(find.byType(StreamMessageInput), findsOneWidget);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -359,7 +359,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
editMessageInputBuilder: (context, m) => const Text('test'),
|
||||
message: Message(
|
||||
@@ -412,7 +412,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
onCopyTap: (m) => tapped = true,
|
||||
message: Message(
|
||||
@@ -462,7 +462,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
status: MessageSendingStatus.failed,
|
||||
@@ -512,7 +512,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
status: MessageSendingStatus.failed_update,
|
||||
@@ -560,7 +560,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
id: 'testid',
|
||||
@@ -617,7 +617,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
id: 'testid',
|
||||
@@ -674,7 +674,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
id: 'testid',
|
||||
@@ -729,7 +729,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
id: 'testid',
|
||||
@@ -786,7 +786,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: SizedBox(
|
||||
child: MessageActionsModal(
|
||||
child: StreamMessageActionsModal(
|
||||
messageWidget: const Text('test'),
|
||||
message: Message(
|
||||
id: 'testid',
|
||||
|
||||
@@ -59,7 +59,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: MessageInput(),
|
||||
body: StreamMessageInput(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -125,7 +125,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: MessageInput(),
|
||||
body: StreamMessageInput(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
client: client,
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageListView(
|
||||
child: StreamMessageListView(
|
||||
emptyBuilder: (_) => Container(key: emptyWidgetKey),
|
||||
),
|
||||
),
|
||||
@@ -63,7 +63,7 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(MessageListView), findsOneWidget);
|
||||
expect(find.byType(StreamMessageListView), findsOneWidget);
|
||||
expect(find.byKey(emptyWidgetKey), findsOneWidget);
|
||||
});
|
||||
|
||||
@@ -92,7 +92,7 @@ void main() {
|
||||
child: StreamChat(
|
||||
client: client,
|
||||
streamChatThemeData: StreamChatThemeData.light().copyWith(
|
||||
messageListViewTheme: const MessageListViewThemeData(
|
||||
messageListViewTheme: const StreamMessageListViewThemeData(
|
||||
backgroundColor: Colors.grey,
|
||||
backgroundImage: DecorationImage(
|
||||
image: AssetImage('images/placeholder.png'),
|
||||
@@ -102,7 +102,7 @@ void main() {
|
||||
),
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const MessageListView(
|
||||
child: const StreamMessageListView(
|
||||
key: nonEmptyWidgetKey,
|
||||
),
|
||||
),
|
||||
@@ -118,7 +118,7 @@ void main() {
|
||||
widget.decoration is BoxDecoration &&
|
||||
(widget.decoration! as BoxDecoration).image != null;
|
||||
|
||||
expect(find.byType(MessageListView), findsOneWidget);
|
||||
expect(find.byType(StreamMessageListView), findsOneWidget);
|
||||
expect(find.byKey(nonEmptyWidgetKey), findsOneWidget);
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
|
||||
@@ -36,7 +36,7 @@ void main() {
|
||||
streamChatThemeData: streamTheme,
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageReactionsModal(
|
||||
child: StreamMessageReactionsModal(
|
||||
messageWidget: const Text(
|
||||
'test',
|
||||
key: Key('MessageWidget'),
|
||||
@@ -51,9 +51,9 @@ void main() {
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 1000));
|
||||
|
||||
expect(find.byType(ReactionBubble), findsNothing);
|
||||
expect(find.byType(StreamReactionBubble), findsNothing);
|
||||
|
||||
expect(find.byType(UserAvatar), findsNothing);
|
||||
expect(find.byType(StreamUserAvatar), findsNothing);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -96,7 +96,7 @@ void main() {
|
||||
streamChatThemeData: streamTheme,
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: MessageReactionsModal(
|
||||
child: StreamMessageReactionsModal(
|
||||
messageWidget: const Text(
|
||||
'test',
|
||||
key: Key('MessageWidget'),
|
||||
@@ -116,8 +116,8 @@ void main() {
|
||||
|
||||
expect(find.byKey(const Key('MessageWidget')), findsOneWidget);
|
||||
|
||||
expect(find.byType(ReactionBubble), findsOneWidget);
|
||||
expect(find.byType(UserAvatar), findsOneWidget);
|
||||
expect(find.byType(StreamReactionBubble), findsOneWidget);
|
||||
expect(find.byType(StreamUserAvatar), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: MessageText(
|
||||
body: StreamMessageText(
|
||||
message: Message(
|
||||
text: 'demo',
|
||||
),
|
||||
@@ -84,7 +84,7 @@ void main() {
|
||||
final clientState = MockClientState();
|
||||
final channel = MockChannel();
|
||||
final channelState = MockChannelState();
|
||||
const messageTheme = MessageThemeData();
|
||||
const messageTheme = StreamMessageThemeData();
|
||||
|
||||
final currentUser = OwnUser(
|
||||
id: 'sahil',
|
||||
@@ -122,7 +122,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: MessageText(
|
||||
body: StreamMessageText(
|
||||
message: message,
|
||||
messageTheme: messageTheme,
|
||||
),
|
||||
@@ -158,7 +158,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: MessageText(
|
||||
body: StreamMessageText(
|
||||
message: message,
|
||||
messageTheme: messageTheme,
|
||||
),
|
||||
@@ -221,7 +221,7 @@ cool.''';
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: MessageText(
|
||||
body: StreamMessageText(
|
||||
message: Message(
|
||||
text: messageText,
|
||||
),
|
||||
|
||||
@@ -25,7 +25,7 @@ void main() {
|
||||
streamChatThemeData: theme,
|
||||
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||
child: SizedBox(
|
||||
child: ReactionBubble(
|
||||
child: StreamReactionBubble(
|
||||
reactions: [
|
||||
Reaction(
|
||||
type: 'like',
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||
child: Container(
|
||||
color: Colors.black,
|
||||
child: ReactionBubble(
|
||||
child: StreamReactionBubble(
|
||||
reactions: [
|
||||
Reaction(
|
||||
type: 'like',
|
||||
@@ -99,7 +99,7 @@ void main() {
|
||||
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||
child: Container(
|
||||
color: Colors.black,
|
||||
child: ReactionBubble(
|
||||
child: StreamReactionBubble(
|
||||
reactions: [
|
||||
Reaction(
|
||||
type: 'like',
|
||||
@@ -144,7 +144,7 @@ void main() {
|
||||
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||
child: Container(
|
||||
color: Colors.black,
|
||||
child: ReactionBubble(
|
||||
child: StreamReactionBubble(
|
||||
reactions: [
|
||||
Reaction(
|
||||
type: 'like',
|
||||
@@ -187,7 +187,7 @@ void main() {
|
||||
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
||||
child: SizedBox(
|
||||
child: ReactionBubble(
|
||||
child: StreamReactionBubble(
|
||||
reactions: [
|
||||
Reaction(
|
||||
type: 'like',
|
||||
|
||||
@@ -40,7 +40,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: SystemMessage(
|
||||
body: StreamSystemMessage(
|
||||
onMessageTap: (m) => tapped = true,
|
||||
message: Message(
|
||||
text: 'demo message',
|
||||
@@ -51,7 +51,7 @@ void main() {
|
||||
),
|
||||
));
|
||||
|
||||
await tester.tap(find.byType(SystemMessage));
|
||||
await tester.tap(find.byType(StreamSystemMessage));
|
||||
|
||||
expect(find.text('demo message'), findsOneWidget);
|
||||
expect(tapped, true);
|
||||
@@ -94,7 +94,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: Center(
|
||||
child: SystemMessage(
|
||||
child: StreamSystemMessage(
|
||||
message: Message(
|
||||
text: 'demo message',
|
||||
),
|
||||
@@ -146,7 +146,7 @@ void main() {
|
||||
showLoading: false,
|
||||
channel: channel,
|
||||
child: Center(
|
||||
child: SystemMessage(
|
||||
child: StreamSystemMessage(
|
||||
message: Message(
|
||||
text: 'demo message',
|
||||
),
|
||||
|
||||
@@ -4,22 +4,23 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('AvatarThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const AvatarThemeData(), const AvatarThemeData().copyWith());
|
||||
expect(const AvatarThemeData().hashCode,
|
||||
const AvatarThemeData().copyWith().hashCode);
|
||||
expect(const StreamAvatarThemeData(),
|
||||
const StreamAvatarThemeData().copyWith());
|
||||
expect(const StreamAvatarThemeData().hashCode,
|
||||
const StreamAvatarThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('AvatarThemeData lerps correctly', () {
|
||||
test('Lerp completely', () {
|
||||
expect(
|
||||
const AvatarThemeData()
|
||||
const StreamAvatarThemeData()
|
||||
.lerp(_avatarThemeDataControl1, _avatarThemeDataControl2, 1),
|
||||
_avatarThemeDataControl2);
|
||||
});
|
||||
|
||||
test('Lerp halfway', () {
|
||||
expect(
|
||||
const AvatarThemeData()
|
||||
const StreamAvatarThemeData()
|
||||
.lerp(_avatarThemeDataControl1, _avatarThemeDataControl2, 0.5),
|
||||
_avatarThemeDataControlMidLerp);
|
||||
});
|
||||
@@ -31,9 +32,9 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
const _avatarThemeDataControl1 = AvatarThemeData();
|
||||
const _avatarThemeDataControl1 = StreamAvatarThemeData();
|
||||
|
||||
final _avatarThemeDataControlMidLerp = AvatarThemeData(
|
||||
final _avatarThemeDataControlMidLerp = StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 33,
|
||||
@@ -41,7 +42,7 @@ final _avatarThemeDataControlMidLerp = AvatarThemeData(
|
||||
),
|
||||
);
|
||||
|
||||
final _avatarThemeDataControl2 = AvatarThemeData(
|
||||
final _avatarThemeDataControl2 = StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 34,
|
||||
|
||||
@@ -4,10 +4,10 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('ChannelHeaderThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const ChannelHeaderThemeData(),
|
||||
const ChannelHeaderThemeData().copyWith());
|
||||
expect(const ChannelHeaderThemeData().hashCode,
|
||||
const ChannelHeaderThemeData().copyWith().hashCode);
|
||||
expect(const StreamChannelHeaderThemeData(),
|
||||
const StreamChannelHeaderThemeData().copyWith());
|
||||
expect(const StreamChannelHeaderThemeData().hashCode,
|
||||
const StreamChannelHeaderThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('ChannelHeaderThemeData lerps', () {
|
||||
@@ -15,7 +15,7 @@ void main() {
|
||||
'''Light ChannelHeaderThemeData lerps completely to dark ChannelHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelHeaderThemeData()
|
||||
const StreamChannelHeaderThemeData()
|
||||
.lerp(_channelThemeControl, _channelThemeControlDark, 1),
|
||||
_channelThemeControlDark);
|
||||
});
|
||||
@@ -24,7 +24,7 @@ void main() {
|
||||
'''Light ChannelHeaderThemeData lerps halfway to dark ChannelHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelHeaderThemeData()
|
||||
const StreamChannelHeaderThemeData()
|
||||
.lerp(_channelThemeControl, _channelThemeControlDark, 0.5),
|
||||
_channelThemeControlMidLerp);
|
||||
});
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
'''Dark ChannelHeaderThemeData lerps completely to light ChannelHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelHeaderThemeData()
|
||||
const StreamChannelHeaderThemeData()
|
||||
.lerp(_channelThemeControlDark, _channelThemeControl, 1),
|
||||
_channelThemeControl);
|
||||
});
|
||||
@@ -45,8 +45,8 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
final _channelThemeControl = ChannelHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelThemeControl = StreamChannelHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
@@ -54,16 +54,16 @@ final _channelThemeControl = ChannelHeaderThemeData(
|
||||
),
|
||||
),
|
||||
color: const Color(0xff101418),
|
||||
titleStyle: TextTheme.light().headlineBold.copyWith(
|
||||
titleStyle: StreamTextTheme.light().headlineBold.copyWith(
|
||||
color: const Color(0xffffffff),
|
||||
),
|
||||
subtitleStyle: TextTheme.light().footnote.copyWith(
|
||||
subtitleStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: const Color(0xff7a7a7a),
|
||||
),
|
||||
);
|
||||
|
||||
final _channelThemeControlMidLerp = ChannelHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelThemeControlMidLerp = StreamChannelHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
@@ -76,22 +76,22 @@ final _channelThemeControlMidLerp = ChannelHeaderThemeData(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
subtitleStyle: TextTheme.light().footnote.copyWith(
|
||||
subtitleStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: const Color(0xff7a7a7a),
|
||||
),
|
||||
);
|
||||
|
||||
final _channelThemeControlDark = ChannelHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelThemeControlDark = StreamChannelHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
color: ColorTheme.dark().barsBg,
|
||||
titleStyle: TextTheme.dark().headlineBold,
|
||||
subtitleStyle: TextTheme.dark().footnote.copyWith(
|
||||
color: StreamColorTheme.dark().barsBg,
|
||||
titleStyle: StreamTextTheme.dark().headlineBold,
|
||||
subtitleStyle: StreamTextTheme.dark().footnote.copyWith(
|
||||
color: const Color(0xff7A7A7A),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -4,10 +4,10 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('ChannelListHeaderThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const ChannelListHeaderThemeData(),
|
||||
const ChannelListHeaderThemeData().copyWith());
|
||||
expect(const ChannelListHeaderThemeData().hashCode,
|
||||
const ChannelListHeaderThemeData().copyWith().hashCode);
|
||||
expect(const StreamChannelListHeaderThemeData(),
|
||||
const StreamChannelListHeaderThemeData().copyWith());
|
||||
expect(const StreamChannelListHeaderThemeData().hashCode,
|
||||
const StreamChannelListHeaderThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('ChannelListHeaderThemeData lerps', () {
|
||||
@@ -15,7 +15,7 @@ void main() {
|
||||
'''Light ChannelListHeaderThemeData lerps completely to dark ChannelListHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListHeaderThemeData().lerp(
|
||||
const StreamChannelListHeaderThemeData().lerp(
|
||||
_channelListHeaderThemeControl,
|
||||
_channelListHeaderThemeControlDark,
|
||||
1),
|
||||
@@ -26,7 +26,7 @@ void main() {
|
||||
'''Light ChannelListHeaderThemeData lerps halfway to dark ChannelListHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListHeaderThemeData().lerp(
|
||||
const StreamChannelListHeaderThemeData().lerp(
|
||||
_channelListHeaderThemeControl,
|
||||
_channelListHeaderThemeControlDark,
|
||||
0.5),
|
||||
@@ -37,7 +37,7 @@ void main() {
|
||||
'''Dark ChannelListHeaderThemeData lerps completely to light ChannelListHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListHeaderThemeData().lerp(
|
||||
const StreamChannelListHeaderThemeData().lerp(
|
||||
_channelListHeaderThemeControlDark,
|
||||
_channelListHeaderThemeControl,
|
||||
1),
|
||||
@@ -53,20 +53,20 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
final _channelListHeaderThemeControl = ChannelListHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelListHeaderThemeControl = StreamChannelListHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
color: ColorTheme.light().barsBg,
|
||||
titleStyle: TextTheme.light().headlineBold,
|
||||
color: StreamColorTheme.light().barsBg,
|
||||
titleStyle: StreamTextTheme.light().headlineBold,
|
||||
);
|
||||
|
||||
final _channelListHeaderThemeControlMidLerp = ChannelListHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelListHeaderThemeControlMidLerp = StreamChannelListHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
@@ -81,14 +81,14 @@ final _channelListHeaderThemeControlMidLerp = ChannelListHeaderThemeData(
|
||||
),
|
||||
);
|
||||
|
||||
final _channelListHeaderThemeControlDark = ChannelListHeaderThemeData(
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelListHeaderThemeControlDark = StreamChannelListHeaderThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
color: ColorTheme.dark().barsBg,
|
||||
titleStyle: TextTheme.dark().headlineBold,
|
||||
color: StreamColorTheme.dark().barsBg,
|
||||
titleStyle: StreamTextTheme.dark().headlineBold,
|
||||
);
|
||||
|
||||
@@ -6,16 +6,18 @@ import '../mocks.dart';
|
||||
|
||||
void main() {
|
||||
test('ChannelListViewThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const ChannelListViewThemeData(),
|
||||
const ChannelListViewThemeData().copyWith());
|
||||
expect(const StreamChannelListViewThemeData(),
|
||||
const StreamChannelListViewThemeData().copyWith());
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light ChannelListViewThemeData lerps completely to dark ChannelListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListViewThemeData().lerp(_channelListViewThemeDataControl,
|
||||
_channelListViewThemeDataControlDark, 1),
|
||||
const StreamChannelListViewThemeData().lerp(
|
||||
_channelListViewThemeDataControl,
|
||||
_channelListViewThemeDataControlDark,
|
||||
1),
|
||||
_channelListViewThemeDataControlDark);
|
||||
});
|
||||
|
||||
@@ -23,8 +25,10 @@ void main() {
|
||||
'''Light ChannelListViewThemeData lerps halfway to dark ChannelListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListViewThemeData().lerp(_channelListViewThemeDataControl,
|
||||
_channelListViewThemeDataControlDark, 0.5),
|
||||
const StreamChannelListViewThemeData().lerp(
|
||||
_channelListViewThemeDataControl,
|
||||
_channelListViewThemeDataControlDark,
|
||||
0.5),
|
||||
_channelListViewThemeDataControlHalfLerp);
|
||||
});
|
||||
|
||||
@@ -32,7 +36,7 @@ void main() {
|
||||
'''Dark ChannelListViewThemeData lerps completely to light ChannelListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelListViewThemeData().lerp(
|
||||
const StreamChannelListViewThemeData().lerp(
|
||||
_channelListViewThemeDataControlDark,
|
||||
_channelListViewThemeDataControl,
|
||||
1),
|
||||
@@ -70,7 +74,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final channelListViewTheme = ChannelListViewTheme.of(_context);
|
||||
final channelListViewTheme = StreamChannelListViewTheme.of(_context);
|
||||
expect(channelListViewTheme.backgroundColor,
|
||||
_channelListViewThemeDataControl.backgroundColor);
|
||||
});
|
||||
@@ -92,7 +96,7 @@ void main() {
|
||||
return Scaffold(
|
||||
body: StreamChannel(
|
||||
channel: MockChannel(),
|
||||
child: const MessageListView(),
|
||||
child: const StreamMessageListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -100,20 +104,20 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final channelListViewTheme = ChannelListViewTheme.of(_context);
|
||||
final channelListViewTheme = StreamChannelListViewTheme.of(_context);
|
||||
expect(channelListViewTheme.backgroundColor,
|
||||
_channelListViewThemeDataControlDark.backgroundColor);
|
||||
});
|
||||
}
|
||||
|
||||
final _channelListViewThemeDataControl = ChannelListViewThemeData(
|
||||
backgroundColor: ColorTheme.light().appBg,
|
||||
final _channelListViewThemeDataControl = StreamChannelListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.light().appBg,
|
||||
);
|
||||
|
||||
const _channelListViewThemeDataControlHalfLerp = ChannelListViewThemeData(
|
||||
const _channelListViewThemeDataControlHalfLerp = StreamChannelListViewThemeData(
|
||||
backgroundColor: Color(0xff818384),
|
||||
);
|
||||
|
||||
final _channelListViewThemeDataControlDark = ChannelListViewThemeData(
|
||||
backgroundColor: ColorTheme.dark().appBg,
|
||||
final _channelListViewThemeDataControlDark = StreamChannelListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.dark().appBg,
|
||||
);
|
||||
|
||||
@@ -4,10 +4,10 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('ChannelPreviewThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const ChannelPreviewThemeData(),
|
||||
const ChannelPreviewThemeData().copyWith());
|
||||
expect(const ChannelPreviewThemeData().hashCode,
|
||||
const ChannelPreviewThemeData().copyWith().hashCode);
|
||||
expect(const StreamChannelPreviewThemeData(),
|
||||
const StreamChannelPreviewThemeData().copyWith());
|
||||
expect(const StreamChannelPreviewThemeData().hashCode,
|
||||
const StreamChannelPreviewThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('ChannelPreviewThemeData lerps', () {
|
||||
@@ -15,7 +15,7 @@ void main() {
|
||||
'''Light ChannelPreviewThemeData lerps completely to dark ChannelPreviewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelPreviewThemeData().lerp(
|
||||
const StreamChannelPreviewThemeData().lerp(
|
||||
_channelPreviewThemeControl, _channelPreviewThemeControlDark, 1),
|
||||
_channelPreviewThemeControlDark);
|
||||
});
|
||||
@@ -24,8 +24,10 @@ void main() {
|
||||
'''Light ChannelPreviewThemeData lerps halfway to dark ChannelPreviewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelPreviewThemeData().lerp(_channelPreviewThemeControl,
|
||||
_channelPreviewThemeControlDark, 0.5),
|
||||
const StreamChannelPreviewThemeData().lerp(
|
||||
_channelPreviewThemeControl,
|
||||
_channelPreviewThemeControlDark,
|
||||
0.5),
|
||||
_channelPreviewThemeControlMidLerp);
|
||||
});
|
||||
|
||||
@@ -33,7 +35,7 @@ void main() {
|
||||
'''Dark ChannelPreviewThemeData lerps completely to light ChannelPreviewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const ChannelPreviewThemeData().lerp(
|
||||
const StreamChannelPreviewThemeData().lerp(
|
||||
_channelPreviewThemeControlDark, _channelPreviewThemeControl, 1),
|
||||
_channelPreviewThemeControl);
|
||||
});
|
||||
@@ -45,28 +47,28 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
final _channelPreviewThemeControl = ChannelPreviewThemeData(
|
||||
unreadCounterColor: ColorTheme.light().accentError,
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelPreviewThemeControl = StreamChannelPreviewThemeData(
|
||||
unreadCounterColor: StreamColorTheme.light().accentError,
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
titleStyle: TextTheme.light().bodyBold,
|
||||
subtitleStyle: TextTheme.light().footnote.copyWith(
|
||||
titleStyle: StreamTextTheme.light().bodyBold,
|
||||
subtitleStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: const Color(0xff7A7A7A),
|
||||
),
|
||||
lastMessageAtStyle: TextTheme.light().footnote.copyWith(
|
||||
color: ColorTheme.light().textHighEmphasis.withOpacity(0.5),
|
||||
lastMessageAtStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: StreamColorTheme.light().textHighEmphasis.withOpacity(0.5),
|
||||
),
|
||||
indicatorIconSize: 16,
|
||||
);
|
||||
|
||||
final _channelPreviewThemeControlMidLerp = ChannelPreviewThemeData(
|
||||
final _channelPreviewThemeControlMidLerp = StreamChannelPreviewThemeData(
|
||||
unreadCounterColor: const Color(0xffff3742),
|
||||
avatarTheme: AvatarThemeData(
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
@@ -82,27 +84,27 @@ final _channelPreviewThemeControlMidLerp = ChannelPreviewThemeData(
|
||||
color: Color(0xff7a7a7a),
|
||||
fontSize: 12,
|
||||
),
|
||||
lastMessageAtStyle: TextTheme.light().footnote.copyWith(
|
||||
lastMessageAtStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: const Color(0x807f7f7f).withOpacity(0.5),
|
||||
),
|
||||
indicatorIconSize: 16,
|
||||
);
|
||||
|
||||
final _channelPreviewThemeControlDark = ChannelPreviewThemeData(
|
||||
unreadCounterColor: ColorTheme.dark().accentError,
|
||||
avatarTheme: AvatarThemeData(
|
||||
final _channelPreviewThemeControlDark = StreamChannelPreviewThemeData(
|
||||
unreadCounterColor: StreamColorTheme.dark().accentError,
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
titleStyle: TextTheme.dark().bodyBold,
|
||||
subtitleStyle: TextTheme.dark().footnote.copyWith(
|
||||
titleStyle: StreamTextTheme.dark().bodyBold,
|
||||
subtitleStyle: StreamTextTheme.dark().footnote.copyWith(
|
||||
color: const Color(0xff7A7A7A),
|
||||
),
|
||||
lastMessageAtStyle: TextTheme.dark().footnote.copyWith(
|
||||
color: ColorTheme.dark().textHighEmphasis.withOpacity(0.5),
|
||||
lastMessageAtStyle: StreamTextTheme.dark().footnote.copyWith(
|
||||
color: StreamColorTheme.dark().textHighEmphasis.withOpacity(0.5),
|
||||
),
|
||||
indicatorIconSize: 16,
|
||||
);
|
||||
|
||||
@@ -7,18 +7,20 @@ class MockStreamChatClient extends Mock implements StreamChatClient {}
|
||||
|
||||
void main() {
|
||||
test('GalleryFooterThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const GalleryFooterThemeData(),
|
||||
const GalleryFooterThemeData().copyWith());
|
||||
expect(const GalleryFooterThemeData().hashCode,
|
||||
const GalleryFooterThemeData().copyWith().hashCode);
|
||||
expect(const StreamGalleryFooterThemeData(),
|
||||
const StreamGalleryFooterThemeData().copyWith());
|
||||
expect(const StreamGalleryFooterThemeData().hashCode,
|
||||
const StreamGalleryFooterThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light GalleryFooterThemeData lerps completely to dark GalleryFooterThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryFooterThemeData().lerp(_galleryFooterThemeDataControl,
|
||||
_galleryFooterThemeDataControlDark, 1),
|
||||
const StreamGalleryFooterThemeData().lerp(
|
||||
_galleryFooterThemeDataControl,
|
||||
_galleryFooterThemeDataControlDark,
|
||||
1),
|
||||
_galleryFooterThemeDataControlDark);
|
||||
});
|
||||
|
||||
@@ -26,8 +28,10 @@ void main() {
|
||||
'''Light GalleryFooterThemeData lerps halfway to dark GalleryFooterThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryFooterThemeData().lerp(_galleryFooterThemeDataControl,
|
||||
_galleryFooterThemeDataControlDark, 0.5),
|
||||
const StreamGalleryFooterThemeData().lerp(
|
||||
_galleryFooterThemeDataControl,
|
||||
_galleryFooterThemeDataControlDark,
|
||||
0.5),
|
||||
_galleryFooterThemeDataControlMidLerp);
|
||||
});
|
||||
|
||||
@@ -35,8 +39,10 @@ void main() {
|
||||
'''Dark GalleryFooterThemeData lerps completely to light GalleryFooterThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryFooterThemeData().lerp(_galleryFooterThemeDataControlDark,
|
||||
_galleryFooterThemeDataControl, 1),
|
||||
const StreamGalleryFooterThemeData().lerp(
|
||||
_galleryFooterThemeDataControlDark,
|
||||
_galleryFooterThemeDataControl,
|
||||
1),
|
||||
_galleryFooterThemeDataControl);
|
||||
});
|
||||
|
||||
@@ -68,7 +74,7 @@ void main() {
|
||||
builder: (context) {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
appBar: GalleryFooter(
|
||||
appBar: StreamGalleryFooter(
|
||||
message: Message(),
|
||||
),
|
||||
);
|
||||
@@ -77,7 +83,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final imageFooterTheme = GalleryFooterTheme.of(_context);
|
||||
final imageFooterTheme = StreamGalleryFooterTheme.of(_context);
|
||||
expect(imageFooterTheme.backgroundColor,
|
||||
_galleryFooterThemeDataControl.backgroundColor);
|
||||
expect(imageFooterTheme.shareIconColor,
|
||||
@@ -111,7 +117,7 @@ void main() {
|
||||
builder: (context) {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
appBar: GalleryFooter(
|
||||
appBar: StreamGalleryFooter(
|
||||
message: Message(),
|
||||
),
|
||||
);
|
||||
@@ -120,7 +126,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final imageFooterTheme = GalleryFooterTheme.of(_context);
|
||||
final imageFooterTheme = StreamGalleryFooterTheme.of(_context);
|
||||
expect(imageFooterTheme.backgroundColor,
|
||||
_galleryFooterThemeDataControlDark.backgroundColor);
|
||||
expect(imageFooterTheme.shareIconColor,
|
||||
@@ -141,19 +147,19 @@ void main() {
|
||||
}
|
||||
|
||||
// Light theme control
|
||||
final _galleryFooterThemeDataControl = GalleryFooterThemeData(
|
||||
backgroundColor: ColorTheme.light().barsBg,
|
||||
shareIconColor: ColorTheme.light().textHighEmphasis,
|
||||
titleTextStyle: TextTheme.light().headlineBold,
|
||||
gridIconButtonColor: ColorTheme.light().textHighEmphasis,
|
||||
bottomSheetBackgroundColor: ColorTheme.light().barsBg,
|
||||
bottomSheetBarrierColor: ColorTheme.light().overlay,
|
||||
bottomSheetCloseIconColor: ColorTheme.light().textHighEmphasis,
|
||||
bottomSheetPhotosTextStyle: TextTheme.light().headlineBold,
|
||||
final _galleryFooterThemeDataControl = StreamGalleryFooterThemeData(
|
||||
backgroundColor: StreamColorTheme.light().barsBg,
|
||||
shareIconColor: StreamColorTheme.light().textHighEmphasis,
|
||||
titleTextStyle: StreamTextTheme.light().headlineBold,
|
||||
gridIconButtonColor: StreamColorTheme.light().textHighEmphasis,
|
||||
bottomSheetBackgroundColor: StreamColorTheme.light().barsBg,
|
||||
bottomSheetBarrierColor: StreamColorTheme.light().overlay,
|
||||
bottomSheetCloseIconColor: StreamColorTheme.light().textHighEmphasis,
|
||||
bottomSheetPhotosTextStyle: StreamTextTheme.light().headlineBold,
|
||||
);
|
||||
|
||||
// Mid-lerp theme control
|
||||
const _galleryFooterThemeDataControlMidLerp = GalleryFooterThemeData(
|
||||
const _galleryFooterThemeDataControlMidLerp = StreamGalleryFooterThemeData(
|
||||
backgroundColor: Color(0xff87898b),
|
||||
shareIconColor: Color(0xff7f7f7f),
|
||||
titleTextStyle: TextStyle(
|
||||
@@ -173,13 +179,13 @@ const _galleryFooterThemeDataControlMidLerp = GalleryFooterThemeData(
|
||||
);
|
||||
|
||||
// Dark theme control
|
||||
final _galleryFooterThemeDataControlDark = GalleryFooterThemeData(
|
||||
backgroundColor: ColorTheme.dark().barsBg,
|
||||
shareIconColor: ColorTheme.dark().textHighEmphasis,
|
||||
titleTextStyle: TextTheme.dark().headlineBold,
|
||||
gridIconButtonColor: ColorTheme.dark().textHighEmphasis,
|
||||
bottomSheetBackgroundColor: ColorTheme.dark().barsBg,
|
||||
bottomSheetBarrierColor: ColorTheme.dark().overlay,
|
||||
bottomSheetCloseIconColor: ColorTheme.dark().textHighEmphasis,
|
||||
bottomSheetPhotosTextStyle: TextTheme.dark().headlineBold,
|
||||
final _galleryFooterThemeDataControlDark = StreamGalleryFooterThemeData(
|
||||
backgroundColor: StreamColorTheme.dark().barsBg,
|
||||
shareIconColor: StreamColorTheme.dark().textHighEmphasis,
|
||||
titleTextStyle: StreamTextTheme.dark().headlineBold,
|
||||
gridIconButtonColor: StreamColorTheme.dark().textHighEmphasis,
|
||||
bottomSheetBackgroundColor: StreamColorTheme.dark().barsBg,
|
||||
bottomSheetBarrierColor: StreamColorTheme.dark().overlay,
|
||||
bottomSheetCloseIconColor: StreamColorTheme.dark().textHighEmphasis,
|
||||
bottomSheetPhotosTextStyle: StreamTextTheme.dark().headlineBold,
|
||||
);
|
||||
|
||||
@@ -7,18 +7,20 @@ class MockStreamChatClient extends Mock implements StreamChatClient {}
|
||||
|
||||
void main() {
|
||||
test('GalleryHeaderThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const GalleryHeaderThemeData(),
|
||||
const GalleryHeaderThemeData().copyWith());
|
||||
expect(const GalleryHeaderThemeData().hashCode,
|
||||
const GalleryHeaderThemeData().copyWith().hashCode);
|
||||
expect(const StreamGalleryHeaderThemeData(),
|
||||
const StreamGalleryHeaderThemeData().copyWith());
|
||||
expect(const StreamGalleryHeaderThemeData().hashCode,
|
||||
const StreamGalleryHeaderThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light GalleryHeaderThemeData lerps completely to dark GalleryHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryHeaderThemeData().lerp(_galleryHeaderThemeDataControl,
|
||||
_galleryHeaderThemeDataDarkControl, 1),
|
||||
const StreamGalleryHeaderThemeData().lerp(
|
||||
_galleryHeaderThemeDataControl,
|
||||
_galleryHeaderThemeDataDarkControl,
|
||||
1),
|
||||
_galleryHeaderThemeDataDarkControl);
|
||||
});
|
||||
|
||||
@@ -26,8 +28,10 @@ void main() {
|
||||
'''Light GalleryHeaderThemeData lerps halfway to dark GalleryHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryHeaderThemeData().lerp(_galleryHeaderThemeDataControl,
|
||||
_galleryHeaderThemeDataDarkControl, 0.5),
|
||||
const StreamGalleryHeaderThemeData().lerp(
|
||||
_galleryHeaderThemeDataControl,
|
||||
_galleryHeaderThemeDataDarkControl,
|
||||
0.5),
|
||||
_galleryHeaderThemeDataHalfLerpControl);
|
||||
});
|
||||
|
||||
@@ -35,8 +39,10 @@ void main() {
|
||||
'''Dark GalleryHeaderThemeData lerps completely to light GalleryHeaderThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const GalleryHeaderThemeData().lerp(_galleryHeaderThemeDataDarkControl,
|
||||
_galleryHeaderThemeDataControl, 1),
|
||||
const StreamGalleryHeaderThemeData().lerp(
|
||||
_galleryHeaderThemeDataDarkControl,
|
||||
_galleryHeaderThemeDataControl,
|
||||
1),
|
||||
_galleryHeaderThemeDataControl);
|
||||
});
|
||||
|
||||
@@ -61,7 +67,7 @@ void main() {
|
||||
builder: (context) {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
appBar: GalleryHeader(
|
||||
appBar: StreamGalleryHeader(
|
||||
message: Message(),
|
||||
),
|
||||
);
|
||||
@@ -70,7 +76,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final imageHeaderTheme = GalleryHeaderTheme.of(_context);
|
||||
final imageHeaderTheme = StreamGalleryHeaderTheme.of(_context);
|
||||
expect(imageHeaderTheme.closeButtonColor,
|
||||
_galleryHeaderThemeDataControl.closeButtonColor);
|
||||
expect(imageHeaderTheme.backgroundColor,
|
||||
@@ -100,7 +106,7 @@ void main() {
|
||||
builder: (context) {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
appBar: GalleryHeader(
|
||||
appBar: StreamGalleryHeader(
|
||||
message: Message(),
|
||||
),
|
||||
);
|
||||
@@ -109,7 +115,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final imageHeaderTheme = GalleryHeaderTheme.of(_context);
|
||||
final imageHeaderTheme = StreamGalleryHeaderTheme.of(_context);
|
||||
expect(imageHeaderTheme.closeButtonColor,
|
||||
_galleryHeaderThemeDataDarkControl.closeButtonColor);
|
||||
expect(imageHeaderTheme.backgroundColor,
|
||||
@@ -126,7 +132,7 @@ void main() {
|
||||
}
|
||||
|
||||
// Light theme test control.
|
||||
final _galleryHeaderThemeDataControl = GalleryHeaderThemeData(
|
||||
final _galleryHeaderThemeDataControl = StreamGalleryHeaderThemeData(
|
||||
closeButtonColor: const Color(0xff000000),
|
||||
backgroundColor: const Color(0xffffffff),
|
||||
iconMenuPointColor: const Color(0xff000000),
|
||||
@@ -145,7 +151,7 @@ final _galleryHeaderThemeDataControl = GalleryHeaderThemeData(
|
||||
);
|
||||
|
||||
// Light theme test control.
|
||||
final _galleryHeaderThemeDataHalfLerpControl = GalleryHeaderThemeData(
|
||||
final _galleryHeaderThemeDataHalfLerpControl = StreamGalleryHeaderThemeData(
|
||||
closeButtonColor: const Color(0xff7f7f7f),
|
||||
backgroundColor: const Color(0xff87898b),
|
||||
iconMenuPointColor: const Color(0xff7f7f7f),
|
||||
@@ -164,7 +170,7 @@ final _galleryHeaderThemeDataHalfLerpControl = GalleryHeaderThemeData(
|
||||
);
|
||||
|
||||
// Dark theme test control.
|
||||
final _galleryHeaderThemeDataDarkControl = GalleryHeaderThemeData(
|
||||
final _galleryHeaderThemeDataDarkControl = StreamGalleryHeaderThemeData(
|
||||
closeButtonColor: const Color(0xffffffff),
|
||||
backgroundColor: const Color(0xff101418),
|
||||
iconMenuPointColor: const Color(0xffffffff),
|
||||
|
||||
@@ -4,30 +4,30 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('MessageInputThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const MessageInputThemeData(),
|
||||
const MessageInputThemeData().copyWith());
|
||||
expect(const MessageInputThemeData().hashCode,
|
||||
const MessageInputThemeData().copyWith().hashCode);
|
||||
expect(const StreamMessageInputThemeData(),
|
||||
const StreamMessageInputThemeData().copyWith());
|
||||
expect(const StreamMessageInputThemeData().hashCode,
|
||||
const StreamMessageInputThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('MessageInputThemeData lerps correctly', () {
|
||||
test('Lerp completely from light to dark', () {
|
||||
expect(
|
||||
const MessageInputThemeData().lerp(
|
||||
const StreamMessageInputThemeData().lerp(
|
||||
_messageInputThemeControl, _messageInputThemeControlDark, 1),
|
||||
_messageInputThemeControlDark);
|
||||
});
|
||||
|
||||
test('Lerp halfway from light to dark', () {
|
||||
expect(
|
||||
const MessageInputThemeData().lerp(
|
||||
const StreamMessageInputThemeData().lerp(
|
||||
_messageInputThemeControl, _messageInputThemeControlDark, 0.5),
|
||||
_messageInputThemeControlMidLerp);
|
||||
});
|
||||
|
||||
test('Lerp completely from dark to light', () {
|
||||
expect(
|
||||
const MessageInputThemeData().lerp(
|
||||
const StreamMessageInputThemeData().lerp(
|
||||
_messageInputThemeControlDark, _messageInputThemeControl, 1),
|
||||
_messageInputThemeControl);
|
||||
});
|
||||
@@ -39,33 +39,33 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
final _messageInputThemeControl = MessageInputThemeData(
|
||||
final _messageInputThemeControl = StreamMessageInputThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
sendAnimationDuration: const Duration(milliseconds: 300),
|
||||
actionButtonColor: ColorTheme.light().accentPrimary,
|
||||
actionButtonIdleColor: ColorTheme.light().textLowEmphasis,
|
||||
expandButtonColor: ColorTheme.light().accentPrimary,
|
||||
sendButtonColor: ColorTheme.light().accentPrimary,
|
||||
sendButtonIdleColor: ColorTheme.light().disabled,
|
||||
inputBackgroundColor: ColorTheme.light().barsBg,
|
||||
inputTextStyle: TextTheme.light().body,
|
||||
actionButtonColor: StreamColorTheme.light().accentPrimary,
|
||||
actionButtonIdleColor: StreamColorTheme.light().textLowEmphasis,
|
||||
expandButtonColor: StreamColorTheme.light().accentPrimary,
|
||||
sendButtonColor: StreamColorTheme.light().accentPrimary,
|
||||
sendButtonIdleColor: StreamColorTheme.light().disabled,
|
||||
inputBackgroundColor: StreamColorTheme.light().barsBg,
|
||||
inputTextStyle: StreamTextTheme.light().body,
|
||||
idleBorderGradient: LinearGradient(
|
||||
stops: const [0.0, 1.0],
|
||||
colors: [
|
||||
ColorTheme.light().disabled,
|
||||
ColorTheme.light().disabled,
|
||||
StreamColorTheme.light().disabled,
|
||||
StreamColorTheme.light().disabled,
|
||||
],
|
||||
),
|
||||
activeBorderGradient: LinearGradient(
|
||||
stops: const [0.0, 1.0],
|
||||
colors: [
|
||||
ColorTheme.light().disabled,
|
||||
ColorTheme.light().disabled,
|
||||
StreamColorTheme.light().disabled,
|
||||
StreamColorTheme.light().disabled,
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
final _messageInputThemeControlMidLerp = MessageInputThemeData(
|
||||
final _messageInputThemeControlMidLerp = StreamMessageInputThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
sendAnimationDuration: const Duration(milliseconds: 300),
|
||||
inputBackgroundColor: const Color(0xff87898b),
|
||||
@@ -95,28 +95,28 @@ final _messageInputThemeControlMidLerp = MessageInputThemeData(
|
||||
),
|
||||
);
|
||||
|
||||
final _messageInputThemeControlDark = MessageInputThemeData(
|
||||
final _messageInputThemeControlDark = StreamMessageInputThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
sendAnimationDuration: const Duration(milliseconds: 300),
|
||||
actionButtonColor: ColorTheme.dark().accentPrimary,
|
||||
actionButtonIdleColor: ColorTheme.dark().textLowEmphasis,
|
||||
expandButtonColor: ColorTheme.dark().accentPrimary,
|
||||
sendButtonColor: ColorTheme.dark().accentPrimary,
|
||||
sendButtonIdleColor: ColorTheme.dark().disabled,
|
||||
inputBackgroundColor: ColorTheme.dark().barsBg,
|
||||
inputTextStyle: TextTheme.dark().body,
|
||||
actionButtonColor: StreamColorTheme.dark().accentPrimary,
|
||||
actionButtonIdleColor: StreamColorTheme.dark().textLowEmphasis,
|
||||
expandButtonColor: StreamColorTheme.dark().accentPrimary,
|
||||
sendButtonColor: StreamColorTheme.dark().accentPrimary,
|
||||
sendButtonIdleColor: StreamColorTheme.dark().disabled,
|
||||
inputBackgroundColor: StreamColorTheme.dark().barsBg,
|
||||
inputTextStyle: StreamTextTheme.dark().body,
|
||||
idleBorderGradient: LinearGradient(
|
||||
stops: const [0.0, 1.0],
|
||||
colors: [
|
||||
ColorTheme.dark().disabled,
|
||||
ColorTheme.dark().disabled,
|
||||
StreamColorTheme.dark().disabled,
|
||||
StreamColorTheme.dark().disabled,
|
||||
],
|
||||
),
|
||||
activeBorderGradient: LinearGradient(
|
||||
stops: const [0.0, 1.0],
|
||||
colors: [
|
||||
ColorTheme.dark().disabled,
|
||||
ColorTheme.dark().disabled,
|
||||
StreamColorTheme.dark().disabled,
|
||||
StreamColorTheme.dark().disabled,
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -9,18 +9,20 @@ class MockStreamChatClient extends Mock implements StreamChatClient {}
|
||||
|
||||
void main() {
|
||||
test('MessageListViewThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const MessageListViewThemeData(),
|
||||
const MessageListViewThemeData().copyWith());
|
||||
expect(const MessageListViewThemeData().hashCode,
|
||||
const MessageListViewThemeData().copyWith().hashCode);
|
||||
expect(const StreamMessageListViewThemeData(),
|
||||
const StreamMessageListViewThemeData().copyWith());
|
||||
expect(const StreamMessageListViewThemeData().hashCode,
|
||||
const StreamMessageListViewThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light MessageListViewThemeData lerps completely to dark MessageListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageListViewThemeData().lerp(_messageListViewThemeDataControl,
|
||||
_messageListViewThemeDataControlDark, 1),
|
||||
const StreamMessageListViewThemeData().lerp(
|
||||
_messageListViewThemeDataControl,
|
||||
_messageListViewThemeDataControlDark,
|
||||
1),
|
||||
_messageListViewThemeDataControlDark);
|
||||
});
|
||||
|
||||
@@ -28,8 +30,10 @@ void main() {
|
||||
'''Light MessageListViewThemeData lerps halfway to dark MessageListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageListViewThemeData().lerp(_messageListViewThemeDataControl,
|
||||
_messageListViewThemeDataControlDark, 0.5),
|
||||
const StreamMessageListViewThemeData().lerp(
|
||||
_messageListViewThemeDataControl,
|
||||
_messageListViewThemeDataControlDark,
|
||||
0.5),
|
||||
_messageListViewThemeDataControlHalfLerp);
|
||||
});
|
||||
|
||||
@@ -37,7 +41,7 @@ void main() {
|
||||
'''Dark MessageListViewThemeData lerps completely to light MessageListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageListViewThemeData().lerp(
|
||||
const StreamMessageListViewThemeData().lerp(
|
||||
_messageListViewThemeDataControlDark,
|
||||
_messageListViewThemeDataControl,
|
||||
1),
|
||||
@@ -67,7 +71,7 @@ void main() {
|
||||
return Scaffold(
|
||||
body: StreamChannel(
|
||||
channel: MockChannel(),
|
||||
child: const MessageListView(),
|
||||
child: const StreamMessageListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -75,7 +79,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final messageListViewTheme = MessageListViewTheme.of(_context);
|
||||
final messageListViewTheme = StreamMessageListViewTheme.of(_context);
|
||||
expect(messageListViewTheme.backgroundColor,
|
||||
_messageListViewThemeDataControl.backgroundColor);
|
||||
});
|
||||
@@ -97,7 +101,7 @@ void main() {
|
||||
return Scaffold(
|
||||
body: StreamChannel(
|
||||
channel: MockChannel(),
|
||||
child: const MessageListView(),
|
||||
child: const StreamMessageListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -105,7 +109,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final messageListViewTheme = MessageListViewTheme.of(_context);
|
||||
final messageListViewTheme = StreamMessageListViewTheme.of(_context);
|
||||
expect(messageListViewTheme.backgroundColor,
|
||||
_messageListViewThemeDataControlDark.backgroundColor);
|
||||
});
|
||||
@@ -128,7 +132,7 @@ void main() {
|
||||
return Scaffold(
|
||||
body: StreamChannel(
|
||||
channel: MockChannel(),
|
||||
child: const MessageListView(),
|
||||
child: const StreamMessageListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -136,25 +140,25 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final messageListViewTheme = MessageListViewTheme.of(_context);
|
||||
final messageListViewTheme = StreamMessageListViewTheme.of(_context);
|
||||
expect(messageListViewTheme.backgroundImage,
|
||||
_messageListViewThemeDataImage.backgroundImage);
|
||||
});
|
||||
}
|
||||
|
||||
final _messageListViewThemeDataControl = MessageListViewThemeData(
|
||||
backgroundColor: ColorTheme.light().barsBg,
|
||||
final _messageListViewThemeDataControl = StreamMessageListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.light().barsBg,
|
||||
);
|
||||
|
||||
const _messageListViewThemeDataControlHalfLerp = MessageListViewThemeData(
|
||||
const _messageListViewThemeDataControlHalfLerp = StreamMessageListViewThemeData(
|
||||
backgroundColor: Color(0xff87898b),
|
||||
);
|
||||
|
||||
final _messageListViewThemeDataControlDark = MessageListViewThemeData(
|
||||
backgroundColor: ColorTheme.dark().barsBg,
|
||||
final _messageListViewThemeDataControlDark = StreamMessageListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.dark().barsBg,
|
||||
);
|
||||
|
||||
const _messageListViewThemeDataImage = MessageListViewThemeData(
|
||||
const _messageListViewThemeDataImage = StreamMessageListViewThemeData(
|
||||
backgroundImage: DecorationImage(
|
||||
image: AssetImage('example/assets/background_doodle.png'),
|
||||
fit: BoxFit.cover,
|
||||
|
||||
+19
-16
@@ -6,17 +6,17 @@ import '../mocks.dart';
|
||||
|
||||
void main() {
|
||||
test('MessageSearchListViewThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const MessageSearchListViewThemeData(),
|
||||
const MessageSearchListViewThemeData().copyWith());
|
||||
expect(const MessageSearchListViewThemeData().hashCode,
|
||||
const MessageSearchListViewThemeData().copyWith().hashCode);
|
||||
expect(const StreamMessageSearchListViewThemeData(),
|
||||
const StreamMessageSearchListViewThemeData().copyWith());
|
||||
expect(const StreamMessageSearchListViewThemeData().hashCode,
|
||||
const StreamMessageSearchListViewThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light MessageSearchListViewThemeData lerps completely to dark MessageSearchListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageSearchListViewThemeData().lerp(
|
||||
const StreamMessageSearchListViewThemeData().lerp(
|
||||
_messageSearchListViewThemeDataControl,
|
||||
_messageSearchListViewThemeDataControlDark,
|
||||
1),
|
||||
@@ -27,7 +27,7 @@ void main() {
|
||||
'''Light MessageSearchListViewThemeData lerps halfway to dark MessageSearchListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageSearchListViewThemeData().lerp(
|
||||
const StreamMessageSearchListViewThemeData().lerp(
|
||||
_messageSearchListViewThemeDataControl,
|
||||
_messageSearchListViewThemeDataControlDark,
|
||||
0.5),
|
||||
@@ -38,7 +38,7 @@ void main() {
|
||||
'''Dark MessageSearchListViewThemeData lerps completely to light MessageSearchListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageSearchListViewThemeData().lerp(
|
||||
const StreamMessageSearchListViewThemeData().lerp(
|
||||
_messageSearchListViewThemeDataControlDark,
|
||||
_messageSearchListViewThemeDataControl,
|
||||
1),
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
body: MessageSearchBloc(
|
||||
child: MessageSearchListView(
|
||||
child: StreamMessageSearchListView(
|
||||
filters: Filter.in_('members', const ['test_id']),
|
||||
messageQuery: 'test query',
|
||||
),
|
||||
@@ -78,7 +78,8 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final messageSearchListViewTheme = MessageSearchListViewTheme.of(_context);
|
||||
final messageSearchListViewTheme =
|
||||
StreamMessageSearchListViewTheme.of(_context);
|
||||
expect(messageSearchListViewTheme.backgroundColor,
|
||||
_messageSearchListViewThemeDataControl.backgroundColor);
|
||||
});
|
||||
@@ -99,7 +100,7 @@ void main() {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
body: MessageSearchBloc(
|
||||
child: MessageSearchListView(
|
||||
child: StreamMessageSearchListView(
|
||||
filters: Filter.in_('members', const ['test_id']),
|
||||
messageQuery: 'test query',
|
||||
),
|
||||
@@ -110,22 +111,24 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final messageSearchListViewTheme = MessageSearchListViewTheme.of(_context);
|
||||
final messageSearchListViewTheme =
|
||||
StreamMessageSearchListViewTheme.of(_context);
|
||||
expect(messageSearchListViewTheme.backgroundColor,
|
||||
_messageSearchListViewThemeDataControlDark.backgroundColor);
|
||||
});
|
||||
}
|
||||
|
||||
final _messageSearchListViewThemeDataControl = MessageSearchListViewThemeData(
|
||||
backgroundColor: ColorTheme.light().appBg,
|
||||
final _messageSearchListViewThemeDataControl =
|
||||
StreamMessageSearchListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.light().appBg,
|
||||
);
|
||||
|
||||
const _messageSearchListViewThemeDataControlHalfLerp =
|
||||
MessageSearchListViewThemeData(
|
||||
StreamMessageSearchListViewThemeData(
|
||||
backgroundColor: Color(0xff818384),
|
||||
);
|
||||
|
||||
final _messageSearchListViewThemeDataControlDark =
|
||||
MessageSearchListViewThemeData(
|
||||
backgroundColor: ColorTheme.dark().appBg,
|
||||
StreamMessageSearchListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.dark().appBg,
|
||||
);
|
||||
|
||||
@@ -4,16 +4,17 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
void main() {
|
||||
test('MessageThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const MessageThemeData(), const MessageThemeData().copyWith());
|
||||
expect(const MessageThemeData().hashCode,
|
||||
const MessageThemeData().copyWith().hashCode);
|
||||
expect(const StreamMessageThemeData(),
|
||||
const StreamMessageThemeData().copyWith());
|
||||
expect(const StreamMessageThemeData().hashCode,
|
||||
const StreamMessageThemeData().copyWith().hashCode);
|
||||
});
|
||||
|
||||
group('MessageThemeData lerps', () {
|
||||
test('''Light MessageThemeData lerps completely to dark MessageThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageThemeData()
|
||||
const StreamMessageThemeData()
|
||||
.lerp(_messageThemeControl, _messageThemeControlDark, 1),
|
||||
_messageThemeControlDark);
|
||||
});
|
||||
@@ -21,7 +22,7 @@ void main() {
|
||||
test('''Dark MessageThemeData lerps completely to light MessageThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const MessageThemeData()
|
||||
const StreamMessageThemeData()
|
||||
.lerp(_messageThemeControlDark, _messageThemeControl, 1),
|
||||
_messageThemeControl);
|
||||
});
|
||||
@@ -33,23 +34,23 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
final _messageThemeControl = MessageThemeData(
|
||||
messageAuthorStyle: TextTheme.light().footnote.copyWith(
|
||||
color: ColorTheme.light().textLowEmphasis,
|
||||
final _messageThemeControl = StreamMessageThemeData(
|
||||
messageAuthorStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: StreamColorTheme.light().textLowEmphasis,
|
||||
),
|
||||
messageTextStyle: TextTheme.light().body,
|
||||
createdAtStyle: TextTheme.light().footnote.copyWith(
|
||||
color: ColorTheme.light().textLowEmphasis,
|
||||
messageTextStyle: StreamTextTheme.light().body,
|
||||
createdAtStyle: StreamTextTheme.light().footnote.copyWith(
|
||||
color: StreamColorTheme.light().textLowEmphasis,
|
||||
),
|
||||
repliesStyle: TextTheme.light().footnoteBold.copyWith(
|
||||
color: ColorTheme.light().accentPrimary,
|
||||
repliesStyle: StreamTextTheme.light().footnoteBold.copyWith(
|
||||
color: StreamColorTheme.light().accentPrimary,
|
||||
),
|
||||
messageBackgroundColor: ColorTheme.light().disabled,
|
||||
reactionsBackgroundColor: ColorTheme.light().barsBg,
|
||||
reactionsBorderColor: ColorTheme.light().borders,
|
||||
reactionsMaskColor: ColorTheme.light().appBg,
|
||||
messageBorderColor: ColorTheme.light().disabled,
|
||||
avatarTheme: AvatarThemeData(
|
||||
messageBackgroundColor: StreamColorTheme.light().disabled,
|
||||
reactionsBackgroundColor: StreamColorTheme.light().barsBg,
|
||||
reactionsBorderColor: StreamColorTheme.light().borders,
|
||||
reactionsMaskColor: StreamColorTheme.light().appBg,
|
||||
messageBorderColor: StreamColorTheme.light().disabled,
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 32,
|
||||
@@ -57,28 +58,28 @@ final _messageThemeControl = MessageThemeData(
|
||||
),
|
||||
),
|
||||
messageLinksStyle: TextStyle(
|
||||
color: ColorTheme.light().accentPrimary,
|
||||
color: StreamColorTheme.light().accentPrimary,
|
||||
),
|
||||
linkBackgroundColor: ColorTheme.light().linkBg,
|
||||
linkBackgroundColor: StreamColorTheme.light().linkBg,
|
||||
);
|
||||
|
||||
final _messageThemeControlDark = MessageThemeData(
|
||||
messageAuthorStyle: TextTheme.dark().footnote.copyWith(
|
||||
color: ColorTheme.dark().textLowEmphasis,
|
||||
final _messageThemeControlDark = StreamMessageThemeData(
|
||||
messageAuthorStyle: StreamTextTheme.dark().footnote.copyWith(
|
||||
color: StreamColorTheme.dark().textLowEmphasis,
|
||||
),
|
||||
messageTextStyle: TextTheme.dark().body,
|
||||
createdAtStyle: TextTheme.dark().footnote.copyWith(
|
||||
color: ColorTheme.dark().textLowEmphasis,
|
||||
messageTextStyle: StreamTextTheme.dark().body,
|
||||
createdAtStyle: StreamTextTheme.dark().footnote.copyWith(
|
||||
color: StreamColorTheme.dark().textLowEmphasis,
|
||||
),
|
||||
repliesStyle: TextTheme.dark().footnoteBold.copyWith(
|
||||
color: ColorTheme.dark().accentPrimary,
|
||||
repliesStyle: StreamTextTheme.dark().footnoteBold.copyWith(
|
||||
color: StreamColorTheme.dark().accentPrimary,
|
||||
),
|
||||
messageBackgroundColor: ColorTheme.dark().disabled,
|
||||
reactionsBackgroundColor: ColorTheme.dark().barsBg,
|
||||
reactionsBorderColor: ColorTheme.dark().borders,
|
||||
reactionsMaskColor: ColorTheme.dark().appBg,
|
||||
messageBorderColor: ColorTheme.dark().disabled,
|
||||
avatarTheme: AvatarThemeData(
|
||||
messageBackgroundColor: StreamColorTheme.dark().disabled,
|
||||
reactionsBackgroundColor: StreamColorTheme.dark().barsBg,
|
||||
reactionsBorderColor: StreamColorTheme.dark().borders,
|
||||
reactionsMaskColor: StreamColorTheme.dark().appBg,
|
||||
messageBorderColor: StreamColorTheme.dark().disabled,
|
||||
avatarTheme: StreamAvatarThemeData(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
height: 32,
|
||||
@@ -86,7 +87,7 @@ final _messageThemeControlDark = MessageThemeData(
|
||||
),
|
||||
),
|
||||
messageLinksStyle: TextStyle(
|
||||
color: ColorTheme.dark().accentPrimary,
|
||||
color: StreamColorTheme.dark().accentPrimary,
|
||||
),
|
||||
linkBackgroundColor: ColorTheme.dark().linkBg,
|
||||
linkBackgroundColor: StreamColorTheme.dark().linkBg,
|
||||
);
|
||||
|
||||
@@ -6,15 +6,15 @@ import '../mocks.dart';
|
||||
|
||||
void main() {
|
||||
test('UserListViewThemeData copyWith, ==, hashCode basics', () {
|
||||
expect(const UserListViewThemeData(),
|
||||
const UserListViewThemeData().copyWith());
|
||||
expect(const StreamUserListViewThemeData(),
|
||||
const StreamUserListViewThemeData().copyWith());
|
||||
});
|
||||
|
||||
test(
|
||||
'''Light UserListViewThemeData lerps completely to dark UserListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const UserListViewThemeData().lerp(_userListViewThemeDataControl,
|
||||
const StreamUserListViewThemeData().lerp(_userListViewThemeDataControl,
|
||||
_userListViewThemeDataControlDark, 1),
|
||||
_userListViewThemeDataControlDark);
|
||||
});
|
||||
@@ -23,7 +23,7 @@ void main() {
|
||||
'''Light UserListViewThemeData lerps halfway to dark UserListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const UserListViewThemeData().lerp(_userListViewThemeDataControl,
|
||||
const StreamUserListViewThemeData().lerp(_userListViewThemeDataControl,
|
||||
_userListViewThemeDataControlDark, 0.5),
|
||||
_userListViewThemeDataControlHalfLerp);
|
||||
});
|
||||
@@ -32,8 +32,10 @@ void main() {
|
||||
'''Dark UserListViewThemeData lerps completely to light UserListViewThemeData''',
|
||||
() {
|
||||
expect(
|
||||
const UserListViewThemeData().lerp(_userListViewThemeDataControlDark,
|
||||
_userListViewThemeDataControl, 1),
|
||||
const StreamUserListViewThemeData().lerp(
|
||||
_userListViewThemeDataControlDark,
|
||||
_userListViewThemeDataControl,
|
||||
1),
|
||||
_userListViewThemeDataControl);
|
||||
});
|
||||
|
||||
@@ -58,7 +60,7 @@ void main() {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
body: UsersBloc(
|
||||
child: UserListView(),
|
||||
child: StreamUserListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -66,7 +68,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final userListViewTheme = UserListViewTheme.of(_context);
|
||||
final userListViewTheme = StreamUserListViewTheme.of(_context);
|
||||
expect(userListViewTheme.backgroundColor,
|
||||
_userListViewThemeDataControl.backgroundColor);
|
||||
});
|
||||
@@ -87,7 +89,7 @@ void main() {
|
||||
_context = context;
|
||||
return Scaffold(
|
||||
body: UsersBloc(
|
||||
child: UserListView(),
|
||||
child: StreamUserListView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -95,20 +97,20 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final userListViewTheme = UserListViewTheme.of(_context);
|
||||
final userListViewTheme = StreamUserListViewTheme.of(_context);
|
||||
expect(userListViewTheme.backgroundColor,
|
||||
_userListViewThemeDataControlDark.backgroundColor);
|
||||
});
|
||||
}
|
||||
|
||||
final _userListViewThemeDataControl = UserListViewThemeData(
|
||||
backgroundColor: ColorTheme.light().appBg,
|
||||
final _userListViewThemeDataControl = StreamUserListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.light().appBg,
|
||||
);
|
||||
|
||||
const _userListViewThemeDataControlHalfLerp = UserListViewThemeData(
|
||||
const _userListViewThemeDataControlHalfLerp = StreamUserListViewThemeData(
|
||||
backgroundColor: Color(0xff818384),
|
||||
);
|
||||
|
||||
final _userListViewThemeDataControlDark = UserListViewThemeData(
|
||||
backgroundColor: ColorTheme.dark().appBg,
|
||||
final _userListViewThemeDataControlDark = StreamUserListViewThemeData(
|
||||
backgroundColor: StreamColorTheme.dark().appBg,
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: ThreadHeader(
|
||||
body: StreamThreadHeader(
|
||||
parent: Message(),
|
||||
),
|
||||
),
|
||||
@@ -112,7 +112,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: ThreadHeader(
|
||||
body: StreamThreadHeader(
|
||||
parent: Message(),
|
||||
subtitle: const Text('subtitle'),
|
||||
leading: const Text('leading'),
|
||||
|
||||
@@ -71,7 +71,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: TypingIndicator(
|
||||
body: StreamTypingIndicator(
|
||||
key: typingKey,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -37,7 +37,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: const Scaffold(
|
||||
body: UnreadIndicator(),
|
||||
body: StreamUnreadIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: UnreadIndicator(
|
||||
body: StreamUnreadIndicator(
|
||||
cid: channel.cid,
|
||||
),
|
||||
),
|
||||
@@ -115,7 +115,7 @@ void main() {
|
||||
child: StreamChannel(
|
||||
channel: channel,
|
||||
child: Scaffold(
|
||||
body: UnreadIndicator(
|
||||
body: StreamUnreadIndicator(
|
||||
cid: channel.cid,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user