-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWidget.cs
More file actions
40 lines (35 loc) · 1.08 KB
/
Copy pathMainWidget.cs
File metadata and controls
40 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using UniMob.UI;
using UniMob.UI.Widgets;
using UnityEngine;
namespace Samples.Navigation
{
public class MainWidget : StatefulWidget
{
public Action ShowDetail { get; set; }
public override State CreateState() => new MainState();
}
public class MainState : HocState<MainWidget>
{
public override Widget Build(BuildContext context)
{
return new Container
{
Size = WidgetSize.Stretched,
BackgroundColor = Color.white,
Child = new UniMobButton
{
OnClick = () => Widget.ShowDetail?.Invoke(),
Child = new UniMobText(WidgetSize.Fixed(600, 200))
{
Value = "Open Detail",
FontSize = 60,
Color = Color.black,
MainAxisAlignment = MainAxisAlignment.Center,
CrossAxisAlignment = CrossAxisAlignment.Center,
}
}
};
}
}
}