12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. class DefLayout extends StatelessWidget {
  4. Widget head;
  5. List<Widget> children;
  6. DefLayout({Key? key, required this.head, required this.children})
  7. : super(key: key);
  8. static double headHeight = 214.w;
  9. static double offset = 20.w;
  10. static Widget card(
  11. {required double top,
  12. required Widget child,
  13. double? height,
  14. EdgeInsetsGeometry? padding}) {
  15. final _border = 20.w;
  16. return Container(
  17. margin: EdgeInsets.only(top: top),
  18. padding: padding,
  19. height: height,
  20. clipBehavior: Clip.hardEdge,
  21. decoration: BoxDecoration(
  22. color: Colors.white,
  23. borderRadius: BorderRadius.vertical(top: Radius.circular(_border))),
  24. child:child,
  25. // ListView(
  26. // children: [
  27. // child,
  28. // ],
  29. // )
  30. );
  31. }
  32. @override
  33. Widget build(BuildContext context) {
  34. final width = MediaQuery.of(context).size.width;
  35. return Stack(
  36. children: [
  37. SizedBox(
  38. width: width,
  39. height: headHeight,
  40. child:head,
  41. ),
  42. ...children
  43. ],
  44. );
  45. }
  46. }