NumberLine constructor
NumberLine({
- Color color = LIGHT_GREY,
- double xMin = -FRAME_X_RADIUS,
- double xMax = FRAME_X_RADIUS,
- double unitSize = 1,
- bool includeTicks = true,
- double tickSize = 0.1,
- double tickFrequency = 1,
- double? leftmostTick,
- List<
double> numbersWithElongatedTicks = const [0], - bool includeNumbers = false,
- dynamic numbersToShow,
- double longTickMultiple = 2,
- double numberAtCenter = 0,
- double numberScaleVal = 0.75,
- Vector3 labelDirection = DOWN,
- double lineToNumberBuff = MED_SMALL_BUFFER,
- bool includeTip = true,
- double tipWidth = 0.25,
- double tipHeight = 0.25,
- dynamic decimalNumberConfig,
- bool excludeZeroFromDefaultNumbers = false,
Implementation
NumberLine({
Color color = LIGHT_GREY,
this.xMin = -FRAME_X_RADIUS,
this.xMax = FRAME_X_RADIUS,
this.unitSize = 1,
this.includeTicks = true,
this.tickSize = 0.1,
this.tickFrequency = 1,
this.leftmostTick,
this.numbersWithElongatedTicks = const [0],
this.includeNumbers = false,
this.numbersToShow,
this.longTickMultiple = 2,
this.numberAtCenter = 0,
this.numberScaleVal = 0.75,
this.labelDirection = DOWN,
this.lineToNumberBuff = MED_SMALL_BUFFER,
this.includeTip = true,
this.tipWidth = 0.25,
this.tipHeight = 0.25,
this.decimalNumberConfig,
this.excludeZeroFromDefaultNumbers = false,
}) : super(color: color) {
tipLength = max(tipWidth, tipHeight);
if (includeTip) {
xMax += tipLength / 2;
}
start = RIGHT * unitSize * xMin;
end = RIGHT * unitSize * xMax;
putStartAndEndOn(start, end);
shift(numberToPoint(numberAtCenter) * -1);
initLeftmostTick();
if (includeTip) {
addTip(tipLength: tipLength);
}
if (includeTicks) {
addTickMarks();
}
if (includeNumbers) {
// TODO addNumbers();
}
}