import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class HeightScreen extends StatefulWidget { final UserRegistrationSheet sheet; const HeightScreen({super.key, required this.sheet}); @override State createState() => _HeightScreenState(); } class _HeightScreenState extends State { final heightController = TextEditingController(); @override void initState() { super.initState(); if (widget.sheet.height != 0) heightController.text = widget.sheet.height.toString(); } @override Widget build(BuildContext context) { return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80), child: Container( width: double.maxFinite, padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v), child: Column( children: [ Text( "height_measurements".tr, style: theme.textTheme.headlineSmall, ), SizedBox(height: 16.v), Column( children: [ Text( "your_height".tr, style: theme.textTheme.bodyLarge, ), SizedBox(height: 4.v), CustomTextFormField( width: 150.h, textInputAction: TextInputAction.done, controller: heightController, keyboardType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.digitsOnly, ], onChanged: (newValue) { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(height: int.parse(newValue))); }, ), ], ), ], ), ), ); } }