Merge branch 'develop' into v4

This commit is contained in:
Salvatore Giordano
2022-04-29 16:24:12 +02:00
80 changed files with 607 additions and 180 deletions
@@ -280,7 +280,7 @@ void main() {
expect(find.text('test'), findsNothing);
expect(find.byType(StreamBackButton), findsNothing);
expect(find.byType(ChannelAvatar), findsNothing);
expect(find.byType(StreamChannelAvatar), findsNothing);
expect(find.byType(StreamChannelInfo), findsNothing);
expect(find.text('leading'), findsOneWidget);
expect(find.text('title'), findsOneWidget);
@@ -31,8 +31,10 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: const Scaffold(
body: ChannelAvatar(),
child: Scaffold(
body: StreamChannelAvatar(
channel: channel,
),
),
),
),
@@ -101,8 +103,10 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: const Scaffold(
body: ChannelAvatar(),
child: Scaffold(
body: StreamChannelAvatar(
channel: channel,
),
),
),
),
@@ -162,8 +166,10 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: const Scaffold(
body: ChannelAvatar(),
child: Scaffold(
body: StreamChannelAvatar(
channel: channel,
),
),
),
),
@@ -202,9 +208,10 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: const Scaffold(
body: ChannelAvatar(
child: Scaffold(
body: StreamChannelAvatar(
selected: true,
channel: channel,
),
),
),
@@ -57,8 +57,10 @@ void main() {
client: client,
child: StreamChannel(
channel: channel,
child: const Scaffold(
body: ChannelName(),
child: Scaffold(
body: StreamChannelName(
channel: channel,
),
),
),
),
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use_from_same_package
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
@@ -0,0 +1,37 @@
import 'package:stream_chat_flutter/src/media_list_view_controller.dart';
import 'package:test/test.dart';
void main() {
test('should update media', () {
final controller = MediaListViewController();
expect(controller.shouldUpdateMedia, false);
controller.updateMedia(newValue: true);
expect(controller.shouldUpdateMedia, true);
controller.dispose();
});
test('should notify listeners on update media', () {
final controller = MediaListViewController();
var callCount = 0;
void updateCallsSpy() => callCount++;
controller.addListener(updateCallsSpy);
expect(callCount, 0);
controller.updateMedia(newValue: false);
expect(controller.shouldUpdateMedia, false);
expect(callCount, 1);
controller.updateMedia(newValue: true);
expect(controller.shouldUpdateMedia, true);
expect(callCount, 2);
controller
..removeListener(updateCallsSpy)
..dispose();
});
}
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use_from_same_package
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -1,3 +1,6 @@
// ignore: lines_longer_than_80_chars
// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -1,3 +1,6 @@
// ignore: lines_longer_than_80_chars
// ignore_for_file: deprecated_member_use_from_same_package, deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use_from_same_package
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';