@@ -245,43 +245,46 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
245245
246246 final TextStyle textStyle = themeData.textTheme.textStyle.copyWith (color: foregroundColor);
247247
248- return GestureDetector (
249- behavior: HitTestBehavior .opaque,
250- onTapDown: enabled ? _handleTapDown : null ,
251- onTapUp: enabled ? _handleTapUp : null ,
252- onTapCancel: enabled ? _handleTapCancel : null ,
253- onTap: widget.onPressed,
254- child: Semantics (
255- button: true ,
256- child: ConstrainedBox (
257- constraints: widget.minSize == null
258- ? const BoxConstraints ()
259- : BoxConstraints (
260- minWidth: widget.minSize! ,
261- minHeight: widget.minSize! ,
262- ),
263- child: FadeTransition (
264- opacity: _opacityAnimation,
265- child: DecoratedBox (
266- decoration: BoxDecoration (
267- borderRadius: widget.borderRadius,
268- color: backgroundColor != null && ! enabled
269- ? CupertinoDynamicColor .resolve (widget.disabledColor, context)
270- : backgroundColor,
271- ),
272- child: Padding (
273- padding: widget.padding ?? (backgroundColor != null
274- ? _kBackgroundButtonPadding
275- : _kButtonPadding),
276- child: Align (
277- alignment: widget.alignment,
278- widthFactor: 1.0 ,
279- heightFactor: 1.0 ,
280- child: DefaultTextStyle (
281- style: textStyle,
282- child: IconTheme (
283- data: IconThemeData (color: foregroundColor),
284- child: widget.child,
248+ return MouseRegion (
249+ cursor: enabled && kIsWeb ? SystemMouseCursors .click : MouseCursor .defer,
250+ child: GestureDetector (
251+ behavior: HitTestBehavior .opaque,
252+ onTapDown: enabled ? _handleTapDown : null ,
253+ onTapUp: enabled ? _handleTapUp : null ,
254+ onTapCancel: enabled ? _handleTapCancel : null ,
255+ onTap: widget.onPressed,
256+ child: Semantics (
257+ button: true ,
258+ child: ConstrainedBox (
259+ constraints: widget.minSize == null
260+ ? const BoxConstraints ()
261+ : BoxConstraints (
262+ minWidth: widget.minSize! ,
263+ minHeight: widget.minSize! ,
264+ ),
265+ child: FadeTransition (
266+ opacity: _opacityAnimation,
267+ child: DecoratedBox (
268+ decoration: BoxDecoration (
269+ borderRadius: widget.borderRadius,
270+ color: backgroundColor != null && ! enabled
271+ ? CupertinoDynamicColor .resolve (widget.disabledColor, context)
272+ : backgroundColor,
273+ ),
274+ child: Padding (
275+ padding: widget.padding ?? (backgroundColor != null
276+ ? _kBackgroundButtonPadding
277+ : _kButtonPadding),
278+ child: Align (
279+ alignment: widget.alignment,
280+ widthFactor: 1.0 ,
281+ heightFactor: 1.0 ,
282+ child: DefaultTextStyle (
283+ style: textStyle,
284+ child: IconTheme (
285+ data: IconThemeData (color: foregroundColor),
286+ child: widget.child,
287+ ),
285288 ),
286289 ),
287290 ),
0 commit comments