You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
875 B
Dart
38 lines
875 B
Dart
4 years ago
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class ClippedVideo extends StatefulWidget {
|
||
|
final double width;
|
||
|
final double height;
|
||
|
final Widget child;
|
||
|
|
||
|
const ClippedVideo({
|
||
|
Key key,
|
||
|
@required this.width,
|
||
|
@required this.height,
|
||
|
@required this.child,
|
||
|
}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
_ClippedVideoState createState() => _ClippedVideoState();
|
||
|
}
|
||
|
|
||
|
class _ClippedVideoState extends State<ClippedVideo> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
width: widget.width,
|
||
|
height: widget.height,
|
||
|
decoration: BoxDecoration(
|
||
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||
|
border: Border.all(
|
||
|
color: Colors.white24,
|
||
|
),
|
||
|
),
|
||
|
child: ClipRRect(
|
||
|
child: widget.child,
|
||
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|