Skip to content

Commit

Permalink
version 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Azmoud committed Apr 4, 2019
1 parent 1df06ce commit 7978fec
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* `selectByTap` feature added
* some options ( values, max, min, step, ... ) can be updated by setState

## [2.3.0] - 03/30/2019
## [2.3.1] - 03/30/2019

* removed TouchZone
* `leftInactiveTrackBar` and `rightInactiveTrackBar` changed to `inactiveTrackBar`
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(Flutter Xlider) A material design slider and range slider, horizontal and vertical, with rtl support and lots of options and customizations for flutter

**Version 2.3.0 and above, will break functionality of older versions**
**Version 2.3.1 and above, will break functionality of older versions**

## Get Started

Expand Down Expand Up @@ -137,7 +137,7 @@ FlutterSlider(
trackBar: FlutterSliderTrackBar(
activeTrackBarColor: Colors.redAccent,
activeTrackBarHeight: 5,
leftInactiveTrackBarColor: Colors.greenAccent.withOpacity(0.5),
inactiveTrackBarColor: Colors.greenAccent.withOpacity(0.5),
),
...
)
Expand Down Expand Up @@ -360,13 +360,13 @@ FlutterSlider(
)
```

To see the touchable area for handlers you set `displayTestTouchZone` to true and test your slider
To see the touchable area for handlers you set `visibleTouchArea` to true and test your slider


```dart
FlutterSlider(
...
displayTestTouchZone: true,
visibleTouchArea: true,
...
)
```
Expand Down
2 changes: 1 addition & 1 deletion example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class _MyHomePageState extends State<MyHomePage> {
rangeSlider: true,
max: 100,
min: 0,
displayTestTouchZone: true,
visibleTouchArea: true,
onDragging: (handlerIndex, lowerValue, upperValue) {
_lowerValue = lowerValue;
_upperValue = upperValue;
Expand Down
39 changes: 27 additions & 12 deletions lib/flutter_xlider.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* *
* * A material design slider and range slider with rtl support and lots of options and customizations for flutter
* * Written by Ali Azmoude <ali.azmoude@gmail.com>
* *
* *
* *
* * When I wrote this, only God and I understood what I was doing.
* * Now, God only knows "Karl Weierstrass"
* */

import 'package:flutter/material.dart';
import 'package:intl/intl.dart' as intl;
import 'dart:core';
Expand Down Expand Up @@ -28,7 +39,7 @@ class FlutterSlider extends StatefulWidget {
final List<FlutterSliderIgnoreSteps> ignoreSteps;
final bool disabled;
final double touchSize;
final bool displayTestTouchZone;
final bool visibleTouchArea;
final double minimumDistance;
final double maximumDistance;
final FlutterSliderHandlerAnimation handlerAnimation;
Expand All @@ -55,15 +66,16 @@ class FlutterSlider extends StatefulWidget {
this.ignoreSteps = const [],
this.disabled = false,
this.touchSize,
this.displayTestTouchZone = false,
this.visibleTouchArea = false,
this.minimumDistance = 0,
this.maximumDistance = 0,
this.tooltip,
this.trackBar = const FlutterSliderTrackBar(),
this.handlerAnimation = const FlutterSliderHandlerAnimation(),
this.selectByTap = true,
this.step = 1})
: assert(touchSize == null || (touchSize != null && (touchSize >= 10 && touchSize <= 100))),
: assert(touchSize == null ||
(touchSize != null && (touchSize >= 10 && touchSize <= 100))),
assert(values != null),
assert(min != null && max != null && min <= max),
assert(handlerAnimation != null),
Expand Down Expand Up @@ -471,7 +483,7 @@ class _FlutterSliderState extends State<FlutterSlider>
rightHandler = _MakeHandler(
animation: _rightHandlerScaleAnimation,
id: rightHandlerKey,
displayTestTouchZone: widget.displayTestTouchZone,
visibleTouchArea: widget.visibleTouchArea,
handlerData: tmpInputRightHandler ??
FlutterSliderHandler(
icon: Icon(
Expand Down Expand Up @@ -502,7 +514,7 @@ class _FlutterSliderState extends State<FlutterSlider>
leftHandler = _MakeHandler(
animation: _leftHandlerScaleAnimation,
id: leftHandlerKey,
displayTestTouchZone: widget.displayTestTouchZone,
visibleTouchArea: widget.visibleTouchArea,
handlerData: tmpInputHandler ??
FlutterSliderHandler(icon: Icon(hIcon, color: Colors.black45)),
width: _handlersWidth,
Expand Down Expand Up @@ -1136,7 +1148,7 @@ class _FlutterSliderState extends State<FlutterSlider>
height = widget.trackBar.inactiveTrackBarHeight;
} else {
right = 0;
height = _containerHeight;
height = _containerHeightWithoutPadding;
top = _handlersPadding;
width = widget.trackBar.inactiveTrackBarHeight;
}
Expand Down Expand Up @@ -1277,22 +1289,22 @@ class _MakeHandler extends StatelessWidget {
final double height;
final GlobalKey id;
final FlutterSliderHandler handlerData;
final bool displayTestTouchZone;
final bool visibleTouchArea;
final Animation animation;
final Axis axis;

_MakeHandler(
{this.id,
this.handlerData,
this.displayTestTouchZone,
this.visibleTouchArea,
this.width,
this.height,
this.animation,
this.axis});

@override
Widget build(BuildContext context) {
double touchOpacity = (displayTestTouchZone == true) ? 1 : 0;
double touchOpacity = (visibleTouchArea == true) ? 1 : 0;

double localWidth, localHeight;
if (axis == Axis.vertical) localHeight = height + (_touchSize * 2);
Expand Down Expand Up @@ -1416,9 +1428,12 @@ class FlutterSliderTrackBar {
this.inactiveDisabledTrackBarColor = const Color(0xffe5e5e5),
this.activeTrackBarHeight = 3.5,
this.inactiveTrackBarHeight = 3,
}) : assert(inactiveTrackBarColor != null && activeTrackBarColor != null),
assert(inactiveTrackBarHeight != null && inactiveTrackBarHeight > 0),
assert(activeTrackBarHeight != null && activeTrackBarHeight > 0),
}) : assert(activeTrackBarHeight != null &&
activeTrackBarHeight > 0 &&
inactiveTrackBarHeight != null &&
inactiveTrackBarHeight > 0 &&
activeTrackBarHeight >= inactiveTrackBarHeight),
assert(inactiveTrackBarColor != null && activeTrackBarColor != null),
assert(activeDisabledTrackBarColor != null &&
inactiveDisabledTrackBarColor != null);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_xlider
description: (Flutter Xlider) A material design slider and range slider, horizontal and vertical, with RTL support and lots of options and customizations for flutter
version: 2.3.0
version: 2.3.1
author: Ali Azmoude <ali.azmoude@gmail.com>
homepage: https://github.com/Ali-Azmoud/flutter_xlider

Expand Down

0 comments on commit 7978fec

Please sign in to comment.