|
|
|
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.widgets |
|
|
|
{ |
|
|
|
internal class _Placeholderpainter : AbstractCustomPainter |
|
|
|
{ |
|
|
|
namespace Unity.UIWidgets.widgets { |
|
|
|
class _Placeholderpainter : AbstractCustomPainter { |
|
|
|
) |
|
|
|
{ |
|
|
|
) { |
|
|
|
this.color = color; |
|
|
|
this.strokeWidth = strokeWidth; |
|
|
|
} |
|
|
|
|
|
|
public readonly float strokeWidth; |
|
|
|
|
|
|
|
public override void paint(Canvas canvas, Size size) |
|
|
|
{ |
|
|
|
public override void paint(Canvas canvas, Size size) { |
|
|
|
paint.color = color; |
|
|
|
paint.color = this.color; |
|
|
|
paint.strokeWidth = strokeWidth; |
|
|
|
paint.strokeWidth = this.strokeWidth; |
|
|
|
|
|
|
|
Rect rect = Offset.zero & size; |
|
|
|
Path path = new Path(); |
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
public override bool shouldRepaint(CustomPainter oldPainter) |
|
|
|
{ |
|
|
|
return ((_Placeholderpainter) oldPainter).color != color || |
|
|
|
((_Placeholderpainter) oldPainter).strokeWidth != strokeWidth; |
|
|
|
public override bool shouldRepaint(CustomPainter oldPainter) { |
|
|
|
return ((_Placeholderpainter) oldPainter).color != this.color || |
|
|
|
((_Placeholderpainter) oldPainter).strokeWidth != this.strokeWidth; |
|
|
|
public override bool? hitTest(Offset position) |
|
|
|
{ |
|
|
|
public override bool? hitTest(Offset position) { |
|
|
|
public class Placeholder : StatelessWidget |
|
|
|
{ |
|
|
|
public class Placeholder : StatelessWidget { |
|
|
|
public Placeholder( |
|
|
|
Key key = null, |
|
|
|
Color color = null, |
|
|
|
|
|
|
) : base(key) |
|
|
|
{ |
|
|
|
) : base(key) { |
|
|
|
this.color = color ?? new Color(0xFF455A64); |
|
|
|
this.strokeWidth = strokeWidth; |
|
|
|
this.fallbackWidth = fallbackWidth; |
|
|
|
|
|
|
public readonly float fallbackWidth; |
|
|
|
public readonly float fallbackHeight; |
|
|
|
|
|
|
|
public override Widget build(BuildContext context) |
|
|
|
{ |
|
|
|
public override Widget build(BuildContext context) { |
|
|
|
maxWidth: fallbackWidth, |
|
|
|
maxHeight: fallbackHeight, |
|
|
|
maxWidth: this.fallbackWidth, |
|
|
|
maxHeight: this.fallbackHeight, |
|
|
|
color: color, |
|
|
|
strokeWidth: strokeWidth |
|
|
|
color: this.color, |
|
|
|
strokeWidth: this.strokeWidth |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|