1
+ using Unity . UIWidgets . animation ;
2
+ using Unity . UIWidgets . cupertino ;
3
+ using Unity . UIWidgets . editor ;
4
+ using Unity . UIWidgets . foundation ;
5
+ using Unity . UIWidgets . painting ;
6
+ using Unity . UIWidgets . ui ;
7
+ using Unity . UIWidgets . widgets ;
8
+ using UnityEditor ;
9
+ using UnityEngine ;
10
+ using Rect = UnityEngine . Rect ;
11
+
12
+ namespace UIWidgetsSample {
13
+ public class CupertinoSample : UIWidgetsEditorWindow {
14
+ [ MenuItem ( "UIWidgetsTests/CupertinoSample" ) ]
15
+ public static void gallery ( ) {
16
+ GetWindow < CupertinoSample > ( ) ;
17
+ }
18
+
19
+ protected override void OnEnable ( ) {
20
+ FontManager . instance . addFont ( Resources . Load < Font > ( "CupertinoIcons" ) , "CupertinoIcons" ) ;
21
+ base . OnEnable ( ) ;
22
+ }
23
+
24
+ protected override Widget createWidget ( ) {
25
+ Debug . Log ( "[Cupertino Sample] Created" ) ;
26
+ return new CupertinoSampleApp ( ) ;
27
+ }
28
+ }
29
+
30
+
31
+ public class CupertinoSampleApp : StatelessWidget {
32
+ public override Widget build ( BuildContext context ) {
33
+ return new CupertinoApp (
34
+ theme : new CupertinoThemeData (
35
+ textTheme : new CupertinoTextThemeData (
36
+ navLargeTitleTextStyle : new TextStyle (
37
+ fontWeight : FontWeight . bold ,
38
+ fontSize : 70f ,
39
+ color : CupertinoColors . activeBlue
40
+ )
41
+ ) ) ,
42
+ home : new CupertinoSampleWidget ( )
43
+ ) ;
44
+ }
45
+ }
46
+
47
+ public class CupertinoSampleWidget : StatefulWidget {
48
+ public CupertinoSampleWidget ( Key key = null ) : base ( key ) { }
49
+
50
+ public override State createState ( ) {
51
+ return new CupertinoSampleWidgetState ( ) ;
52
+ }
53
+ }
54
+
55
+ public class CupertinoSampleWidgetState : State < CupertinoSampleWidget > {
56
+ public override Widget build ( BuildContext context ) {
57
+ return new CupertinoPageScaffold (
58
+ child : new Center (
59
+ child : new Text ( "Hello Cupertino" ,
60
+ style : CupertinoTheme . of ( context ) . textTheme . navLargeTitleTextStyle
61
+ )
62
+ )
63
+ ) ;
64
+ }
65
+ }
66
+ }
0 commit comments