forked from eatvio/eatvio_app
54 lines
1.9 KiB
Dart
54 lines
1.9 KiB
Dart
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';
|
|
|
|
class AllergiesScreen extends StatefulWidget {
|
|
final UserRegistrationSheet sheet;
|
|
|
|
const AllergiesScreen({super.key, required this.sheet});
|
|
|
|
@override
|
|
State<AllergiesScreen> createState() => _AllergiesScreenState();
|
|
}
|
|
|
|
class _AllergiesScreenState extends State<AllergiesScreen> {
|
|
final enterInformationController = TextEditingController();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
enterInformationController.text = widget.sheet.aboutAllergy;
|
|
}
|
|
|
|
@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("allergies_presence".tr, style: theme.textTheme.headlineSmall),
|
|
SizedBox(height: 22.v),
|
|
Text("fill_in_information".tr, style: CustomTextStyles.titleMediumSegoeUI),
|
|
SizedBox(height: 2.v),
|
|
CustomTextFormField(
|
|
controller: enterInformationController,
|
|
hintText: "enter_information".tr,
|
|
textInputAction: TextInputAction.done,
|
|
maxLines: 8,
|
|
onChanged: (newValue) {
|
|
final registrationCubit = context.read<RegistrationCubit>();
|
|
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(aboutAllergy: newValue));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|