165 lines
4.2 KiB
Dart
165 lines
4.2 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:get/utils.dart';
|
|
import 'package:icons_plus/icons_plus.dart';
|
|
|
|
enum ProductCategoryIcons {
|
|
birthday_2,
|
|
bone,
|
|
bowl,
|
|
bread,
|
|
cake,
|
|
candy_2,
|
|
candy,
|
|
carrot,
|
|
champagne,
|
|
chicken,
|
|
chopsticks,
|
|
cookie,
|
|
cookie_man,
|
|
cupcake,
|
|
drink,
|
|
egg_crack,
|
|
egg,
|
|
fish,
|
|
fork_knife,
|
|
fork,
|
|
fork_spoon,
|
|
glass_cup,
|
|
ice_cream_2,
|
|
ice_cream,
|
|
lollipop,
|
|
spoon,
|
|
sugar_coated_haws,
|
|
teacup,
|
|
wine,
|
|
wineglass_2,
|
|
wineglass;
|
|
|
|
IconData get icon {
|
|
switch (this) {
|
|
case ProductCategoryIcons.birthday_2:
|
|
return MingCute.birthday_2_line;
|
|
case ProductCategoryIcons.bone:
|
|
return MingCute.bone_line;
|
|
case ProductCategoryIcons.bowl:
|
|
return MingCute.bowl_line;
|
|
case ProductCategoryIcons.bread:
|
|
return MingCute.bread_line;
|
|
case ProductCategoryIcons.cake:
|
|
return MingCute.cake_line;
|
|
case ProductCategoryIcons.candy_2:
|
|
return MingCute.candy_2_line;
|
|
case ProductCategoryIcons.candy:
|
|
return MingCute.candy_line;
|
|
case ProductCategoryIcons.carrot:
|
|
return MingCute.carrot_line;
|
|
case ProductCategoryIcons.champagne:
|
|
return MingCute.champagne_line;
|
|
case ProductCategoryIcons.chicken:
|
|
return MingCute.chicken_line;
|
|
case ProductCategoryIcons.chopsticks:
|
|
return MingCute.chopsticks_line;
|
|
case ProductCategoryIcons.cookie:
|
|
return MingCute.cookie_line;
|
|
case ProductCategoryIcons.cookie_man:
|
|
return MingCute.cookie_man_line;
|
|
case ProductCategoryIcons.cupcake:
|
|
return MingCute.cupcake_line;
|
|
case ProductCategoryIcons.drink:
|
|
return MingCute.drink_line;
|
|
case ProductCategoryIcons.egg_crack:
|
|
return MingCute.egg_crack_line;
|
|
case ProductCategoryIcons.egg:
|
|
return MingCute.egg_line;
|
|
case ProductCategoryIcons.fish:
|
|
return MingCute.fish_line;
|
|
case ProductCategoryIcons.fork_knife:
|
|
return MingCute.fork_knife_line;
|
|
case ProductCategoryIcons.fork:
|
|
return MingCute.fork_line;
|
|
case ProductCategoryIcons.fork_spoon:
|
|
return MingCute.fork_spoon_line;
|
|
case ProductCategoryIcons.glass_cup:
|
|
return MingCute.glass_cup_line;
|
|
case ProductCategoryIcons.ice_cream_2:
|
|
return MingCute.ice_cream_2_line;
|
|
case ProductCategoryIcons.ice_cream:
|
|
return MingCute.ice_cream_line;
|
|
case ProductCategoryIcons.lollipop:
|
|
return MingCute.lollipop_line;
|
|
case ProductCategoryIcons.spoon:
|
|
return MingCute.spoon_line;
|
|
case ProductCategoryIcons.sugar_coated_haws:
|
|
return MingCute.sugar_coated_haws_line;
|
|
case ProductCategoryIcons.teacup:
|
|
return MingCute.teacup_line;
|
|
case ProductCategoryIcons.wine:
|
|
return MingCute.wine_line;
|
|
case ProductCategoryIcons.wineglass_2:
|
|
return MingCute.wineglass_2_line;
|
|
case ProductCategoryIcons.wineglass:
|
|
return MingCute.wineglass_line;
|
|
}
|
|
}
|
|
|
|
String get betterName {
|
|
final parts = name.split("_");
|
|
return parts.indexed.map((e) {
|
|
if (e.$1 == 0) {
|
|
return e.$2.capitalize;
|
|
}
|
|
return e.$2;
|
|
}).join(" ");
|
|
}
|
|
|
|
static ProductCategoryIcons fromName(String name) {
|
|
for (final v in values) {
|
|
if (v.name == name) {
|
|
return v;
|
|
}
|
|
}
|
|
return ProductCategoryIcons.fork;
|
|
}
|
|
}
|
|
|
|
enum StorageLocationIcon {
|
|
box_2,
|
|
box_3,
|
|
inbox,
|
|
package,
|
|
package_2;
|
|
|
|
IconData get icon {
|
|
switch (this) {
|
|
case StorageLocationIcon.box_2:
|
|
return MingCute.box_2_line;
|
|
case StorageLocationIcon.box_3:
|
|
return MingCute.box_3_line;
|
|
case StorageLocationIcon.inbox:
|
|
return MingCute.inbox_line;
|
|
case StorageLocationIcon.package:
|
|
return MingCute.package_line;
|
|
case StorageLocationIcon.package_2:
|
|
return MingCute.package_2_line;
|
|
}
|
|
}
|
|
|
|
static StorageLocationIcon fromName(String name) {
|
|
for (final v in values) {
|
|
if (v.name == name) {
|
|
return v;
|
|
}
|
|
}
|
|
return StorageLocationIcon.box_2;
|
|
}
|
|
|
|
String get betterName {
|
|
final parts = name.split("_");
|
|
return parts.indexed.map((e) {
|
|
if (e.$1 == 0) {
|
|
return e.$2.capitalize;
|
|
}
|
|
return e.$2;
|
|
}).join(" ");
|
|
}
|
|
}
|