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';
|
2023-12-30 23:29:40 +00:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
2024-06-04 01:22:47 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2023-01-08 12:51:19 +00:00
|
|
|
|
|
|
|
|
class CalendarPluginBuilder extends PluginBuilder {
|
|
|
|
|
@override
|
|
|
|
|
Plugin build(dynamic data) {
|
|
|
|
|
if (data is ViewPB) {
|
2023-06-20 15:48:34 +00:00
|
|
|
return DatabaseTabBarViewPlugin(pluginType: pluginType, view: data);
|
2023-01-08 12:51:19 +00:00
|
|
|
} else {
|
|
|
|
|
throw FlowyPluginException.invalidData;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String get menuName => LocaleKeys.calendar_menuName.tr();
|
|
|
|
|
|
|
|
|
|
@override
|
2024-06-04 01:22:47 +00:00
|
|
|
FlowySvgData get icon => FlowySvgs.icon_calendar_s;
|
2023-01-08 12:51:19 +00:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
PluginType get pluginType => PluginType.calendar;
|
|
|
|
|
|
|
|
|
|
@override
|
2024-06-03 06:27:28 +00:00
|
|
|
ViewLayoutPB get layoutType => ViewLayoutPB.Calendar;
|
2023-01-08 12:51:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class CalendarPluginConfig implements PluginConfig {
|
|
|
|
|
@override
|
2023-03-20 13:16:37 +00:00
|
|
|
bool get creatable => true;
|
2023-01-08 12:51:19 +00:00
|
|
|
}
|