Skip to content

Commit

Permalink
fix: Fix issues with the menu on lists (#6202)
Browse files Browse the repository at this point in the history
* bugfixes_list

* Remove heroTag from search results

* Personalized lists: better header

* Lists: Ensure the pull to refresh works with non-scrollable listview

* Personalized search: Dismissible widget to take the full height

* Flutter Map: InkWell with the same border radius as the ClipRRect
  • Loading branch information
g123k authored Jan 14, 2025
1 parent f65d70d commit 29bc107
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ class _SmoothProductItemPicture extends StatelessWidget {
bottom: const Radius.circular(08.0),
),
noImageBuilder: (_) => const PictureNotFound(),
heroTag: context.watch<String>(),
blurFilter: false,
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class KnowledgePanelWorldMapCard extends StatelessWidget {
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6.0)),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<Widget>(
Expand Down
24 changes: 17 additions & 7 deletions packages/smooth_app/lib/pages/personalized_ranking_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:smooth_app/helpers/product_compatibility_helper.dart';
import 'package:smooth_app/pages/product/common/loading_status.dart';
import 'package:smooth_app/pages/product/common/product_list_item_simple.dart';
import 'package:smooth_app/pages/product_list_user_dialog_helper.dart';
import 'package:smooth_app/resources/app_icons.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_menu_button.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';
Expand Down Expand Up @@ -106,6 +107,7 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage>
SmoothPopupMenuItem<String>(
value: 'add_to_list',
label: appLocalizations.user_list_button_add_product,
icon: const AddToList.symbol().icon,
),
];
},
Expand Down Expand Up @@ -200,12 +202,21 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage>
) {
final ProductCompatibilityHelper helper =
ProductCompatibilityHelper.status(status);
return Center(
child: Padding(
padding: const EdgeInsets.all(SMALL_SPACE),
child: Text(
helper.getHeaderText(appLocalizations),
style: Theme.of(context).textTheme.titleMedium,
return SizedBox(
width: double.infinity,
child: ColoredBox(
color: helper.getColor(context),
child: Padding(
padding: const EdgeInsets.all(MEDIUM_SPACE),
child: Text(
helper.getHeaderText(appLocalizations),
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
fontSize: 15.0,
color: Colors.white,
),
),
),
),
);
Expand All @@ -220,7 +231,6 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage>
direction: DismissDirection.endToStart,
background: Container(
alignment: AlignmentDirectional.centerEnd,
margin: const EdgeInsets.symmetric(vertical: 14.0),
color: RED_COLOR,
padding: const EdgeInsetsDirectional.only(end: 30.0),
child: const Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ class _ProductListPageState extends State<ProductListPage>
child: ListView.separated(
controller: _scrollController,
itemCount: products.length,
physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) =>
_buildItem(
dismissible,
Expand Down
2 changes: 1 addition & 1 deletion packages/smooth_app/lib/widgets/smooth_menu_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _SmoothPopupMenuButtonState<T> extends State<SmoothPopupMenuButton<T>> {
padding: EdgeInsetsDirectional.only(
bottom: MediaQuery.viewPaddingOf(context).bottom,
),
itemCount: widget.itemBuilder(context).length,
itemCount: list.length,
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
final SmoothPopupMenuItem<T> item = list.elementAt(index);
Expand Down

0 comments on commit 29bc107

Please sign in to comment.