This commit is contained in:
Deven Joshi
2021-05-05 19:07:32 +05:30
parent 9b09874df1
commit 0590fe1a76
19 changed files with 68 additions and 70 deletions
@@ -23,7 +23,8 @@ class MockAttachmentDownloader extends Mock {
void main() {
setUpAll(() {
registerFallbackValue(MaterialPageRoute(builder: (context) => SizedBox()));
registerFallbackValue(
MaterialPageRoute(builder: (context) => const SizedBox()));
registerFallbackValue(Message());
});
@@ -461,9 +462,9 @@ void main() {
MaterialApp(
builder: (context, child) => StreamChat(
client: client,
child: child!,
child: child,
),
home: Container(
home: SizedBox(
child: AttachmentActionsModal(
fileDownloader: fileDownloader,
message: Message(
@@ -19,7 +19,7 @@ void main() {
child: Center(
child: StreamChatTheme(
data: StreamChatThemeData.fromTheme(theme),
child: StreamBackButton(),
child: const StreamBackButton(),
),
),
),
@@ -26,7 +26,7 @@ void main() {
),
),
),
surfaceSize: Size(100, 100),
surfaceSize: const Size(100, 100),
);
await screenMatchesGolden(tester, 'reaction_bubble_0');
},
@@ -47,7 +47,7 @@ void main() {
StreamChat(
client: client,
streamChatThemeData: theme,
child: Container(
child: SizedBox(
child: ReactionBubble(
reactions: [
Reaction(
@@ -61,7 +61,7 @@ void main() {
),
),
),
surfaceSize: Size(100, 100),
surfaceSize: const Size(100, 100),
);
await screenMatchesGolden(tester, 'reaction_bubble_like_light');
},
@@ -97,7 +97,7 @@ void main() {
),
),
),
surfaceSize: Size(100, 100),
surfaceSize: const Size(100, 100),
);
await screenMatchesGolden(tester, 'reaction_bubble_like_dark');
},
@@ -141,7 +141,7 @@ void main() {
),
),
),
surfaceSize: Size(140, 140),
surfaceSize: const Size(140, 140),
);
await screenMatchesGolden(tester, 'reaction_bubble_3_light');
},
@@ -185,7 +185,7 @@ void main() {
),
),
),
surfaceSize: Size(140, 140),
surfaceSize: const Size(140, 140),
);
await screenMatchesGolden(tester, 'reaction_bubble_3_dark');
},
@@ -205,7 +205,7 @@ void main() {
StreamChat(
client: client,
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
child: Container(
child: SizedBox(
child: ReactionBubble(
reactions: [
Reaction(
@@ -230,7 +230,7 @@ void main() {
),
),
),
surfaceSize: Size(200, 200),
surfaceSize: const Size(200, 200),
);
await screenMatchesGolden(tester, 'reaction_bubble_2');
@@ -1,19 +1,17 @@
import 'package:flutter/material.dart';
class SimpleFrame extends StatelessWidget {
final Widget child;
const SimpleFrame({Key? key, required this.child}) : super(key: key);
final Widget child;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF),
border: Border.all(color: const Color(0xFF9E9E9E)),
),
child: child,
);
}
Widget build(BuildContext context) => Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF),
border: Border.all(color: const Color(0xFF9E9E9E)),
),
child: child,
);
}
@@ -102,7 +102,7 @@ void main() {
),
),
),
surfaceSize: Size.square(200),
surfaceSize: const Size.square(200),
);
await screenMatchesGolden(tester, 'system_message_light');
@@ -153,7 +153,7 @@ void main() {
),
),
),
surfaceSize: Size.square(200),
surfaceSize: const Size.square(200),
);
await screenMatchesGolden(tester, 'system_message_dark');
@@ -117,13 +117,13 @@ void main() {
child: Scaffold(
body: ThreadHeader(
parent: Message(),
subtitle: Text('subtitle'),
leading: Text('leading'),
title: Text('title'),
subtitle: const Text('subtitle'),
leading: const Text('leading'),
title: const Text('title'),
onTitleTap: () {
tapped = true;
},
actions: [
actions: const [
Text('action'),
],
),
@@ -67,14 +67,14 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: Scaffold(
child: const Scaffold(
body: TypingIndicator(),
),
),
),
));
expect(find.byKey(Key('typings')), findsOneWidget);
expect(find.byKey(const Key('typings')), findsOneWidget);
},
);
}
@@ -36,7 +36,7 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: Scaffold(
child: const Scaffold(
body: UnreadIndicator(),
),
),