https://github.com/joakimunge/flutter_dial_knob
A customizable knob widget for Flutter.
https://github.com/joakimunge/flutter_dial_knob
dart dial flutter knob widget
Last synced: about 1 year ago
JSON representation
A customizable knob widget for Flutter.
- Host: GitHub
- URL: https://github.com/joakimunge/flutter_dial_knob
- Owner: joakimunge
- License: mit
- Created: 2024-09-05T06:27:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T07:19:50.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T12:21:45.717Z (about 1 year ago)
- Topics: dart, dial, flutter, knob, widget
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_dial_knob
- Size: 131 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Knob
A customizable dial knob widget for Flutter.

## Features
- Dart 3 Compatible
- Customizable colors for track, level, knob, and indicator
- Gradient support for level indicator
- Adjustable size
## Installation
Add this to your `pubspec.yaml` file:
```yaml
dependencies:
flutter_dial_knob: ^0.0.2
```
Then run:
```sh
flutter pub get
```
or
```
$ flutter pub add flutter_dial_knob
```
## Usage
Import the package in your Dart file:
```dart
import 'package:flutter_dial_knob/flutter_dial_knob.dart';
```
Use the `DialKnob` widget in your Flutter app:
```dart
import 'package:flutter/material.dart';
import 'package:flutter_dial_knob/flutter_dial_knob.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Dial Knob Example'),
),
body: Center(
child: DialKnob(
value: 0.5,
onChanged: (newValue) {
print(newValue);
},
min: 0,
max: 1,
size: 100,
trackColor: Colors.grey,
levelColorStart: Colors.green,
levelColorEnd: Colors.red,
knobColor: Colors.blue,
indicatorColor: Colors.white,
),
),
),
);
}
}
```
## Customizable Properties
- `value`: The current value of the knob.
- `onChanged`: Callback when the value changes.
- `min`: Minimum value (default is 0).
- `max`: Maximum value (default is 1).
- `size`: Size of the knob (default is 72).
- `child`: Optional child widget.
- `trackColor`: Color of the track.
- `levelColorStart`: Start color of the level gradient.
- `levelColorEnd`: End color of the level gradient.
- `levelColor`: Solid color of the level.
- `knobColor`: Color of the knob.
- `indicatorColor`: Color of the indicator.
## Example
```dart
DialKnob(
value: 0.5,
onChanged: (newValue) {
print(newValue);
},
min: 0,
max: 1,
size: 100,
trackColor: Colors.grey,
levelColorStart: Colors.green,
levelColorEnd: Colors.red,
knobColor: Colors.blue,
indicatorColor: Colors.white,
)
```
## License
MIT License. See LICENSE for more information.