reworked page layout inheritence
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:anyway/structs/landmark.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:anyway/structs/landmark.dart';
|
||||
import 'package:anyway/modules/map_chooser.dart';
|
||||
|
||||
|
||||
class StepBetweenLandmarks extends StatefulWidget {
|
||||
final Landmark current;
|
||||
final Landmark next;
|
||||
@@ -19,11 +21,15 @@ class StepBetweenLandmarks extends StatefulWidget {
|
||||
class _StepBetweenLandmarksState extends State<StepBetweenLandmarks> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int time = widget.current.tripTime?.inMinutes ?? 0;
|
||||
int? time = widget.current.tripTime?.inMinutes;
|
||||
if (time != null && time < 1) {
|
||||
time = 1;
|
||||
}
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
margin: const EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
left: BorderSide(width: 3.0, color: Colors.black),
|
||||
),
|
||||
@@ -32,21 +38,22 @@ class _StepBetweenLandmarksState extends State<StepBetweenLandmarks> {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Icon(Icons.directions_walk),
|
||||
Text("$time min", style: TextStyle(fontSize: 10)),
|
||||
const Icon(Icons.directions_walk),
|
||||
Text(
|
||||
time == null ? "" : "About $time min",
|
||||
style: const TextStyle(fontSize: 10)
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
ElevatedButton(
|
||||
|
||||
const Spacer(),
|
||||
|
||||
ElevatedButton.icon(
|
||||
onPressed: () async {
|
||||
showMapChooser(context, widget.current, widget.next);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.directions),
|
||||
Text("Directions"),
|
||||
],
|
||||
),
|
||||
icon: const Icon(Icons.directions),
|
||||
label: const Text("Directions"),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user