diff --git a/CHANGELOG.md b/CHANGELOG.md index b17db7a..16b36de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.5 + +- Fixed left button + ## 0.3.4 - Fixed audio recording that would start without permissions diff --git a/example/lib/media_picker.dart b/example/lib/media_picker.dart index a244f80..f6e0e95 100644 --- a/example/lib/media_picker.dart +++ b/example/lib/media_picker.dart @@ -104,9 +104,27 @@ class _MediaPickerExampleState extends ConsumerState { // iconText: "Record audio", // ), checkPageSettings: {'title': 'Share audio'}, - onComplete: (MediaResult result) { - Navigator.pop(context); - }, + onComplete: (MediaResult result) => + Navigator.pop(context), + inputStyling: AudioInputStyling( + leftButton: (_, __) => GestureDetector( + onTap: () async => Navigator.pop(context), + child: Container( + width: MediaQuery.of(context).size.width * 0.3, + height: 45, + decoration: BoxDecoration( + color: const Color(0xFFD8D8D8), + borderRadius: BorderRadius.circular(15), + ), + child: Center( + child: Text( + 'Back', + style: Theme.of(context).textTheme.button, + ), + ), + ), + ), + ), audioService: audioService, ), MediaPickerInputText( diff --git a/example/pubspec.lock b/example/pubspec.lock index c8a4b2d..399b38d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -146,7 +146,7 @@ packages: path: ".." relative: true source: path - version: "0.3.4" + version: "0.3.5" flutter_plugin_android_lifecycle: dependency: transitive description: diff --git a/lib/src/inputs/input_audio.dart b/lib/src/inputs/input_audio.dart index b69b9d8..c8903f2 100644 --- a/lib/src/inputs/input_audio.dart +++ b/lib/src/inputs/input_audio.dart @@ -160,7 +160,15 @@ class _RecorderState extends ConsumerState { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - widget.inputStyling.leftButton ?? const SizedBox(), + Expanded( + child: Center( + child: widget.inputStyling.leftButton?.call( + recording, + nextOnTap, + ) ?? + const SizedBox(), + ), + ), widget.inputStyling.playButton?.call( recording, playOnTap, @@ -351,7 +359,7 @@ class AudioInputStyling { final Widget Function(bool recording, Function onTap)? nextButton; /// leftButton is an extra button that can be filled in. - final Widget? leftButton; + final Widget Function(bool recording, Function onTap)? leftButton; } /// Generic clock class can be created and used to keep the time. diff --git a/pubspec.yaml b/pubspec.yaml index 8b907de..dd3cd4e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_media_picker description: A new Flutter package project. -version: 0.3.4 +version: 0.3.5 homepage: https://github.com/Iconica-Development/flutter_media_picker publish_to: "none"