浏览代码

update

/imageFlow
siyao 3 年前
当前提交
7da14431
共有 1 个文件被更改,包括 39 次插入34 次删除
  1. 73
      AwesomeUIWidgets/Assets/Scripts/ImageFlowDemo.cs

73
AwesomeUIWidgets/Assets/Scripts/ImageFlowDemo.cs


internal static Random random = new Random();
public static bool UseImage = true;
public static bool UseAmountSlider = false;
public static T RandomSelect<T>(this List<T> a)
{

private readonly List<Widget> _tiles = new List<Widget>();
private int count = 4;
private int tileCount = 10;
private int tileCount = 30;
public void UpdateTiles()
{

public override Widget build(BuildContext context)
{
return new Column(
children: new List<Widget>()
{
new Expanded(child:
new Container(
child:
StaggeredGridView.count(
crossAxisCount: count,
staggeredTiles: _staggeredTiles,
mainAxisSpacing: 3,
crossAxisSpacing: 3,
padding: EdgeInsets.all(4),
children: _tiles
)
)),
new Slider(
activeColor: Colors.blue,
inactiveColor: Colors.white,
value: count,
min: 2,
max: 8,
divisions: 6,
label: count.ToString(),
onChanged: v =>
var result = new List<Widget>()
{
new Expanded(child:
new Container(
child:
StaggeredGridView.count(
crossAxisCount: count,
staggeredTiles: _staggeredTiles,
mainAxisSpacing: 3,
crossAxisSpacing: 3,
padding: EdgeInsets.all(4),
children: _tiles
)
)),
new Slider(
activeColor: Colors.blue,
inactiveColor: Colors.white,
value: count,
min: 2,
max: 8,
divisions: 6,
label: count.ToString(),
onChanged: v =>
{
int newCount = (int) v;
if (newCount != count)
int newCount = (int) v;
if (newCount != count)
{
setState(() => { count = newCount; });
}
setState(() => { count = newCount; });
),
}
),
};
if (Utils.UseAmountSlider)
{
result.Add(
new Slider(
activeColor: Colors.blue,
inactiveColor: Colors.white,

});
}
}
),
}
);
)
);
}
return new Column(children: result);
}
}

正在加载...
取消
保存