From e036f4c3180a8f7c0ffb24ac706ab0e0c9016795 Mon Sep 17 00:00:00 2001 From: maxxkim Date: Fri, 9 Feb 2024 16:21:18 +0000 Subject: [PATCH] revert 53d6ea56a0357fbd69e10002b8e26b6eb210b281 revert feat(diary) Initial layouts for Diary edit --- .../diary_edit_screen/diary_edit_screen.dart | 782 ------------------ lib/routes/app_routes.dart | 6 - lib/widgets/custom_drop_down.dart | 49 +- lib/widgets/custom_icon_button.dart | 72 -- 4 files changed, 29 insertions(+), 880 deletions(-) delete mode 100644 lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart delete mode 100644 lib/widgets/custom_icon_button.dart diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart deleted file mode 100644 index 09ce91c5..00000000 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ /dev/null @@ -1,782 +0,0 @@ -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 dropdownItemList = [ - "Item One", - "Item Two", - "Item Three", - ]; - - List dropdownItemList1 = [ - "Item One", - "Item Two", - "Item Three", - ]; - - TextEditingController enterProductNameController = TextEditingController(); - - TextEditingController quantityController = TextEditingController(); - - List dropdownItemList2 = [ - "Item One", - "Item Two", - "Item Three", - ]; - - List 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, - ); - } -} diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index d3b1fcd1..b83e7ff9 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -19,7 +19,6 @@ 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 @@ -70,10 +69,6 @@ class AppRoutes { static const String mySettings = '/mySettings'; - //DIARY - - static const String diaryEdit = '/diaryEdit'; - static Map get routes => { dateOfBirthScreen: DateOfBirthScreen.builder, cityOfLivingScreen: CityOfLivingScreen.builder, @@ -96,6 +91,5 @@ class AppRoutes { initialRoute: SplashScreen.builder, myProfile: MyProfileScreen.builder, mySettings: MySettingsScreen.builder, - diaryEdit: DiaryEditScreen.builder, }; } diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index 12b98cf3..dd5afc7d 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; class CustomDropDown extends StatelessWidget { @@ -38,7 +39,7 @@ class CustomDropDown extends StatelessWidget { final TextStyle? textStyle; - final List? items; + final List? items; final String? hintText; @@ -60,9 +61,9 @@ class CustomDropDown extends StatelessWidget { final bool? filled; - final FormFieldValidator? validator; + final FormFieldValidator? validator; - final Function(String)? onChanged; + final Function(SelectionPopupModel)? onChanged; @override Widget build(BuildContext context) { @@ -76,29 +77,31 @@ class CustomDropDown extends StatelessWidget { Widget get dropDownWidget => SizedBox( width: width ?? double.maxFinite, - child: DropdownButtonFormField( + child: DropdownButtonFormField( focusNode: focusNode ?? FocusNode(), icon: icon, autofocus: autofocus!, - items: items?.map>((String value) { - return DropdownMenuItem( - value: value, + style: textStyle ?? theme.textTheme.titleMedium, + items: items?.map((SelectionPopupModel item) { + return DropdownMenuItem( + value: item, child: Text( - value, + item.title, overflow: TextOverflow.ellipsis, + style: hintStyle ?? theme.textTheme.titleMedium, ), ); }).toList(), decoration: decoration, validator: validator, onChanged: (value) { - onChanged!(value.toString()); + onChanged!(value!); }, ), ); InputDecoration get decoration => InputDecoration( hintText: hintText ?? "", - hintStyle: hintStyle, + hintStyle: hintStyle ?? theme.textTheme.titleMedium, prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, @@ -106,27 +109,33 @@ class CustomDropDown extends StatelessWidget { isDense: true, contentPadding: contentPadding ?? EdgeInsets.only( - left: 17, - top: 17, - bottom: 17, + left: 6.h, + top: 6.v, + bottom: 6.v, ), - fillColor: fillColor, + fillColor: fillColor ?? theme.colorScheme.onPrimary, filled: filled, border: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(8.h), + borderSide: BorderSide( + color: appTheme.blueA400, + width: 1, + ), ), enabledBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(8.h), + borderSide: BorderSide( + color: appTheme.blueA400, + width: 1, + ), ), focusedBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(5), + borderRadius: BorderRadius.circular(8.h), borderSide: BorderSide( - color: Colors.blue, + color: appTheme.blueA400, width: 1, ), ), diff --git a/lib/widgets/custom_icon_button.dart b/lib/widgets/custom_icon_button.dart deleted file mode 100644 index cdf5b5b5..00000000 --- a/lib/widgets/custom_icon_button.dart +++ /dev/null @@ -1,72 +0,0 @@ -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), - ); -}