Skip to content

Commit 95a23e5

Browse files
committed
formatting
1 parent 9e85cb4 commit 95a23e5

File tree

10 files changed

+124
-52
lines changed

10 files changed

+124
-52
lines changed

packages/docs_screenshots/pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ dev_dependencies:
2727
mocktail: ^1.0.0
2828
plugin_platform_interface: ^2.0.0
2929
record: ">=5.2.0 <7.0.0"
30+
stream_core_flutter:
31+
git:
32+
url: https://github.com/GetStream/stream-core-flutter.git
33+
ref: c0c5986c2388d7064b81e207ad82ddadb9021032
34+
path: packages/stream_core_flutter
3035

3136
flutter:
3237
uses-material-design: true

packages/docs_screenshots/test/channel/channel_preview_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ void main() {
129129
child: Scaffold(
130130
appBar: AppBar(
131131
title: const Text('Stream Chat'),
132-
actions: [
133-
IconButton(icon: const Icon(Icons.edit_outlined), onPressed: null),
132+
actions: const [
133+
IconButton(icon: Icon(Icons.edit_outlined), onPressed: null),
134134
],
135135
),
136136
body: StreamChannelListView(

packages/docs_screenshots/test/draft_list/draft_list_view_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ void main() {
7474
child: Scaffold(
7575
appBar: AppBar(
7676
title: const Text('Stream Chat'),
77-
actions: [
78-
IconButton(icon: const Icon(Icons.edit_outlined), onPressed: null),
77+
actions: const [
78+
IconButton(icon: Icon(Icons.edit_outlined), onPressed: null),
7979
],
8080
),
8181
body: StreamDraftListView(controller: controller),

packages/docs_screenshots/test/flutter_test_config.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'dart:async';
22
import 'dart:io';
3-
import 'dart:typed_data';
43

54
import 'package:alchemist/alchemist.dart';
65
import 'package:flutter/material.dart';
@@ -60,8 +59,7 @@ Future<void> _loadEmojiFont() async {
6059
for (final path in paths) {
6160
final file = File(path);
6261
if (!file.existsSync()) continue;
63-
final loader = FontLoader(family);
64-
loader.addFont(file.readAsBytes().then(ByteData.sublistView));
62+
final loader = FontLoader(family)..addFont(file.readAsBytes().then(ByteData.sublistView));
6563
await loader.load();
6664
return; // Stop after the first font successfully loaded.
6765
}

packages/docs_screenshots/test/message_search/message_search_list_view_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ GetMessageResponse _makeSearchResult({
1313
required String userName,
1414
required String channelName,
1515
}) {
16-
final response = GetMessageResponse();
17-
response.message = Message(
18-
id: messageId,
19-
text: text,
20-
user: User(id: 'user-$messageId', name: userName),
21-
createdAt: DateTime(2024, 6, 1, 10, 0),
22-
);
23-
response.channel = ChannelModel(
24-
id: 'ch-$messageId',
25-
type: 'messaging',
26-
extraData: {'name': channelName},
27-
);
16+
final response = GetMessageResponse()
17+
..message = Message(
18+
id: messageId,
19+
text: text,
20+
user: User(id: 'user-$messageId', name: userName),
21+
createdAt: DateTime(2024, 6, 1, 10, 0),
22+
)
23+
..channel = ChannelModel(
24+
id: 'ch-$messageId',
25+
type: 'messaging',
26+
extraData: {'name': channelName},
27+
);
2828
return response;
2929
}
3030

packages/docs_screenshots/test/polls/poll_test.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ void main() {
4343
poll: Poll(
4444
id: 'poll-1',
4545
name: 'What is your favorite programming language?',
46-
options: [
47-
const PollOption(id: 'opt-1', text: 'Dart'),
48-
const PollOption(id: 'opt-2', text: 'Swift'),
49-
const PollOption(id: 'opt-3', text: 'Kotlin'),
46+
options: const [
47+
PollOption(id: 'opt-1', text: 'Dart'),
48+
PollOption(id: 'opt-2', text: 'Swift'),
49+
PollOption(id: 'opt-3', text: 'Kotlin'),
5050
],
5151
),
5252
);
@@ -60,14 +60,14 @@ void main() {
6060
connectivityStream: Stream.value([ConnectivityResult.mobile]),
6161
child: Scaffold(
6262
appBar: AppBar(
63-
leading: IconButton(
64-
icon: const Icon(Icons.close),
63+
leading: const IconButton(
64+
icon: Icon(Icons.close),
6565
onPressed: null,
6666
),
6767
title: const Text('Create Poll'),
68-
actions: [
68+
actions: const [
6969
IconButton(
70-
icon: const Icon(Icons.send),
70+
icon: Icon(Icons.send),
7171
onPressed: null,
7272
),
7373
],
@@ -103,13 +103,13 @@ void main() {
103103
final poll = Poll(
104104
id: 'poll-2',
105105
name: 'Which feature would you like to see next?',
106-
options: [
107-
const PollOption(id: 'opt-a', text: 'Offline mode'),
108-
const PollOption(id: 'opt-b', text: 'Message scheduling'),
109-
const PollOption(id: 'opt-c', text: 'Voice messages'),
110-
const PollOption(id: 'opt-d', text: 'Reactions 2.0'),
106+
options: const [
107+
PollOption(id: 'opt-a', text: 'Offline mode'),
108+
PollOption(id: 'opt-b', text: 'Message scheduling'),
109+
PollOption(id: 'opt-c', text: 'Voice messages'),
110+
PollOption(id: 'opt-d', text: 'Reactions 2.0'),
111111
],
112-
voteCountsByOption: {
112+
voteCountsByOption: const {
113113
'opt-a': 8,
114114
'opt-b': 5,
115115
'opt-c': 12,

packages/docs_screenshots/test/src/golden_theme.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ StreamChatThemeData docsStreamChatThemeData() {
4343
const roboto = TextStyle(fontFamily: 'Roboto');
4444
final base = StreamChatThemeData.light();
4545
final textTheme = base.textTheme.merge(
46-
StreamTextTheme.light(
46+
const StreamTextTheme.light(
4747
body: roboto,
4848
bodyBold: roboto,
4949
title: roboto,

packages/docs_screenshots/test/src/mocks.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ class MockChannel extends Mock implements Channel {
8282
String? eventType2,
8383
String? eventType3,
8484
String? eventType4,
85-
]) =>
86-
const Stream.empty();
85+
]) => const Stream.empty();
8786
}
8887

8988
class MockChannelState extends Mock implements ChannelClientState {
@@ -118,7 +117,12 @@ void setupMockChannel({
118117
}) {
119118
final allMembers = members.isNotEmpty
120119
? members
121-
: [Member(userId: 'user-id', user: User(id: 'user-id'))];
120+
: [
121+
Member(
122+
userId: 'user-id',
123+
user: User(id: 'user-id'),
124+
),
125+
];
122126

123127
when(() => client.state).thenReturn(clientState);
124128
when(() => channel.lastMessageAt).thenReturn(DateTime.parse('2020-06-22 12:00:00'));

packages/docs_screenshots/test/thread_list/thread_list_view_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Widget _buildFullAppThreadScaffold({
7373
child: Scaffold(
7474
appBar: AppBar(
7575
title: const Text('Stream Chat'),
76-
actions: [
77-
IconButton(icon: const Icon(Icons.edit_outlined), onPressed: null),
76+
actions: const [
77+
IconButton(icon: Icon(Icons.edit_outlined), onPressed: null),
7878
],
7979
),
8080
body: Column(
@@ -222,7 +222,7 @@ void main() {
222222
streamChatThemeData: docsStreamChatThemeData(),
223223
connectivityStream: Stream.value([ConnectivityResult.mobile]),
224224
child: Scaffold(
225-
body: Container(
225+
body: DecoratedBox(
226226
decoration: BoxDecoration(
227227
border: Border(
228228
left: BorderSide(color: Colors.blue.shade700, width: 4),
@@ -279,8 +279,8 @@ void main() {
279279
return _buildFullAppThreadScaffold(
280280
client: client,
281281
controller: controller,
282-
banner: StreamUnreadThreadsBanner(
283-
unreadThreads: const {'thread-1', 'thread-2', 'thread-3'},
282+
banner: const StreamUnreadThreadsBanner(
283+
unreadThreads: {'thread-1', 'thread-2', 'thread-3'},
284284
),
285285
);
286286
},

packages/docs_screenshots/test/voice_recording/voice_recording_test.dart

Lines changed: 75 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
33
import 'package:flutter_test/flutter_test.dart';
44
import 'package:mocktail/mocktail.dart';
55
import 'package:record/record.dart';
6-
import 'package:stream_chat_flutter/src/audio/audio_playlist_state.dart';
76
import 'package:stream_chat_flutter/src/components/message_composer/message_composer_recording_locked.dart';
87
import 'package:stream_chat_flutter/src/components/message_composer/message_composer_recording_ongoing.dart';
98
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -17,7 +16,7 @@ class _MockAudioRecorder extends Mock implements AudioRecorder {}
1716
StreamAudioRecorderController _makeRecorderController(AudioRecorderState initialState) {
1817
final mockRecorder = _MockAudioRecorder();
1918
when(() => mockRecorder.onAmplitudeChanged(any())).thenAnswer((_) => const Stream.empty());
20-
when(() => mockRecorder.dispose()).thenAnswer((_) async {});
19+
when(mockRecorder.dispose).thenAnswer((_) async {});
2120
return StreamAudioRecorderController.raw(
2221
config: const RecordConfig(numChannels: 1),
2322
recorder: mockRecorder,
@@ -276,10 +275,43 @@ void main() {
276275
uploadState: const UploadState.success(),
277276
extraData: const {
278277
'duration': 15.0,
279-
'waveform_data': <double>[0.1, 0.3, 0.5, 0.7, 0.9, 0.7, 0.5, 0.3, 0.1,
280-
0.2, 0.4, 0.6, 0.8, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6, 0.3,
281-
0.1, 0.4, 0.7, 0.9, 0.6, 0.3, 0.1, 0.4, 0.7, 0.5, 0.2,
282-
0.6, 0.8, 0.4, 0.2],
278+
'waveform_data': <double>[
279+
0.1,
280+
0.3,
281+
0.5,
282+
0.7,
283+
0.9,
284+
0.7,
285+
0.5,
286+
0.3,
287+
0.1,
288+
0.2,
289+
0.4,
290+
0.6,
291+
0.8,
292+
0.6,
293+
0.4,
294+
0.2,
295+
0.5,
296+
0.8,
297+
0.6,
298+
0.3,
299+
0.1,
300+
0.4,
301+
0.7,
302+
0.9,
303+
0.6,
304+
0.3,
305+
0.1,
306+
0.4,
307+
0.7,
308+
0.5,
309+
0.2,
310+
0.6,
311+
0.8,
312+
0.4,
313+
0.2,
314+
],
283315
},
284316
),
285317
],
@@ -315,10 +347,43 @@ void main() {
315347
uploadState: const UploadState.success(),
316348
extraData: const {
317349
'duration': 15.0,
318-
'waveform_data': <double>[0.1, 0.3, 0.5, 0.7, 0.9, 0.7, 0.5, 0.3, 0.1,
319-
0.2, 0.4, 0.6, 0.8, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6, 0.3,
320-
0.1, 0.4, 0.7, 0.9, 0.6, 0.3, 0.1, 0.4, 0.7, 0.5, 0.2,
321-
0.6, 0.8, 0.4, 0.2],
350+
'waveform_data': <double>[
351+
0.1,
352+
0.3,
353+
0.5,
354+
0.7,
355+
0.9,
356+
0.7,
357+
0.5,
358+
0.3,
359+
0.1,
360+
0.2,
361+
0.4,
362+
0.6,
363+
0.8,
364+
0.6,
365+
0.4,
366+
0.2,
367+
0.5,
368+
0.8,
369+
0.6,
370+
0.3,
371+
0.1,
372+
0.4,
373+
0.7,
374+
0.9,
375+
0.6,
376+
0.3,
377+
0.1,
378+
0.4,
379+
0.7,
380+
0.5,
381+
0.2,
382+
0.6,
383+
0.8,
384+
0.4,
385+
0.2,
386+
],
322387
},
323388
),
324389
],

0 commit comments

Comments
 (0)