AppFlowy/frontend/app_flowy/lib/plugins/trash/menu.dart

47 lines
1.4 KiB
Dart
Raw Normal View History

import 'package:app_flowy/startup/plugin/plugin.dart';
2021-10-12 08:58:05 +00:00
import 'package:app_flowy/startup/startup.dart';
2022-03-01 08:05:45 +00:00
import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
import 'package:app_flowy/workspace/presentation/home/menu/menu.dart';
2021-12-07 17:31:23 +00:00
import 'package:easy_localization/easy_localization.dart';
2021-10-12 08:58:05 +00:00
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
2021-12-07 17:31:23 +00:00
import 'package:app_flowy/generated/locale_keys.g.dart';
2021-10-12 08:58:05 +00:00
class MenuTrash extends StatelessWidget {
const MenuTrash({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 26,
child: InkWell(
onTap: () {
2022-04-26 06:43:42 +00:00
getIt<MenuSharedState>().latestOpenView = null;
getIt<HomeStackManager>()
.setPlugin(makePlugin(pluginType: PluginType.trash));
2021-10-12 08:58:05 +00:00
},
child: _render(context),
),
);
}
Widget _render(BuildContext context) {
return Row(
children: [
SizedBox(
width: 16,
height: 16,
child: svgWidget(
"home/trash",
color: Theme.of(context).colorScheme.onSurface,
),
2022-01-29 02:44:35 +00:00
),
const HSpace(6),
FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12),
],
);
2021-10-12 08:58:05 +00:00
}
}