box.dart 544 B

123456789101112131415161718192021
  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
  12. ? const EdgeInsets.all(12.0)
  13. : const EdgeInsets.symmetric(horizontal: 12.0),
  14. decoration: circular(),
  15. child: body);
  16. }
  17. }