Hibok
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

33 wiersze
1.0 KiB

  1. import 'package:flutter/material.dart';
  2. class MySeparator extends StatelessWidget {
  3. final double height;
  4. final Color color;
  5. const MySeparator({this.height = 1.6, this.color = Colors.black});
  6. @override
  7. Widget build(BuildContext context) {
  8. return Container(child: RotatedBox(child: LayoutBuilder(
  9. builder: (BuildContext context, BoxConstraints constraints) {
  10. final boxWidth = constraints.constrainWidth();
  11. final dashWidth = height;
  12. final dashHeight = 1.5;
  13. final dashCount = (boxWidth / (2 * dashWidth)).floor();
  14. return Flex(
  15. children: List.generate(dashCount, (_) {
  16. return SizedBox(
  17. width: dashWidth,
  18. height: dashHeight,
  19. child: DecoratedBox(
  20. decoration: BoxDecoration(color: color),
  21. ),
  22. );
  23. }),
  24. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  25. direction: Axis.horizontal,
  26. );
  27. },
  28. ),quarterTurns: 1,),height: 26,);
  29. }
  30. }