AwesomeBottomActions constructor
AwesomeBottomActions({
- Key? key,
- required CameraState state,
- Widget? left,
- Widget? right,
- Widget? captureButton,
- OnMediaTap? onMediaTap,
- EdgeInsets padding = const EdgeInsets.symmetric(vertical: 8),
Implementation
AwesomeBottomActions({
super.key,
required this.state,
Widget? left,
Widget? right,
Widget? captureButton,
OnMediaTap? onMediaTap,
this.padding = const EdgeInsets.symmetric(vertical: 8),
}) : captureButton = captureButton ??
AwesomeCaptureButton(
state: state,
),
left = left ??
(state is VideoRecordingCameraState
? AwesomePauseResumeButton(
state: state,
)
: Builder(builder: (context) {
final theme = AwesomeThemeProvider.of(context).theme;
return AwesomeCameraSwitchButton(
state: state,
theme: theme.copyWith(
buttonTheme: theme.buttonTheme.copyWith(
backgroundColor: Colors.white12,
),
),
);
})),
right = right ??
(state is VideoRecordingCameraState
? const SizedBox(width: 48)
: StreamBuilder<MediaCapture?>(
stream: state.captureState$,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const SizedBox(width: 60, height: 60);
}
return SizedBox(
width: 60,
child: AwesomeMediaPreview(
mediaCapture: snapshot.requireData,
onMediaTap: onMediaTap,
),
);
},
));