2024-01-04 07:06:37 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:pwa_ios/utils/util.dart';
|
|
|
|
|
|
|
|
class CustomRangeSlider extends StatelessWidget {
|
|
|
|
final double sliderPos;
|
|
|
|
final void Function(double) onChanged;
|
|
|
|
double? min;
|
|
|
|
double? max;
|
|
|
|
|
|
|
|
CustomRangeSlider(
|
|
|
|
{super.key,
|
|
|
|
required this.sliderPos,
|
|
|
|
required this.onChanged,
|
|
|
|
this.max,
|
|
|
|
this.min});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
children: [
|
2024-04-08 12:00:54 +00:00
|
|
|
SizedBox(
|
|
|
|
height: isTablet ? 40 : 40,
|
|
|
|
child: Slider(
|
|
|
|
activeColor: const Color(0xFF2b9af3),
|
|
|
|
onChanged: onChanged,
|
|
|
|
min: min ?? 10.0,
|
|
|
|
max: max ?? 80.0,
|
|
|
|
label: sliderPos.toInt().toString(),
|
|
|
|
divisions: 48,
|
|
|
|
value: sliderPos,
|
|
|
|
),
|
2024-01-04 07:06:37 +00:00
|
|
|
),
|
|
|
|
SizedBox(
|
2024-04-08 12:00:54 +00:00
|
|
|
height: isTablet ? 1 : 1,
|
2024-01-04 07:06:37 +00:00
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"Range: ${sliderPos.toInt()}",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: isTablet ? 14.0 : 12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|