FileTypeIcon constructor
FileTypeIcon({
- Key? key,
- required TypeOfFile type,
- required double size,
Implementation
FileTypeIcon({
super.key,
required this.type,
required this.size,
}) {
double iconSize = size * 0.6;
switch (type) {
case TypeOfFile.image:
typeIndex = 0;
icon = Icon(
Icons.image_outlined,
size: iconSize,
color: fileTypesColor[0],
);
break;
case TypeOfFile.video:
typeIndex = 1;
icon = Icon(
Boxicons.bx_movie,
size: iconSize,
color: fileTypesColor[1],
);
break;
case TypeOfFile.file:
typeIndex = 2;
icon = Icon(
Boxicons.bx_file,
size: iconSize,
color: fileTypesColor[2],
);
break;
case TypeOfFile.dicom:
typeIndex = 2;
icon = Icon(
Boxicons.bx_file,
size: iconSize,
color: fileTypesColor[2],
);
break;
}
}