mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-11-09 23:46:19 +03:00
fix: show database view options for inline as disabled (#4711)
This commit is contained in:
parent
c0b667b4ea
commit
746f0817bc
@ -46,19 +46,27 @@ class MobileDatabaseViewQuickActions extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (!isInline) ...[
|
||||
_divider(),
|
||||
_actionButton(context, _Action.duplicate, () {
|
||||
_divider(),
|
||||
_actionButton(
|
||||
context,
|
||||
_Action.duplicate,
|
||||
() {
|
||||
context.read<ViewBloc>().add(const ViewEvent.duplicate());
|
||||
context.pop();
|
||||
}),
|
||||
_divider(),
|
||||
_actionButton(context, _Action.delete, () {
|
||||
},
|
||||
!isInline,
|
||||
),
|
||||
_divider(),
|
||||
_actionButton(
|
||||
context,
|
||||
_Action.delete,
|
||||
() {
|
||||
context.read<ViewBloc>().add(const ViewEvent.delete());
|
||||
context.pop();
|
||||
}),
|
||||
_divider(),
|
||||
],
|
||||
},
|
||||
!isInline,
|
||||
),
|
||||
_divider(),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -66,14 +74,16 @@ class MobileDatabaseViewQuickActions extends StatelessWidget {
|
||||
Widget _actionButton(
|
||||
BuildContext context,
|
||||
_Action action,
|
||||
VoidCallback onTap,
|
||||
) {
|
||||
VoidCallback onTap, [
|
||||
bool enable = true,
|
||||
]) {
|
||||
return MobileQuickActionButton(
|
||||
icon: action.icon,
|
||||
text: action.label,
|
||||
textColor: action.color(context),
|
||||
iconColor: action.color(context),
|
||||
onTap: onTap,
|
||||
enable: enable,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ class MobileQuickActionButton extends StatelessWidget {
|
||||
required this.text,
|
||||
this.textColor,
|
||||
this.iconColor,
|
||||
this.enable = true,
|
||||
});
|
||||
|
||||
final VoidCallback onTap;
|
||||
@ -17,6 +18,7 @@ class MobileQuickActionButton extends StatelessWidget {
|
||||
final String text;
|
||||
final Color? textColor;
|
||||
final Color? iconColor;
|
||||
final bool enable;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -25,6 +27,8 @@ class MobileQuickActionButton extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
overlayColor:
|
||||
enable ? null : const MaterialStatePropertyAll(Colors.transparent),
|
||||
splashColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 44,
|
||||
@ -34,14 +38,14 @@ class MobileQuickActionButton extends StatelessWidget {
|
||||
FlowySvg(
|
||||
icon,
|
||||
size: const Size.square(20),
|
||||
color: iconColor,
|
||||
color: enable ? iconColor : Theme.of(context).disabledColor,
|
||||
),
|
||||
const HSpace(12),
|
||||
Expanded(
|
||||
child: FlowyText(
|
||||
text,
|
||||
fontSize: 15,
|
||||
color: textColor,
|
||||
color: enable ? textColor : Theme.of(context).disabledColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user