2021-07-26 08:35:51 +00:00
|
|
|
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2021-09-05 10:02:49 +00:00
|
|
|
import 'package:flowy_infra/image.dart';
|
2021-08-14 07:45:00 +00:00
|
|
|
|
2021-07-26 08:35:51 +00:00
|
|
|
AssetImage assetImageForViewType(ViewType type) {
|
|
|
|
final imageName = imageNameForViewType(type);
|
|
|
|
return AssetImage('assets/images/$imageName');
|
|
|
|
}
|
|
|
|
|
2021-08-14 07:45:00 +00:00
|
|
|
Widget svgImageForViewType(ViewType type) {
|
|
|
|
final imageName = imageNameForViewType(type);
|
2021-09-05 10:02:49 +00:00
|
|
|
final Widget svg = svgWidgetWithName(imageName);
|
2021-08-14 07:45:00 +00:00
|
|
|
|
|
|
|
return svg;
|
|
|
|
}
|
|
|
|
|
2021-07-26 08:35:51 +00:00
|
|
|
String imageNameForViewType(ViewType type) {
|
|
|
|
switch (type) {
|
|
|
|
case ViewType.Doc:
|
2021-08-14 07:45:00 +00:00
|
|
|
return "file_icon.svg";
|
2021-07-26 08:35:51 +00:00
|
|
|
default:
|
2021-08-14 07:45:00 +00:00
|
|
|
return "file_icon.svg";
|
2021-07-26 08:35:51 +00:00
|
|
|
}
|
|
|
|
}
|