Is there any way I can create a Flutter Widget, on which that widget will be an position absolute(in CSS), which inside that widget will be the Camera Preview?
I have created the widget, on which I can see it on bottom right side of the screen when I access the page, but when I add the CameraPreview plugin from Flutter, it makes it full screen.
What I need is an option to make it inApp preview on that bottom right widget of the page/screen that I have created.
the Square widget, is where I want to display the camera only.
import 'package:flutter/material.dart';
[![class CameraAppTest extends StatelessWidget {
static const routeName = '/videoRecordScreen';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('test'),
),
body: Container(
// width: 200,
alignment: Alignment.center,
// margin: EdgeInsets.all(24),
// padding: EdgeInsets.all(24),
decoration: BoxDecoration(),
// decoration: ,
child: Container(child: Demo()),
),
);
}
}
class Square extends StatelessWidget {
final color;
final size;
Square({this.color, this.size});
@override
Widget build(BuildContext context) {
return Container(
child: Icon(Icons.add),
);
}
}
class Demo extends StatelessWidget {
build(context) {
return Container(
margin: EdgeInsets.only(bottom: 20, right: 20),
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Stack(
children: \[
Align(
alignment: Alignment.bottomRight,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(20)),
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
border: Border.all(width: 10, color: Colors.black),
),
// margin: EdgeInsets.only(bottom: 30),
child: Square(),
),
),
),
// Square(),
\],
),
);
}
}][1]][1]
please check the image below on where i want to place the camera widget, on the bottom right corner. thank you, Milot.

