2022-03-01 08:05:45 +00:00
|
|
|
export "./src/sizes.dart";
|
|
|
|
export "./src/trash_cell.dart";
|
|
|
|
export "./src/trash_header.dart";
|
|
|
|
|
2022-08-09 02:35:27 +00:00
|
|
|
import 'package:app_flowy/startup/plugin/plugin.dart';
|
2022-03-01 08:05:45 +00:00
|
|
|
import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
|
2021-12-07 17:31:23 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2021-10-13 15:11:45 +00:00
|
|
|
import 'package:flowy_infra_ui/style_widget/text.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-13 15:11:45 +00:00
|
|
|
|
2022-09-21 03:37:42 +00:00
|
|
|
import 'trash_page.dart';
|
2021-10-14 06:34:22 +00:00
|
|
|
|
2022-03-01 02:25:21 +00:00
|
|
|
class TrashPluginBuilder extends PluginBuilder {
|
2022-02-28 14:38:53 +00:00
|
|
|
@override
|
|
|
|
Plugin build(dynamic data) {
|
|
|
|
return TrashPlugin(pluginType: pluginType);
|
|
|
|
}
|
2021-10-13 15:11:45 +00:00
|
|
|
|
|
|
|
@override
|
2022-07-19 06:11:29 +00:00
|
|
|
String get menuName => "TrashPB";
|
2021-10-13 15:11:45 +00:00
|
|
|
|
2022-11-15 03:45:23 +00:00
|
|
|
@override
|
|
|
|
String get menuIcon => "editor/delete";
|
|
|
|
|
2021-10-13 15:11:45 +00:00
|
|
|
@override
|
2022-08-18 11:32:08 +00:00
|
|
|
PluginType get pluginType => PluginType.trash;
|
2022-02-28 14:38:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-01 03:22:39 +00:00
|
|
|
class TrashPluginConfig implements PluginConfig {
|
|
|
|
@override
|
|
|
|
bool get creatable => false;
|
|
|
|
}
|
|
|
|
|
2022-03-01 08:05:45 +00:00
|
|
|
class TrashPlugin extends Plugin {
|
2022-03-01 02:25:21 +00:00
|
|
|
final PluginType _pluginType;
|
2022-02-28 14:38:53 +00:00
|
|
|
|
2022-03-01 02:25:21 +00:00
|
|
|
TrashPlugin({required PluginType pluginType}) : _pluginType = pluginType;
|
2021-11-09 15:13:04 +00:00
|
|
|
|
2021-10-13 15:11:45 +00:00
|
|
|
@override
|
2022-03-02 03:38:22 +00:00
|
|
|
PluginDisplay get display => TrashPluginDisplay();
|
2021-10-13 15:11:45 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-02 03:38:22 +00:00
|
|
|
PluginId get id => "TrashStack";
|
2021-10-13 15:11:45 +00:00
|
|
|
|
2021-10-28 13:55:22 +00:00
|
|
|
@override
|
2022-03-02 03:38:22 +00:00
|
|
|
PluginType get ty => _pluginType;
|
2022-02-28 14:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class TrashPluginDisplay extends PluginDisplay {
|
|
|
|
@override
|
2022-11-19 09:53:30 +00:00
|
|
|
Widget get leftBarItem => FlowyText.medium(LocaleKeys.trash_text.tr());
|
2022-02-28 14:38:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget? get rightBarItem => null;
|
|
|
|
|
|
|
|
@override
|
2022-09-22 05:08:48 +00:00
|
|
|
Widget buildWidget(PluginContext context) => const TrashPage(
|
|
|
|
key: ValueKey('TrashPage'),
|
|
|
|
);
|
2022-02-28 14:38:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
List<NavigationItem> get navigationItems => [this];
|
2021-10-13 15:11:45 +00:00
|
|
|
}
|