cards static method

Widget cards(
  1. BuildContext context,
  2. List<Widget> children, {
  3. double radius = 24,
  4. double padding = 16,
  5. double outPadding = 0,
  6. int alpha = 22,
  7. bool useWhite = false,
  8. bool isAllPadding = true,
})

Implementation

static Widget cards(
  BuildContext context,
  List<Widget> children, {
  double radius = 24,
  double padding = 16,
  double outPadding = 0,
  int alpha = 22,
  bool useWhite = false,
  bool isAllPadding = true,
}) {
  return Padding(
    padding: isAllPadding ? EdgeInsets.all(outPadding) : EdgeInsets.symmetric(horizontal: outPadding),
    child: ClipRRect(
      borderRadius: BorderRadius.circular(radius),
      child: BackdropFilter(
        filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
        child: Container(
          decoration: BoxDecoration(
            color: (useWhite ? Colors.white : Colors.grey).withAlpha(alpha),
            borderRadius: BorderRadius.circular(radius),
            border: Border.all(color: Theme.of(context).colorScheme.outlineVariant),
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              SizedBox(height: padding),
              for (int i = 0; i < children.length; i++) ...[
                Padding(padding: EdgeInsets.symmetric(horizontal: padding), child: children[i]),
                if (i < children.length - 1) Divider(),
              ],
              SizedBox(height: padding),
            ],
          ),
        ),
      ),
    ),
  );
}