cpd_2022_energy/lib/widgets/weight_widget.dart

28 lines
678 B
Dart

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;
},
),
],
),
);
}
}