UnitRuler constructor

const UnitRuler({
  1. Key? key,
  2. required ValueChangedCallback onValueChanged,
  3. required double width,
  4. required ScaleUnit scaleUnit,
  5. required EdgeInsetsGeometry? scalePadding,
  6. required Alignment scaleAlignment,
  7. required Axis scrollDirection,
  8. required double scaleMarkerPositionTop,
  9. required double scaleMarkerPositionLeft,
  10. required double height,
  11. required String scaleIntervalText(
    1. int index,
    2. num rulerScaleValue
    ),
  12. required double scaleIntervalTextPosition,
  13. double scaleMargin = 0,
  14. List<ScaleIntervalStyle> scaleIntervalStyles = const [ScaleIntervalStyle(scale: 0, color: Color.fromARGB(255, 188, 194, 203), width: 2, height: 32), ScaleIntervalStyle(color: Color.fromARGB(255, 188, 194, 203), width: 1, height: 20)],
  15. TextStyle scaleIntervalTextStyle = const TextStyle(color: Color.fromARGB(255, 188, 194, 203), fontSize: 14),
  16. Widget? scaleMarker,
  17. Color backgroundColor = Colors.white,
  18. ScaleController? controller,
})

Creates an instance of the UnitRuler. This constructor initializes the ruler with default settings.

Implementation

const UnitRuler({
  super.key,
  required this.onValueChanged,
  required this.width,
  required this.scaleUnit,
  required this.scalePadding,
  required this.scaleAlignment,
  required this.scrollDirection,
  required this.scaleMarkerPositionTop,
  required this.scaleMarkerPositionLeft,
  required this.height,
  required this.scaleIntervalText,
  required this.scaleIntervalTextPosition,
  this.scaleMargin = 0,
  this.scaleIntervalStyles = const [
    ScaleIntervalStyle(
        scale: 0,
        color: Color.fromARGB(255, 188, 194, 203),
        width: 2,
        height: 32),
    ScaleIntervalStyle(
        color: Color.fromARGB(255, 188, 194, 203), width: 1, height: 20),
  ],
  this.scaleIntervalTextStyle = const TextStyle(
    color: Color.fromARGB(255, 188, 194, 203),
    fontSize: 14,
  ),
  this.scaleMarker,
  this.backgroundColor = Colors.white,
  this.controller,
});