buildListItemDescriptor static method
FastListItemDescriptor
buildListItemDescriptor(
- BuildContext context,
- FastItem<
String> item, - FastSettingsItems value
Implementation
static FastListItemDescriptor buildListItemDescriptor(
BuildContext context,
FastItem<String> item,
FastSettingsItems value,
) {
assert(kFastSettingsItemIcons[value] != null);
final useProIcons = FastIconHelper.of(context).useProIcons;
final icons = kFastSettingsItemIcons[value]!;
final scaleFactor = MediaQuery.maybeTextScalerOf(context);
final iconSize = scaleFactor?.scale(kFastIconSizeSmall);
final icon = SizedBox(
width: iconSize,
child: FaIcon(
useProIcons ? icons.pro : icons.free,
size: iconSize ?? kFastIconSizeSmall,
),
);
if (item.descriptor == null) {
return FastListItemDescriptor(leading: icon);
}
return item.descriptor!.copyWith(leading: icon);
}