diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart index 4d9a5335227..55fcc1888ad 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; @@ -108,4 +109,11 @@ class KnowledgePanelActionCard extends StatelessWidget { return false; } } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('html', element.html)); + properties.add(IterableProperty('actions', element.actions)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_card.dart index ebce76fb64a..4966f07bd39 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; @@ -91,4 +92,11 @@ class KnowledgePanelCard extends StatelessWidget { } return false; } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('panelId', panelId)); + properties.add(DiagnosticsProperty('clickable', isClickable)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_expanded_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_expanded_card.dart index 8b01476e83d..3a47e3d2acf 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_expanded_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_expanded_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; @@ -51,4 +52,14 @@ class KnowledgePanelExpandedCard extends StatelessWidget { children: elementWidgets, ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('panelId', panelId)); + properties.add( + DiagnosticsProperty('initiallyExpanded', isInitiallyExpanded), + ); + properties.add(DiagnosticsProperty('clickable', isClickable)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_group_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_group_card.dart index 89125ea5093..0ac2b7f6603 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_group_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_group_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; @@ -43,4 +44,12 @@ class KnowledgePanelGroupCard extends StatelessWidget { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('groupElement', groupElement.title)); + properties.add(DiagnosticsProperty('clickable', isClickable)); + properties.add(IterableProperty('panelIds', groupElement.panelIds)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_image_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_image_card.dart index 622cedb82aa..b44ee88d481 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_image_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_image_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; @@ -16,4 +17,12 @@ class KnowledgePanelImageCard extends StatelessWidget { width: imageElement.width?.toDouble(), height: imageElement.height?.toDouble(), ); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('url', imageElement.url)); + properties.add(IntProperty('width', imageElement.width)); + properties.add(IntProperty('height', imageElement.height)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_page.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_page.dart index 3925c35b96b..3d0ead01919 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_page.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; @@ -124,4 +125,10 @@ class _KnowledgePanelPageState extends State } return ''; } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('panelId', widget.panelId)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_product_cards.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_product_cards.dart index 19a44c4b7a9..d9592d96fd0 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_product_cards.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_product_cards.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/helpers/product_cards_helper.dart'; @@ -35,4 +36,10 @@ class KnowledgePanelProductCards extends StatelessWidget { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(IntProperty('count', knowledgePanelWidgets.length)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_table_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_table_card.dart index 954a2bedd62..814cc8841e9 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_table_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_table_card.dart @@ -1,5 +1,6 @@ import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; @@ -272,6 +273,14 @@ class _KnowledgePanelTableCardState extends State { return buffer.toString(); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('tableElementId', widget.tableElement.id)); + properties + .add(DiagnosticsProperty('expanded', widget.isInitiallyExpanded)); + } } class TableCellWidget extends StatefulWidget { @@ -404,4 +413,12 @@ class _TableCellWidgetState extends State { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + .add(DiagnosticsProperty('expanded', widget.isInitiallyExpanded)); + properties.add(DoubleProperty('cellWidth', widget.cellWidth)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_text_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_text_card.dart index f59bb71bd09..f3a7d962584 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_text_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_text_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; @@ -56,4 +57,11 @@ class KnowledgePanelTextCard extends StatelessWidget { bool get _hasSource => textElement.sourceText?.isNotEmpty == true && textElement.sourceUrl?.isNotEmpty == true; + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(StringProperty('text', textElement.sourceText)); + properties.add(StringProperty('url', textElement.sourceUrl)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_title_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_title_card.dart index 528a60499df..ae51b6fc00a 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_title_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_title_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; @@ -182,4 +183,23 @@ class KnowledgePanelTitleCard extends StatelessWidget { return buffer.toString(); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + + properties.add( + StringProperty('iconUrl', knowledgePanelTitleElement.iconUrl), + ); + properties.add( + EnumProperty('type', knowledgePanelTitleElement.type), + ); + properties.add( + EnumProperty('grade', knowledgePanelTitleElement.grade), + ); + properties.add( + DiagnosticsProperty('clickable', isClickable), + ); + properties.add(EnumProperty('evaluation', evaluation)); + } } diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_world_map_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_world_map_card.dart index 1c76fe01008..9c6f4f143fe 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_world_map_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_world_map_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_map/flutter_map.dart'; import 'package:latlong2/latlong.dart'; @@ -85,4 +86,18 @@ class KnowledgePanelWorldMapCard extends StatelessWidget { ), ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add( + IterableProperty( + 'pointers', + mapElement.pointers.map( + (KnowledgePanelGeoPointer pointer) => + pointer.geo?.toJson().toString(), + ), + ), + ); + } }