34 lines
925 B
Dart
Raw Normal View History

import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/tar_bar/tab_bar_view.dart';
import 'package:appflowy/startup/plugin/plugin.dart';
2022-05-17 20:25:35 +02:00
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
2022-03-04 08:22:49 +08:00
2022-03-06 09:03:02 +08:00
class GridPluginBuilder implements PluginBuilder {
2022-03-04 08:22:49 +08:00
@override
Plugin build(dynamic data) {
2022-07-19 14:11:29 +08:00
if (data is ViewPB) {
return DatabaseTabBarViewPlugin(pluginType: pluginType, view: data);
2022-03-04 08:22:49 +08:00
} else {
throw FlowyPluginException.invalidData;
}
}
@override
2022-05-17 20:25:35 +02:00
String get menuName => LocaleKeys.grid_menuName.tr();
2022-03-04 08:22:49 +08:00
@override
String get menuIcon => "editor/grid";
2022-03-04 08:22:49 +08:00
@override
PluginType get pluginType => PluginType.grid;
2022-03-06 09:03:02 +08:00
2022-08-10 17:59:28 +08:00
@override
ViewLayoutPB? get layoutType => ViewLayoutPB.Grid;
2022-03-04 08:22:49 +08:00
}
class GridPluginConfig implements PluginConfig {
@override
2022-04-08 14:31:33 +08:00
bool get creatable => true;
2022-03-04 08:22:49 +08:00
}