From fecb9d9be70958ade0036cc70f8350ee0db3f007 Mon Sep 17 00:00:00 2001 From: Sun Date: Sat, 3 Jul 2021 21:15:25 +0800 Subject: [PATCH] upgrade flutter --- core/pubspec.lock | 10 +++--- lib/widgets/audio_recorder.dart | 9 ++--- pubspec.lock | 62 ++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/core/pubspec.lock b/core/pubspec.lock index f644e6e..2519f8b 100644 --- a/core/pubspec.lock +++ b/core/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.7.0" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: @@ -73,7 +73,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" path: dependency: transitive description: @@ -127,7 +127,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.4.1" typed_data: dependency: transitive description: @@ -143,5 +143,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=2.12.0-0.0 <3.0.0" + dart: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" diff --git a/lib/widgets/audio_recorder.dart b/lib/widgets/audio_recorder.dart index bb56527..1c51a7e 100644 --- a/lib/widgets/audio_recorder.dart +++ b/lib/widgets/audio_recorder.dart @@ -19,6 +19,7 @@ class AudioRecorder extends StatefulWidget { class _AudioRecorderState extends State { final player = AudioPlayer(); + final _record = Record(); bool _isRecording = false; bool _isPlaying = false; @@ -55,10 +56,10 @@ class _AudioRecorderState extends State { Future _start() async { try { - if (await Record.hasPermission()) { - await Record.start(path: widget.path); + if (await _record.hasPermission()) { + await _record.start(path: widget.path); - bool isRecording = await Record.isRecording(); + bool isRecording = await _record.isRecording(); setState(() { _isRecording = isRecording; _remainingDuration = 0; @@ -73,7 +74,7 @@ class _AudioRecorderState extends State { Future _stop() async { _timer?.cancel(); - await Record.stop(); + await _record.stop(); print(widget.path); setState(() { diff --git a/pubspec.lock b/pubspec.lock index f59048e..3a1547f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,7 +28,7 @@ packages: name: audio_session url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.1.5" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: @@ -77,7 +77,7 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" crop: dependency: "direct main" description: @@ -105,42 +105,42 @@ packages: name: device_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.0" device_info_plus_web: dependency: transitive description: name: device_info_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" esse_core: dependency: "direct main" description: @@ -168,14 +168,14 @@ packages: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.1" + version: "6.1.2" file_picker: dependency: "direct main" description: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "3.0.2+2" + version: "3.0.3" file_selector: dependency: "direct main" description: @@ -309,7 +309,7 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.8.0+1" + version: "0.8.1+3" image_picker_for_web: dependency: transitive description: @@ -349,21 +349,21 @@ packages: name: just_audio url: "https://pub.dartlang.org" source: hosted - version: "0.7.5" + version: "0.8.0" just_audio_platform_interface: dependency: transitive description: name: just_audio_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" just_audio_web: dependency: transitive description: name: just_audio_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1" + version: "0.3.2" matcher: dependency: transitive description: @@ -440,7 +440,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.11.1" percent_indicator: dependency: "direct main" description: @@ -454,14 +454,14 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.0.1" + version: "8.1.2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.5.1" + version: "3.6.0" petitparser: dependency: transitive description: @@ -503,7 +503,7 @@ packages: name: qr url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" qr_code_scanner: dependency: "direct main" description: @@ -524,7 +524,21 @@ packages: name: record url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" + record_platform_interface: + dependency: transitive + description: + name: record_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" + record_web: + dependency: transitive + description: + name: record_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" rxdart: dependency: transitive description: @@ -627,7 +641,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.1" typed_data: dependency: transitive description: @@ -648,7 +662,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.6" + version: "6.0.8" url_launcher_linux: dependency: transitive description: @@ -704,7 +718,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.1.0" web_socket_channel: dependency: "direct main" description: @@ -725,7 +739,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.2.4" xdg_directories: dependency: transitive description: