lint test
This commit is contained in:
@@ -128,7 +128,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
text: 'test',
|
text: 'test',
|
||||||
@@ -185,7 +185,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
message: message,
|
message: message,
|
||||||
currentIndex: 0,
|
currentIndex: 0,
|
||||||
@@ -218,7 +218,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
onShowMessage: onShowMessage,
|
onShowMessage: onShowMessage,
|
||||||
message: Message(
|
message: Message(
|
||||||
@@ -250,9 +250,8 @@ void main() {
|
|||||||
final clientState = MockClientState();
|
final clientState = MockClientState();
|
||||||
final mockChannel = MockChannel();
|
final mockChannel = MockChannel();
|
||||||
|
|
||||||
when(() => mockChannel.updateMessage(any())).thenAnswer((_) async {
|
when(() => mockChannel.updateMessage(any()))
|
||||||
return UpdateMessageResponse();
|
.thenAnswer((_) async => UpdateMessageResponse());
|
||||||
});
|
|
||||||
when(() => client.state).thenReturn(clientState);
|
when(() => client.state).thenReturn(clientState);
|
||||||
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
||||||
|
|
||||||
@@ -275,12 +274,10 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
client: client,
|
||||||
client: client,
|
child: child,
|
||||||
child: child!,
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: mockChannel,
|
channel: mockChannel,
|
||||||
@@ -307,9 +304,8 @@ void main() {
|
|||||||
final clientState = MockClientState();
|
final clientState = MockClientState();
|
||||||
final mockChannel = MockChannel();
|
final mockChannel = MockChannel();
|
||||||
|
|
||||||
when(() => mockChannel.updateMessage(any())).thenAnswer((_) async {
|
when(() => mockChannel.updateMessage(any()))
|
||||||
return UpdateMessageResponse();
|
.thenAnswer((_) async => UpdateMessageResponse());
|
||||||
});
|
|
||||||
when(() => client.state).thenReturn(clientState);
|
when(() => client.state).thenReturn(clientState);
|
||||||
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
||||||
|
|
||||||
@@ -328,12 +324,10 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
client: client,
|
||||||
client: client,
|
child: child,
|
||||||
child: child!,
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: mockChannel,
|
channel: mockChannel,
|
||||||
@@ -352,15 +346,15 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
testWidgets(
|
testWidgets(
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
'tapping on delete in chat should remove the message if that\'s the only attachment and there is no text',
|
'tapping on delete in chat should remove the message if that\'s the only attachment and there is no text',
|
||||||
(WidgetTester tester) async {
|
(WidgetTester tester) async {
|
||||||
final client = MockClient();
|
final client = MockClient();
|
||||||
final clientState = MockClientState();
|
final clientState = MockClientState();
|
||||||
final mockChannel = MockChannel();
|
final mockChannel = MockChannel();
|
||||||
|
|
||||||
when(() => mockChannel.deleteMessage(any())).thenAnswer((_) async {
|
when(() => mockChannel.deleteMessage(any()))
|
||||||
return EmptyResponse();
|
.thenAnswer((_) async => EmptyResponse());
|
||||||
});
|
|
||||||
when(() => client.state).thenReturn(clientState);
|
when(() => client.state).thenReturn(clientState);
|
||||||
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
when(() => clientState.user).thenReturn(OwnUser(id: 'user-id'));
|
||||||
|
|
||||||
@@ -378,12 +372,10 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: mockChannel,
|
channel: mockChannel,
|
||||||
@@ -412,13 +404,11 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
home: SizedBox(
|
||||||
home: Container(
|
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
imageDownloader: imageDownloader,
|
imageDownloader: imageDownloader,
|
||||||
message: Message(
|
message: Message(
|
||||||
@@ -451,8 +441,8 @@ void main() {
|
|||||||
imageDownloader.progressCallback!(100, 100);
|
imageDownloader.progressCallback!(100, 100);
|
||||||
imageDownloader.completer.complete('path');
|
imageDownloader.completer.complete('path');
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
expect(find.byKey(Key('completedIcon')), findsOneWidget);
|
expect(find.byKey(const Key('completedIcon')), findsOneWidget);
|
||||||
await tester.pumpAndSettle(Duration(milliseconds: 500));
|
await tester.pumpAndSettle(const Duration(milliseconds: 500));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -469,12 +459,10 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
child: child!,
|
child: child!,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
home: Container(
|
home: Container(
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
fileDownloader: fileDownloader,
|
fileDownloader: fileDownloader,
|
||||||
@@ -508,8 +496,8 @@ void main() {
|
|||||||
fileDownloader.progressCallback!(100, 100);
|
fileDownloader.progressCallback!(100, 100);
|
||||||
fileDownloader.completer.complete('path');
|
fileDownloader.completer.complete('path');
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
expect(find.byKey(Key('completedIcon')), findsOneWidget);
|
expect(find.byKey(const Key('completedIcon')), findsOneWidget);
|
||||||
await tester.pumpAndSettle(Duration(milliseconds: 500));
|
await tester.pumpAndSettle(const Duration(milliseconds: 500));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ void main() {
|
|||||||
data: streamTheme,
|
data: streamTheme,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: FileAttachment(
|
child: FileAttachment(
|
||||||
size: Size(
|
size: const Size(
|
||||||
300,
|
300,
|
||||||
300,
|
300,
|
||||||
),
|
),
|
||||||
@@ -33,7 +33,7 @@ void main() {
|
|||||||
attachment: Attachment(
|
attachment: Attachment(
|
||||||
type: 'file',
|
type: 'file',
|
||||||
title: 'example.pdf',
|
title: 'example.pdf',
|
||||||
extraData: {
|
extraData: const {
|
||||||
'mime_type': 'pdf',
|
'mime_type': 'pdf',
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,16 +15,14 @@ void main() {
|
|||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: const Material(child: Text('Home')),
|
home: const Material(child: Text('Home')),
|
||||||
routes: <String, WidgetBuilder>{
|
routes: <String, WidgetBuilder>{
|
||||||
'/next': (BuildContext context) {
|
'/next': (BuildContext context) => Material(
|
||||||
return Material(
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: StreamChatTheme(
|
child: StreamChatTheme(
|
||||||
data: StreamChatThemeData.fromTheme(theme),
|
data: StreamChatThemeData.fromTheme(theme),
|
||||||
child: StreamBackButton(),
|
child: StreamBackButton(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -52,7 +50,7 @@ void main() {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: StreamChatTheme(
|
child: StreamChatTheme(
|
||||||
data: StreamChatThemeData.fromTheme(theme),
|
data: StreamChatThemeData.fromTheme(theme),
|
||||||
child: StreamBackButton(),
|
child: const StreamBackButton(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -78,8 +76,7 @@ void main() {
|
|||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: const Material(child: Text('Home')),
|
home: const Material(child: Text('Home')),
|
||||||
routes: <String, WidgetBuilder>{
|
routes: <String, WidgetBuilder>{
|
||||||
'/next': (BuildContext context) {
|
'/next': (BuildContext context) => Material(
|
||||||
return Material(
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: StreamChatTheme(
|
child: StreamChatTheme(
|
||||||
data: StreamChatThemeData.fromTheme(theme),
|
data: StreamChatThemeData.fromTheme(theme),
|
||||||
@@ -88,8 +85,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -131,7 +127,7 @@ void main() {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: StreamChat(
|
child: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: StreamBackButton(
|
child: const StreamBackButton(
|
||||||
showUnreads: true,
|
showUnreads: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelHeader(),
|
body: ChannelHeader(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -115,7 +115,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelHeader(
|
body: ChannelHeader(
|
||||||
showConnectionStateTile: true,
|
showConnectionStateTile: true,
|
||||||
),
|
),
|
||||||
@@ -178,7 +178,7 @@ void main() {
|
|||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelHeader(
|
body: ChannelHeader(
|
||||||
showConnectionStateTile: true,
|
showConnectionStateTile: true,
|
||||||
),
|
),
|
||||||
@@ -242,7 +242,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelHeader(
|
body: ChannelHeader(
|
||||||
leading: Text('leading'),
|
leading: Text('leading'),
|
||||||
subtitle: Text('subtitle'),
|
subtitle: Text('subtitle'),
|
||||||
@@ -314,7 +314,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelHeader(
|
body: ChannelHeader(
|
||||||
showTypingIndicator: false,
|
showTypingIndicator: false,
|
||||||
showBackButton: false,
|
showBackButton: false,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelImage(),
|
body: ChannelImage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -112,7 +112,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelImage(),
|
body: ChannelImage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -207,7 +207,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelImage(),
|
body: ChannelImage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -248,7 +248,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelImage(
|
body: ChannelImage(
|
||||||
selected: true,
|
selected: true,
|
||||||
),
|
),
|
||||||
@@ -257,7 +257,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
expect(find.byKey(Key('selectedImage')), findsOneWidget);
|
expect(find.byKey(const Key('selectedImage')), findsOneWidget);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ void main() {
|
|||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelListHeader(),
|
body: ChannelListHeader(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -51,7 +51,7 @@ void main() {
|
|||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelListHeader(
|
body: ChannelListHeader(
|
||||||
showConnectionStateTile: true,
|
showConnectionStateTile: true,
|
||||||
),
|
),
|
||||||
@@ -80,7 +80,7 @@ void main() {
|
|||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelListHeader(
|
body: ChannelListHeader(
|
||||||
showConnectionStateTile: true,
|
showConnectionStateTile: true,
|
||||||
),
|
),
|
||||||
@@ -111,12 +111,10 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: ChannelListHeader(
|
body: ChannelListHeader(
|
||||||
titleBuilder: (context, status, client) {
|
titleBuilder: (context, status, client) => const Text('TITLE'),
|
||||||
return Text('TITLE');
|
subtitle: const Text('SUBTITLE'),
|
||||||
},
|
leading: const Text('LEADING'),
|
||||||
subtitle: Text('SUBTITLE'),
|
actions: const [
|
||||||
leading: Text('LEADING'),
|
|
||||||
actions: [
|
|
||||||
Text('ACTION'),
|
Text('ACTION'),
|
||||||
],
|
],
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: ChannelName(),
|
body: ChannelName(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void main() {
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: DeletedMessage(
|
body: DeletedMessage(
|
||||||
messageTheme: MessageTheme(
|
messageTheme: MessageTheme(
|
||||||
createdAt: TextStyle(
|
createdAt: TextStyle(
|
||||||
@@ -81,7 +81,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
);
|
);
|
||||||
|
|
||||||
await screenMatchesGolden(tester, 'deleted_message_light');
|
await screenMatchesGolden(tester, 'deleted_message_light');
|
||||||
@@ -133,7 +133,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
);
|
);
|
||||||
|
|
||||||
await screenMatchesGolden(tester, 'deleted_message_dark');
|
await screenMatchesGolden(tester, 'deleted_message_dark');
|
||||||
@@ -189,7 +189,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
);
|
);
|
||||||
|
|
||||||
await screenMatchesGolden(tester, 'deleted_message_custom');
|
await screenMatchesGolden(tester, 'deleted_message_custom');
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ void main() {
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: Portal(
|
body: Portal(
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: InfoTile(
|
child: InfoTile(
|
||||||
showMessage: true,
|
showMessage: true,
|
||||||
message: 'message',
|
message: 'message',
|
||||||
@@ -49,9 +49,9 @@ void main() {
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: Portal(
|
body: Portal(
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: InfoTile(
|
child: InfoTile(
|
||||||
showMessage: false,
|
showMessage: false,
|
||||||
message: 'message',
|
message: 'message',
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import 'mocks.dart';
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
setUpAll(() {
|
setUpAll(() {
|
||||||
registerFallbackValue(MaterialPageRoute(builder: (context) => SizedBox()));
|
registerFallbackValue(
|
||||||
|
MaterialPageRoute(builder: (context) => const SizedBox()));
|
||||||
registerFallbackValue(Message());
|
registerFallbackValue(Message());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
text: 'test',
|
text: 'test',
|
||||||
@@ -45,7 +46,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
expect(find.byKey(const Key('MessageWidget')), findsOneWidget);
|
||||||
expect(find.text('Thread Reply'), findsOneWidget);
|
expect(find.text('Thread Reply'), findsOneWidget);
|
||||||
expect(find.text('Reply'), findsOneWidget);
|
expect(find.text('Reply'), findsOneWidget);
|
||||||
expect(find.text('Edit Message'), findsOneWidget);
|
expect(find.text('Edit Message'), findsOneWidget);
|
||||||
@@ -71,7 +72,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
showEditMessage: false,
|
showEditMessage: false,
|
||||||
showCopyMessage: false,
|
showCopyMessage: false,
|
||||||
@@ -92,7 +93,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
expect(find.byKey(Key('MessageWidget')), findsOneWidget);
|
expect(find.byKey(const Key('MessageWidget')), findsOneWidget);
|
||||||
expect(find.text('Reply'), findsNothing);
|
expect(find.text('Reply'), findsNothing);
|
||||||
expect(find.text('Thread reply'), findsNothing);
|
expect(find.text('Thread reply'), findsNothing);
|
||||||
expect(find.text('Edit message'), findsNothing);
|
expect(find.text('Edit message'), findsNothing);
|
||||||
@@ -120,7 +121,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
text: 'test',
|
text: 'test',
|
||||||
@@ -131,8 +132,8 @@ void main() {
|
|||||||
messageTheme: streamTheme.ownMessageTheme,
|
messageTheme: streamTheme.ownMessageTheme,
|
||||||
customActions: [
|
customActions: [
|
||||||
MessageAction(
|
MessageAction(
|
||||||
leading: Icon(Icons.check),
|
leading: const Icon(Icons.check),
|
||||||
title: Text('title'),
|
title: const Text('title'),
|
||||||
onTap: (m) {
|
onTap: (m) {
|
||||||
tapped = true;
|
tapped = true;
|
||||||
},
|
},
|
||||||
@@ -175,7 +176,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
onReplyTap: (m) {
|
onReplyTap: (m) {
|
||||||
tapped = true;
|
tapped = true;
|
||||||
@@ -220,7 +221,7 @@ void main() {
|
|||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
client: client,
|
client: client,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
onThreadReplyTap: (m) {
|
onThreadReplyTap: (m) {
|
||||||
tapped = true;
|
tapped = true;
|
||||||
@@ -260,18 +261,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
text: 'test',
|
text: 'test',
|
||||||
@@ -310,22 +309,18 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
editMessageInputBuilder: (context, m) {
|
editMessageInputBuilder: (context, m) => const Text('test'),
|
||||||
return Text('test');
|
|
||||||
},
|
|
||||||
message: Message(
|
message: Message(
|
||||||
text: 'test',
|
text: 'test',
|
||||||
user: User(
|
user: User(
|
||||||
@@ -365,18 +360,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
onCopyTap: (m) => tapped = true,
|
onCopyTap: (m) => tapped = true,
|
||||||
message: Message(
|
message: Message(
|
||||||
@@ -416,18 +409,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
status: MessageSendingStatus.failed,
|
status: MessageSendingStatus.failed,
|
||||||
@@ -467,18 +458,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
status: MessageSendingStatus.failed_update,
|
status: MessageSendingStatus.failed_update,
|
||||||
@@ -516,18 +505,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
id: 'testid',
|
id: 'testid',
|
||||||
@@ -575,18 +562,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
id: 'testid',
|
id: 'testid',
|
||||||
@@ -634,18 +619,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
id: 'testid',
|
id: 'testid',
|
||||||
@@ -689,18 +672,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
id: 'testid',
|
id: 'testid',
|
||||||
@@ -748,18 +729,16 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
builder: (context, child) {
|
builder: (context, child) => StreamChat(
|
||||||
return StreamChat(
|
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: streamTheme,
|
streamChatThemeData: streamTheme,
|
||||||
child: child!,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
|
||||||
theme: themeData,
|
theme: themeData,
|
||||||
home: StreamChannel(
|
home: StreamChannel(
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: MessageActionsModal(
|
child: MessageActionsModal(
|
||||||
message: Message(
|
message: Message(
|
||||||
id: 'testid',
|
id: 'testid',
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void main() {
|
|||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: Scaffold(
|
child: const Scaffold(
|
||||||
body: MessageInput(),
|
body: MessageInput(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -76,7 +76,7 @@ void main() {
|
|||||||
|
|
||||||
expect(find.byType(TextField), findsOneWidget);
|
expect(find.byType(TextField), findsOneWidget);
|
||||||
expect(find.byType(StreamSvgIcon), findsNWidgets(8));
|
expect(find.byType(StreamSvgIcon), findsNWidgets(8));
|
||||||
expect(find.byKey(Key('messageInputText')), findsOneWidget);
|
expect(find.byKey(const Key('messageInputText')), findsOneWidget);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
await tester.pump(Duration(milliseconds: 1000));
|
await tester.pump(const Duration(milliseconds: 1000));
|
||||||
|
|
||||||
expect(find.byType(MessageWidget), findsOneWidget);
|
expect(find.byType(MessageWidget), findsOneWidget);
|
||||||
final messageWidget =
|
final messageWidget =
|
||||||
@@ -95,6 +95,7 @@ void main() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ignore: prefer_function_declarations_over_variables
|
||||||
final onUserAvatarTap = (u) => print('ok');
|
final onUserAvatarTap = (u) => print('ok');
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
@@ -109,16 +110,16 @@ void main() {
|
|||||||
showUserAvatar: DisplayWidget.gone,
|
showUserAvatar: DisplayWidget.gone,
|
||||||
reverse: true,
|
reverse: true,
|
||||||
attachmentBorderRadiusGeometry: BorderRadius.circular(1),
|
attachmentBorderRadiusGeometry: BorderRadius.circular(1),
|
||||||
attachmentShape: RoundedRectangleBorder(),
|
attachmentShape: const RoundedRectangleBorder(),
|
||||||
showReactions: false,
|
showReactions: false,
|
||||||
messageShape: RoundedRectangleBorder(),
|
messageShape: const RoundedRectangleBorder(),
|
||||||
onUserAvatarTap: onUserAvatarTap,
|
onUserAvatarTap: onUserAvatarTap,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
await tester.pump(Duration(milliseconds: 1000));
|
await tester.pump(const Duration(milliseconds: 1000));
|
||||||
|
|
||||||
expect(find.byType(MessageWidget), findsOneWidget);
|
expect(find.byType(MessageWidget), findsOneWidget);
|
||||||
final messageWidget =
|
final messageWidget =
|
||||||
@@ -130,8 +131,8 @@ void main() {
|
|||||||
expect(messageWidget.showUserAvatar, DisplayWidget.gone);
|
expect(messageWidget.showUserAvatar, DisplayWidget.gone);
|
||||||
expect(messageWidget.reverse, true);
|
expect(messageWidget.reverse, true);
|
||||||
expect(messageWidget.showReactions, false);
|
expect(messageWidget.showReactions, false);
|
||||||
expect(messageWidget.attachmentShape, RoundedRectangleBorder());
|
expect(messageWidget.attachmentShape, const RoundedRectangleBorder());
|
||||||
expect(messageWidget.shape, RoundedRectangleBorder());
|
expect(messageWidget.shape, const RoundedRectangleBorder());
|
||||||
expect(messageWidget.showReactions, false);
|
expect(messageWidget.showReactions, false);
|
||||||
expect(messageWidget.showUsername, false);
|
expect(messageWidget.showUsername, false);
|
||||||
expect(messageWidget.showThreadReplyIndicator, false);
|
expect(messageWidget.showThreadReplyIndicator, false);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class MockChannel extends Mock implements Channel {
|
|||||||
Future<bool> get initialized async => true;
|
Future<bool> get initialized async => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
// ignore: prefer_expression_function_bodies
|
||||||
Future<void> keyStroke([String? parentId]) async {
|
Future<void> keyStroke([String? parentId]) async {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void main() {
|
|||||||
SimpleFrame(
|
SimpleFrame(
|
||||||
child: StreamChatTheme(
|
child: StreamChatTheme(
|
||||||
data: StreamChatThemeData(),
|
data: StreamChatThemeData(),
|
||||||
child: Container(
|
child: const SizedBox(
|
||||||
child: ReactionBubble(
|
child: ReactionBubble(
|
||||||
reactions: [],
|
reactions: [],
|
||||||
borderColor: Colors.black,
|
borderColor: Colors.black,
|
||||||
|
|||||||
Reference in New Issue
Block a user