diff --git a/lib/app/common/add_button.dart b/lib/app/common/add_button.dart index c8bc82e..ad0c0fe 100644 --- a/lib/app/common/add_button.dart +++ b/lib/app/common/add_button.dart @@ -34,27 +34,5 @@ class AddButton extends StatelessWidget { ), ), ); - - // return ElevatedButton( - // onPressed: onPressed, - // style: OutlinedButton.styleFrom( - // elevation: 0, - // fixedSize: Size(119.toAutoScaledWidthWithContext(context), 42.toAutoScaledHeightWithContext(context)), - // padding: EdgeInsets.zero, - // side: const BorderSide( - // color: Color(0xFF3D54FF), - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(4), - // ), - // ), - // child: Text( - // 'Add', - // style: TextStyle( - // fontSize: 12.toAutoScaledWidthWithContext(context), - // color: const Color(0xFF3D54FF), - // ), - // ), - // ); } } diff --git a/lib/presentation/menu/widgets/category_card.dart b/lib/presentation/menu/widgets/category_card.dart index e0f1918..1dc7535 100644 --- a/lib/presentation/menu/widgets/category_card.dart +++ b/lib/presentation/menu/widgets/category_card.dart @@ -30,80 +30,83 @@ class _CategoryCardState extends State { right: 16.toAutoScaledWidthWithContext(context), bottom: 16.toAutoScaledWidthWithContext(context), ), - child: Theme( - data: Theme.of(context).copyWith(dividerColor: Colors.transparent), - child: ExpansionTile( - key: ValueKey(isInitiallyExpanded), - initiallyExpanded: isInitiallyExpanded, - tilePadding: EdgeInsets.symmetric( - vertical: 8.toAutoScaledWidthWithContext(context), - horizontal: 16.toAutoScaledWidthWithContext(context), - ), - trailing: trailingWidget(isExpanded), - onExpansionChanged: (bool expanded) { - setState(() { - isExpanded = expanded; - }); - }, - backgroundColor: Colors.white, - collapsedBackgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.toAutoScaledWidthWithContext(context)), - ), - collapsedShape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.toAutoScaledWidthWithContext(context)), - ), - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - widget.categoryName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.toAutoScaledWidthWithContext(context), - fontWeight: FontWeight.w600, - ), + child: ExpansionTile( + key: ValueKey(isInitiallyExpanded), + initiallyExpanded: isInitiallyExpanded, + childrenPadding: EdgeInsets.zero, + tilePadding: EdgeInsets.symmetric( + vertical: 8.toAutoScaledHeightWithContext(context), + horizontal: 16.toAutoScaledWidthWithContext(context), + ), + trailing: trailingWidget(isExpanded), + onExpansionChanged: (bool expanded) { + setState(() { + isExpanded = expanded; + }); + }, + backgroundColor: Colors.white, + collapsedBackgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + collapsedShape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text( + widget.categoryName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.toAutoScaledWidthWithContext(context), + fontWeight: FontWeight.w600, ), ), - Text( + ), + Expanded( + flex: 1, + child: Text( '${widget.entries.length} items', + textAlign: TextAlign.end, style: TextStyle( fontSize: 12.toAutoScaledWidthWithContext(context), color: const Color(0xFFA9AAAE), ), ), - ], - ), - children: [ - const Divider( - height: 2, - color: Color(0xFFE5E6EF), ), - ...widget.entries.asMap().entries.map((e) { - final selectedMeatPref = controller.selectedMeatStatus.value; - final isMeatPrefEmpty = selectedMeatPref == null; + ], + ), + children: [ + const Divider( + height: 2, + color: Color(0xFFE5E6EF), + ), + ...widget.entries.asMap().entries.map((e) { + final selectedMeatPref = controller.selectedMeatStatus.value; + final isMeatPrefEmpty = selectedMeatPref == null; - if (isMeatPrefEmpty) { + if (isMeatPrefEmpty) { + return DishCard( + isFirst: e.key == 0, + entry: e.value, + ); + } else { + final isMeatPrefMatch = e.value.dish.meatStatus == selectedMeatPref; + if (isMeatPrefMatch) { return DishCard( isFirst: e.key == 0, entry: e.value, ); } else { - final isMeatPrefMatch = e.value.dish.meatStatus == selectedMeatPref; - if (isMeatPrefMatch) { - return DishCard( - isFirst: e.key == 0, - entry: e.value, - ); - } else { - return SizedBox.shrink(); - } + return SizedBox.shrink(); } - }).toList(), - ], - ), + } + }).toList(), + ], ), ); }); @@ -114,7 +117,7 @@ class _CategoryCardState extends State { height: 20.toAutoScaledHeightWithContext(context), width: 20.toAutoScaledWidthWithContext(context), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.toAutoScaledWidthWithContext(context)), + borderRadius: BorderRadius.circular(4), color: const Color(0xFFE5E6EF), ), child: Center( diff --git a/lib/presentation/menu/widgets/preference_bar.dart b/lib/presentation/menu/widgets/preference_bar.dart index 11b774b..8ec83c6 100644 --- a/lib/presentation/menu/widgets/preference_bar.dart +++ b/lib/presentation/menu/widgets/preference_bar.dart @@ -76,7 +76,7 @@ class PreferenceButton extends StatelessWidget { border: Border.all( width: 0.5, ), - borderRadius: BorderRadius.circular(4.toAutoScaledWidthWithContext(context)), + borderRadius: BorderRadius.circular(4), ), child: Row( children: [