box.dart 521 B

12345678910111213141516171819
  1. import 'package:flutter/material.dart';
  2. import 'decoration.dart';
  3. class BoxWidget extends StatelessWidget {
  4. final Widget body;
  5. final bool paddingAll;
  6. BoxWidget({@required this.body, this.paddingAll = true});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. margin: const EdgeInsets.fromLTRB(12.0, 6.0, 12.0, 6.0),
  11. padding: paddingAll ? const EdgeInsets.all(12.0) : const EdgeInsets.symmetric(horizontal: 12.0),
  12. decoration: circular(),
  13. child: body);
  14. }
  15. }