PressableScale class
Bọc 1 nút bấm để co nhẹ (scale) lúc nhấn xuống — micro-bounce dùng chung cho mọi nút (A3). Tái dùng 1 chỗ thay vì lặp GestureDetector+AnimatedScale ở từng widget nút.
FEAT-82: cũng là điểm sửa keyboard/gamepad activation DUY NHẤT cần cho
gần như toàn bộ kit — CommonButton/NeonButton/AvatarFrame/
LeaderboardList/CommonListTile/RewardChoicePanel/SoundToggleFab/
SegmentedTabBar/CandyToggleSwitch/LevelSelectGrid/
DailyLoginCalendarWidget đều bọc qua đúng widget này (verify bằng
grep trước khi sửa, không phải giả định) — sửa 1 chỗ, cả kit được
focusable + Enter/Space (và D-pad gamepad, ánh xạ qua cùng
ActivateIntent Flutter framework tự bind sẵn) kích hoạt được, thay vì
gesture-only như trước (gap đã ghi nhận cụ thể trong Quyết định của
FEAT-53/PauseOverlay).
Không đổi hành vi gì với người chơi chỉ dùng cảm ứng: không có
Focus/Actions nào được gắn khi onTap là null (giữ nguyên
"no-op" convention AvatarFrame/LeaderboardList đã ghi), và viền
focus chỉ vẽ khi FocusManager.instance.highlightMode đang
FocusHighlightMode.traditional — chế độ đó CHỈ được framework tự
chuyển sang sau 1 tương tác bàn phím/gamepad/chuột thật, không bao giờ
từ 1 cú chạm màn hình.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PressableScale
Constructors
- PressableScale({Key? key, required VoidCallback? onTap, required Widget child, double scale = 0.94, FocusNode? focusNode, bool autofocus = false})
-
const
Properties
- autofocus → bool
-
Requests focus as soon as this widget is first built — for a caller
(e.g. a modal's first/most-important action) wanting keyboard/
gamepad focus to land here immediately, same reasoning
FocusTrapScope's ownautofocusparam exists for.final - child → Widget
-
final
- focusNode → FocusNode?
-
Caller-supplied focus node — when omitted, this widget manages its
own internally (created/disposed with the widget's own lifecycle).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → VoidCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PressableScale> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited