Merge pull request #11 from Iconica-Development/fix/leftbutton

fix:left-button
This commit is contained in:
Gorter-dev 2023-03-27 10:44:58 +02:00 committed by GitHub
commit 19200f0fe7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 5 deletions

View file

@ -104,9 +104,27 @@ class _MediaPickerExampleState extends ConsumerState<MediaPickerExample> {
// 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(

View file

@ -160,7 +160,15 @@ class _RecorderState extends ConsumerState<Recorder> {
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.