mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-06 18:25:11 +08:00
33 lines
679 B
Dart
33 lines
679 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SmoothClipRRect extends StatelessWidget {
|
|
const SmoothClipRRect({
|
|
required this.child,
|
|
this.enabled = true,
|
|
this.borderRadius = BorderRadius.zero,
|
|
this.clipBehavior = Clip.antiAlias,
|
|
this.clipper,
|
|
super.key,
|
|
});
|
|
|
|
final Widget child;
|
|
final bool enabled;
|
|
final BorderRadius borderRadius;
|
|
final Clip clipBehavior;
|
|
final CustomClipper<RRect>? clipper;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (!enabled) {
|
|
return child;
|
|
}
|
|
|
|
return ClipRRect(
|
|
borderRadius: borderRadius,
|
|
clipBehavior: clipBehavior,
|
|
clipper: clipper,
|
|
child: child,
|
|
);
|
|
}
|
|
}
|