diff --git a/packages/smooth_app/lib/pages/prices/price_product_search_page.dart b/packages/smooth_app/lib/pages/prices/price_product_search_page.dart index e16b639b764..fcfc88b81fb 100644 --- a/packages/smooth_app/lib/pages/prices/price_product_search_page.dart +++ b/packages/smooth_app/lib/pages/prices/price_product_search_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; import 'package:smooth_app/data_models/fetched_product.dart'; @@ -26,13 +27,15 @@ class PriceProductSearchPage extends StatefulWidget { }); final PriceMetaProduct? product; + // TODO(monsieurtanuki): as a parameter, add a list of barcodes already there: we're not supposed to select twice the same product @override State createState() => _PriceProductSearchPageState(); } -class _PriceProductSearchPageState extends State { +class _PriceProductSearchPageState extends State + with TraceableClientMixin { final TextEditingController _controller = TextEditingController(); late PriceMetaProduct? _product = widget.product; diff --git a/packages/smooth_app/lib/pages/prices/prices_proofs_page.dart b/packages/smooth_app/lib/pages/prices/prices_proofs_page.dart index fe5f202231c..fac691981f4 100644 --- a/packages/smooth_app/lib/pages/prices/prices_proofs_page.dart +++ b/packages/smooth_app/lib/pages/prices/prices_proofs_page.dart @@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:intl/intl.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/generic_lib/widgets/images/smooth_image.dart'; @@ -21,7 +22,8 @@ class PricesProofsPage extends StatefulWidget { State createState() => _PricesProofsPageState(); } -class _PricesProofsPageState extends State { +class _PricesProofsPageState extends State + with TraceableClientMixin { late final Future> _results = _download(); static const int _columns = 3; diff --git a/packages/smooth_app/lib/pages/prices/prices_users_page.dart b/packages/smooth_app/lib/pages/prices/prices_users_page.dart index 07a32bbe50f..4ec9283aaec 100644 --- a/packages/smooth_app/lib/pages/prices/prices_users_page.dart +++ b/packages/smooth_app/lib/pages/prices/prices_users_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/generic_lib/widgets/smooth_back_button.dart'; @@ -20,7 +21,8 @@ class PricesUsersPage extends StatefulWidget { State createState() => _PricesUsersPageState(); } -class _PricesUsersPageState extends State { +class _PricesUsersPageState extends State + with TraceableClientMixin { late final Future> _users = _showTopUsers(); // In this specific page, let's never try to go beyond the top 10. diff --git a/packages/smooth_app/lib/pages/prices/product_price_add_page.dart b/packages/smooth_app/lib/pages/prices/product_price_add_page.dart index d851750fc1f..733098d9703 100644 --- a/packages/smooth_app/lib/pages/prices/product_price_add_page.dart +++ b/packages/smooth_app/lib/pages/prices/product_price_add_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; import 'package:smooth_app/data_models/preferences/user_preferences.dart'; @@ -56,6 +57,7 @@ class ProductPriceAddPage extends StatefulWidget { if (!context.mounted) { return; } + await Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => ProductPriceAddPage( @@ -71,7 +73,8 @@ class ProductPriceAddPage extends StatefulWidget { State createState() => _ProductPriceAddPageState(); } -class _ProductPriceAddPageState extends State { +class _ProductPriceAddPageState extends State + with TraceableClientMixin { late final PriceModel _model = PriceModel( proofType: widget.proofType, locations: widget.latestOsmLocations, @@ -244,4 +247,7 @@ class _ProductPriceAddPageState extends State { } return true; } + + @override + String get actionName => 'Opened price_page with ${widget.proofType.offTag}'; } diff --git a/packages/smooth_app/lib/pages/prices/product_prices_list.dart b/packages/smooth_app/lib/pages/prices/product_prices_list.dart index 61b82d54203..8f30271732d 100644 --- a/packages/smooth_app/lib/pages/prices/product_prices_list.dart +++ b/packages/smooth_app/lib/pages/prices/product_prices_list.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/generic_lib/widgets/smooth_card.dart'; @@ -20,7 +21,8 @@ class ProductPricesList extends StatefulWidget { State createState() => _ProductPricesListState(); } -class _ProductPricesListState extends State { +class _ProductPricesListState extends State + with TraceableClientMixin { late final Future> _prices = _showProductPrices(widget.model.parameters);