blank.dart 1.7 KB

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