PictureInPictureConfig constructor

PictureInPictureConfig({
  1. Offset startingPosition = const Offset(20, 20),
  2. bool isDraggable = true,
  3. required Sensor sensor,
  4. PictureInPictureBuilder? pictureInPictureBuilder,
  5. VoidCallback? onTap,
})

Implementation

PictureInPictureConfig({
  this.startingPosition = const Offset(20, 20),
  this.isDraggable = true,
  required this.sensor,
  PictureInPictureBuilder? pictureInPictureBuilder,
  this.onTap,
}) : pictureInPictureBuilder = pictureInPictureBuilder ??
          ((preview, aspectRatio) {
            return Container(
                decoration: BoxDecoration(
                  color: Colors.transparent,
                  border: Border.all(color: Colors.white60, width: 3),
                  borderRadius: BorderRadius.circular(23),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.15),
                      spreadRadius: 10,
                      blurRadius: 20,
                      offset: const Offset(0, 0),
                    ),
                  ],
                ),
                child: Stack(
                  children: [
                    ClipRRect(
                      borderRadius: BorderRadius.circular(20),
                      child: SizedBox(
                        // TODO: set size in config
                        height: 200,
                        child: preview,
                        // child: frontPreviewTexture,
                      ),
                    ),
                    Text("${sensor.position}"),
                  ],
                ));
          });