Skip to content

the method '+' was called on null - with FlutterSliderTooltipPositionOffset(bottom #99

@jlnrrg

Description

@jlnrrg

I noticed an error, which fires when I use FlutterSliderTooltipPositionOffset(bottom: 10)
It is not time critical, as you can work around it by using FlutterSliderTooltipPositionOffset(top: -10) with negative values, just wanted to let you know.

This is my FlutterSlider build:


final ValueNotifier<double> minValue = useState(0); // comes from package flutter_hooks
final ValueNotifier<double> maxValue = useState(120);

return FlutterSlider(
            values: <double>[minValue.value, maxValue.value],
            rangeSlider: true,
            min: 0, //minValue.value,
            max: 120, //maxValue.value,
            tooltip: FlutterSliderTooltip(
                alwaysShowTooltip: true,
                positionOffset:
                    FlutterSliderTooltipPositionOffset(bottom: 10.0),
                custom: (dynamic value) {
                  if (value is double) {
                    return Container(
                        padding: const EdgeInsets.all(8),
                        decoration: BoxDecoration(
                            border:
                                Border.all(color: Colors.black12, width: 0.5),
                            color: const Color(0xffffffff)),
                        child: Text(value.toInt().toString()));
                  }

                  return Text(value.toString());
                }),
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions