mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
27 lines
612 B
Dart
27 lines
612 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class FunctionSlider extends StatelessWidget {
|
|
final dynamic initialValue;
|
|
|
|
final (double min, double max) range;
|
|
final void Function(double value) onChanged;
|
|
|
|
const FunctionSlider({
|
|
required this.onChanged,
|
|
required this.initialValue,
|
|
required this.range,
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Slider(
|
|
value: initialValue is int ? initialValue.toDouble() : range.$1,
|
|
min: range.$1,
|
|
max: range.$2,
|
|
divisions: (range.$2 - range.$1).toInt(),
|
|
onChanged: onChanged,
|
|
);
|
|
}
|
|
}
|