Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #2123 onboarding preference issues #2231

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class _HelperState extends State<_Helper> {
),
),
Container(
height: _isProductExpanded ? null : 150,
height: _isProductExpanded ? null : 180,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit approximative...

padding: const EdgeInsets.only(
bottom: LARGE_SPACE,
right: LARGE_SPACE,
Expand All @@ -108,6 +108,7 @@ class _HelperState extends State<_Helper> {
productPreferences,
isFullVersion: _isProductExpanded,
isRemovable: false,
isSettingClickable: false,
),
),
),
Expand Down
26 changes: 18 additions & 8 deletions packages/smooth_app/lib/pages/product/summary_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class SummaryCard extends StatefulWidget {
this.showUnansweredQuestions = false,
this.refreshProductCallback,
this.isRemovable = true,
this.isSettingClickable = true,
});

final Product _product;
Expand All @@ -67,6 +68,9 @@ class SummaryCard extends StatefulWidget {
/// If true, there will be a button to remove the product from the carousel.
final bool isRemovable;

/// If true, the icon setting will be clickable.
final bool isSettingClickable;

/// Callback to refresh the product when necessary.
final Function(BuildContext)? refreshProductCallback;

Expand Down Expand Up @@ -417,16 +421,22 @@ class _SummaryCardState extends State<SummaryCard> {
),
InkWell(
borderRadius: const BorderRadius.only(topRight: ROUNDED_RADIUS),
onTap: () async => Navigator.push<Widget>(
context,
MaterialPageRoute<Widget>(
builder: (BuildContext context) => const UserPreferencesPage(
type: PreferencePageType.FOOD,
),
),
),
onTap: widget.isSettingClickable
? () async => Navigator.push<Widget>(
context,
MaterialPageRoute<Widget>(
builder: (BuildContext context) =>
const UserPreferencesPage(
type: PreferencePageType.FOOD,
),
),
)
: null,
child: Tooltip(
message: appLocalizations.open_food_preferences_tooltip,
triggerMode: widget.isSettingClickable
? TooltipTriggerMode.longPress
: TooltipTriggerMode.tap,
child: const SizedBox.square(
dimension: kMinInteractiveDimension,
child: Icon(
Expand Down