File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,6 @@ abstract class PhenoDataProvider {
6060 Future <PhenoScreenSpec > doLoadScreenLayout (int id);
6161 Future <PhenoComponentSpec > doLoadComponentSpec (String name);
6262
63- Image loadPng (String path, { required BoxFit fit });
63+ Image loadImage (String path, { required BoxFit fit });
6464 SvgPicture loadSvg (String path, { required BoxFit fit });
6565}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ class StrapiDataProvider extends PhenoDataProvider {
4848 }
4949
5050 @override
51- Image loadPng (String path, { required BoxFit fit }) {
51+ Image loadImage (String path, { required BoxFit fit }) {
5252 return Image .network (path, fit: fit);
5353 }
5454
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import 'figma_node_model.dart';
66
77enum FigmaImageFormat with FigmaEnum {
88 png,
9+ jpeg,
910 svg,
1011 unknown,
1112 ;
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ class FigmaImageParser extends MiraiParser<FigmaImageModel> {
1818 @override
1919 String get type => 'figma-image' ;
2020
21- _loadPNG (FigmaImageModel model) {
21+ _loadImage (FigmaImageModel model) {
2222 if (model.method == FigmaImageDataMethod .embed) {
2323 return Image .memory (base64Decode (model.data), fit: model.fit);
2424 }
25- return FigmaScreens ().provider! .loadPng (model.data, fit: model.fit);
25+ return FigmaScreens ().provider! .loadImage (model.data, fit: model.fit);
2626 }
2727
2828 _loadSVG (FigmaImageModel model) {
@@ -35,7 +35,8 @@ class FigmaImageParser extends MiraiParser<FigmaImageModel> {
3535 @override
3636 Widget parse (BuildContext context, FigmaImageModel model) {
3737 Widget widget = switch (model.format) {
38- FigmaImageFormat .png => _loadPNG (model),
38+ FigmaImageFormat .png => _loadImage (model),
39+ FigmaImageFormat .jpeg => _loadImage (model),
3940 FigmaImageFormat .svg => _loadSVG (model),
4041 _ => throw 'ERROR: Unknown image format [${model .format .name }]' ,
4142 };
You can’t perform that action at this time.
0 commit comments