shootingButton method
The shooting button.
Implementation
Widget shootingButton(BoxConstraints constraints) {
const outerSize = Size.square(115);
const innerSize = Size.square(82);
return Listener(
behavior: HitTestBehavior.opaque,
onPointerDown: shouldPrepareForVideoRecording
? (_) => controller.prepareForVideoRecording()
: null,
onPointerUp: enableRecording ? recordDetectionCancel : null,
onPointerMove: enablePullToZoomInRecord
? (PointerMoveEvent e) => onShootingButtonMove(e, constraints)
: null,
child: InkWell(
borderRadius: maxBorderRadius,
onTap: !onlyEnableRecording ? takePicture : null,
onLongPress: enableRecording ? recordDetection : null,
child: SizedBox.fromSize(
size: outerSize,
child: Stack(
children: <Widget>[
Center(
child: AnimatedContainer(
duration: kThemeChangeDuration,
width: isShootingButtonAnimate
? outerSize.width
: innerSize.width,
height: isShootingButtonAnimate
? outerSize.height
: innerSize.height,
padding: EdgeInsets.all(isShootingButtonAnimate ? 41 : 11),
decoration: BoxDecoration(
color: theme.canvasColor.withOpacity(0.85),
shape: BoxShape.circle,
),
child: const DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
),
),
_initializeWrapper(
isInitialized: () =>
controller.value.isRecordingVideo && isRecordingRestricted,
builder: (_, __) => CircleProgressBar(
duration: maximumRecordingDuration!,
outerRadius: outerSize.width,
ringsWidth: 2.0,
),
),
],
),
),
),
);
}