buildPlayPause method

Widget buildPlayPause(
  1. VoidCallback onTap
)

Implementation

Widget buildPlayPause(VoidCallback onTap) {
  final controller = context.watch<BetterVideoPlayerController>();

  return CupertinoButton(
    padding: EdgeInsets.zero,
    onPressed: onTap,
    child: controller.value.videoPlayerController?.value.isPlaying ?? false
        ? SizedBox(
            width: 44,
            height: 44,
            child: const Icon(
              Icons.pause,
              color: Colors.white,
            ),
          )
        : SizedBox(
            width: 44,
            height: 44,
            child: const Icon(
              Icons.play_arrow,
              color: Colors.white,
            ),
          ),
  );
}