Skip to content

Commit 9cdce59

Browse files
committed
v1.0.0
1 parent aa6d719 commit 9cdce59

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

example/lib/main.dart

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ class _HomePageState extends State<HomePage> {
4747
_processText = FlutterProcessText.getProcessTextStream;
4848
}
4949

50-
void initialize() {
51-
FlutterProcessText.initialize(
52-
showToast: true,
53-
confirmationMessage: "Text Added",
54-
refreshMessage: "Got all Text",
55-
errorMessage: "Some Error",
56-
);
57-
}
58-
5950
@override
6051
Widget build(BuildContext context) {
6152
return Scaffold(
@@ -82,7 +73,7 @@ class _HomePageState extends State<HomePage> {
8273
child: StreamBuilder<String>(
8374
stream: _processText,
8475
builder: (context, snapshot) {
85-
return Text('Fetched Data: ${snapshot.data}\n');
76+
return Text('Fetched Data: ${snapshot.data}');
8677
},
8778
),
8879
),

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ packages:
6868
path: ".."
6969
relative: true
7070
source: path
71-
version: "0.0.1"
71+
version: "1.0.0"
7272
flutter_test:
7373
dependency: "direct dev"
7474
description: flutter

lib/flutter_process_text.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,5 @@ packages:
143143
source: hosted
144144
version: "2.1.0"
145145
sdks:
146-
dart: ">=2.12.0-0.0 <3.0.0"
146+
dart: ">=2.12.0 <3.0.0"
147147
flutter: ">=1.20.0"

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: flutter_process_text
2-
version: 0.0.1
3-
description: Flutter plugin to listen to process text stream.
2+
version: 1.0.0
3+
description: Flutter plugin to listen the process text stream to get continuous process text intent data.
44
repository: https://github.com/divshekhar/flutter_process_text
55
documentation: https://github.com/divshekhar/flutter_process_text/blob/main/README.md
66

77
environment:
8-
sdk: ">=2.7.0 <3.0.0"
8+
sdk: ">=2.12.0 <3.0.0"
99
flutter: ">=1.20.0"
1010

1111
dependencies:

0 commit comments

Comments
 (0)