AppFlowy/app_flowy/lib/workspace/domain/image.dart

28 lines
663 B
Dart
Raw Normal View History

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-08-14 07:45:00 +00:00
import 'package:flutter_svg/flutter_svg.dart';
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);
final Widget svg = SvgPicture.asset(
'assets/images/$imageName',
);
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
}
}