I am facing some issues compiling my custom widgets. Its a range selector to select a price range to filter the search results in my app. These errors are exhausting me mentally, like I would never be able to complete my app and had to outsource its production. All these YouTubers would skip on this error part. Like literally no one is discussing how to troubleshoot it and chat GPT is going sane, sometimes it makes things on its own and presents me as some kind of eternal fact.
What have you tried so far?
import 'package:syncfusion_flutter_sliders/sliders.dart';
class PriceRangeSelector extends StatefulWidget {
const PriceRangeSelector({
super.key,
this.width,
this.height,
required this.minprice,
required this.maxprice,
});
final double? width;
final double? height;
final double minprice;
final double maxprice;
get minPrice => null;
get maxPrice => null;
@override
_PriceRangeSelectorState createState() => _PriceRangeSelectorState();
void onPriceChange(start, end) {}
}
class _PriceRangeSelectorState extends State<PriceRangeSelector> {
late SfRangeValues _currentRange;
@override
void initState() {
super.initState();
_currentRange = SfRangeValues(widget.minPrice, widget.maxPrice);
}
@override
Widget build(BuildContext context) {
return SfRangeSlider(
min: widget.minPrice,
max: widget.maxPrice,
values: _currentRange,
interval: (widget.maxPrice - widget.minPrice) / 5,
showTicks: true,
showLabels: true,
enableTooltip: true,
onChanged: (SfRangeValues values) {
setState(() {
_currentRange = values;
});
// Pass start and end values to the callback
widget.onPriceChange(values.start, values.end);
},
);
}
}
Did you check FlutterFlow's Documentation for this topic?