import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class DefLayout extends StatelessWidget {
  Widget head;
  List<Widget> children;

  DefLayout({Key? key, required this.head, required this.children})
      : super(key: key);

  static double headHeight = 214.w;
  static double offset = 20.w;

  static Widget card(
      {required double top,
      required Widget child,
      double? height,
      EdgeInsetsGeometry? padding}) {
    final _border = 20.w;
    return Container(
      margin: EdgeInsets.only(top: top),
      padding: padding,
      height: height,
      clipBehavior: Clip.hardEdge,
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.vertical(top: Radius.circular(_border))),
      child:child,
      // ListView(
      //   children: [
      //     child,
      //   ],
      // )
    );
  }

  @override
  Widget build(BuildContext context) {
    final width = MediaQuery.of(context).size.width;

    return Stack(
      children: [
        SizedBox(
          width: width,
          height: headHeight,
          child:head,
        ),
        ...children
      ],
    );
  }
}