-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add InkResponse, Material and fix Opacity
#6199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ad5b352
d0361d5
f23677c
212102e
559ae8f
b356b03
f74cd13
54adf1e
51a5447
f9bf799
cfd3a43
06d2761
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| import 'package:flutter/gestures.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter/rendering.dart'; | ||
|
|
||
| import 'argument_decoders.dart'; | ||
| import 'runtime.dart'; | ||
|
|
@@ -30,6 +31,7 @@ import 'runtime.dart'; | |
| /// * [DropdownButton] | ||
| /// * [ElevatedButton] | ||
| /// * [FloatingActionButton] | ||
| /// * [InkResponse] | ||
| /// * [InkWell] | ||
| /// * [LinearProgressIndicator] | ||
| /// * [ListTile] | ||
|
|
@@ -337,6 +339,45 @@ Map<String, LocalWidgetBuilder> get _materialWidgetsDefinitions => <String, Loca | |
| ); | ||
| }, | ||
|
|
||
| 'InkResponse': (BuildContext context, DataSource source) { | ||
| return InkResponse( | ||
| onTap: source.voidHandler(['onTap']), | ||
| onTapDown: source.handler(['onTapDown'], (VoidCallback trigger) => (TapDownDetails details) => trigger()), | ||
| onTapUp: source.handler(['onTapUp'], (VoidCallback trigger) => (TapUpDetails details) => trigger()), | ||
| onTapCancel: source.voidHandler(['onTapCancel']), | ||
| onDoubleTap: source.voidHandler(['onDoubleTap']), | ||
| onLongPress: source.voidHandler(['onLongPress']), | ||
| onSecondaryTap: source.voidHandler(['onSecondaryTap']), | ||
| onSecondaryTapUp: source.handler(['onSecondaryTapUp'], (VoidCallback trigger) => (TapUpDetails details) => trigger()), | ||
| onSecondaryTapDown: source.handler(['onSecondaryTapDown'], (VoidCallback trigger) => (TapDownDetails details) => trigger()), | ||
| onSecondaryTapCancel: source.voidHandler(['onSecondaryTapCancel']), | ||
| onHighlightChanged: source.handler(['onHighlightChanged'], (VoidCallback trigger) => (bool highlighted) => trigger()), | ||
| onHover: source.handler(['onHover'], (VoidCallback trigger) => (bool hovered) => trigger()), | ||
| // MouseCursor? mouseCursor, | ||
| containedInkWell: source.v<bool>(['containedInkWell']) ?? false, | ||
| highlightShape: ArgumentDecoders.enumValue<BoxShape>(BoxShape.values, source, ['highlightShape']) ?? BoxShape.circle, | ||
| radius: source.v<double>(['radius']), | ||
| borderRadius: ArgumentDecoders.borderRadius(source, ['borderRadius']) | ||
| ?.resolve(Directionality.of(context)), | ||
|
||
| customBorder: ArgumentDecoders.shapeBorder(source, ['customBorder']), | ||
| focusColor: ArgumentDecoders.color(source, ['focusColor']), | ||
| hoverColor: ArgumentDecoders.color(source, ['hoverColor']), | ||
| highlightColor: ArgumentDecoders.color(source, ['highlightColor']), | ||
| // MaterialStateProperty<Color?>? overlayColor, | ||
| splashColor: ArgumentDecoders.color(source, ['splashColor']), | ||
| // InteractiveInkFeatureFactory? splashFactory, | ||
| enableFeedback: source.v<bool>(['enableFeedback']) ?? true, | ||
| excludeFromSemantics: source.v<bool>(['excludeFromSemantics']) ?? false, | ||
| // FocusNode? focusNode, | ||
| canRequestFocus: source.v<bool>(['canRequestFocus']) ?? true, | ||
| onFocusChange: source.handler(['onFocusChange'], (VoidCallback trigger) => (bool focus) => trigger()), | ||
| autofocus: source.v<bool>(['autofocus']) ?? false, | ||
| hoverDuration: | ||
| ArgumentDecoders.duration(source, ['hoverDuration'], context), | ||
|
||
| child: source.child(['child']), | ||
|
||
| ); | ||
| }, | ||
|
|
||
| 'InkWell': (BuildContext context, DataSource source) { | ||
| // not implemented: onHighlightChanged, onHover; mouseCursor; focusColor, hoverColor, highlightColor, overlayColor, splashColor; splashFactory; focusNode, onFocusChange | ||
|
||
| return InkWell( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to expose the details in the event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed the issue #144175. We should expose the details for all the tap events.