menu.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:app_flowy/startup/plugin/plugin.dart';
  2. import 'package:app_flowy/startup/startup.dart';
  3. import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
  4. import 'package:app_flowy/workspace/presentation/home/menu/menu.dart';
  5. import 'package:easy_localization/easy_localization.dart';
  6. import 'package:flowy_infra/image.dart';
  7. import 'package:flowy_infra_ui/style_widget/text.dart';
  8. import 'package:flowy_infra_ui/widget/spacing.dart';
  9. import 'package:flutter/material.dart';
  10. import 'package:app_flowy/generated/locale_keys.g.dart';
  11. class MenuTrash extends StatelessWidget {
  12. const MenuTrash({Key? key}) : super(key: key);
  13. @override
  14. Widget build(BuildContext context) {
  15. return SizedBox(
  16. height: 26,
  17. child: InkWell(
  18. onTap: () {
  19. getIt<MenuSharedState>().latestOpenView = null;
  20. getIt<HomeStackManager>()
  21. .setPlugin(makePlugin(pluginType: PluginType.trash));
  22. },
  23. child: _render(context),
  24. ),
  25. );
  26. }
  27. Widget _render(BuildContext context) {
  28. return Row(
  29. children: [
  30. SizedBox(
  31. width: 16,
  32. height: 16,
  33. child: svgWidget(
  34. "home/trash",
  35. color: Theme.of(context).colorScheme.onSurface,
  36. ),
  37. ),
  38. const HSpace(6),
  39. FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12),
  40. ],
  41. );
  42. }
  43. }