forked from eatvio/eatvio_app
fix: analyzer and token storage
This commit is contained in:
@@ -7,10 +7,7 @@ import 'package:go_router/go_router.dart';
|
||||
class PhysicalActivityScreen extends StatefulWidget {
|
||||
final SettingsEntity settingsEntity;
|
||||
|
||||
const PhysicalActivityScreen({
|
||||
super.key,
|
||||
required this.settingsEntity,
|
||||
});
|
||||
const PhysicalActivityScreen({super.key, required this.settingsEntity});
|
||||
|
||||
@override
|
||||
State<PhysicalActivityScreen> createState() => _PhysicalActivityScreenState();
|
||||
@@ -46,69 +43,108 @@ class _PhysicalActivityScreenState extends State<PhysicalActivityScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Физическая нагрузка'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Физическая нагрузка')),
|
||||
bottomSheet: _saveButton(),
|
||||
body: SingleChildScrollView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 80),
|
||||
child: Column(
|
||||
children: [
|
||||
RadioListTile<PhysicalActivity>(
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
title: const Text('1,2 — минимальный (сидячая работа, отсутствие физических нагрузок);'),
|
||||
value: PhysicalActivity.minimum,
|
||||
groupValue: _physicalActivity,
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
Row(
|
||||
children: [
|
||||
Radio<PhysicalActivity>(
|
||||
value: PhysicalActivity.minimum,
|
||||
// ignore: deprecated_member_use
|
||||
groupValue: _physicalActivity,
|
||||
// ignore: deprecated_member_use
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 8, right: 16),
|
||||
child: Text('1,2 — минимальный (сидячая работа, отсутствие физических нагрузок);'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
RadioListTile<PhysicalActivity>(
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
title: const Text('1,375 — низкий (тренировки не менее 20 мин 1–3 раза в неделю);'),
|
||||
value: PhysicalActivity.low,
|
||||
groupValue: _physicalActivity,
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
Row(
|
||||
children: [
|
||||
Radio<PhysicalActivity>(
|
||||
value: PhysicalActivity.low,
|
||||
// ignore: deprecated_member_use
|
||||
groupValue: _physicalActivity,
|
||||
// ignore: deprecated_member_use
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const Expanded(
|
||||
child: Padding(padding: EdgeInsets.only(left: 8, right: 16), child: Text('1,375 — низкий (тренировки не менее 20 мин 1–3 раза в неделю);')),
|
||||
),
|
||||
],
|
||||
),
|
||||
RadioListTile<PhysicalActivity>(
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
title: const Text('1,55 — умеренный (тренировки 30–60 мин 3–4 раза в неделю);'),
|
||||
value: PhysicalActivity.medium,
|
||||
groupValue: _physicalActivity,
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
Row(
|
||||
children: [
|
||||
Radio<PhysicalActivity>(
|
||||
value: PhysicalActivity.medium,
|
||||
// ignore: deprecated_member_use
|
||||
groupValue: _physicalActivity,
|
||||
// ignore: deprecated_member_use
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const Expanded(
|
||||
child: Padding(padding: EdgeInsets.only(left: 8, right: 16), child: Text('1,55 — умеренный (тренировки 30–60 мин 3–4 раза в неделю);')),
|
||||
),
|
||||
],
|
||||
),
|
||||
RadioListTile<PhysicalActivity>(
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
title: const Text('1,7 — высокий (тренировки 30–60 мин 5–7 раза в неделю; тяжёлая физическая работа);'),
|
||||
value: PhysicalActivity.high,
|
||||
groupValue: _physicalActivity,
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
Row(
|
||||
children: [
|
||||
Radio<PhysicalActivity>(
|
||||
value: PhysicalActivity.high,
|
||||
// ignore: deprecated_member_use
|
||||
groupValue: _physicalActivity,
|
||||
// ignore: deprecated_member_use
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 8, right: 16),
|
||||
child: Text('1,7 — высокий (тренировки 30–60 мин 5–7 раза в неделю; тяжёлая физическая работа);'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
RadioListTile<PhysicalActivity>(
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
title: const Text('1,9 — экстремальный (несколько интенсивных тренировок в день'),
|
||||
value: PhysicalActivity.extreme,
|
||||
groupValue: _physicalActivity,
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
Row(
|
||||
children: [
|
||||
Radio<PhysicalActivity>(
|
||||
value: PhysicalActivity.extreme,
|
||||
// ignore: deprecated_member_use
|
||||
groupValue: _physicalActivity,
|
||||
// ignore: deprecated_member_use
|
||||
onChanged: (PhysicalActivity? value) {
|
||||
setState(() {
|
||||
_physicalActivity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const Expanded(
|
||||
child: Padding(padding: EdgeInsets.only(left: 8, right: 16), child: Text('1,9 — экстремальный (несколько интенсивных тренировок в день')),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -141,8 +177,8 @@ class _PhysicalActivityScreenState extends State<PhysicalActivityScreen> {
|
||||
}
|
||||
widget.settingsEntity.settingsCubit.updateProfileDetails(
|
||||
profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith(
|
||||
activityCoefficient: activityCoefficient,
|
||||
),
|
||||
activityCoefficient: activityCoefficient,
|
||||
),
|
||||
);
|
||||
GoRouter.of(context).pop();
|
||||
},
|
||||
@@ -150,19 +186,11 @@ class _PhysicalActivityScreenState extends State<PhysicalActivityScreen> {
|
||||
child: Ink(
|
||||
height: 52,
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: appTheme.blueA400,
|
||||
),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: appTheme.blueA400),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Сохранить',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
height: 1,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18,
|
||||
),
|
||||
style: TextStyle(color: Colors.white, height: 1, fontWeight: FontWeight.w600, fontSize: 18),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user