blank.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import 'package:app_flowy/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:app_flowy/generated/locale_keys.g.dart';
  6. import 'package:app_flowy/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. PluginType get pluginType => PluginType.blank;
  16. }
  17. class BlankPluginConfig implements PluginConfig {
  18. @override
  19. bool get creatable => false;
  20. }
  21. class BlankPagePlugin extends Plugin {
  22. @override
  23. PluginDisplay get display => BlankPagePluginDisplay();
  24. @override
  25. PluginId get id => "BlankStack";
  26. @override
  27. PluginType get ty => PluginType.blank;
  28. }
  29. class BlankPagePluginDisplay extends PluginDisplay with NavigationItem {
  30. @override
  31. Widget get leftBarItem =>
  32. FlowyText.medium(LocaleKeys.blankPageTitle.tr(), fontSize: 12);
  33. @override
  34. Widget buildWidget(PluginContext context) => const BlankPage();
  35. @override
  36. List<NavigationItem> get navigationItems => [this];
  37. }
  38. class BlankPage extends StatefulWidget {
  39. const BlankPage({Key? key}) : super(key: key);
  40. @override
  41. State<BlankPage> createState() => _BlankPageState();
  42. }
  43. class _BlankPageState extends State<BlankPage> {
  44. @override
  45. Widget build(BuildContext context) {
  46. return SizedBox.expand(
  47. child: Container(
  48. color: Theme.of(context).colorScheme.surface,
  49. child: Padding(
  50. padding: const EdgeInsets.all(10),
  51. child: Container(),
  52. ),
  53. ),
  54. );
  55. }
  56. }