From fde1a98f1d8057ccb4dabe3f4bb844cb43fecfd8 Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Sun, 3 Apr 2022 19:37:43 +0530 Subject: [PATCH 1/4] dismissible color added to personalized ranking --- .../lib/pages/personalized_ranking_page.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/smooth_app/lib/pages/personalized_ranking_page.dart b/packages/smooth_app/lib/pages/personalized_ranking_page.dart index 83af14529f7..e00e7d6659e 100644 --- a/packages/smooth_app/lib/pages/personalized_ranking_page.dart +++ b/packages/smooth_app/lib/pages/personalized_ranking_page.dart @@ -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'; + class PersonalizedRankingPage extends StatefulWidget { PersonalizedRankingPage({ required final ProductList productList, @@ -154,6 +156,17 @@ class _PersonalizedRankingPageState extends State { 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); From 751fa08d64cf81dc343042e9226c9a786acd579c Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Sun, 3 Apr 2022 19:37:43 +0530 Subject: [PATCH 2/4] dismissible color added to personalized ranking --- .../lib/pages/personalized_ranking_page.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/smooth_app/lib/pages/personalized_ranking_page.dart b/packages/smooth_app/lib/pages/personalized_ranking_page.dart index 83af14529f7..e00e7d6659e 100644 --- a/packages/smooth_app/lib/pages/personalized_ranking_page.dart +++ b/packages/smooth_app/lib/pages/personalized_ranking_page.dart @@ -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'; + class PersonalizedRankingPage extends StatefulWidget { PersonalizedRankingPage({ required final ProductList productList, @@ -154,6 +156,17 @@ class _PersonalizedRankingPageState extends State { 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); From 5cf1ca50ea11c7ca5242c1041bf51a84b6507b93 Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Sun, 3 Apr 2022 21:38:01 +0530 Subject: [PATCH 3/4] imported direct file rather than relative --- packages/smooth_app/lib/pages/personalized_ranking_page.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/smooth_app/lib/pages/personalized_ranking_page.dart b/packages/smooth_app/lib/pages/personalized_ranking_page.dart index e00e7d6659e..0d35c0f5aa0 100644 --- a/packages/smooth_app/lib/pages/personalized_ranking_page.dart +++ b/packages/smooth_app/lib/pages/personalized_ranking_page.dart @@ -9,11 +9,10 @@ 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'; -import '../generic_lib/design_constants.dart'; - class PersonalizedRankingPage extends StatefulWidget { PersonalizedRankingPage({ required final ProductList productList, From 699756e1549fd34374747aae6c325b22878be5b9 Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Sun, 3 Apr 2022 21:54:22 +0530 Subject: [PATCH 4/4] made constants in use instead of --- packages/smooth_app/lib/pages/personalized_ranking_page.dart | 2 -- packages/smooth_app/lib/pages/scan/search_history_view.dart | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/smooth_app/lib/pages/personalized_ranking_page.dart b/packages/smooth_app/lib/pages/personalized_ranking_page.dart index c7e1e939381..0d35c0f5aa0 100644 --- a/packages/smooth_app/lib/pages/personalized_ranking_page.dart +++ b/packages/smooth_app/lib/pages/personalized_ranking_page.dart @@ -13,8 +13,6 @@ 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'; -import '../generic_lib/design_constants.dart'; - class PersonalizedRankingPage extends StatefulWidget { PersonalizedRankingPage({ required final ProductList productList, diff --git a/packages/smooth_app/lib/pages/scan/search_history_view.dart b/packages/smooth_app/lib/pages/scan/search_history_view.dart index 9227cb127c3..0b8e4b1a979 100644 --- a/packages/smooth_app/lib/pages/scan/search_history_view.dart +++ b/packages/smooth_app/lib/pages/scan/search_history_view.dart @@ -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({ @@ -47,7 +48,7 @@ class _SearchHistoryViewState extends State { 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.