Skip to content

Commit

Permalink
Remove the warning icon from the Help modal sheet (too ugly)
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 26, 2025
1 parent 599009b commit e3ca2e4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 60 deletions.
2 changes: 1 addition & 1 deletion packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2548,7 +2548,7 @@
"@add_basic_details_product_name_help_info1": {
"description": "Text explaining how to write the product name"
},
"add_basic_details_product_name_help_info2": "Please don't add a translation **if the language is not present on the packaging**.",
"add_basic_details_product_name_help_info2": "**Note:** Please don't add a translation **if the language is not present on the packaging**.",
"@add_basic_details_product_name_help_info2": {
"description": "Text explaining how to write the product name"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,9 @@ class _ProductNameExplanation extends StatelessWidget {
],
),
const SizedBox(height: VERY_LARGE_SPACE),
ExplanationBodyWarning(
ExplanationBodyInfo(
text: appLocalizations.add_basic_details_product_name_help_info2,
icon: false,
safeArea: true,
),
],
Expand Down
71 changes: 14 additions & 57 deletions packages/smooth_app/lib/widgets/smooth_explanation_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,60 +145,12 @@ class ExplanationBodyTitle extends StatelessWidget {
class ExplanationBodyInfo extends StatelessWidget {
const ExplanationBodyInfo({
required this.text,
this.icon = true,
this.safeArea = false,
super.key,
});

final String text;
final bool safeArea;

@override
Widget build(BuildContext context) {
return _ExplanationBodyText(
text: text,
icon: Transform.translate(
offset: const Offset(-17.0, 09.0),
child: const icons.Info(size: 55.0),
),
safeArea: safeArea,
);
}
}

class ExplanationBodyWarning extends StatelessWidget {
const ExplanationBodyWarning({
required this.text,
this.safeArea = false,
super.key,
});

final String text;
final bool safeArea;

@override
Widget build(BuildContext context) {
return _ExplanationBodyText(
text: text,
icon: Transform.translate(
offset: const Offset(-19.0, -06.0),
child: const icons.Warning(
size: 55.0,
),
),
safeArea: safeArea,
);
}
}

class _ExplanationBodyText extends StatelessWidget {
const _ExplanationBodyText({
required this.text,
required this.icon,
required this.safeArea,
});

final String text;
final Widget icon;
final bool icon;
final bool safeArea;

@override
Expand All @@ -217,18 +169,23 @@ class _ExplanationBodyText extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Align(
alignment: AlignmentDirectional.bottomCenter,
child: icons.AppIconTheme(
if (icon)
Align(
alignment: AlignmentDirectional.bottomCenter,
child: icons.AppIconTheme(
color: lightTheme
? extension.primaryNormal
: extension.primaryMedium,
child: icon),
),
child: Transform.translate(
offset: const Offset(-17.0, 09.0),
child: const icons.Info(size: 55.0),
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsetsDirectional.only(
start: SMALL_SPACE,
padding: EdgeInsetsDirectional.only(
start: icon ? SMALL_SPACE : LARGE_SPACE,
end: LARGE_SPACE,
top: MEDIUM_SPACE,
bottom: MEDIUM_SPACE,
Expand Down
2 changes: 1 addition & 1 deletion packages/smooth_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1914,4 +1914,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.6.1 <4.0.0"
flutter: ">=3.24.0"
flutter: ">=3.27.0"

0 comments on commit e3ca2e4

Please sign in to comment.