mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: ai writer generate button color (#6035)
* fix: ai writer generate button color * fix: replace ai writer button with outlined rounded button
This commit is contained in:
@ -140,9 +140,12 @@ class _AutoCompletionBlockComponentState
|
|||||||
if (PlatformExtension.isMobile) {
|
if (PlatformExtension.isMobile) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Card(
|
final child = Card(
|
||||||
elevation: 5,
|
elevation: 5,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.all(10),
|
margin: const EdgeInsets.all(10),
|
||||||
@ -169,6 +172,11 @@ class _AutoCompletionBlockComponentState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 40),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildInputWidget(BuildContext context) {
|
Widget _buildInputWidget(BuildContext context) {
|
||||||
@ -474,16 +482,23 @@ class AutoCompletionInputFooter extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
FlowyTextButton.primary(
|
PrimaryRoundedButton(
|
||||||
text: LocaleKeys.button_generate.tr(),
|
text: LocaleKeys.button_generate.tr(),
|
||||||
context: context,
|
margin: const EdgeInsets.symmetric(
|
||||||
onPressed: onGenerate,
|
horizontal: 16.0,
|
||||||
|
vertical: 10.0,
|
||||||
|
),
|
||||||
|
radius: 8.0,
|
||||||
|
onTap: onGenerate,
|
||||||
),
|
),
|
||||||
const Space(10, 0),
|
const Space(10, 0),
|
||||||
FlowyTextButton.secondary(
|
OutlinedRoundedButton(
|
||||||
text: LocaleKeys.button_cancel.tr(),
|
text: LocaleKeys.button_cancel.tr(),
|
||||||
context: context,
|
margin: const EdgeInsets.symmetric(
|
||||||
onPressed: onExit,
|
horizontal: 16.0,
|
||||||
|
vertical: 10.0,
|
||||||
|
),
|
||||||
|
onTap: onExit,
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -517,22 +532,23 @@ class AutoCompletionFooter extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
FlowyTextButton.primary(
|
PrimaryRoundedButton(
|
||||||
context: context,
|
|
||||||
text: LocaleKeys.button_keep.tr(),
|
text: LocaleKeys.button_keep.tr(),
|
||||||
onPressed: onKeep,
|
margin: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 9.0,
|
||||||
|
),
|
||||||
|
onTap: onKeep,
|
||||||
),
|
),
|
||||||
const Space(10, 0),
|
const HSpace(10),
|
||||||
FlowyTextButton.secondary(
|
OutlinedRoundedButton(
|
||||||
context: context,
|
|
||||||
text: LocaleKeys.document_plugins_autoGeneratorRewrite.tr(),
|
text: LocaleKeys.document_plugins_autoGeneratorRewrite.tr(),
|
||||||
onPressed: onRewrite,
|
onTap: onRewrite,
|
||||||
),
|
),
|
||||||
const Space(10, 0),
|
const HSpace(10),
|
||||||
FlowyTextButton.secondary(
|
OutlinedRoundedButton(
|
||||||
context: context,
|
|
||||||
text: LocaleKeys.button_discard.tr(),
|
text: LocaleKeys.button_discard.tr(),
|
||||||
onPressed: onDiscard,
|
onTap: onDiscard,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -185,22 +185,9 @@ class SpaceCancelOrConfirmButton extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
DecoratedBox(
|
OutlinedRoundedButton(
|
||||||
decoration: ShapeDecoration(
|
text: LocaleKeys.button_cancel.tr(),
|
||||||
shape: RoundedRectangleBorder(
|
onTap: onCancel,
|
||||||
side: const BorderSide(color: Color(0x1E14171B)),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: FlowyButton(
|
|
||||||
useIntrinsicWidth: true,
|
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
|
||||||
text: FlowyText.regular(
|
|
||||||
LocaleKeys.button_cancel.tr(),
|
|
||||||
lineHeight: 1.0,
|
|
||||||
),
|
|
||||||
onTap: onCancel,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const HSpace(12.0),
|
const HSpace(12.0),
|
||||||
DecoratedBox(
|
DecoratedBox(
|
||||||
@ -244,24 +231,11 @@ class SpaceOkButton extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
DecoratedBox(
|
PrimaryRoundedButton(
|
||||||
decoration: ShapeDecoration(
|
text: confirmButtonName,
|
||||||
color: confirmButtonColor ?? Theme.of(context).colorScheme.primary,
|
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
||||||
shape: RoundedRectangleBorder(
|
radius: 8.0,
|
||||||
borderRadius: BorderRadius.circular(8),
|
onTap: onConfirm,
|
||||||
),
|
|
||||||
),
|
|
||||||
child: FlowyButton(
|
|
||||||
useIntrinsicWidth: true,
|
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
|
||||||
radius: BorderRadius.circular(8),
|
|
||||||
text: FlowyText.regular(
|
|
||||||
confirmButtonName,
|
|
||||||
lineHeight: 1.0,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onTap: onConfirm,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -133,17 +133,17 @@ class _WorkspaceMoreActionWrapper extends CustomActionCell {
|
|||||||
},
|
},
|
||||||
).show(context);
|
).show(context);
|
||||||
case WorkspaceMoreAction.leave:
|
case WorkspaceMoreAction.leave:
|
||||||
await showDialog(
|
await showConfirmDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => NavigatorOkCancelDialog(
|
title: LocaleKeys.workspace_leaveCurrentWorkspace.tr(),
|
||||||
message: LocaleKeys.workspace_leaveCurrentWorkspacePrompt.tr(),
|
description:
|
||||||
onOkPressed: () {
|
LocaleKeys.workspace_leaveCurrentWorkspacePrompt.tr(),
|
||||||
workspaceBloc.add(
|
confirmLabel: LocaleKeys.button_yes.tr(),
|
||||||
UserWorkspaceEvent.leaveWorkspace(workspace.workspaceId),
|
onConfirm: () {
|
||||||
);
|
workspaceBloc.add(
|
||||||
},
|
UserWorkspaceEvent.leaveWorkspace(workspace.workspaceId),
|
||||||
okTitle: LocaleKeys.button_yes.tr(),
|
);
|
||||||
),
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -175,7 +175,7 @@ class _WorkspaceMoreActionWrapper extends CustomActionCell {
|
|||||||
case WorkspaceMoreAction.leave:
|
case WorkspaceMoreAction.leave:
|
||||||
return FlowySvg(
|
return FlowySvg(
|
||||||
FlowySvgs.logout_s,
|
FlowySvgs.logout_s,
|
||||||
color: Theme.of(context).colorScheme.error,
|
color: onHover ? Theme.of(context).colorScheme.error : null,
|
||||||
);
|
);
|
||||||
case WorkspaceMoreAction.divider:
|
case WorkspaceMoreAction.divider:
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
|
@ -128,6 +128,10 @@ class SingleSettingAction extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color? hoverColor(BuildContext context) {
|
Color? hoverColor(BuildContext context) {
|
||||||
|
if (buttonType.isDangerous) {
|
||||||
|
return Theme.of(context).colorScheme.error.withOpacity(0.1);
|
||||||
|
}
|
||||||
|
|
||||||
if (buttonType.isPrimary) {
|
if (buttonType.isPrimary) {
|
||||||
return Theme.of(context).colorScheme.primary.withOpacity(0.9);
|
return Theme.of(context).colorScheme.primary.withOpacity(0.9);
|
||||||
}
|
}
|
||||||
|
@ -263,8 +263,7 @@ class FlowyButton extends StatelessWidget {
|
|||||||
(Platform.isIOS || Platform.isAndroid)
|
(Platform.isIOS || Platform.isAndroid)
|
||||||
? BoxDecoration(
|
? BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: borderColor ??
|
color: borderColor ?? Theme.of(context).colorScheme.outline,
|
||||||
Theme.of(context).colorScheme.outline,
|
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius: radius,
|
borderRadius: radius,
|
||||||
|
@ -54,3 +54,46 @@ class PrimaryRoundedButton extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class OutlinedRoundedButton extends StatelessWidget {
|
||||||
|
const OutlinedRoundedButton({
|
||||||
|
super.key,
|
||||||
|
required this.text,
|
||||||
|
this.onTap,
|
||||||
|
this.margin,
|
||||||
|
this.radius,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
final EdgeInsets? margin;
|
||||||
|
final double? radius;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return DecoratedBox(
|
||||||
|
decoration: ShapeDecoration(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: Theme.of(context).brightness == Brightness.light
|
||||||
|
? const BorderSide(color: Color(0x1E14171B))
|
||||||
|
: const BorderSide(color: Colors.white10),
|
||||||
|
borderRadius: BorderRadius.circular(radius ?? 8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: FlowyButton(
|
||||||
|
useIntrinsicWidth: true,
|
||||||
|
margin: margin ??
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 9.0,
|
||||||
|
),
|
||||||
|
radius: BorderRadius.circular(radius ?? 8),
|
||||||
|
text: FlowyText.regular(
|
||||||
|
text,
|
||||||
|
lineHeight: 1.0,
|
||||||
|
),
|
||||||
|
onTap: onTap,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user