From 206f63ff8419b85429600f21e78dce2032b4ab07 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 1 Feb 2021 14:50:01 +0530 Subject: [PATCH] [StreamChatCore] Move `EventHandler` into typedef.dart Signed-off-by: Sahil Kumar --- .../stream_chat_flutter_core/lib/src/stream_chat_core.dart | 2 +- packages/stream_chat_flutter_core/lib/src/typedef.dart | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart index e17fe708..78cae0ba 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart @@ -4,7 +4,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:stream_chat/stream_chat.dart'; -typedef EventHandler = void Function(Event event); +import 'typedef.dart'; /// Widget used to provide information about the chat to the widget tree. /// This Widget is used to react to life cycle changes and system updates. diff --git a/packages/stream_chat_flutter_core/lib/src/typedef.dart b/packages/stream_chat_flutter_core/lib/src/typedef.dart index 3077574e..29fb2d31 100644 --- a/packages/stream_chat_flutter_core/lib/src/typedef.dart +++ b/packages/stream_chat_flutter_core/lib/src/typedef.dart @@ -1,6 +1,10 @@ import 'package:flutter/widgets.dart'; +import 'package:stream_chat/stream_chat.dart'; /// A signature for a callback which exposes an error and returns a function. /// This Callback can be used in cases where an API failure occurs and the widget /// is unable to render data. typedef ErrorBuilder = Widget Function(BuildContext context, Object error); + +/// A Signature for a handler function which will expose a [event]. +typedef EventHandler = void Function(Event event);