浏览代码

Merge pull request #244 from IIzzaya/iizzaya

Code Format in placeholder
/main
GitHub 5 年前
当前提交
01e11d03
共有 1 个文件被更改,包括 17 次插入26 次删除
  1. 43
      Runtime/widgets/placeholder.cs

43
Runtime/widgets/placeholder.cs


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
)
)
);

正在加载...
取消
保存