Skip to content

Commit 69cf699

Browse files
authored
Product screen v2 (#10)
1 parent 3dd9710 commit 69cf699

16 files changed

Lines changed: 420 additions & 325 deletions

assets/translations/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang": "English",
33
"app_name": "WooApp",
4-
"recently_viewed": "Recently you have looked at:",
4+
"recently_viewed": "Recently you have looked at",
55
"tab_home": "Home",
66
"tab_catalog": "Catalog",
77
"tab_search": "Search",
@@ -87,6 +87,8 @@
8787
"filter_on_sale": "On sale",
8888
"filter_stock": "Availability",
8989
"filter_price": "Price",
90+
"product_description": "Description",
91+
"product_characteristics": "Product properties",
9092
"product_property_id": "Unique ID",
9193
"product_property_name": "Name",
9294
"product_property_price": "Price",

assets/translations/ru.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang": "Русский",
33
"app_name": "WooApp",
4-
"recently_viewed": "Недавно вы интересовались:",
4+
"recently_viewed": "Недавно вы интересовались",
55
"tab_home": "Товары",
66
"tab_catalog": "Каталог",
77
"tab_search": "Поиск",
@@ -87,6 +87,8 @@
8787
"filter_on_sale": "Акции и распродажи",
8888
"filter_stock": "Наличие",
8989
"filter_price": "Цена",
90+
"product_description": "Описание",
91+
"product_characteristics": "Характеристики товара",
9092
"product_property_id": "Идентификатор",
9193
"product_property_name": "Наименование",
9294
"product_property_price": "Цена",

assets/translations/uk.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang": "Українська",
33
"app_name": "WooApp",
4-
"recently_viewed": "Нещодавно вас зацікавило:",
4+
"recently_viewed": "Нещодавно вас зацікавило",
55
"tab_home": "Товари",
66
"tab_catalog": "Каталог",
77
"tab_search": "Пошук",
@@ -87,6 +87,8 @@
8787
"filter_on_sale": "Акції та розпродажі",
8888
"filter_stock": "Наявність",
8989
"filter_price": "Ціна",
90+
"product_description": "Опис",
91+
"product_characteristics": "Характеристики товару",
9092
"product_property_id": "Ідентифікатор",
9193
"product_property_name": "Найменування",
9294
"product_property_price": "Ціна",

lib/database/database.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class AppDb {
185185

186186
Future<void> saveProductView(Product product) async {
187187
var box = await Hive.openBox(boxViewedProduct);
188-
if (box.containsKey('$keyViewedProduct${product.id}')) return box.close();
188+
if (box.containsKey('$keyViewedProduct${product.id}')) return;
189189
box.put(
190190
'$keyViewedProduct${product.id}',
191191
ViewedProduct(
@@ -195,7 +195,6 @@ class AppDb {
195195
product.images[0].src,
196196
),
197197
);
198-
return box.close();
199198
}
200199

201200
Future<List<ViewedProduct>> getViewedProducts() async {

lib/extensions/extensions_context.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void showWooScrollableBottomSheet(
5757
maxChildSize: 0.85,
5858
builder: (_, controller) => Container(
5959
decoration: BoxDecoration(
60-
color: Colors.white,
60+
color: WooAppTheme.colorCommonBackground,
6161
borderRadius: BorderRadius.only(
6262
topLeft: const Radius.circular(20.0),
6363
topRight: const Radius.circular(20.0),

lib/screens/category/category_screen.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ class CategoryScreen extends StatefulWidget {
3333
}
3434

3535
class _CategoryScreenState extends State<CategoryScreen> {
36-
final CategoryAttributeDateSource _ds = locator<CategoryAttributeDateSource>();
37-
final PagingController<int, CategoryProduct> _pagingController = PagingController(firstPageKey: 1);
36+
final CategoryAttributeDateSource _ds =
37+
locator<CategoryAttributeDateSource>();
38+
final PagingController<int, CategoryProduct> _pagingController =
39+
PagingController(firstPageKey: 1);
3840

3941
final _scaffoldKey = GlobalKey<ScaffoldState>();
4042

@@ -67,7 +69,7 @@ class _CategoryScreenState extends State<CategoryScreen> {
6769
color: WooAppTheme.colorToolbarForeground,
6870
),
6971
actions: [
70-
IconButton(
72+
if (widget.categoryDesc.isNotEmpty) IconButton(
7173
onPressed: () => Navigator.of(context).push(
7274
MaterialPageRoute(
7375
builder: (context) => CategoryInfoScreen(

0 commit comments

Comments
 (0)