Ejemplo n.º 1
0
 public _RangeSliderRenderObjectWidget(
     Key key                                  = null,
     RangeValues values                       = null,
     int?divisions                            = null,
     RangeLabels labels                       = null,
     SliderThemeData sliderTheme              = null,
     float textScaleFactor                    = 0f,
     ValueChanged <RangeValues> onChanged     = null,
     ValueChanged <RangeValues> onChangeStart = null,
     ValueChanged <RangeValues> onChangeEnd   = null,
     _RangeSliderState state                  = null) : base(key: key)
 {
     this.values          = values;
     this.divisions       = divisions;
     this.labels          = labels;
     this.sliderTheme     = sliderTheme;
     this.textScaleFactor = textScaleFactor;
     this.onChanged       = onChanged;
     this.onChangeStart   = onChangeStart;
     this.onChangeEnd     = onChangeEnd;
     this.state           = state;
 }
Ejemplo n.º 2
0
        public _RenderRangeSlider(
            RangeValues values,
            int?divisions,
            RangeLabels labels,
            SliderThemeData sliderTheme,
            ThemeData theme,
            float textScaleFactor,
            RuntimePlatform platform,
            ValueChanged <RangeValues> onChanged,
            ValueChanged <RangeValues> onChangeStart,
            ValueChanged <RangeValues> onChangeEnd,
            _RangeSliderState state,
            TextDirection?textDirection)
        {
            D.assert(values != null);
            D.assert(values.start >= 0.0 && values.start <= 1.0);
            D.assert(values.end >= 0.0 && values.end <= 1.0);
            D.assert(state != null);
            D.assert(textDirection != null);

            this.onChangeStart = onChangeStart;
            this.onChangeEnd   = onChangeEnd;

            _platform        = platform;
            _labels          = labels;
            _values          = values;
            _divisions       = divisions;
            _sliderTheme     = sliderTheme;
            _theme           = theme;
            _textScaleFactor = textScaleFactor;
            _onChanged       = onChanged;
            _state           = state;
            _textDirection   = textDirection;

            _updateLabelPainters();

            GestureArenaTeam team = new GestureArenaTeam();

            _drag          = new HorizontalDragGestureRecognizer();
            _drag.team     = team;
            _drag.onStart  = _handleDragStart;
            _drag.onUpdate = _handleDragUpdate;
            _drag.onEnd    = _handleDragEnd;
            _drag.onCancel = _handleDragCancel;

            _tap             = new TapGestureRecognizer();
            _tap.team        = team;
            _tap.onTapDown   = _handleTapDown;
            _tap.onTapUp     = _handleTapUp;
            _tap.onTapCancel = _handleTapCancel;

            _overlayAnimation = new CurvedAnimation(
                parent: _state.overlayController,
                curve: Curves.fastOutSlowIn
                );
            _valueIndicatorAnimation = new CurvedAnimation(
                parent: _state.valueIndicatorController,
                curve: Curves.fastOutSlowIn
                );
            _enableAnimation = new CurvedAnimation(
                parent: _state.enableController,
                curve: Curves.easeInOut
                );
        }