cpd_2022_energy/lib/widgets/weight_widget.dart

28 lines
678 B
Dart
Raw Normal View History

2023-02-05 21:46:05 +01:00
import 'package:flutter/material.dart';
class WeightWidget extends StatelessWidget {
const WeightWidget({super.key});
@override
Widget build(BuildContext context) {
return Form(
child: Column(
children: <Widget>[
const Text('Weight'),
TextFormField(
decoration: const InputDecoration(
hintText: 'Enter the weight in kg',
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return 'Invalid input. Please enter the weight (in kg)';
}
return null;
},
),
],
),
);
}
}