浏览代码

BACK BUTTON + APP BAR

/main
xingwei.zhu 6 年前
当前提交
bfeaa376
共有 4 个文件被更改,包括 88 次插入0 次删除
  1. 5
      Runtime/material/app_bar.cs
  2. 48
      Runtime/material/back_button.cs
  3. 5
      Runtime/material/bottom_app_bar.cs
  4. 30
      Runtime/widgets/perferred_size.cs

5
Runtime/material/app_bar.cs


namespace Unity.UIWidgets.material {
public class app_bar {
}
}

48
Runtime/material/back_button.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
public class BackButtonIcon : StatelessWidget {
public BackButtonIcon(
Key key = null) : base(key: key) {
}
static IconData _getIconData() {
return Icons.arrow_back;
}
public override Widget build(BuildContext context) {
return new Icon(_getIconData());
}
}
public class BackButton : StatelessWidget {
public BackButton(
Key key = null,
Color color = null) : base(key: key) {
this.color = color;
}
public readonly Color color;
public override Widget build(BuildContext context) {
return new IconButton(
icon: new BackButtonIcon(),
color: this.color,
onPressed: () => { Navigator.maybePop(context); });
}
}
public class CloseButton : StatelessWidget {
public CloseButton(
Key key = null) : base(key: key) {
}
public override Widget build(BuildContext context) {
return new IconButton(
icon: new Icon(Icons.close),
onPressed: () => { Navigator.maybePop(context); });
}
}
}

5
Runtime/material/bottom_app_bar.cs


namespace Unity.UIWidgets.material {
public class bottom_app_bar {
}
}

30
Runtime/widgets/perferred_size.cs


using System.Drawing;
using Unity.UIWidgets.foundation;
namespace Unity.UIWidgets.widgets {
public interface PreferredSizeWidget {
Size preferredSize { get; }
}
public class PreferredSize : StatelessWidget, PreferredSizeWidget {
public PreferredSize(
Key key = null,
Widget child = null,
Size? preferredSize = null) : base(key: key) {
D.assert(child != null);
D.assert(preferredSize != null);
this.child = child;
this.preferredSize = preferredSize ?? Size.Empty;
}
public readonly Widget child;
public Size preferredSize { get; }
public override Widget build(BuildContext context) {
return this.child;
}
}
}
正在加载...
取消
保存