Transfer showLocalNotification, backgroundKeepAlive from LLC to Core

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-01-29 17:23:00 +05:30
parent 4b9a7d6837
commit 5310287fdd
7 changed files with 72 additions and 98 deletions
@@ -34,11 +34,21 @@ class StreamChat extends StatefulWidget {
final Widget child;
final StreamChatThemeData streamChatThemeData;
/// The amount of time that will pass before disconnecting the client in the background
final Duration backgroundKeepAlive;
/// Handler called whenever the [client] receives a new [Event] while the app
/// is in background. Can be used to display various notifications depending
/// upon the [Event.type]
final EventHandler onBackgroundEventReceived;
StreamChat({
Key key,
@required this.client,
@required this.child,
this.streamChatThemeData,
this.onBackgroundEventReceived,
this.backgroundKeepAlive = const Duration(minutes: 1),
}) : super(
key: key,
);
@@ -82,8 +92,10 @@ class StreamChatState extends State<StreamChat> {
scaffoldBackgroundColor: streamTheme.colorTheme.white,
),
child: StreamChatCore(
child: widget.child,
client: client,
child: widget.child,
onBackgroundEventReceived: widget.onBackgroundEventReceived,
backgroundKeepAlive: widget.backgroundKeepAlive,
),
);
},