Files
eatvio_app/lib/features/settings/presentation/pages/pressure_screen.dart
2024-09-30 12:54:55 +03:00

123 lines
3.6 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
import 'package:eatvio_app/features/profile/models/profile_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:eatvio_app/widgets/custom_drop_down.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
class PressureScreen extends StatefulWidget {
final ProfileDetailsModel profileDetailsModel;
const PressureScreen({
super.key,
required this.profileDetailsModel,
});
@override
State<PressureScreen> createState() => _PressureScreenState();
}
class _PressureScreenState extends State<PressureScreen> {
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
final chestCircumferenceController = TextEditingController();
final waistCircumferenceController = TextEditingController();
final hipCircumferenceController = TextEditingController();
final List<SelectionPopupModel> selectionPopupList = [
SelectionPopupModel(
id: 1,
title: "Да",
),
SelectionPopupModel(
id: 0,
title: "Нет",
),
];
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Scaffold(
appBar: AppBar(
title: Text('Давление'),
),
bottomSheet: _saveButton(),
body: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.all(16) + EdgeInsets.only(bottom: 64),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.up_pressure),
SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
hintText: "90",
onChanged: (newValue) {},
),
SizedBox(height: 16),
Text(s.down_pressure),
SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
hintText: '90',
onChanged: (newValue) {},
),
SizedBox(height: 16),
Text(s.do_you_have_hypotension_tendency),
SizedBox(height: 4),
CustomDropDown(
items: selectionPopupList,
value: selectionPopupList[0],
hintText: "Не выбрано",
onChanged: (newPopup) {
setState(() {});
},
),
SizedBox(height: 16),
Text(s.do_you_have_hypertension_tendency),
SizedBox(height: 4),
CustomDropDown(
items: selectionPopupList,
value: selectionPopupList[0],
hintText: "Не выбрано",
onChanged: (newPopup) {
setState(() {});
},
),
],
),
),
);
}
_saveButton() {
return InkWell(
onTap: () => GoRouter.of(context).pop(),
borderRadius: BorderRadius.circular(20),
child: Ink(
height: 52,
width: MediaQuery.of(context).size.width - 32,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: appTheme.blueA400,
),
child: Center(
child: Text(
'Сохранить',
style: TextStyle(
color: Colors.white,
height: 1,
fontWeight: FontWeight.w600,
fontSize: 18,
),
),
),
),
);
}
}