2023-08-14 20:34:01 +00:00
|
|
|
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
2023-12-08 13:01:54 +00:00
|
|
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
|
|
|
import 'package:appflowy/startup/plugin/plugin.dart';
|
2023-02-26 08:27:17 +00:00
|
|
|
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
|
2024-06-03 06:27:28 +00:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.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_ui/style_widget/text.dart';
|
2021-06-19 15:41:19 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2022-03-01 02:25:21 +00:00
|
|
|
class BlankPluginBuilder extends PluginBuilder {
|
2022-02-28 14:38:53 +00:00
|
|
|
@override
|
|
|
|
Plugin build(dynamic data) {
|
2022-09-22 05:08:48 +00:00
|
|
|
return BlankPagePlugin();
|
2022-02-28 14:38:53 +00:00
|
|
|
}
|
2021-10-10 07:58:57 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-01 08:05:45 +00:00
|
|
|
String get menuName => "Blank";
|
2021-10-10 07:58:57 +00:00
|
|
|
|
2022-11-15 03:45:23 +00:00
|
|
|
@override
|
2023-08-14 20:34:01 +00:00
|
|
|
FlowySvgData get icon => const FlowySvgData('');
|
2022-11-15 03:45:23 +00:00
|
|
|
|
2021-10-10 07:58:57 +00:00
|
|
|
@override
|
2022-08-18 11:32:08 +00:00
|
|
|
PluginType get pluginType => PluginType.blank;
|
2024-06-03 06:27:28 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
ViewLayoutPB get layoutType => ViewLayoutPB.Document;
|
2022-02-28 14:38:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-01 03:22:39 +00:00
|
|
|
class BlankPluginConfig implements PluginConfig {
|
|
|
|
@override
|
|
|
|
bool get creatable => false;
|
|
|
|
}
|
|
|
|
|
2022-03-01 08:05:45 +00:00
|
|
|
class BlankPagePlugin extends Plugin {
|
2021-10-10 07:58:57 +00:00
|
|
|
@override
|
2023-06-01 12:23:27 +00:00
|
|
|
PluginWidgetBuilder get widgetBuilder => BlankPagePluginWidgetBuilder();
|
2021-06-19 15:41:19 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-02 03:38:22 +00:00
|
|
|
PluginId get id => "BlankStack";
|
2021-10-10 09:01:30 +00:00
|
|
|
|
2021-10-28 13:55:22 +00:00
|
|
|
@override
|
2023-06-01 12:23:27 +00:00
|
|
|
PluginType get pluginType => PluginType.blank;
|
2022-02-28 14:38:53 +00:00
|
|
|
}
|
|
|
|
|
2023-06-01 12:23:27 +00:00
|
|
|
class BlankPagePluginWidgetBuilder extends PluginWidgetBuilder
|
|
|
|
with NavigationItem {
|
2022-02-28 14:38:53 +00:00
|
|
|
@override
|
2022-11-19 09:53:30 +00:00
|
|
|
Widget get leftBarItem => FlowyText.medium(LocaleKeys.blankPageTitle.tr());
|
2022-02-28 14:38:53 +00:00
|
|
|
|
2023-07-12 11:13:18 +00:00
|
|
|
@override
|
|
|
|
Widget tabBarItem(String pluginId) => leftBarItem;
|
|
|
|
|
2022-02-28 14:38:53 +00:00
|
|
|
@override
|
2024-06-03 06:27:28 +00:00
|
|
|
Widget buildWidget({
|
|
|
|
required PluginContext context,
|
|
|
|
required bool shrinkWrap,
|
2024-07-22 05:35:42 +00:00
|
|
|
Map<String, dynamic>? data,
|
2024-06-03 06:27:28 +00:00
|
|
|
}) =>
|
2023-08-02 10:07:44 +00:00
|
|
|
const BlankPage();
|
2022-02-28 14:38:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
List<NavigationItem> get navigationItems => [this];
|
2021-06-19 15:41:19 +00:00
|
|
|
}
|
|
|
|
|
2022-03-04 00:22:49 +00:00
|
|
|
class BlankPage extends StatefulWidget {
|
2023-12-08 13:01:54 +00:00
|
|
|
const BlankPage({super.key});
|
2021-06-19 15:41:19 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-04 00:22:49 +00:00
|
|
|
State<BlankPage> createState() => _BlankPageState();
|
2021-06-19 15:41:19 +00:00
|
|
|
}
|
|
|
|
|
2022-03-04 00:22:49 +00:00
|
|
|
class _BlankPageState extends State<BlankPage> {
|
2021-06-19 15:41:19 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-07-27 15:10:39 +00:00
|
|
|
return SizedBox.expand(
|
|
|
|
child: Container(
|
|
|
|
color: Theme.of(context).colorScheme.surface,
|
2024-01-25 15:37:36 +00:00
|
|
|
child: const Padding(
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
child: SizedBox.shrink(),
|
2021-06-19 15:41:19 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|