Skip to content

Commit da049f3

Browse files
committed
update more screenshots
1 parent ff3e7fd commit da049f3

25 files changed

+521
-168
lines changed

melos.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ command:
3333
cupertino_icons: ^1.0.3
3434
desktop_drop: '>=0.5.0 <0.8.0'
3535
device_info_plus: '>=11.0.0 <13.0.0'
36+
device_preview: ^1.2.0
3637
diacritic: ^0.1.5
3738
dio: ^5.4.3+1
3839
drift: ^2.28.0

packages/docs_screenshots/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies:
2121

2222
dev_dependencies:
2323
alchemist: ^0.14.0
24+
device_preview: ^1.2.0
2425
flutter_test:
2526
sdk: flutter
2627
mocktail: ^1.0.0

packages/docs_screenshots/test/channel/channel_preview_test.dart

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:alchemist/alchemist.dart';
2+
import 'package:device_preview/device_preview.dart';
23
import 'package:flutter/material.dart';
34
import 'package:flutter_test/flutter_test.dart';
45
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -48,7 +49,7 @@ void main() {
4849
goldenTest(
4950
'channel list view',
5051
fileName: 'channel_list_view',
51-
constraints: const BoxConstraints.tightFor(width: 375, height: 400),
52+
constraints: const BoxConstraints.tightFor(width: 430, height: 932),
5253
builder: () {
5354
final client = MockClient();
5455

@@ -115,17 +116,27 @@ void main() {
115116

116117
stubQueryChannelsForGoldens(client, channels);
117118

118-
return MaterialApp(
119-
theme: docsScreenshotsTheme(),
120-
debugShowCheckedModeBanner: false,
121-
home: StreamChat(
122-
client: client,
123-
streamChatThemeData: docsStreamChatThemeData(),
124-
connectivityStream: Stream.value([ConnectivityResult.mobile]),
125-
child: Scaffold(
126-
body: StreamChannelListView(
127-
controller: controller,
128-
shrinkWrap: true,
119+
return DeviceFrame(
120+
device: Devices.ios.iPhone13,
121+
isFrameVisible: true,
122+
screen: MaterialApp(
123+
theme: docsScreenshotsTheme(),
124+
debugShowCheckedModeBanner: false,
125+
home: StreamChat(
126+
client: client,
127+
streamChatThemeData: docsStreamChatThemeData(),
128+
connectivityStream: Stream.value([ConnectivityResult.mobile]),
129+
child: Scaffold(
130+
appBar: AppBar(
131+
title: const Text('Stream Chat'),
132+
actions: [
133+
IconButton(icon: const Icon(Icons.edit_outlined), onPressed: null),
134+
],
135+
),
136+
body: StreamChannelListView(
137+
controller: controller,
138+
shrinkWrap: true,
139+
),
129140
),
130141
),
131142
),
@@ -161,15 +172,25 @@ void main() {
161172
streamChatThemeData: docsStreamChatThemeData(),
162173
connectivityStream: Stream.value([ConnectivityResult.mobile]),
163174
child: Scaffold(
164-
body: Swipeable(
165-
key: const ValueKey('swipeable-channel'),
166-
backgroundBuilder: (context, details) => Container(
167-
color: Colors.red,
168-
alignment: Alignment.centerRight,
169-
padding: const EdgeInsets.symmetric(horizontal: 20),
170-
child: const Icon(Icons.delete, color: Colors.white),
171-
),
172-
child: StreamChannelListItem(channel: channel),
175+
body: Stack(
176+
children: [
177+
Container(
178+
color: Colors.red,
179+
alignment: Alignment.centerRight,
180+
padding: const EdgeInsets.only(right: 20),
181+
child: const Column(
182+
mainAxisAlignment: MainAxisAlignment.center,
183+
children: [
184+
Icon(Icons.delete, color: Colors.white),
185+
Text('Delete', style: TextStyle(color: Colors.white, fontSize: 12)),
186+
],
187+
),
188+
),
189+
Transform.translate(
190+
offset: const Offset(-80, 0),
191+
child: StreamChannelListItem(channel: channel),
192+
),
193+
],
173194
),
174195
),
175196
),
15.9 KB
Loading
-1.78 KB
Loading

packages/docs_screenshots/test/draft_list/draft_list_view_test.dart

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void main() {
3434
goldenTest(
3535
'draft list view',
3636
fileName: 'draft_list_view',
37-
constraints: const BoxConstraints.tightFor(width: 375, height: 400),
37+
constraints: const BoxConstraints.tightFor(width: 375, height: 550),
3838
builder: () {
3939
final client = MockClient();
4040
stubMockClientCurrentUser(client, OwnUser(id: 'user-1', name: 'Alice'));
@@ -72,9 +72,33 @@ void main() {
7272
streamChatThemeData: docsStreamChatThemeData(),
7373
connectivityStream: Stream.value([ConnectivityResult.mobile]),
7474
child: Scaffold(
75-
body: StreamDraftListView(
76-
controller: controller,
77-
shrinkWrap: true,
75+
appBar: AppBar(
76+
title: const Text('Stream Chat'),
77+
actions: [
78+
IconButton(icon: const Icon(Icons.edit_outlined), onPressed: null),
79+
],
80+
),
81+
body: StreamDraftListView(controller: controller),
82+
bottomNavigationBar: BottomNavigationBar(
83+
currentIndex: 3,
84+
items: const [
85+
BottomNavigationBarItem(
86+
icon: Icon(Icons.chat_bubble_outline),
87+
label: 'Chats',
88+
),
89+
BottomNavigationBarItem(
90+
icon: Icon(Icons.alternate_email),
91+
label: 'Mentions',
92+
),
93+
BottomNavigationBarItem(
94+
icon: Icon(Icons.comment_outlined),
95+
label: 'Threads',
96+
),
97+
BottomNavigationBarItem(
98+
icon: Icon(Icons.edit_note),
99+
label: 'Drafts',
100+
),
101+
],
78102
),
79103
),
80104
),
3.75 KB
Loading

packages/docs_screenshots/test/flutter_test_config.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:io';
33
import 'dart:typed_data';
44

55
import 'package:alchemist/alchemist.dart';
6+
import 'package:flutter/material.dart';
67
import 'package:flutter/services.dart';
78
import 'package:flutter_test/flutter_test.dart';
89

@@ -21,6 +22,11 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {
2122

2223
return AlchemistConfig.runWithConfig(
2324
config: AlchemistConfig(
25+
goldenTestTheme: GoldenTestTheme(
26+
backgroundColor: Colors.transparent,
27+
borderColor: Colors.transparent,
28+
nameTextStyle: const TextStyle(fontSize: 18),
29+
),
2430
ciGoldensConfig: const CiGoldensConfig(enabled: false),
2531
platformGoldensConfig: const PlatformGoldensConfig(enabled: true),
2632
),
13.8 KB
Loading
121 Bytes
Loading

0 commit comments

Comments
 (0)