mirror of
https://github.com/Iconica-Development/flutter_media_picker.git
synced 2025-05-19 00:43:45 +02:00
fix:left-button
This commit is contained in:
parent
cf6516bf25
commit
b17be9cebb
2 changed files with 31 additions and 5 deletions
|
@ -104,9 +104,27 @@ class _MediaPickerExampleState extends ConsumerState<MediaPickerExample> {
|
||||||
// iconText: "Record audio",
|
// iconText: "Record audio",
|
||||||
// ),
|
// ),
|
||||||
checkPageSettings: {'title': 'Share audio'},
|
checkPageSettings: {'title': 'Share audio'},
|
||||||
onComplete: (MediaResult result) {
|
onComplete: (MediaResult result) =>
|
||||||
Navigator.pop(context);
|
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,
|
audioService: audioService,
|
||||||
),
|
),
|
||||||
MediaPickerInputText(
|
MediaPickerInputText(
|
||||||
|
|
|
@ -160,7 +160,15 @@ class _RecorderState extends ConsumerState<Recorder> {
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
widget.inputStyling.leftButton ?? const SizedBox(),
|
Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: widget.inputStyling.leftButton?.call(
|
||||||
|
recording,
|
||||||
|
nextOnTap,
|
||||||
|
) ??
|
||||||
|
const SizedBox(),
|
||||||
|
),
|
||||||
|
),
|
||||||
widget.inputStyling.playButton?.call(
|
widget.inputStyling.playButton?.call(
|
||||||
recording,
|
recording,
|
||||||
playOnTap,
|
playOnTap,
|
||||||
|
@ -351,7 +359,7 @@ class AudioInputStyling {
|
||||||
final Widget Function(bool recording, Function onTap)? nextButton;
|
final Widget Function(bool recording, Function onTap)? nextButton;
|
||||||
|
|
||||||
/// leftButton is an extra button that can be filled in.
|
/// 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.
|
/// Generic clock class can be created and used to keep the time.
|
||||||
|
|
Loading…
Reference in a new issue