croppedVideoComponent method
Widget
croppedVideoComponent(
- dynamic child
)
Implementation
Widget croppedVideoComponent(child){
return Center(
child: Stack(
children: [
Positioned(
child: child
),
Positioned(
top: 0, left: 0,
child: Container(
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
),
width: currentLeftCrop.value,
height: currentTopCrop.value,
)
),
Positioned(
top: 0, left: currentLeftCrop.value,
child: Container(
width: currentWidthCrop.value,
height: currentTopCrop.value,
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
)
)
),
Positioned(
top: 0, left: currentLeftCrop.value + currentWidthCrop.value,
child: Container(
width: max(0, videoWidth.value - (currentLeftCrop.value + currentWidthCrop.value)),
height: currentHeightCrop.value + currentTopCrop.value,
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
),
)
),
Positioned(
top: currentTopCrop.value, left: 0,
child: Container(
width: currentLeftCrop.value,
height: max(0, videoHeight.value - (currentTopCrop.value)),
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
),
)
),
Positioned(
top: currentTopCrop.value + currentHeightCrop.value, left: currentLeftCrop.value,
child:Container(
width: currentWidthCrop.value,
height: max(0, videoHeight.value - (currentTopCrop.value + currentHeightCrop.value)),
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
),
)
),
Positioned(
top: currentTopCrop.value + currentHeightCrop.value, left: currentLeftCrop.value + currentWidthCrop.value,
child: Container(
width: max(0, videoWidth.value - (currentLeftCrop.value + currentWidthCrop.value)),
height: max(0, videoHeight.value - (currentTopCrop.value + currentHeightCrop.value)),
decoration: BoxDecoration(
border: Border.all(width: 0, color: Colors.white),
color: Colors.white
),
)
),
]
)
);
}