@@ -9,8 +9,13 @@ class FlutterProcessText {
99 static const EventChannel _eventChannel =
1010 const EventChannel ('flutter_process_text_stream' );
1111
12- static Stream <String > _processTextStream;
12+ static Stream <String >? _processTextStream;
1313
14+ /// Initialize FlutterProcessText Plugins.
15+ /// showToast<bool> - if true, will show a toast message, else not.
16+ /// set ConfirmationMessage to show a confirmation message in the Toast.
17+ /// set refreshMessage to show a refresh message in the Toast.
18+ /// set errorMessage to show a error message in the Toast.
1419 static Future <void > initialize ({
1520 bool showToast = true ,
1621 String confirmationMessage = "Text Fetched" ,
@@ -25,15 +30,17 @@ class FlutterProcessText {
2530 });
2631 }
2732
33+ /// Get the pending data by refreshing the process text
2834 static Future <String > get refreshProcessText async {
2935 return await _channel.invokeMethod ('getRefreshProcessText' );
3036 }
3137
38+ /// Listen to the process text stream to get continuous data.
3239 static Stream <String > get getProcessTextStream {
3340 if (_processTextStream == null ) {
3441 _processTextStream =
3542 _eventChannel.receiveBroadcastStream ().map <String >((event) => event);
3643 }
37- return _processTextStream;
44+ return _processTextStream! ;
3845 }
3946}
0 commit comments