Skip to content

Commit

Permalink
feat: openfoodfacts#960 - adjustments after golden and stephanegigandet
Browse files Browse the repository at this point in the history
Impacted files:
* `attribute_button.dart`: smaller title style, info on the right, minimum target size
* `user_preferences_page-blue-dark.png`: golden refresh
* `user_preferences_page-blue-light.png`: golden refresh
* `user_preferences_page-brown-dark.png`: golden refresh
* `user_preferences_page-brown-light.png`: golden refresh
* `user_preferences_page-green-dark.png`: golden refresh
* `user_preferences_page-green-light.png`: golden refresh
  • Loading branch information
monsieurtanuki committed May 6, 2022
1 parent 31c0ff1 commit 0abc679
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions packages/smooth_app/lib/widgets/attribute_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ class AttributeButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final IconThemeData iconThemeData = IconTheme.of(context);
final String currentImportanceId =
productPreferences.getImportanceIdForAttributeId(attribute.id!);
const double horizontalPadding = LARGE_SPACE;
final double widgetWidth =
MediaQuery.of(context).size.width - 2 * horizontalPadding;
final double importanceWidth = widgetWidth / 4;
final TextStyle style = themeData.textTheme.headline3!;
final TextStyle style = themeData.textTheme.headline4!;
final String? info = attribute.settingNote;
final List<Widget> children = <Widget>[];
for (final String importanceId in _importanceIds) {
Expand All @@ -59,8 +58,9 @@ class AttributeButton extends StatelessWidget {
),
);
},
child: SizedBox(
child: Container(
width: importanceWidth,
constraints: const BoxConstraints(minHeight: MINIMUM_TARGET_SIZE),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down Expand Up @@ -93,31 +93,12 @@ class AttributeButton extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
child: SizedBox(
height: MINIMUM_TARGET_SIZE,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
if (info != null) const Icon(Icons.info_outline),
Container(
padding: info == null
? null
: const EdgeInsets.only(left: SMALL_SPACE),
child: SizedBox(
width: widgetWidth -
SMALL_SPACE -
(iconThemeData.size ?? DEFAULT_ICON_SIZE),
child: AutoSizeText(
attribute.settingName ?? attribute.name!,
maxLines: 2,
style: style,
),
),
),
],
),
ListTile(
trailing: info == null ? null : const Icon(Icons.info_outline),
title: AutoSizeText(
attribute.settingName ?? attribute.name!,
maxLines: 2,
style: style,
),
onTap: info == null
? null
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0abc679

Please sign in to comment.