drafts minor changes, edit minor changes
All checks were successful
Release / meta (push) Successful in 15s
Release / linux-build (push) Successful in 9m20s
Release / android-build (push) Successful in 25m33s
Release / release-master (push) Successful in 43s
Release / release-dev (push) Successful in 45s

This commit is contained in:
2025-12-15 00:33:18 +00:00
parent 603e117af8
commit da70dce369
4 changed files with 112 additions and 86 deletions

View File

@@ -97,10 +97,16 @@ class _StationAutocompleteState extends State<StationAutocomplete> {
}
class RouteCalculator extends StatefulWidget {
const RouteCalculator({super.key, this.onDistanceComputed, this.onApplyRoute});
const RouteCalculator({
super.key,
this.onDistanceComputed,
this.onApplyRoute,
this.initialStations,
});
final ValueChanged<double>? onDistanceComputed;
final ValueChanged<RouteResult>? onApplyRoute;
final List<String>? initialStations;
@override
State<RouteCalculator> createState() => _RouteCalculatorState();
@@ -122,6 +128,9 @@ class _RouteCalculatorState extends State<RouteCalculator> {
super.didChangeDependencies();
if (!_fetched) {
_fetched = true;
if (widget.initialStations != null && widget.initialStations!.isNotEmpty) {
context.read<DataService>().stations = List.from(widget.initialStations!);
}
WidgetsBinding.instance.addPostFrameCallback((_) async {
final data = context.read<DataService>();
final result = await data.fetchStations();