mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
a54ca799b9
* update rules of analysis_options.yaml. and solved all problems * refactor: fix remaining problems --------- Co-authored-by: Ushie <ushiekane@gmail.com>
37 lines
1,019 B
Dart
37 lines
1,019 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomCard extends StatelessWidget {
|
|
const CustomCard({
|
|
Key? key,
|
|
this.isFilled = true,
|
|
required this.child,
|
|
this.onTap,
|
|
this.padding,
|
|
this.backgroundColor,
|
|
}) : super(key: key);
|
|
final bool isFilled;
|
|
final Widget child;
|
|
final Function()? onTap;
|
|
final EdgeInsetsGeometry? padding;
|
|
final Color? backgroundColor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: isFilled ? MaterialType.card : MaterialType.transparency,
|
|
color: isFilled
|
|
? backgroundColor?.withOpacity(0.4) ??
|
|
Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.4)
|
|
: backgroundColor ?? Colors.transparent,
|
|
borderRadius: BorderRadius.circular(16),
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(16),
|
|
child: Padding(
|
|
padding: padding ?? const EdgeInsets.all(20.0),
|
|
child: child,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|