42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class HeightWidget extends StatelessWidget {
|
|
const HeightWidget({super.key});
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
return Form(
|
|
child: Column(
|
|
children: <Widget>[
|
|
const Text('Height'),
|
|
TextFormField(
|
|
decoration: const InputDecoration(
|
|
hintText: 'Enter the height of the starting point (in m)',
|
|
),
|
|
validator: (String? value) {
|
|
if (value == null || value.isEmpty) {
|
|
return 'Invalid input. Please enter the height of the starting point (in m)';
|
|
}
|
|
return null;
|
|
},
|
|
),
|
|
|
|
TextFormField(
|
|
decoration: const InputDecoration(
|
|
hintText: 'Enter the height of the ending point (in m)',
|
|
),
|
|
validator: (String? value) {
|
|
if (value == null || value.isEmpty) {
|
|
return 'Invalid input. Please enter the height of the ending point (in m)';
|
|
}
|
|
return null;
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|