Skip to content

Commit e0daca4

Browse files
committed
InkWell Changes:
* Add overlayColor. * Move all other color sections to advanced panel. * Refactor ink well editor property. * Allow selection and enable focus handling of each ink well color tile. * Use a Stack to render InkWells infront of all content in SDK and codegen. * Reduce default opacity of InkWells.
1 parent cb46d2a commit e0daca4

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

lib/src/transformers/widget_node_transformer_manager.dart

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,46 @@ abstract class WidgetNodeTransformerManager extends NodeTransformerManager<
119119
final InkWellModel? inkWell = node is BlendMixin ? node.inkWell : null;
120120

121121
if (inkWell != null) {
122-
return Material(
123-
color: Colors.transparent,
124-
borderRadius: getBorderRadius(node),
125-
clipBehavior: getClipBehavior(node),
126-
child: InkWell(
127-
onTap: onClickReactions.isEmpty
128-
? null
129-
: () {
130-
for (final Reaction reaction in onClickReactions) {
131-
final ActionModel action = reaction.action;
122+
return Stack(
123+
clipBehavior: Clip.none,
124+
key: ValueKey('InkWell Stack [${node.id}]'),
125+
children: [
126+
widget,
127+
Positioned.fill(
128+
child: Material(
129+
type: MaterialType.transparency,
130+
borderRadius: getBorderRadius(node),
131+
clipBehavior: getClipBehavior(node),
132+
child: InkWell(
133+
onTap: onClickReactions.isEmpty
134+
? null
135+
: () {
136+
for (final Reaction reaction in onClickReactions) {
137+
final ActionModel action = reaction.action;
132138
FunctionsRepository.performAction(context, action);
133139
}
134140
},
135-
onLongPress: onLongPressReactions.isEmpty
136-
? null
137-
: () {
138-
for (final Reaction reaction in onLongPressReactions) {
139-
final ActionModel action = reaction.action;
141+
onLongPress: onLongPressReactions.isEmpty
142+
? null
143+
: () {
144+
for (final Reaction reaction in onLongPressReactions) {
145+
final ActionModel action = reaction.action;
140146
FunctionsRepository.performAction(context, action);
141147
}
142148
},
143-
splashColor: inkWell.splashColor?.toFlutterColor(),
144-
highlightColor: inkWell.highlightColor?.toFlutterColor(),
145-
hoverColor: inkWell.hoverColor?.toFlutterColor(),
146-
focusColor: inkWell.focusColor?.toFlutterColor(),
147-
child: widget,
148-
),
149+
overlayColor: inkWell.overlayColor != null
150+
? MaterialStatePropertyAll<Color>(
151+
inkWell.overlayColor!.toFlutterColor(),
152+
)
153+
: null,
154+
splashColor: inkWell.splashColor?.toFlutterColor(),
155+
highlightColor: inkWell.highlightColor?.toFlutterColor(),
156+
hoverColor: inkWell.hoverColor?.toFlutterColor(),
157+
focusColor: inkWell.focusColor?.toFlutterColor(),
158+
),
159+
),
160+
),
161+
],
149162
);
150163
} else {
151164
return MouseRegion(

0 commit comments

Comments
 (0)