You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7KB

  1. // import 'package:flutter/material.dart';
  2. // class RoundedRectIndicator extends Decoration {
  3. // final BoxPainter _painter;
  4. // RoundedRectIndicator({
  5. // required Color color,
  6. // required double radius,
  7. // double padding = 0.0,
  8. // double weight = 3.0,
  9. // }) : _painter = _RectPainter(color, radius, padding, weight);
  10. // @override
  11. // BoxPainter createBoxPainter([VoidCallback onChanged]) {
  12. // // TODO: implement createBoxPainter
  13. // throw UnimplementedError();
  14. // }
  15. // // @override
  16. // // BoxPainter createBoxPainter([onChanged]) {
  17. // // return _painter;
  18. // // }
  19. // }
  20. // class _RectPainter extends BoxPainter {
  21. // final Paint _paint;
  22. // final double radius;
  23. // final double padding;
  24. // final double weight;
  25. // final indicatorPaddingBottom = 4.0;
  26. // _RectPainter(Color color, this.radius, this.padding, this.weight)
  27. // : _paint = Paint()
  28. // ..color = color
  29. // ..isAntiAlias = true;
  30. // @override
  31. // void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
  32. // var width = cfg.size.width;
  33. // var height = cfg.size.height;
  34. // var left = 0.0;
  35. // var top = height - indicatorPaddingBottom;
  36. // var right = width;
  37. // var bottom = height - weight - indicatorPaddingBottom;
  38. // //calculate offset
  39. // left = left + offset.dx + padding;
  40. // right = right + offset.dx - padding;
  41. // var rect = RRect.fromLTRBAndCorners(left, top, right, bottom,
  42. // topLeft: Radius.circular(radius),
  43. // bottomLeft: Radius.circular(radius),
  44. // bottomRight: Radius.circular(radius),
  45. // topRight: Radius.circular(radius));
  46. // canvas.drawRRect(rect, _paint);
  47. // }
  48. // }