feat(settings): add weight

This commit is contained in:
Alex
2024-11-27 10:51:08 +03:00
parent d006e4e21a
commit 421190b6c9
6 changed files with 307 additions and 268 deletions

View File

@@ -25,6 +25,7 @@ class _PhysicalFormScreenState extends State<PhysicalFormScreen> {
final waistCircumferenceController = TextEditingController();
final hipCircumferenceController = TextEditingController();
final heightController = TextEditingController();
final weightController = TextEditingController();
@override
void initState() {
@@ -33,6 +34,7 @@ class _PhysicalFormScreenState extends State<PhysicalFormScreen> {
waistCircumferenceController.text = widget.settingsEntity.profileDetailsModel.waistCircumference.toString();
hipCircumferenceController.text = widget.settingsEntity.profileDetailsModel.hipCircumference.toString();
heightController.text = widget.settingsEntity.profileDetailsModel.height.toString();
weightController.text = widget.settingsEntity.profileDetailsModel.weight.toString();
}
@override
@@ -83,6 +85,15 @@ class _PhysicalFormScreenState extends State<PhysicalFormScreen> {
hintText: 'см',
textInputAction: TextInputAction.done,
),
SizedBox(height: 16),
Text('Вес'),
SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
controller: weightController,
hintText: 'кг',
textInputAction: TextInputAction.done,
),
],
),
),
@@ -98,6 +109,7 @@ class _PhysicalFormScreenState extends State<PhysicalFormScreen> {
waistCircumference: int.parse(waistCircumferenceController.text),
hipCircumference: int.parse(hipCircumferenceController.text),
height: int.parse(heightController.text),
weight: double.parse(weightController.text),
),
);
GoRouter.of(context).pop();