Added new locales and layout for profile edit on a settings screen

This commit is contained in:
2024-01-29 16:58:43 +03:00
parent 88202a5e8f
commit 1dbc946a6b
2 changed files with 103 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ final Map<String, String> ru = {
"waist_circumference": "Обхват талии",
"initial_measurements": "Первичные замеры",
"male": "Мужской",
"female": "Женский",
// weight Screen
"weight_measurements": "Замер веса", "your_weight": "Ваш вес:",
"height_measurements": "Замер роста", "your_height": "Ваш рост:",

View File

@@ -28,6 +28,9 @@ class MySettingsScreen extends StatelessWidget {
} else if (state is MyProfileLoadedState) {
// Данные загружены, можно строить экран.
return _buildSetingsScreen(context, state);
} else if (state is MyProfileErrorState) {
// Произошла ошибка при загрузке данных.
return Center(child: Text(state.errorMessage));
} else {
// Другие состояния, если они есть.
return Container(); // Пустой контейнер для необработанных состояний.
@@ -210,8 +213,7 @@ class _ExpandableListState extends State<ExpandableList> {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
return ListView(
children: [
GestureDetector(
onTap: () {
@@ -237,8 +239,103 @@ class _ExpandableListState extends State<ExpandableList> {
Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Column(
//children: widget.items.map((item) => Text(item)).toList(),
children: [Text(widget.items.join('\n'))]),
children: [
TextField(
decoration: InputDecoration(labelText: 'first_name'.tr),
),
TextField(
decoration: InputDecoration(labelText: 'last_name'.tr),
),
// Поле даты рождения, предполагается, что 'reg_form.date_of_birth' это функция для получения даты рождения
TextField(
decoration: InputDecoration(labelText: 'date_of_birth'.tr),
onTap: () {
// Вставьте здесь логику для отображения выбора даты
},
),
// Поле выбора пола
Row(
children: [
Radio(value: 'male'.tr, groupValue: null, onChanged: null),
Text('Male'),
Radio(value: 'female'.tr, groupValue: null, onChanged: null),
Text('Female'),
],
),
TextField(
decoration: InputDecoration(labelText: 'country'.tr),
),
TextField(
decoration: InputDecoration(labelText: 'place_of_living'.tr),
),
// Поле выбора языка
DropdownButton<String>(
value: null,
onChanged: (newValue) {
// Вставьте здесь логику для обработки выбора языка
},
items: ['russian'.tr].map((String language) {
return DropdownMenuItem<String>(
value: language,
child: Text(language),
);
}).toList(),
),
// Поля для ввода чисел
TextField(
decoration: InputDecoration(labelText: 'weight_measurements'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'height_measurements'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'chest_circumference'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'waist_circumference'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'hip_circumference'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'up_pressure'.tr),
keyboardType: TextInputType.number,
),
TextField(
decoration: InputDecoration(labelText: 'down_pressure'),
keyboardType: TextInputType.number,
),
// Переключатели
Row(
children: [
Switch(value: false, onChanged: null),
Text('do_you_have_hypotension_tendency'.tr),
],
),
Row(
children: [
Switch(value: false, onChanged: null),
Text('do_you_have_hypertension_tendency'.tr),
],
),
// Поля для ввода текста
TextField(
decoration: InputDecoration(labelText: 'allergies_presence'.tr),
maxLines: null,
),
TextField(
decoration: InputDecoration(labelText: 'do_you_take_pills'.tr),
maxLines: null,
),
TextField(
decoration: InputDecoration(labelText: 'your_favorite_sports'.tr),
maxLines: null,
),]),
),
Divider(),
],