Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit eb751fe

Browse files
author
Yuncong Zhang
committed
Test Material Themes.
1 parent aa3a77e commit eb751fe

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

Runtime/material/card_theme.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ CardTheme copyWith(
3838
ShapeBorder shape = null
3939
) {
4040
return new CardTheme(
41-
clipBehavior: this.clipBehavior ?? this.clipBehavior,
41+
clipBehavior: clipBehavior ?? this.clipBehavior,
4242
color: color ?? this.color,
43-
elevation: this.elevation ?? this.elevation,
43+
elevation: elevation ?? this.elevation,
4444
margin: margin ?? this.margin,
4545
shape: shape ?? this.shape
4646
);

Samples/UIWidgetSample/MaterialThemeSample.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Unity.UIWidgets.ui;
99
using Unity.UIWidgets.widgets;
1010
using UnityEngine;
11+
using Image = Unity.UIWidgets.widgets.Image;
1112

1213
namespace UIWidgetsSample {
1314
public class MaterialThemeSample: UIWidgetsSamplePanel {
@@ -44,11 +45,32 @@ public override Widget build(BuildContext context) {
4445
),
4546
cardTheme: new CardTheme(
4647
color: Colors.red,
47-
elevation: 6.0f
48+
elevation: 2.0f
4849
)
4950
),
5051
child: new Scaffold(
5152
appBar: new AppBar(title: new Text("Test App Bar Theme")),
53+
body: new Center(
54+
child: new Card(
55+
shape: new RoundedRectangleBorder(
56+
borderRadius: BorderRadius.all(5.0f)
57+
),
58+
child: new Container(
59+
height: 250,
60+
child: new Column(
61+
children: new List<Widget> {
62+
Image.asset(
63+
"products/backpack",
64+
fit: BoxFit.cover,
65+
width: 200,
66+
height: 200
67+
),
68+
new Text("Card Theme")
69+
}
70+
)
71+
)
72+
)
73+
),
5274
bottomNavigationBar: new BottomAppBar(
5375
child: new Row(
5476
mainAxisSize: MainAxisSize.max,

0 commit comments

Comments
 (0)