Skip to content

Commit

Permalink
version 3.4.0-dev.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ali.azmoude@gmail.com authored and ali.azmoude@gmail.com committed May 7, 2020
1 parent 011b0e4 commit 20e4443
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 208 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,24 @@
* tap and slide bug fixed
* tap and slide event call bug fixed
* dragging event bug fixed

## [3.3.2-dev.1] - 05/04/2020

* update widget bug fixed

## [3.4.0-dev.1] - 05/04/2020

* rangeStep feature added
* tooltip format bug fixed

## [3.4.0-dev.2] - 05/04/2020

* tooltip custom bug fixed

## [3.4.0-dev.3] - 05/07/2020

* handler opacity feature added
* hatchmark lines alignment feature added
* hatchmark lines and labels are separated and rewritten
* values setState bug fixed
* step is changed from double to `FlutterSliderStep` class
54 changes: 39 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

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

**Version 3.0.0 and above, breaks functionality of older versions**
**Since version 3.0.0, Intl dependency is removed**

**You can find more customized examples in wiki page**

## Get Started

Expand Down Expand Up @@ -373,11 +371,33 @@ The amount the slider changes on movement can be set using `step` option
```dart
FlutterSlider(
...
step: 100,
step: FlutterSliderStep(step: 1),
...
)
```


### Range Step

If you want to have a non-linear slider with different steps, simply use `rangeStep` feature.

```dart
FlutterSlider(
...
step: FlutterSliderStep(
step: 1, // default
isPercentRange: true, // ranges are percents, 0% to 20% and so on... . default is true
rangeList: [
FlutterSliderRangeStep(from: 0, to: 20, step: 0.5),
FlutterSliderRangeStep(from: 20, to: 100, step: 10),
]
),
...
)
```

![](images/range-step.gif)

### Ignore Steps

If your configurations requires that some steps are not available, you can use `ignoreSteps` property.
Expand Down Expand Up @@ -479,20 +499,27 @@ FlutterSlider(
You can display a `Hatch Mark` underneath or beside of your slider based on `axis`. In order to display hatch mark you must
use `FlutterSliderHatchMark` class which has following properties:

1. `distanceFromTrackBar`: The distance between slider and hatch mark
2. `density`: The amount of lines per percent. 1 is default. any number less or more than 1 will decrease and increase lines respectively
3. `labels`: If you want to display some label or text at certain percent in your hatch mark, you can use `labels`
4. `smallLine`: The widget of small lines in hatch mark
5. `bigLine`: The widget of big lines in hatch mark
6. `labelBox`: The widget of label box
1. `linesDistanceFromTrackBar`: The distance of lines from slider. can be negative
2. `bigLine`: The widget of big lines in hatch mark
3. `smallLine`: The widget of small lines in hatch mark
4. `linesAlignment`: the direct of lines, `right` or `left` which works as `top` or `bottom` on horizontal slider
5. `density`: The amount of lines per percent. 1 is default. any number less or more than 1 will decrease and increase lines respectively
6. `displayLines`: to display lines. by default is `false` for the sake of optimization

7. `labels`: If you want to display some label or text at certain percent in your hatch mark, you can use `labels`
8. `labelBox`: The widget of label box, however, you can define a widget for each label and have it's own style
9. `labelsDistanceFromTrackBar`: The distance of labels from slider. can be negative

10. `disabled`: to disabled the whole hatchmark ( hide )

**labels alignment is center**

Here is an example:

```dart
FlutterSlider(
...
hatchMark: FlutterSliderHatchMark(
distanceFromTrackBar: 10,
density: 0.5, // means 50 lines, from 0 to 100 percent
labels: [
FlutterSliderHatchMarkLabel(percent: 0, label: Text('Start')),
Expand Down Expand Up @@ -621,9 +648,6 @@ FlutterSlider(
...
)
```
**If you use `selectByTap`, then only `onDragStarted` and `onDragCompleted` will fire.**




## Working with Dates
Expand All @@ -639,7 +663,7 @@ FlutterSlider(
],
min: new DateTime(2019,1,1,0,0,0).millisecondsSinceEpoch.toDouble(), // start date : 2019-01-01
max: new DateTime(2020,1,1,0,0,0).millisecondsSinceEpoch.toDouble(), // finish date : 2020-01-01
step: 86400, // 1 day
step: FlutterSliderStep(step: 86400), // 1 day
...
...
Expand Down
10 changes: 5 additions & 5 deletions example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
max: 25000,
min: 0,
step: 100,
step: FlutterSliderStep(step: 100),

jump: true,

Expand Down Expand Up @@ -130,7 +130,7 @@ class _MyHomePageState extends State<MyHomePage> {
// ],
max: 25000,
min: 0,
step: 100,
step: FlutterSliderStep(step: 100),
jump: true,
trackBar: FlutterSliderTrackBar(
inactiveTrackBarHeight: 2,
Expand Down Expand Up @@ -173,7 +173,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
max: 2000000000,
min: 0,
step: 20,
step: FlutterSliderStep(step: 20),
jump: true,
onDragging: (handlerIndex, lowerValue, upperValue) {
_lowerValue = lowerValue;
Expand Down Expand Up @@ -239,7 +239,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: FlutterSlider(
handlerWidth: 15,
hatchMark: FlutterSliderHatchMark(
distanceFromTrackBar: 5,
linesDistanceFromTrackBar: 5,
density: 0.5,
labels: [
FlutterSliderHatchMarkLabel(percent: 0, label: Text('Start')),
Expand Down Expand Up @@ -278,7 +278,7 @@ class _MyHomePageState extends State<MyHomePage> {
max: 100000,
touchSize: 15,
rangeSlider: true,
step: 1000,
step: FlutterSliderStep(step: 1000),
onDragging: (handlerIndex, lowerValue, upperValue) {},
),
),
Expand Down
Binary file added images/range-step.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 20e4443

Please sign in to comment.