docs: update docs

This commit is contained in:
Chen Asraf
2022-08-08 02:37:49 +03:00
parent bf752b0281
commit 4d08e065b3
4 changed files with 28 additions and 5 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ build/
ios/.generated/
ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
doc/

View File

@@ -1,8 +1,29 @@
# wheel_spinner
WheelSpinner provides you with a simple number spinner that resembles a wheel, knob, or more specifically
pitch bender knobs. It allows you to update a single `double` value.
WheelSpinner provides you with a simple number spinner that resembles a wheel, knob, or more
specifically pitch bender knobs. It allows you to update a single `double` value with a finger fling
or drag as in the example below.
## Getting Started
<img src="https://casraf.blog/assets/images/wheel-spinner-tutorial/scr04.gif" width="300px" />
<img src="https://casraf.blog/assets/images/wheel-spinner-tutorial/scr05.gif" width="300px" />
- TODO
## How to use
Simply import the package, and use the exposed `WheelSpinner` widget.
See all the individual parameters for more details on theme and display customization, as well as
event handlers. Here is a simple usage example:
```dart
Widget build(BuildContext context) {
return WheelSpinner(
value: value,
width: width,
min: 0.0,
max: 100.0,
borderRadius: borderRadius,
minMaxLabelBuilder: (value) => value,
onSlideUpdate: (val) => onChange(value),
);
}
```

View File

@@ -1,5 +1,5 @@
import 'dart:math';
/// clamps [value] to [min] and [max]
/// clamps [number] to [low] and [high]
double clamp<T extends num>(T number, T low, T high) =>
max(low * 1.0, min(number * 1.0, high * 1.0));

View File

@@ -1,3 +1,4 @@
/// The main library for the wheel spinner.
library wheel_spinner;
import 'package:flutter/material.dart';