extension.dart 688 B

123456789101112131415161718192021222324252627
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/widgets.dart';
  3. export 'package:styled_widget/styled_widget.dart';
  4. extension FlowyStyledWidget on Widget {
  5. Widget bottomBorder({double width = 0.5, Color color = Colors.grey}) {
  6. return Container(
  7. decoration: BoxDecoration(
  8. border: Border(
  9. bottom: BorderSide(width: width, color: color),
  10. ),
  11. ),
  12. child: this,
  13. );
  14. }
  15. Widget topBorder({double width = 0.5, Color color = Colors.grey}) {
  16. return Container(
  17. decoration: BoxDecoration(
  18. border: Border(
  19. top: BorderSide(width: width, color: color),
  20. ),
  21. ),
  22. child: this,
  23. );
  24. }
  25. }