mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-11-03 19:43:52 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			996 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			996 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:appflowy/generated/flowy_svgs.g.dart';
 | 
						|
import 'package:appflowy/generated/locale_keys.g.dart';
 | 
						|
import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart';
 | 
						|
import 'package:appflowy/startup/plugin/plugin.dart';
 | 
						|
import 'package:easy_localization/easy_localization.dart';
 | 
						|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
 | 
						|
 | 
						|
class CalendarPluginBuilder extends PluginBuilder {
 | 
						|
  @override
 | 
						|
  Plugin build(dynamic data) {
 | 
						|
    if (data is ViewPB) {
 | 
						|
      return DatabaseTabBarViewPlugin(pluginType: pluginType, view: data);
 | 
						|
    } else {
 | 
						|
      throw FlowyPluginException.invalidData;
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  @override
 | 
						|
  String get menuName => LocaleKeys.calendar_menuName.tr();
 | 
						|
 | 
						|
  @override
 | 
						|
  FlowySvgData get icon => FlowySvgs.date_s;
 | 
						|
 | 
						|
  @override
 | 
						|
  PluginType get pluginType => PluginType.calendar;
 | 
						|
 | 
						|
  @override
 | 
						|
  ViewLayoutPB? get layoutType => ViewLayoutPB.Calendar;
 | 
						|
}
 | 
						|
 | 
						|
class CalendarPluginConfig implements PluginConfig {
 | 
						|
  @override
 | 
						|
  bool get creatable => true;
 | 
						|
}
 |