-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Make attributes clickable (without Provider) (#1666)
* feat: Make attributes clickable * feat: Make ScoreCard clickable * fix: Imports * Applied review * Update summary_card.dart * simplification after query merge * Format
- Loading branch information
Showing
6 changed files
with
106 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:openfoodfacts/model/KnowledgePanel.dart'; | ||
import 'package:openfoodfacts/model/KnowledgePanels.dart'; | ||
import 'package:smooth_app/cards/product_cards/knowledge_panels/knowledge_panel_expanded_card.dart'; | ||
import 'package:smooth_app/generic_lib/design_constants.dart'; | ||
import 'package:smooth_app/generic_lib/widgets/smooth_card.dart'; | ||
import 'package:smooth_app/themes/smooth_theme.dart'; | ||
|
||
class KnowledgePanelPage extends StatelessWidget { | ||
const KnowledgePanelPage({ | ||
required this.panel, | ||
required this.allPanels, | ||
}); | ||
|
||
final KnowledgePanel panel; | ||
final KnowledgePanels allPanels; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final ThemeData themeData = Theme.of(context); | ||
return Scaffold( | ||
backgroundColor: SmoothTheme.getColor( | ||
themeData.colorScheme, | ||
SmoothTheme.getMaterialColor(context), | ||
ColorDestination.SURFACE_BACKGROUND, | ||
), | ||
appBar: AppBar( | ||
title: Text(panel.titleElement!.title), | ||
), | ||
body: SingleChildScrollView( | ||
child: SmoothCard( | ||
padding: const EdgeInsets.all( | ||
SMALL_SPACE, | ||
), | ||
child: KnowledgePanelExpandedCard( | ||
panel: panel, | ||
allPanels: allPanels, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters