mirror of
https://github.com/Iconica-Development/flutter_media_picker.git
synced 2025-05-18 16:33:45 +02:00
Merge pull request #11 from Iconica-Development/fix/leftbutton
fix:left-button
This commit is contained in:
commit
19200f0fe7
2 changed files with 31 additions and 5 deletions
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue