Skip to content

Commit

Permalink
3 variants
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 9, 2025
1 parent 019e319 commit 638ac4b
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 8 deletions.
Binary file modified packages/smooth_app/assets/fonts/SmoothIcons.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions packages/smooth_app/assets/fonts/icons/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# App icons

![List of icons](thumbnail.png)


We don't use icons from SVG, but from a font.

Font icons are way more efficient for multiple reasons:
Expand Down
14 changes: 14 additions & 0 deletions packages/smooth_app/assets/fonts/icons/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,20 @@
"search": [
"move"
]
},
{
"uid": "1b3cd374185ecc2053d9266138088706",
"css": "milk_add",
"code": 59520,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M581.8 0C598.7 0 612.3 13.7 612.3 30.5L612.3 64 702.1 243.6 705.7 251.5C711.1 264.8 713.9 279.1 713.9 293.6L713.9 579.2C712.1 579.2 710.2 579.2 708.3 579.2 689.2 579.2 670.7 581.5 652.9 585.9L652.9 293.6C652.9 285.7 651.1 278 647.6 270.9L581.8 139.3 516 270.9C512.5 277.9 510.7 285.7 510.7 293.6L510.6 692.4C490.6 726.4 479.2 766 479.2 808.3 479.2 816.8 479.6 825.1 480.5 833.4L175.3 833.3C136.4 833.3 104.2 801.1 104.2 762.2L104.2 293.6C104.2 276.2 108.2 259.1 116 243.6L205.8 64 205.8 30.5C205.8 13.7 219.4 0 236.3 0L581.8 0ZM231.5 530.8C218.9 531.1 207.8 539.1 203.6 550.9 199.3 562.7 202.7 576 212.2 584.2 265.1 633.3 346.3 633.3 399.3 584.2 408.6 575.8 411.8 562.5 407.4 550.8 402.9 539 391.7 531.2 379.1 531.1 371.2 531 363.6 534 357.8 539.5 326.6 568.4 284.8 568.4 253.6 539.5 247.7 533.7 239.7 530.6 231.5 530.8ZM236.3 426.8C219.4 426.8 205.8 440.5 205.8 457.3 205.8 474.2 219.4 487.8 236.3 487.8 253.1 487.8 266.8 474.2 266.8 457.3 266.8 440.5 253.1 426.8 236.3 426.8ZM378.6 426.8C361.7 426.8 348.1 440.5 348.1 457.3 348.1 474.2 361.7 487.8 378.6 487.8 395.4 487.8 409 474.2 409 457.3 409 440.5 395.4 426.8 378.6 426.8ZM532.5 101.6L255.1 101.6 184 243.9 461.4 243.9 532.5 101.6ZM708.3 620.8C604.8 620.8 520.8 704.8 520.8 808.3 520.8 911.9 604.8 995.8 708.3 995.8 811.9 995.8 895.8 911.9 895.8 808.3 895.8 704.8 811.9 620.8 708.3 620.8ZM764.6 827.1L727.1 827.1 727.1 864.6C727.1 874.9 718.7 883.3 708.3 883.3L708.3 883.3C698 883.3 689.6 874.9 689.6 864.6L689.6 827.1 652.1 827.1C641.7 827.1 633.3 818.7 633.3 808.3L633.3 808.3C633.3 798 641.7 789.6 652.1 789.6L689.6 789.6 689.6 752.1C689.6 741.7 698 733.3 708.3 733.3L708.3 733.3C718.7 733.3 727.1 741.7 727.1 752.1L727.1 789.6 764.6 789.6C774.9 789.6 783.3 798 783.3 808.3L783.3 808.3C783.3 818.7 774.9 827.1 764.6 827.1Z",
"width": 1000
},
"search": [
"milk_add"
]
}
]
}
Binary file modified packages/smooth_app/assets/fonts/icons/icons.sketch
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/smooth_app/assets/fonts/icons/milk_add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ class SmoothImage extends StatelessWidget {
Colors.grey.withValues(alpha: 0.7),
BlendMode.srcIn,
),
child: const SmoothAppLogo(),
child: const PictureNotFound(
style: PictureNotFoundStyle.sad,
),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ class PictureNotFound extends StatelessWidget {
const PictureNotFound({
this.backgroundColor,
this.foregroundColor,
this.style = PictureNotFoundStyle.happy,
super.key,
}) : backgroundDecoration = null,
_useInk = false;

const PictureNotFound.decoration({
this.backgroundDecoration,
this.foregroundColor,
this.style = PictureNotFoundStyle.happy,
super.key,
}) : backgroundColor = null,
_useInk = false;

const PictureNotFound.ink({
this.backgroundDecoration,
this.foregroundColor,
this.style = PictureNotFoundStyle.happy,
super.key,
}) : _useInk = true,
backgroundColor = null;
Expand All @@ -27,6 +30,7 @@ class PictureNotFound extends StatelessWidget {
final Color? backgroundColor;
final Color? foregroundColor;
final bool _useInk;
final PictureNotFoundStyle style;

@override
Widget build(BuildContext context) {
Expand All @@ -35,9 +39,14 @@ class PictureNotFound extends StatelessWidget {
widthFactor: 0.5,
heightFactor: 0.5,
child: FittedBox(
child: icons.Milk.unhappy(
child: icons.AppIconTheme(
color: foregroundColor ?? const Color(0xFF949494),
size: 1000,
child: switch (style) {
PictureNotFoundStyle.happy => const icons.Milk.happy(),
PictureNotFoundStyle.sad => const icons.Milk.unhappy(),
PictureNotFoundStyle.add => const icons.Milk.add(),
},
),
),
),
Expand Down Expand Up @@ -78,3 +87,9 @@ class PictureNotFound extends StatelessWidget {
}
}
}

enum PictureNotFoundStyle {
happy,
sad,
add,
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class _EditOCRImageNotFound extends StatelessWidget {
backgroundDecoration: BoxDecoration(
borderRadius: ROUNDED_BORDER_RADIUS,
),
style: PictureNotFoundStyle.add,
),
),
Align(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class _EditOcrPageState extends State<EditOcrPage> with UpToDateMixin {
builder: (_) => ProductImageSwipeableView.imageField(
imageField: _helper.getImageField(),
product: upToDateProduct,
initialLanguage: _multilingualHelper.getCurrentLanguage(),
isLoggedInMandatory: widget.isLoggedInMandatory,
),
),
Expand Down
20 changes: 14 additions & 6 deletions packages/smooth_app/lib/resources/app_icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1001,29 +1001,37 @@ class Milk extends AppIcon {
super.key,
}) : super._(_IconsFont.milk);

const Milk.happy({
const Milk.add({
super.color,
super.size,
super.shadow,
super.semanticLabel,
super.key,
}) : super._(_IconsFont.milk_filled);
}) : super._(_IconsFont.milk_add);

const Milk.unhappy({
const Milk.download({
super.color,
super.size,
super.shadow,
super.semanticLabel,
super.key,
}) : super._(_IconsFont.milk_filled_unhappy);
}) : super._(_IconsFont.milk_download);

const Milk.download({
const Milk.happy({
super.color,
super.size,
super.shadow,
super.semanticLabel,
super.key,
}) : super._(_IconsFont.milk_download);
}) : super._(_IconsFont.milk_filled);

const Milk.unhappy({
super.color,
super.size,
super.shadow,
super.semanticLabel,
super.key,
}) : super._(_IconsFont.milk_filled_unhappy);
}

class Move extends AppIcon {
Expand Down
2 changes: 2 additions & 0 deletions packages/smooth_app/lib/resources/app_icons_font.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ class _IconsFont {
IconData(0xe87e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData move =
IconData(0xe87f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData milk_add =
IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData share_cupertino =
IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData share_material =
Expand Down

0 comments on commit 638ac4b

Please sign in to comment.