2023-08-14 20:34:01 +00:00
|
|
|
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
2023-02-26 08:27:17 +00:00
|
|
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
2024-01-05 09:30:54 +00:00
|
|
|
import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart';
|
2023-02-26 08:27:17 +00:00
|
|
|
import 'package:appflowy/startup/plugin/plugin.dart';
|
2022-05-17 18:25:35 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2023-12-30 23:29:40 +00:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
2022-03-04 00:22:49 +00:00
|
|
|
|
2022-03-06 01:03:02 +00:00
|
|
|
class GridPluginBuilder implements PluginBuilder {
|
2022-03-04 00:22:49 +00:00
|
|
|
@override
|
|
|
|
|
Plugin build(dynamic data) {
|
2022-07-19 06:11:29 +00:00
|
|
|
if (data is ViewPB) {
|
2023-06-20 15:48:34 +00:00
|
|
|
return DatabaseTabBarViewPlugin(pluginType: pluginType, view: data);
|
2022-03-04 00:22:49 +00:00
|
|
|
} else {
|
|
|
|
|
throw FlowyPluginException.invalidData;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
2022-05-17 18:25:35 +00:00
|
|
|
String get menuName => LocaleKeys.grid_menuName.tr();
|
2022-03-04 00:22:49 +00:00
|
|
|
|
2022-11-15 03:45:23 +00:00
|
|
|
@override
|
2023-08-14 20:34:01 +00:00
|
|
|
FlowySvgData get icon => FlowySvgs.grid_s;
|
2022-11-15 03:45:23 +00:00
|
|
|
|
2022-03-04 00:22:49 +00:00
|
|
|
@override
|
2022-08-18 11:32:08 +00:00
|
|
|
PluginType get pluginType => PluginType.grid;
|
2022-03-06 01:03:02 +00:00
|
|
|
|
2022-08-10 09:59:28 +00:00
|
|
|
@override
|
2023-04-04 06:08:50 +00:00
|
|
|
ViewLayoutPB? get layoutType => ViewLayoutPB.Grid;
|
2022-03-04 00:22:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class GridPluginConfig implements PluginConfig {
|
|
|
|
|
@override
|
2022-04-08 06:31:33 +00:00
|
|
|
bool get creatable => true;
|
2022-03-04 00:22:49 +00:00
|
|
|
}
|