blank.dart 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:appflowy/generated/flowy_svgs.g.dart';
  2. import 'package:appflowy/workspace/presentation/home/home_stack.dart';
  3. import 'package:easy_localization/easy_localization.dart';
  4. import 'package:flowy_infra_ui/style_widget/text.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:appflowy/generated/locale_keys.g.dart';
  7. import 'package:appflowy/startup/plugin/plugin.dart';
  8. class BlankPluginBuilder extends PluginBuilder {
  9. @override
  10. Plugin build(dynamic data) {
  11. return BlankPagePlugin();
  12. }
  13. @override
  14. String get menuName => "Blank";
  15. @override
  16. FlowySvgData get icon => const FlowySvgData('');
  17. @override
  18. PluginType get pluginType => PluginType.blank;
  19. }
  20. class BlankPluginConfig implements PluginConfig {
  21. @override
  22. bool get creatable => false;
  23. }
  24. class BlankPagePlugin extends Plugin {
  25. @override
  26. PluginWidgetBuilder get widgetBuilder => BlankPagePluginWidgetBuilder();
  27. @override
  28. PluginId get id => "BlankStack";
  29. @override
  30. PluginType get pluginType => PluginType.blank;
  31. }
  32. class BlankPagePluginWidgetBuilder extends PluginWidgetBuilder
  33. with NavigationItem {
  34. @override
  35. Widget get leftBarItem => FlowyText.medium(LocaleKeys.blankPageTitle.tr());
  36. @override
  37. Widget tabBarItem(String pluginId) => leftBarItem;
  38. @override
  39. Widget buildWidget({PluginContext? context, required bool shrinkWrap}) =>
  40. const BlankPage();
  41. @override
  42. List<NavigationItem> get navigationItems => [this];
  43. }
  44. class BlankPage extends StatefulWidget {
  45. const BlankPage({Key? key}) : super(key: key);
  46. @override
  47. State<BlankPage> createState() => _BlankPageState();
  48. }
  49. class _BlankPageState extends State<BlankPage> {
  50. @override
  51. Widget build(BuildContext context) {
  52. return SizedBox.expand(
  53. child: Container(
  54. color: Theme.of(context).colorScheme.surface,
  55. child: Padding(
  56. padding: const EdgeInsets.all(10),
  57. child: Container(),
  58. ),
  59. ),
  60. );
  61. }
  62. }