mirror of
https://github.com/chenasraf/wheel_spinner.git
synced 2026-05-17 17:48:00 +00:00
docs: update docs
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ build/
|
||||
ios/.generated/
|
||||
ios/Flutter/Generated.xcconfig
|
||||
ios/Runner/GeneratedPluginRegistrant.*
|
||||
doc/
|
||||
|
||||
29
README.md
29
README.md
@@ -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),
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// The main library for the wheel spinner.
|
||||
library wheel_spinner;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Reference in New Issue
Block a user