feature(registration): iter6

This commit is contained in:
mso7nueh
2024-07-15 16:33:33 +03:00
parent ee37f02d78
commit 726b74a236
96 changed files with 358 additions and 3503 deletions

View File

@@ -0,0 +1,63 @@
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_drop_down.dart';
import 'package:flutter/material.dart';
class LanguageSelectScreen extends StatefulWidget {
final UserRegistrationSheet sheet;
const LanguageSelectScreen({required this.sheet, super.key});
@override
State<LanguageSelectScreen> createState() => _LanguageSelectScreenState();
}
class _LanguageSelectScreenState extends State<LanguageSelectScreen> {
final List<SelectionPopupModel> dropdownItemList = [
SelectionPopupModel(id: 1, title: "Русский", isSelected: true),
];
SelectionPopupModel? value;
@override
void initState() {
super.initState();
if (widget.sheet.lang.isNotEmpty) {
value = dropdownItemList.first;
}
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80),
child: Column(
children: [
Container(
width: 262.h,
margin: EdgeInsets.only(left: 41.h, right: 39.h),
child: Text(
"preferred_language".tr,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: theme.textTheme.headlineSmall,
),
),
const SizedBox(height: 32),
CustomDropDown(
value: value,
hintText: "Не выбрано".tr,
items: dropdownItemList,
onChanged: (SelectionPopupModel newValue) => setState(() {
value = newValue;
final registrationCubit = context.read<RegistrationCubit>();
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(lang: value!.title));
}),
),
],
),
);
}
}