Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Support Japan locale and null-safety #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .dart_tool/package_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"configVersion": 2,
"packages": [
{
"name": "characters",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "collection",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "meta",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "typed_data",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "vector_math",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "speech_recognition",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.10"
}
],
"generated": "2021-08-08T07:11:40.541237Z",
"generator": "pub",
"generatorVersion": "2.13.4"
}
33 changes: 33 additions & 0 deletions .dart_tool/package_config_subset
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
speech_recognition
2.10
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/lib/
characters
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
collection
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
meta
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
typed_data
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
sky_engine
2.12
file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine/
file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine/lib/
flutter
2.12
file:///Users/fumiyatanaka/Work/flutter/packages/flutter/
file:///Users/fumiyatanaka/Work/flutter/packages/flutter/lib/
2
1 change: 1 addition & 0 deletions .dart_tool/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ infos.plist, add :

## Limitation

On iOS, by default the plugin is configured for French, English, Russian, Spanish, Italian.
On iOS, by default the plugin is configured for French, English, Russian, Spanish, Italian and Japanese.
On Android, without additional installations, it will probably works only with the default device locale.

## Troubleshooting
Expand Down
62 changes: 62 additions & 0 deletions example/.dart_tool/package_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"configVersion": 2,
"packages": [
{
"name": "characters",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "collection",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "meta",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "speech_recognition",
"rootUri": "../../",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "typed_data",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "vector_math",
"rootUri": "file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "speech_recognition_example",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.12"
}
],
"generated": "2021-08-08T07:15:12.083543Z",
"generator": "pub",
"generatorVersion": "2.13.4"
}
37 changes: 37 additions & 0 deletions example/.dart_tool/package_config_subset
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
speech_recognition
2.12
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/lib/
characters
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
collection
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
meta
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
typed_data
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math
2.12
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/
file:///Users/fumiyatanaka/Work/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
sky_engine
2.12
file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine/
file:///Users/fumiyatanaka/Work/flutter/bin/cache/pkg/sky_engine/lib/
flutter
2.12
file:///Users/fumiyatanaka/Work/flutter/packages/flutter/
file:///Users/fumiyatanaka/Work/flutter/packages/flutter/lib/
speech_recognition_example
2.12
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/example/
file:///Users/fumiyatanaka/Work/FlutterDev/speech_recognition/example/lib/
2
1 change: 1 addition & 0 deletions example/.dart_tool/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.3
1 change: 1 addition & 0 deletions example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"speech_recognition","path":"/Users/fumiyatanaka/Work/FlutterDev/speech_recognition/","dependencies":[]}],"android":[{"name":"speech_recognition","path":"/Users/fumiyatanaka/Work/FlutterDev/speech_recognition/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"speech_recognition","dependencies":[]}],"date_created":"2021-08-08 16:15:12.175867","version":"2.2.3"}
14 changes: 14 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/fumiyatanaka/Work/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/fumiyatanaka/Work/FlutterDev/speech_recognition/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
19 changes: 11 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const languages = const [
const Language('Pусский', 'ru_RU'),
const Language('Italiano', 'it_IT'),
const Language('Español', 'es_ES'),
const Language('Japanese', 'ja_JP'),
];

class Language {
Expand All @@ -26,7 +27,7 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
SpeechRecognition _speech;
late SpeechRecognition _speech;

bool _speechRecognitionAvailable = false;
bool _isListening = false;
Expand All @@ -50,7 +51,7 @@ class _MyAppState extends State<MyApp> {
_speech.setCurrentLocaleHandler(onCurrentLocale);
_speech.setRecognitionStartedHandler(onRecognitionStarted);
_speech.setRecognitionResultHandler(onRecognitionResult);
_speech.setRecognitionCompleteHandler(onRecognitionComplete);
_speech.setRecognitionCompleteHandler((_) => onRecognitionComplete);
_speech.setErrorHandler(errorHandler);
_speech
.activate()
Expand Down Expand Up @@ -117,14 +118,16 @@ class _MyAppState extends State<MyApp> {
setState(() => selectedLang = lang);
}

Widget _buildButton({String label, VoidCallback onPressed}) => new Padding(
Widget _buildButton({required String label, VoidCallback? onPressed}) => new Padding(
padding: new EdgeInsets.all(12.0),
child: new RaisedButton(
color: Colors.cyan.shade600,
child: ElevatedButton(
onPressed: onPressed,
child: new Text(
label,
style: const TextStyle(color: Colors.white),
child: Container(
color: Colors.cyan.shade600,
child: new Text(
label,
style: const TextStyle(color: Colors.white),
),
),
));

Expand Down
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: speech_recognition_example
description: Demonstrates how to use the speech_recognition plugin.

environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
Expand Down
Loading