forked from eatvio/eatvio_app
feat(diary) Initial layouts for Diary edit
This commit is contained in:
782
lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart
Normal file
782
lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart
Normal file
@@ -0,0 +1,782 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_icon_button.dart';
|
||||
|
||||
class DiaryEditScreen extends StatelessWidget {
|
||||
DiaryEditScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
List<String> dropdownItemList = [
|
||||
"Item One",
|
||||
"Item Two",
|
||||
"Item Three",
|
||||
];
|
||||
|
||||
List<String> dropdownItemList1 = [
|
||||
"Item One",
|
||||
"Item Two",
|
||||
"Item Three",
|
||||
];
|
||||
|
||||
TextEditingController enterProductNameController = TextEditingController();
|
||||
|
||||
TextEditingController quantityController = TextEditingController();
|
||||
|
||||
List<String> dropdownItemList2 = [
|
||||
"Item One",
|
||||
"Item Two",
|
||||
"Item Three",
|
||||
];
|
||||
|
||||
List<String> dropdownItemList3 = [
|
||||
"Item One",
|
||||
"Item Two",
|
||||
"Item Three",
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 5.v),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildHeaderRow(context),
|
||||
SizedBox(height: 30.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
child: CustomDropDown(
|
||||
icon: Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(30.h, 24.v, 20.h, 22.v),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
height: 10.v,
|
||||
width: 18.h,
|
||||
),
|
||||
),
|
||||
hintText: "Подъём \\ уход ко сну",
|
||||
items: dropdownItemList,
|
||||
onChanged: (value) {},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.v),
|
||||
_buildImageStack(context),
|
||||
SizedBox(height: 20.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
child: CustomDropDown(
|
||||
icon: Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(30.h, 30.v, 20.h, 30.v),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
height: 10.v,
|
||||
width: 18.h,
|
||||
),
|
||||
),
|
||||
hintText: "Ваше настроение после приема пищи",
|
||||
items: dropdownItemList3,
|
||||
onChanged: (value) {},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.v),
|
||||
_buildHeaderColumn(context),
|
||||
SizedBox(height: 30.v),
|
||||
_buildHeaderStack(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: _buildEndDay(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildHeaderRow(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 24.h,
|
||||
vertical: 12.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
height: 2.v,
|
||||
width: 20.h,
|
||||
margin: EdgeInsets.only(
|
||||
top: 19.v,
|
||||
bottom: 17.v,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 1.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"10 день",
|
||||
style: CustomTextStyles.titleMediumBlack,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2.v),
|
||||
Text(
|
||||
"03-08-2023",
|
||||
style: CustomTextStyles.bodyMediumBluegray800,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildHeaderButton1(BuildContext context) {
|
||||
return CustomOutlinedButton(
|
||||
width: 73.h,
|
||||
text: "14:52",
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildEnterProductName(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
child: CustomTextFormField(
|
||||
controller: enterProductNameController,
|
||||
hintText: "Введите названия продукта",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildQuantity(BuildContext context) {
|
||||
return CustomTextFormField(
|
||||
width: 146.h,
|
||||
controller: quantityController,
|
||||
hintText: "Кол-во",
|
||||
textInputAction: TextInputAction.done,
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildAddProduct(BuildContext context) {
|
||||
return CustomOutlinedButton(
|
||||
text: "Добавить продукт",
|
||||
margin: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildAddPhoto(BuildContext context) {
|
||||
return CustomOutlinedButton(
|
||||
width: 195.h,
|
||||
text: "Добавить фото",
|
||||
rightIcon: Container(
|
||||
margin: EdgeInsets.only(left: 14.h),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgVector,
|
||||
height: 30.v,
|
||||
width: 34.h,
|
||||
),
|
||||
),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
buttonTextStyle: theme.textTheme.bodyMedium!,
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildImageStack(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 790.v,
|
||||
width: 374.h,
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 15.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.h,
|
||||
vertical: 13.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder12,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 11.v,
|
||||
bottom: 7.v,
|
||||
),
|
||||
child: Text(
|
||||
"Время приема пищи",
|
||||
style: CustomTextStyles.bodyMediumBlack900,
|
||||
),
|
||||
),
|
||||
_buildHeaderButton1(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
child: CustomDropDown(
|
||||
hintText: "Прием пищи",
|
||||
items: dropdownItemList1,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 15.h,
|
||||
vertical: 9.v,
|
||||
),
|
||||
onChanged: (value) {},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
_buildEnterProductName(context),
|
||||
SizedBox(height: 20.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildQuantity(context),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 10.h),
|
||||
child: CustomDropDown(
|
||||
width: 146.h,
|
||||
hintText: "Порция",
|
||||
items: dropdownItemList2,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 15.h,
|
||||
vertical: 9.v,
|
||||
),
|
||||
onChanged: (value) {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.v),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 10.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.h,
|
||||
vertical: 6.v,
|
||||
),
|
||||
decoration: AppDecoration.fillGray.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder5,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 7.h,
|
||||
top: 5.v,
|
||||
),
|
||||
child: Text(
|
||||
"Сырный суп",
|
||||
style: CustomTextStyles.titleMedium16,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20.h,
|
||||
top: 3.v,
|
||||
bottom: 3.v,
|
||||
),
|
||||
child: Text(
|
||||
"400мл",
|
||||
style: CustomTextStyles.titleMedium16,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgSearch,
|
||||
height: 24.adaptSize,
|
||||
width: 24.adaptSize,
|
||||
),
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgClose,
|
||||
height: 28.adaptSize,
|
||||
width: 28.adaptSize,
|
||||
margin: EdgeInsets.only(left: 10.h),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.v),
|
||||
_buildAddProduct(context),
|
||||
SizedBox(height: 249.v),
|
||||
_buildAddPhoto(context),
|
||||
SizedBox(height: 29.v),
|
||||
Text(
|
||||
"Ваша сытость после приёма пищи",
|
||||
style: CustomTextStyles.bodyMediumBlack900,
|
||||
),
|
||||
SizedBox(height: 15.v),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgEdit,
|
||||
height: 30.adaptSize,
|
||||
width: 30.adaptSize,
|
||||
),
|
||||
CustomImageView(
|
||||
height: 13.v,
|
||||
width: 243.h,
|
||||
margin: EdgeInsets.only(
|
||||
left: 10.h,
|
||||
top: 9.v,
|
||||
bottom: 8.v,
|
||||
),
|
||||
),
|
||||
CustomImageView(
|
||||
height: 30.adaptSize,
|
||||
width: 30.adaptSize,
|
||||
margin: EdgeInsets.only(left: 10.h),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 7.v),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 342.v),
|
||||
child: SizedBox(
|
||||
width: 374.h,
|
||||
child: Divider(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
height: 203.v,
|
||||
width: 303.h,
|
||||
margin: EdgeInsets.only(bottom: 178.v),
|
||||
child: Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
CustomImageView(
|
||||
height: 203.v,
|
||||
width: 303.h,
|
||||
radius: BorderRadius.circular(
|
||||
5.h,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 265.h,
|
||||
top: 10.v,
|
||||
right: 10.h,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CustomIconButton(
|
||||
height: 18.adaptSize,
|
||||
width: 18.adaptSize,
|
||||
padding: EdgeInsets.all(4.h),
|
||||
alignment: Alignment.centerRight,
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgCloseBlueGray900,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 60.v),
|
||||
CustomIconButton(
|
||||
height: 28.adaptSize,
|
||||
width: 28.adaptSize,
|
||||
padding: EdgeInsets.all(9.h),
|
||||
decoration: IconButtonStyleHelper.fillBlueA,
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imageNotFound,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildHeaderColumn(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.h,
|
||||
vertical: 16.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder12,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 3.v),
|
||||
Text(
|
||||
"Ваш КБЖУ",
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
SizedBox(height: 8.v),
|
||||
Text(
|
||||
"От дневной суточной нормы",
|
||||
style: CustomTextStyles.bodyMediumBluegray800,
|
||||
),
|
||||
SizedBox(height: 19.v),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.h,
|
||||
right: 12.h,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 7.v),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder1,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SizedBox(height: 101.v),
|
||||
Container(
|
||||
height: 47.v,
|
||||
width: 12.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.errorContainer,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
bottom: Radius.circular(1.h),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(
|
||||
flex: 33,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 7.v),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder1,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 66.v),
|
||||
Container(
|
||||
height: 82.v,
|
||||
width: 12.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.lightGreenA700,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
bottom: Radius.circular(1.h),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(
|
||||
flex: 33,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 7.v),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder1,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 14.v),
|
||||
Container(
|
||||
height: 134.v,
|
||||
width: 12.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
bottom: Radius.circular(1.h),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(
|
||||
flex: 33,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 7.v),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder1,
|
||||
),
|
||||
child: Container(
|
||||
height: 148.v,
|
||||
width: 12.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(
|
||||
1.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.h,
|
||||
bottom: 128.v,
|
||||
),
|
||||
child: Text(
|
||||
"*",
|
||||
style: theme.textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 4.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Калории",
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 28.h),
|
||||
child: Text(
|
||||
"Белки",
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
"Жиры",
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 25.h),
|
||||
child: Text(
|
||||
"Углеводы",
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 10.h,
|
||||
right: 2.h,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"255 из 250Ккал",
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.h,
|
||||
bottom: 11.v,
|
||||
),
|
||||
child: Text(
|
||||
"50 из 250 гр",
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 19.h,
|
||||
bottom: 11.v,
|
||||
),
|
||||
child: Text(
|
||||
"270 из 250 гр",
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 16.h,
|
||||
bottom: 11.v,
|
||||
),
|
||||
child: Text(
|
||||
"400 из 250 гр",
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 19.v),
|
||||
Text(
|
||||
"*Превышенная суточная норма углеводов",
|
||||
style: theme.textTheme.labelLarge,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildHeaderColumn1(BuildContext context) {
|
||||
return Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 15.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 50.h,
|
||||
vertical: 28.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder12,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 240.h,
|
||||
child: Text(
|
||||
"Дополнительная информация для консультанта",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: CustomTextStyles.bodyMediumBlack900,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildHeaderStack(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 235.v,
|
||||
width: 374.h,
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
_buildHeaderColumn1(context),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 103.v),
|
||||
child: SizedBox(
|
||||
width: 374.h,
|
||||
child: Divider(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 35.h,
|
||||
right: 35.h,
|
||||
bottom: 20.v,
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 14.h,
|
||||
vertical: 9.v,
|
||||
),
|
||||
decoration: AppDecoration.outlineBlueGray.copyWith(
|
||||
borderRadius: BorderRadiusStyle.roundedBorder5,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 63.v),
|
||||
Container(
|
||||
width: 245.h,
|
||||
margin: EdgeInsets.only(right: 27.h),
|
||||
child: Text(
|
||||
"Введите дополнитльеную информацию для консультанта",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildEndDay(BuildContext context) {
|
||||
return CustomOutlinedButton(
|
||||
text: "Закончить день",
|
||||
margin: EdgeInsets.only(
|
||||
left: 16.h,
|
||||
right: 16.h,
|
||||
bottom: 41.v,
|
||||
),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import 'package:eatvio_app/presentation/registration/app_navigation_screen/app_n
|
||||
import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_profile_screen.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diary/diary_edit_screen/diary_edit_screen.dart';
|
||||
|
||||
class AppRoutes {
|
||||
// REGISTRATION
|
||||
@@ -69,6 +70,10 @@ class AppRoutes {
|
||||
|
||||
static const String mySettings = '/mySettings';
|
||||
|
||||
//DIARY
|
||||
|
||||
static const String diaryEdit = '/diaryEdit';
|
||||
|
||||
static Map<String, WidgetBuilder> get routes => {
|
||||
dateOfBirthScreen: DateOfBirthScreen.builder,
|
||||
cityOfLivingScreen: CityOfLivingScreen.builder,
|
||||
@@ -91,5 +96,6 @@ class AppRoutes {
|
||||
initialRoute: SplashScreen.builder,
|
||||
myProfile: MyProfileScreen.builder,
|
||||
mySettings: MySettingsScreen.builder,
|
||||
diaryEdit: DiaryEditScreen.builder,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomDropDown extends StatelessWidget {
|
||||
@@ -39,7 +38,7 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
final TextStyle? textStyle;
|
||||
|
||||
final List<SelectionPopupModel>? items;
|
||||
final List<String>? items;
|
||||
|
||||
final String? hintText;
|
||||
|
||||
@@ -61,9 +60,9 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
final bool? filled;
|
||||
|
||||
final FormFieldValidator<SelectionPopupModel>? validator;
|
||||
final FormFieldValidator<String>? validator;
|
||||
|
||||
final Function(SelectionPopupModel)? onChanged;
|
||||
final Function(String)? onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -77,31 +76,29 @@ class CustomDropDown extends StatelessWidget {
|
||||
|
||||
Widget get dropDownWidget => SizedBox(
|
||||
width: width ?? double.maxFinite,
|
||||
child: DropdownButtonFormField<SelectionPopupModel>(
|
||||
child: DropdownButtonFormField(
|
||||
focusNode: focusNode ?? FocusNode(),
|
||||
icon: icon,
|
||||
autofocus: autofocus!,
|
||||
style: textStyle ?? theme.textTheme.titleMedium,
|
||||
items: items?.map((SelectionPopupModel item) {
|
||||
return DropdownMenuItem<SelectionPopupModel>(
|
||||
value: item,
|
||||
items: items?.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(
|
||||
item.title,
|
||||
value,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: hintStyle ?? theme.textTheme.titleMedium,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
decoration: decoration,
|
||||
validator: validator,
|
||||
onChanged: (value) {
|
||||
onChanged!(value!);
|
||||
onChanged!(value.toString());
|
||||
},
|
||||
),
|
||||
);
|
||||
InputDecoration get decoration => InputDecoration(
|
||||
hintText: hintText ?? "",
|
||||
hintStyle: hintStyle ?? theme.textTheme.titleMedium,
|
||||
hintStyle: hintStyle,
|
||||
prefixIcon: prefix,
|
||||
prefixIconConstraints: prefixConstraints,
|
||||
suffixIcon: suffix,
|
||||
@@ -109,33 +106,27 @@ class CustomDropDown extends StatelessWidget {
|
||||
isDense: true,
|
||||
contentPadding: contentPadding ??
|
||||
EdgeInsets.only(
|
||||
left: 6.h,
|
||||
top: 6.v,
|
||||
bottom: 6.v,
|
||||
left: 17,
|
||||
top: 17,
|
||||
bottom: 17,
|
||||
),
|
||||
fillColor: fillColor ?? theme.colorScheme.onPrimary,
|
||||
fillColor: fillColor,
|
||||
filled: filled,
|
||||
border: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabledBorder: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: borderDecoration ??
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
borderSide: BorderSide(
|
||||
color: appTheme.blueA400,
|
||||
color: Colors.blue,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
|
||||
72
lib/widgets/custom_icon_button.dart
Normal file
72
lib/widgets/custom_icon_button.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomIconButton extends StatelessWidget {
|
||||
CustomIconButton({
|
||||
Key? key,
|
||||
this.alignment,
|
||||
this.height,
|
||||
this.width,
|
||||
this.padding,
|
||||
this.decoration,
|
||||
this.child,
|
||||
this.onTap,
|
||||
}) : super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
final Alignment? alignment;
|
||||
|
||||
final double? height;
|
||||
|
||||
final double? width;
|
||||
|
||||
final EdgeInsetsGeometry? padding;
|
||||
|
||||
final BoxDecoration? decoration;
|
||||
|
||||
final Widget? child;
|
||||
|
||||
final VoidCallback? onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return alignment != null
|
||||
? Align(
|
||||
alignment: alignment ?? Alignment.center,
|
||||
child: iconButtonWidget,
|
||||
)
|
||||
: iconButtonWidget;
|
||||
}
|
||||
|
||||
Widget get iconButtonWidget => SizedBox(
|
||||
height: height ?? 0,
|
||||
width: width ?? 0,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
icon: Container(
|
||||
height: height ?? 0,
|
||||
width: width ?? 0,
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
decoration: decoration ??
|
||||
BoxDecoration(
|
||||
color: Colors.black,
|
||||
borderRadius: BorderRadius.circular(9),
|
||||
border: Border.all(
|
||||
color: Colors.blueGrey,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
onPressed: onTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Extension on [CustomIconButton] to facilitate inclusion of all types of border style etc
|
||||
extension IconButtonStyleHelper on CustomIconButton {
|
||||
static BoxDecoration get fillBlueA => BoxDecoration(
|
||||
color: Colors.blue,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user