Skip to content

Commit 8cadead

Browse files
committed
Updated docs, improved text layout in example app, prepping for 0.1.2 release
1 parent 1ee1263 commit 8cadead

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

example/lib/main.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
* flutter_snowboy - Flutter package wrapper for Snowboy hotword detection.
3+
*
24
* Copyright 2021-2023 Miðeind ehf.
35
*
46
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -181,6 +183,7 @@ class _SnowboyExampleAppState extends State<SnowboyExampleApp> {
181183
),
182184
body: Center(
183185
child: Column(children: <Widget>[
186+
Text("\n"),
184187
MaterialButton(
185188
minWidth: double.infinity,
186189
child: Text(buttonTitle,
@@ -189,11 +192,13 @@ class _SnowboyExampleAppState extends State<SnowboyExampleApp> {
189192
)),
190193
onPressed: toggleHotwordDetection,
191194
),
192-
Text(status,
195+
Text("\n" + status,
196+
textAlign: TextAlign.center,
193197
style: TextStyle(
194198
fontSize: 20.0,
195199
)),
196-
Text('Hotword heard $numDetected times',
200+
Text('\nHotword heard $numDetected times',
201+
textAlign: TextAlign.center,
197202
style: TextStyle(
198203
fontSize: 20.0,
199204
)),

lib/flutter_snowboy.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
* flutter_snowboy - Flutter package wrapper for Snowboy hotword detection.
3+
*
24
* Copyright (C) 2021-2023 Miðeind ehf.
35
*
46
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,12 +30,13 @@ class Snowboy {
2830
MethodChannel _channel = const MethodChannel('plugin_snowboy');
2931
Function? hotwordHandler;
3032

33+
/// Constructor
3134
Snowboy() {
32-
// Register handler to receive messages from native plugin
35+
// Register handler to receive messages from the native plugin.
3336
_channel.setMethodCallHandler(channelMethodCallHandler);
3437
}
3538

36-
// Handle messages from the native plugin
39+
/// Handle messages from the native plugin.
3740
Future<dynamic> channelMethodCallHandler(MethodCall methodCall) async {
3841
switch (methodCall.method) {
3942
case 'hotword':
@@ -66,7 +69,7 @@ class Snowboy {
6669
}
6770
}
6871

69-
/// Detect hotword in the provided audio data
72+
/// Detect hotword in the provided audio data.
7073
Future<void> detect(Uint8List data) async {
7174
try {
7275
await _channel.invokeMethod('detectSnowboy', [data]);
@@ -75,7 +78,7 @@ class Snowboy {
7578
}
7679
}
7780

78-
/// Dispose of all resources
81+
/// Dispose of all resources.
7982
Future<void> purge() async {
8083
try {
8184
await _channel.invokeMethod('purgeSnowboy');

test/flutter_snowboy_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
* flutter_snowboy - Flutter package wrapper for Snowboy hotword detection.
3+
*
24
* Copyright (C) 2021-2023 Miðeind ehf.
35
*
46
* Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)