mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
28 lines
666 B
Dart
28 lines
666 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
Widget videoProgressIndicator(double progress) => ClipRect(
|
|
clipper: ProgressClipper(),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.only(
|
|
bottomLeft: Radius.circular(12),
|
|
bottomRight: Radius.circular(12),
|
|
),
|
|
child: LinearProgressIndicator(
|
|
minHeight: 12,
|
|
value: progress,
|
|
),
|
|
),
|
|
);
|
|
|
|
class ProgressClipper extends CustomClipper<Rect> {
|
|
@override
|
|
Rect getClip(Size size) {
|
|
return Rect.fromLTWH(0, 8, size.width, size.height - 8);
|
|
}
|
|
|
|
@override
|
|
bool shouldReclip(CustomClipper<Rect> oldClipper) {
|
|
return false;
|
|
}
|
|
}
|