mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: open-row-as-full-page-related launch review issues (#5266)
This commit is contained in:
parent
a69e83c2cb
commit
d52042fa4f
@ -13,6 +13,7 @@ import 'package:appflowy/workspace/presentation/settings/widgets/emoji_picker/em
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
@ -262,11 +263,14 @@ class RowActionButton extends StatelessWidget {
|
||||
return AppFlowyPopover(
|
||||
direction: PopoverDirection.bottomWithLeftAligned,
|
||||
popupBuilder: (context) => RowActionList(rowController: rowController),
|
||||
child: FlowyIconButton(
|
||||
width: 20,
|
||||
height: 20,
|
||||
icon: const FlowySvg(FlowySvgs.details_horizontal_s),
|
||||
iconColorOnHover: Theme.of(context).colorScheme.onSecondary,
|
||||
child: FlowyTooltip(
|
||||
message: LocaleKeys.grid_rowPage_moreRowActions.tr(),
|
||||
child: FlowyIconButton(
|
||||
width: 20,
|
||||
height: 20,
|
||||
icon: const FlowySvg(FlowySvgs.details_horizontal_s),
|
||||
iconColorOnHover: Theme.of(context).colorScheme.onSecondary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/plugins/database/application/database_controller.dart';
|
||||
import 'package:appflowy/plugins/database/application/row/row_controller.dart';
|
||||
import 'package:appflowy/plugins/database/domain/database_view_service.dart';
|
||||
@ -9,7 +10,9 @@ import 'package:appflowy/startup/plugin/plugin.dart';
|
||||
import 'package:appflowy/startup/startup.dart';
|
||||
import 'package:appflowy/user/application/reminder/reminder_bloc.dart';
|
||||
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
@ -107,35 +110,39 @@ class _RowDetailPageState extends State<RowDetailPage> {
|
||||
List<Widget> _actions(BuildContext context) {
|
||||
return [
|
||||
if (widget.allowOpenAsFullPage) ...[
|
||||
FlowyIconButton(
|
||||
width: 20,
|
||||
height: 20,
|
||||
icon: const FlowySvg(FlowySvgs.full_view_s),
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
final databaseId = await DatabaseViewBackendService(
|
||||
viewId: widget.databaseController.viewId,
|
||||
)
|
||||
.getDatabaseId()
|
||||
.then((value) => value.fold((s) => s, (f) => null));
|
||||
final documentId = widget.rowController.rowMeta.documentId;
|
||||
if (databaseId != null) {
|
||||
getIt<TabsBloc>().add(
|
||||
TabsEvent.openPlugin(
|
||||
plugin: DatabaseDocumentPlugin(
|
||||
data: DatabaseDocumentContext(
|
||||
view: widget.databaseController.view,
|
||||
databaseId: databaseId,
|
||||
rowId: widget.rowController.rowId,
|
||||
documentId: documentId,
|
||||
FlowyTooltip(
|
||||
message: LocaleKeys.grid_rowPage_openAsFullPage.tr(),
|
||||
child: FlowyIconButton(
|
||||
width: 20,
|
||||
height: 20,
|
||||
icon: const FlowySvg(FlowySvgs.full_view_s),
|
||||
iconColorOnHover: Theme.of(context).colorScheme.onSurface,
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
final databaseId = await DatabaseViewBackendService(
|
||||
viewId: widget.databaseController.viewId,
|
||||
)
|
||||
.getDatabaseId()
|
||||
.then((value) => value.fold((s) => s, (f) => null));
|
||||
final documentId = widget.rowController.rowMeta.documentId;
|
||||
if (databaseId != null) {
|
||||
getIt<TabsBloc>().add(
|
||||
TabsEvent.openPlugin(
|
||||
plugin: DatabaseDocumentPlugin(
|
||||
data: DatabaseDocumentContext(
|
||||
view: widget.databaseController.view,
|
||||
databaseId: databaseId,
|
||||
rowId: widget.rowController.rowId,
|
||||
documentId: documentId,
|
||||
),
|
||||
pluginType: PluginType.databaseDocument,
|
||||
),
|
||||
pluginType: PluginType.databaseDocument,
|
||||
setLatest: false,
|
||||
),
|
||||
setLatest: false,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const HSpace(4),
|
||||
],
|
||||
|
@ -759,7 +759,9 @@
|
||||
"one": "Hide {count} hidden field",
|
||||
"many": "Hide {count} hidden fields",
|
||||
"other": "Hide {count} hidden fields"
|
||||
}
|
||||
},
|
||||
"openAsFullPage": "Open as full page",
|
||||
"moreRowActions": "More row actions"
|
||||
},
|
||||
"sort": {
|
||||
"ascending": "Ascending",
|
||||
|
Loading…
Reference in New Issue
Block a user