Skip to content

Commit

Permalink
feat: dismissible color added to personalized ranking (#1476)
Browse files Browse the repository at this point in the history
* dismissible color added to personalized ranking

* dismissible color added to personalized ranking

* imported direct file rather than relative

* made constants in use instead of
  • Loading branch information
AshAman999 authored Apr 3, 2022
1 parent 6f00d88 commit a397c58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/smooth_app/lib/pages/personalized_ranking_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:smooth_app/data_models/smooth_it_model.dart';
import 'package:smooth_app/data_models/user_preferences.dart';
import 'package:smooth_app/database/dao_product_list.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/helpers/smooth_matched_product.dart';

Expand Down Expand Up @@ -154,6 +155,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
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/pages/scan/search_history_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/database/dao_string_list.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';

class SearchHistoryView extends StatefulWidget {
const SearchHistoryView({
Expand Down Expand Up @@ -47,7 +48,7 @@ class _SearchHistoryViewState extends State<SearchHistoryView> {
direction: DismissDirection.endToStart,
onDismissed: (DismissDirection direction) =>
_handleDismissed(context, query),
background: Container(color: Colors.red),
background: Container(color: RED_COLOR),
child: ListTile(
leading: const SizedBox(
height: double.infinity, // Vertically center the icon.
Expand Down

0 comments on commit a397c58

Please sign in to comment.