fix lint and tests
This commit is contained in:
@@ -39,6 +39,7 @@ class StreamChat extends StatefulWidget {
|
|||||||
this.streamChatThemeData,
|
this.streamChatThemeData,
|
||||||
this.onBackgroundEventReceived,
|
this.onBackgroundEventReceived,
|
||||||
this.backgroundKeepAlive = const Duration(minutes: 1),
|
this.backgroundKeepAlive = const Duration(minutes: 1),
|
||||||
|
this.connectivityStream,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Client to do chat ops with
|
/// Client to do chat ops with
|
||||||
@@ -59,6 +60,11 @@ class StreamChat extends StatefulWidget {
|
|||||||
/// upon the [Event.type]
|
/// upon the [Event.type]
|
||||||
final EventHandler? onBackgroundEventReceived;
|
final EventHandler? onBackgroundEventReceived;
|
||||||
|
|
||||||
|
/// Stream of connectivity result
|
||||||
|
/// Visible for testing
|
||||||
|
@visibleForTesting
|
||||||
|
final Stream<ConnectivityResult>? connectivityStream;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
StreamChatState createState() => StreamChatState();
|
StreamChatState createState() => StreamChatState();
|
||||||
|
|
||||||
@@ -102,6 +108,7 @@ class StreamChatState extends State<StreamChat> {
|
|||||||
client: client,
|
client: client,
|
||||||
onBackgroundEventReceived: widget.onBackgroundEventReceived,
|
onBackgroundEventReceived: widget.onBackgroundEventReceived,
|
||||||
backgroundKeepAlive: widget.backgroundKeepAlive,
|
backgroundKeepAlive: widget.backgroundKeepAlive,
|
||||||
|
connectivityStream: widget.connectivityStream,
|
||||||
child: widget.child ?? const Offstage(),
|
child: widget.child ?? const Offstage(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
@@ -131,6 +132,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
@@ -187,6 +189,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ void main() {
|
|||||||
maskColor: theme.ownMessageTheme.reactionsMaskColor!,
|
maskColor: theme.ownMessageTheme.reactionsMaskColor!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size(100, 100),
|
surfaceSize: const Size(100, 100),
|
||||||
);
|
);
|
||||||
@@ -96,6 +97,7 @@ void main() {
|
|||||||
maskColor: theme.ownMessageTheme.reactionsMaskColor!,
|
maskColor: theme.ownMessageTheme.reactionsMaskColor!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size(100, 100),
|
surfaceSize: const Size(100, 100),
|
||||||
);
|
);
|
||||||
@@ -118,6 +120,7 @@ void main() {
|
|||||||
StreamChat(
|
StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: ReactionBubble(
|
child: ReactionBubble(
|
||||||
@@ -162,6 +165,7 @@ void main() {
|
|||||||
StreamChat(
|
StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: ReactionBubble(
|
child: ReactionBubble(
|
||||||
@@ -204,6 +208,7 @@ void main() {
|
|||||||
await tester.pumpWidgetBuilder(
|
await tester.pumpWidgetBuilder(
|
||||||
StreamChat(
|
StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
streamChatThemeData: StreamChatThemeData.fromTheme(themeData),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: ReactionBubble(
|
child: ReactionBubble(
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
@@ -151,6 +152,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
connectivityStream: Stream.value(ConnectivityResult.mobile),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
surfaceSize: const Size.square(200),
|
surfaceSize: const Size.square(200),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
library stream_chat_flutter_core;
|
library stream_chat_flutter_core;
|
||||||
|
|
||||||
|
export 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
export 'package:stream_chat/stream_chat.dart';
|
export 'package:stream_chat/stream_chat.dart';
|
||||||
|
|
||||||
export 'src/channel_list_core.dart' hide ChannelListCoreState;
|
export 'src/channel_list_core.dart' hide ChannelListCoreState;
|
||||||
|
|||||||
@@ -11,16 +11,16 @@ environment:
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
collection: ^1.15.0
|
collection: ^1.15.0
|
||||||
|
connectivity_plus: ^1.0.1
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
meta: ^1.3.0
|
meta: ^1.3.0
|
||||||
rxdart: ^0.27.0
|
rxdart: ^0.27.0
|
||||||
stream_chat: ^2.0.0-nullsafety.2
|
stream_chat: ^2.0.0-nullsafety.2
|
||||||
connectivity_plus: ^1.0.1
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
fake_async: ^1.2.0
|
fake_async: ^1.2.0
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
mocktail: ^0.1.1
|
mocktail: ^0.1.3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user