Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dismissible color added to personalized ranking #1476

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/smooth_app/lib/pages/personalized_ranking_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/helpers/smooth_matched_product.dart';

import '../generic_lib/design_constants.dart';
AshAman999 marked this conversation as resolved.
Show resolved Hide resolved

class PersonalizedRankingPage extends StatefulWidget {
PersonalizedRankingPage({
required final ProductList productList,
Expand Down Expand Up @@ -154,6 +156,17 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage> {
final AppLocalizations appLocalizations,
) =>
Dismissible(
direction: DismissDirection.endToStart,
background: Container(
alignment: Alignment.centerRight,
margin: const EdgeInsets.symmetric(vertical: 14),
color: RED_COLOR,
padding: const EdgeInsets.only(right: 30),
child: const Icon(
Icons.delete,
color: Colors.white,
),
),
key: Key(matchedProduct.product.barcode!),
onDismissed: (final DismissDirection direction) async {
final bool removed = widget.products.remove(matchedProduct.product);
Expand Down