feat: add gesture prop logic.

This commit is contained in:
2021-11-12 18:57:34 +08:00
parent 1c6d50a4b6
commit 07b9464496
8 changed files with 222 additions and 22 deletions
+21 -4
View File
@@ -33,7 +33,7 @@ class DButton extends StatefulWidget {
key: key,
width: width,
height: height,
onTap: onTap,
onTap: enabled ? onTap : null,
child: Tooltip(
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.add, size: 18)),
message: LocaleKeys.operation_add.tr(),
@@ -50,7 +50,7 @@ class DButton extends StatefulWidget {
key: key,
width: width,
height: height,
onTap: onTap,
onTap: enabled ? onTap : null,
child: Tooltip(
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.remove, size: 18)),
message: LocaleKeys.operation_delete.tr(),
@@ -67,7 +67,7 @@ class DButton extends StatefulWidget {
key: key,
width: width,
height: height,
onTap: onTap,
onTap: enabled ? onTap : null,
child: Tooltip(
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.check, size: 18)),
message: LocaleKeys.operation_apply.tr(),
@@ -84,12 +84,29 @@ class DButton extends StatefulWidget {
key: key,
width: width,
height: height,
onTap: onTap,
onTap: enabled ? onTap : null,
child: Tooltip(
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.copy_rounded, size: 18)),
message: LocaleKeys.operation_duplicate.tr(),
));
factory DButton.paste({
Key? key,
required enabled,
GestureTapCallback? onTap,
height = defaultButtonHeight * .7,
width = defaultButtonHeight * .7,
}) =>
DButton(
key: key,
width: width,
height: height,
onTap: enabled ? onTap : null,
child: Tooltip(
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.paste_rounded, size: 18)),
message: LocaleKeys.operation_paste.tr(),
));
factory DButton.dropdown({
Key? key,
width = 60.0,