diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart index b378e32c..fc254862 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -20,10 +20,13 @@ class DiaryEditScreen extends StatelessWidget { "Item Three", ]; - List dropdownItemList1 = [ - "Item One", - "Item Two", - "Item Three", + List mealList = [ + "Прием пищи 1", + "Прием пищи 2", + "Прием пищи 3", + "Прием пищи 4", + "Прием пищи 5", + "Прием пищи 6", ]; List dropdownItemList2 = [ @@ -77,7 +80,8 @@ class DiaryEditScreen extends StatelessWidget { mediaQueryData = MediaQuery.of(context); return SafeArea( child: Scaffold( - resizeToAvoidBottomInset: false, + backgroundColor: Color.fromARGB(255, 240, 242, 245), + resizeToAvoidBottomInset: true, body: SizedBox( width: double.maxFinite, child: Column( @@ -92,13 +96,14 @@ class DiaryEditScreen extends StatelessWidget { SizedBox(height: 30.v), _buildWakupRetire(context, state), SizedBox(height: 30.v), - _buildImageStack(context), + //_buildImageStack(context), + _buildMeal(context, state), SizedBox(height: 20.v), _buildMood(moodList, context, state), SizedBox(height: 30.v), _buildHeaderColumn(context), SizedBox(height: 30.v), - _buildComment(context), + _buildComment(context, state), ], ), ), @@ -120,8 +125,17 @@ class DiaryEditScreen extends StatelessWidget { horizontal: 24.h, vertical: 12.v, ), - decoration: AppDecoration.outlinePrimary.copyWith( - borderRadius: BorderRadiusStyle.roundedBorder12, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -155,16 +169,6 @@ class DiaryEditScreen extends StatelessWidget { ); } - /// Section Widget - Widget _buildMealTime(BuildContext context) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), - child: CustomTextFormField( - hintText: "14:52", - ), - ); - } - /// Section Widget Widget _buildEnterProductName(BuildContext context) { return Padding( @@ -175,15 +179,6 @@ class DiaryEditScreen extends StatelessWidget { ); } - /// Section Widget - Widget _buildQuantity(BuildContext context) { - return CustomTextFormField( - width: 146.h, - hintText: "Кол-во", - textInputAction: TextInputAction.done, - ); - } - /// Section Widget Widget _buildAddProduct(BuildContext context) { return CustomOutlinedButton( @@ -211,245 +206,155 @@ class DiaryEditScreen extends StatelessWidget { ); } - /// Section Widget - Widget _buildImageStack(BuildContext context) { - return SizedBox( - height: 790.v, - width: 374.h, - child: Stack( - alignment: Alignment.bottomCenter, + _buildMeal(BuildContext context, DiaryEditLoadedState state) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.h), + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 24.h, + vertical: 12.v, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Время приема пищи", + style: CustomTextStyles.bodyMediumBlack900, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.h), + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width - 210, + ), + child: CustomTextFormField( + hintText: "14:52", + ), + ), + ), + ], + ), + ), + SizedBox(height: 20.v), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.h), + child: CustomDropDown( + hintText: "Прием пищи", + items: mealList, + 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: [ + CustomTextFormField( + width: 146.h, + hintText: "Кол-во", + textInputAction: TextInputAction.done, + ), + Padding( + padding: EdgeInsets.only(left: 10.h), + child: Text( + "порций", + style: CustomTextStyles.bodyMediumBlack900, + )), + ], + ), + ), + SizedBox(height: 30.v), + + _buildAddProduct(context), + SizedBox(height: 30.v), + //_buildAddPhoto(context), + SizedBox(height: 29.v), + Text( + "Ваша сытость после приёма пищи", + style: CustomTextStyles.bodyMediumBlack900, + ), + SizedBox(height: 15.v), + ], + ), + )); + } + + _buildProduct(BuildContext context) { + return 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: [ - 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, - ), - ), - _buildMealTime(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), - ], - ), + Padding( + padding: EdgeInsets.only( + left: 7.h, + top: 5.v, + ), + child: Text( + "Сырный суп", + style: CustomTextStyles.titleMedium16, ), ), - Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: EdgeInsets.only(bottom: 342.v), - child: SizedBox( - width: 374.h, - child: Divider(), - ), + Padding( + padding: EdgeInsets.only( + left: 20.h, + top: 3.v, + bottom: 3.v, + ), + child: Text( + "400мл", + style: CustomTextStyles.titleMedium16, ), ), - 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, - ), - ), - ], - ), - ), - ), - ], - ), - ), + 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), ), ], ), ); } - /// Section Widget Widget _buildHeaderColumn(BuildContext context) { return Container( margin: EdgeInsets.symmetric(horizontal: 16.h), @@ -457,8 +362,17 @@ class DiaryEditScreen extends StatelessWidget { horizontal: 10.h, vertical: 16.v, ), - decoration: AppDecoration.outlinePrimary.copyWith( - borderRadius: BorderRadiusStyle.roundedBorder12, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], ), child: Column( mainAxisSize: MainAxisSize.min, @@ -659,7 +573,7 @@ class DiaryEditScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.only( - left: 16.h, + left: 14.h, bottom: 11.v, ), child: Text( @@ -689,8 +603,17 @@ class DiaryEditScreen extends StatelessWidget { horizontal: 24.h, vertical: 12.v, ), - decoration: AppDecoration.outlinePrimary.copyWith( - borderRadius: BorderRadiusStyle.roundedBorder12, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], ), child: Column( mainAxisSize: MainAxisSize.min, @@ -734,8 +657,17 @@ class DiaryEditScreen extends StatelessWidget { horizontal: 24.h, vertical: 12.v, ), - decoration: AppDecoration.outlinePrimary.copyWith( - borderRadius: BorderRadiusStyle.roundedBorder12, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], ), child: Column( children: [ @@ -817,8 +749,17 @@ Widget _buildMood( horizontal: 24.h, vertical: 12.v, ), - decoration: AppDecoration.outlinePrimary.copyWith( - borderRadius: BorderRadiusStyle.roundedBorder12, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 2, + blurRadius: 5, + offset: Offset(0, 3), + ), + ], ), child: Column(children: [ GestureDetector( @@ -866,3 +807,229 @@ Future _selectTime( state.wakeupController = pickedTime; } } + +/*Widget _buildImageStack(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric( + horizontal: 24.h, + vertical: 12.v, + ), + decoration: AppDecoration.outlinePrimary.copyWith( + borderRadius: BorderRadiusStyle.roundedBorder12, + ), + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + Align( + alignment: Alignment.center, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 10.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: [ + Text( + "Время приема пищи", + style: CustomTextStyles.bodyMediumBlack900, + ), + _buildMealTime(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: 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, + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ); + }*/ \ No newline at end of file diff --git a/lib/widgets/custom_edit_drop_down.dart b/lib/widgets/custom_edit_drop_down.dart index 12b98cf3..9e22b9ab 100644 --- a/lib/widgets/custom_edit_drop_down.dart +++ b/lib/widgets/custom_edit_drop_down.dart @@ -119,9 +119,8 @@ class CustomDropDown extends StatelessWidget { ), enabledBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, - ), + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: Colors.grey, width: 1)), focusedBorder: borderDecoration ?? OutlineInputBorder( borderRadius: BorderRadius.circular(5),