siyao
4 年前
当前提交
cc7bb1f7
共有 9 个文件被更改,包括 818 次插入 和 199 次删除
-
8com.unity.uiwidgets/Runtime/material/card.cs
-
12com.unity.uiwidgets/Runtime/material/card_theme.cs
-
184com.unity.uiwidgets/Runtime/material/checkbox.cs
-
573com.unity.uiwidgets/Runtime/material/chip.cs
-
38com.unity.uiwidgets/Runtime/material/chip_theme.cs
-
6com.unity.uiwidgets/Runtime/material/ink_ripple.cs
-
30com.unity.uiwidgets/Runtime/material/ink_splash.cs
-
82com.unity.uiwidgets/Runtime/material/ink_well.cs
-
84com.unity.uiwidgets/Runtime/material/checkbox_list_tile.cs
573
com.unity.uiwidgets/Runtime/material/chip.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.gestures; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.material { |
|||
public class CheckboxListTile : StatelessWidget { |
|||
public CheckboxListTile( |
|||
Key key, |
|||
bool? value = null, |
|||
ValueChanged<bool?> onChanged = null, |
|||
Color activeColor = null, |
|||
Color checkColor = null, |
|||
Widget title = null, |
|||
Widget subtitle = null, |
|||
bool isThreeLine = false, |
|||
bool? dense = null, |
|||
Widget secondary = null, |
|||
bool selected = false, |
|||
ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform |
|||
) : base(key: key) { |
|||
D.assert(value != null); |
|||
D.assert(!isThreeLine || subtitle != null); |
|||
this.checkColor = checkColor; |
|||
this.title = title; |
|||
this.subtitle = subtitle; |
|||
this.isThreeLine = isThreeLine; |
|||
this.dense = dense; |
|||
this.secondary = secondary; |
|||
this.selected = selected; |
|||
this.controlAffinity = controlAffinity; |
|||
} |
|||
|
|||
public readonly bool? value; |
|||
public readonly ValueChanged<bool?> onChanged; |
|||
public readonly Color activeColor; |
|||
public readonly Color checkColor; |
|||
public readonly Widget title; |
|||
public readonly Widget subtitle; |
|||
public readonly Widget secondary; |
|||
public readonly bool isThreeLine; |
|||
public readonly bool? dense; |
|||
public readonly bool selected; |
|||
public readonly ListTileControlAffinity controlAffinity; |
|||
|
|||
public override Widget build(BuildContext context) { |
|||
Widget control = new Checkbox( |
|||
value: value, |
|||
onChanged: onChanged, |
|||
activeColor: activeColor, |
|||
checkColor: checkColor, |
|||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap |
|||
); |
|||
Widget leading = null; |
|||
Widget trailing = null; |
|||
switch (controlAffinity) { |
|||
case ListTileControlAffinity.leading: |
|||
leading = control; |
|||
trailing = secondary; |
|||
break; |
|||
case ListTileControlAffinity.trailing: |
|||
case ListTileControlAffinity.platform: |
|||
leading = secondary; |
|||
trailing = control; |
|||
break; |
|||
} |
|||
|
|||
return ListTileTheme.merge( |
|||
selectedColor: activeColor ?? Theme.of(context).accentColor, |
|||
child: new ListTile( |
|||
leading: leading, |
|||
title: title, |
|||
subtitle: subtitle, |
|||
trailing: trailing, |
|||
isThreeLine: isThreeLine, |
|||
dense: dense, |
|||
enabled: onChanged != null, |
|||
onTap: onChanged != null ? () => { onChanged(!value); } : (GestureTapCallback) null, |
|||
selected: selected |
|||
) |
|||
); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue