28 lines
678 B
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;
|
||
|
},
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|