chore: merge release 0.0.5.1

This commit is contained in:
appflowy 2022-09-15 11:12:06 +08:00
parent cb293e9e51
commit 97eab3b648
2 changed files with 35 additions and 28 deletions

View File

@ -50,10 +50,10 @@ class _FieldEditorState extends State<FieldEditor> {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => FieldEditorBloc(
gridId: gridId,
fieldName: fieldName,
isGroupField: isGroupField,
loader: typeOptionLoader,
gridId: widget.gridId,
fieldName: widget.fieldName,
isGroupField: widget.isGroupField,
loader: widget.typeOptionLoader,
)..add(const FieldEditorEvent.initial()),
child: BlocBuilder<FieldEditorBloc, FieldEditorState>(
buildWhen: (p, c) => false,
@ -66,7 +66,7 @@ class _FieldEditorState extends State<FieldEditor> {
const VSpace(10),
const _FieldNameCell(),
const VSpace(10),
const _DeleteFieldButton(),
_DeleteFieldButton(popoverMutex: popoverMutex),
const VSpace(10),
_FieldTypeOptionCell(popoverMutex: popoverMutex),
],
@ -128,7 +128,12 @@ class _FieldNameCell extends StatelessWidget {
}
class _DeleteFieldButton extends StatelessWidget {
const _DeleteFieldButton({Key? key}) : super(key: key);
final PopoverMutex popoverMutex;
const _DeleteFieldButton({
required this.popoverMutex,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -136,37 +141,36 @@ class _DeleteFieldButton extends StatelessWidget {
return BlocBuilder<FieldEditorBloc, FieldEditorState>(
builder: (context, state) {
final enable = !state.canDelete && !state.isGroupField;
return SizedBox(
height: GridSize.typeOptionItemHeight,
return Popover(
triggerActions: PopoverTriggerActionFlags.click,
mutex: popoverMutex,
direction: PopoverDirection.center,
popupBuilder: (context) {
return FlowyAlertDialog(
title: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
cancel: () {
// FlowyOverlay.of(context).remove(FieldEditor.identifier())
// popoverMutex.state?.close();
},
confirm: () {
context
.read<FieldEditorBloc>()
.add(const FieldEditorEvent.deleteField());
// FlowyOverlay.of(context).remove(FieldEditor.identifier());
},
);
},
child: FlowyButton(
text: FlowyText.medium(
LocaleKeys.grid_field_delete.tr(),
fontSize: 12,
color: enable ? null : theme.shader4,
),
hoverColor: theme.hover,
onTap: () {
if (enable) {
FlowyAlertDialog(
title: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
cancel: () {
FlowyOverlay.of(context).remove(FieldEditor.identifier());
},
confirm: () {
context
.read<FieldEditorBloc>()
.add(const FieldEditorEvent.deleteField());
FlowyOverlay.of(context).remove(FieldEditor.identifier());
},
).show(context);
}
},
leftIcon: svgWidget('grid/delete', color: theme.iconColor),
),
);
},
);
}
void so() {}
}

View File

@ -416,6 +416,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ARCHS = arm64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
@ -549,6 +550,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ARCHS = arm64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
@ -573,6 +575,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ARCHS = arm64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;