浏览代码

Merge pull request #296 from IIzzaya/cupertinosample

[Cupertino] Gallery bug fix
/main
GitHub 5 年前
当前提交
b6482e34
共有 2 个文件被更改,包括 128 次插入133 次删除
  1. 2
      Runtime/widgets/heroes.cs
  2. 259
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs

2
Runtime/widgets/heroes.cs


HeroFlightShuttleBuilder shuttleBuilder,
bool isUserGestureTransition
) {
D.assert(fromHero.widget.tag.ToString() == toHero.widget.tag.ToString());
D.assert(fromHero.widget.tag.Equals(toHero.widget.tag));
this.type = type;
this.overlay = overlay;
this.navigatorRect = navigatorRect;

259
Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


new Tab2ConversationRow(
avatar: new Tab2ConversationAvatar(
text: "KL",
color: new Color(0xfFD5015)
color: new Color(0xFFFD5015)
),
text: "We'll rush you a new one.\nIt's gonna be incredible"
),

new Tab2ConversationRow(
avatar: new Tab2ConversationAvatar(
text: "SJ",
color: new Color(0xf34CAD6)
color: new Color(0xFF34CAD6)
),
text: "We'll send you our\nnewest Labrador too!"
),

new Tab2ConversationRow(
avatar: new Tab2ConversationAvatar(
text: "KL",
color: new Color(0xfFD5015)
color: new Color(0xFFFD5015)
),
text: "Actually there's one more thing..."
),

new Text(
"Buy this cool color",
style: new TextStyle(
color: new Color(0xf8E8E93),
color: new Color(0xFF8E8E93),
fontSize: 13.0f,
fontWeight: FontWeight.w300
)

row,
new Container(
height: 1.0f,
color: new Color(0xfD9D9D9)
color: new Color(0xFFD9D9D9)
)
}
);

this.relatedColors = new List<Color>();
for (int i = 0; i < 10; i++) {
this.relatedColors.Add(
Color.fromARGB(
255,
this.widget.color.red + Random.Range(0, 50).clamp(0, 255),
this.widget.color.green + Random.Range(0, 50).clamp(0, 255),
this.widget.color.blue + Random.Range(0, 50).clamp(0, 255)
)
);
this.relatedColors.Add(Color.fromARGB(
255,
(this.widget.color.red + Random.Range(-50, 50)).clamp(0, 255),
(this.widget.color.green + Random.Range(-50, 50)).clamp(0, 255),
(this.widget.color.blue + Random.Range(-50, 50)).clamp(0, 255)
));
}
}

),
new Padding(padding: EdgeInsets.only(top: 6.0f)),
new Text(
"Item number ${widget.index}",
$"Item number {this.widget.index}",
color: new Color(0xf8E8E93),
color: new Color(0xFF8E8E93),
fontSize: 16.0f,
fontWeight: FontWeight.w100
)

