anyway/frontend/lib/modules/step_between_landmarks.dart
Helldragon67 4fd1272ea4
Some checks failed
Build and release debug APK / Build APK (pull_request) Failing after 3m7s
test
2025-02-07 15:08:00 +01:00

56 lines
1.4 KiB
Dart

import 'package:anyway/structs/landmark.dart';
import 'package:flutter/material.dart';
import 'package:anyway/modules/map_chooser.dart';
class StepBetweenLandmarks extends StatefulWidget {
final Landmark current;
final Landmark next;
const StepBetweenLandmarks({
super.key,
required this.current,
required this.next
});
@override
State<StepBetweenLandmarks> createState() => _StepBetweenLandmarksState();
}
class _StepBetweenLandmarksState extends State<StepBetweenLandmarks> {
@override
Widget build(BuildContext context) {
int time = 5 * ((widget.current.tripTime?.inMinutes ?? 0) ~/ 5);
return Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border(
left: BorderSide(width: 3.0, color: Colors.black),
),
),
child: Row(
children: [
Column(
children: [
Icon(Icons.directions_walk),
Text("$time min", style: TextStyle(fontSize: 10)),
],
),
Spacer(),
ElevatedButton(
onPressed: () async {
showMapChooser(context, widget.current, widget.next);
},
child: Row(
children: [
Icon(Icons.directions),
Text("Directions"),
],
),
)
],
),
);
}
}