CupertinoButton.filled(
minSize: 30.0f,
padding: EdgeInsets.symmetric(horizontal: 24.0f),
borderRadius: BorderRadius.circular(32.0f),
borderRadius: BorderRadius.circular(16.0f),
child: new Text(
"GET",
style: new TextStyle(

CupertinoButton.filled(
minSize: 30.0f,
padding: EdgeInsets.zero,
borderRadius: BorderRadius.circular(32.0f),
borderRadius: BorderRadius.circular(16.0f),
child: new Icon(CupertinoIcons.ellipsis),
onPressed: () => { }
)

child: new Text(
"USERS ALSO LIKED",
style: new TextStyle(
color: new Color(0xf646464),
color: new Color(0xFF646464),
letterSpacing: -0.60f,
fontSize: 15.0f,
fontWeight: FontWeight.w500

navigationBar: new CupertinoNavigationBar(
trailing: CupertinoNavigationDemoUtils.trailingButtons
),
child: new ListView(
children: listViewList
child:
new SafeArea(
child: new ListView(
children: listViewList
)
)
);
}

public override Widget build(BuildContext context) {
return new Padding(
padding: EdgeInsets.all(16.0f),
child: new SafeArea(
top: false,
bottom: false,
child: new ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(16.0f)),
child: new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new Container(
decoration: new BoxDecoration(
color: new Color(0xfE5E5E5)
),
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: new List<Widget> {
new Text(
"SUPPORT TICKET",
style: new TextStyle(
color: new Color(0xf646464),
letterSpacing: -0.9f,
fontSize: 14.0f,
fontWeight: FontWeight.w500
)
),
new Text(
"Show More",
style: new TextStyle(
color: new Color(0xf646464),
letterSpacing: -0.6f,
fontSize: 12.0f,
fontWeight: FontWeight.w500
)
child: new ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(16.0f)),
child: new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new Container(
decoration: new BoxDecoration(
color: new Color(0xFFE5E5E5)
),
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: new List<Widget> {
new Text(
"SUPPORT TICKET",
style: new TextStyle(
color: new Color(0xFF646464),
letterSpacing: -0.9f,
fontSize: 14.0f,
fontWeight: FontWeight.w500
)
),
new Text(
"Show More",
style: new TextStyle(
color: new Color(0xFF646464),
letterSpacing: -0.6f,
fontSize: 12.0f,
fontWeight: FontWeight.w500
}
)
)
}
)
),
new Container(
decoration: new BoxDecoration(
color: new Color(0xFFF3F3F3)
new Container(
decoration: new BoxDecoration(
color: new Color(0xfF3F3F3)
),
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: new List<Widget> {
new Text(
"Product or product packaging damaged during transit",
style: new TextStyle(
fontSize: 16.0f,
fontWeight: FontWeight.w700,
letterSpacing: -0.46f
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: new List<Widget> {
new Text(
"Product or product packaging damaged during transit",
style: new TextStyle(
fontSize: 16.0f,
fontWeight: FontWeight.w700,
letterSpacing: -0.46f
)
),
new Padding(padding: EdgeInsets.only(top: 16.0f)),
new Text(
"REVIEWERS",
style: new TextStyle(
color: new Color(0xFF646464),
fontSize: 12.0f,
letterSpacing: -0.6f,
fontWeight: FontWeight.w500
)
),
new Padding(padding: EdgeInsets.only(top: 8.0f)),
new Row(
children: new List<Widget> {
new Container(
width: 44.0f,
height: 44.0f,
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage(
"people/square/trevor"
)
),
shape: BoxShape.circle
)
),
new Padding(padding: EdgeInsets.only(left: 8.0f)),
new Container(
width: 44.0f,
height: 44.0f,
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage(
"people/square/sandra"
)
),
shape: BoxShape.circle
)
),
new Padding(padding: EdgeInsets.only(left: 2.0f)),
new Icon(
CupertinoIcons.check_mark_circled,
color: new Color(0xFF646464),
size: 20.0f
),
new Padding(padding: EdgeInsets.only(top: 16.0f)),
new Text(
"REVIEWERS",
style: new TextStyle(
color: new Color(0xf646464),
fontSize: 12.0f,
letterSpacing: -0.6f,
fontWeight: FontWeight.w500
)
),
new Padding(padding: EdgeInsets.only(top: 8.0f)),
new Row(
children: new List<Widget> {
new Container(
width: 44.0f,
height: 44.0f,
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage(
"people/square/trevor"
)
),
shape: BoxShape.circle
)
),
new Padding(padding: EdgeInsets.only(left: 8.0f)),
new Container(
width: 44.0f,
height: 44.0f,
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage(
"people/square/sandra"
)
),
shape: BoxShape.circle
)
),
new Padding(padding: EdgeInsets.only(left: 2.0f)),
new Icon(
CupertinoIcons.check_mark_circled,
color: new Color(0xf646464),
size: 20.0f
)
}
)
}
)
}
)
}
}
)
)
}
)
)
);

: Tab2ConversationBubbleColor.gray
)
);
return new SafeArea(
child: new Row(
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
children: children
)
return new Row(
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
children: children
);
}
}

decoration: new BoxDecoration(
color: CupertinoTheme.of(context).scaffoldBackgroundColor,
border: new Border(
top: new BorderSide(color: new Color(0xfBCBBC1), width: 0.0f),
bottom: new BorderSide(color: new Color(0xfBCBBC1), width: 0.0f)
top: new BorderSide(color: new Color(0xFFBCBBC1), width: 0.0f),
bottom: new BorderSide(color: new Color(0xFFBCBBC1), width: 0.0f)
)
),
height: 44.0f,

new Icon(
CupertinoIcons.profile_circled,
size: 160.0f,
color: new Color(0xf646464)
color: new Color(0xFF646464)
),
new Padding(padding: EdgeInsets.only(top: 18.0f)),
CupertinoButton.filled(

正在加载...
取消
保存