-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
82 lines (69 loc) · 1.86 KB
/
Copy pathmain.go
File metadata and controls
82 lines (69 loc) · 1.86 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
import (
"fmt"
"github.com/base-go/GoFlow/pkg/ui/cupertino"
"github.com/base-go/GoFlow/pkg/core/framework"
"github.com/base-go/GoFlow/pkg/core/widgets"
)
// CupertinoDemoApp demonstrates Cupertino (iOS/macOS) widgets
type CupertinoDemoApp struct {
goflow.BaseWidget
}
func (c *CupertinoDemoApp) Build(context goflow.BuildContext) goflow.Widget {
theme := cupertino.DefaultLightTheme()
return &widgets.Column{
Children: []goflow.Widget{
// Cupertino NavigationBar
cupertino.NewNavigationBar(&widgets.Text{
Data: "Cupertino Demo",
}),
// Theme info card
cupertino.NewCard(&widgets.Column{
Children: []goflow.Widget{
&widgets.Text{
Data: "Cupertino Components (iOS/macOS)",
},
&widgets.Text{
Data: fmt.Sprintf("Primary Color: #%02x%02x%02x",
theme.PrimaryColor.R,
theme.PrimaryColor.G,
theme.PrimaryColor.B),
},
},
}),
// Buttons showcase
cupertino.NewCard(&widgets.Column{
Children: []goflow.Widget{
&widgets.Text{
Data: "Cupertino Buttons",
},
// Filled button
cupertino.NewButton(&widgets.Text{
Data: "Filled Button",
}, func() {
fmt.Println("Filled button clicked!")
}),
// Text button
cupertino.NewTextButton("Text Button", func() {
fmt.Println("Text button clicked!")
}),
// Gray button
cupertino.NewGrayButton("Gray Button", func() {
fmt.Println("Gray button clicked!")
}),
},
}),
// Additional cards
cupertino.NewCard(&widgets.Text{
Data: "Cupertino is Apple's design language for iOS and macOS applications.",
}),
},
}
}
func main() {
fmt.Println("GoFlow Cupertino Demo")
fmt.Println("This example demonstrates Cupertino (iOS/macOS) widgets.")
fmt.Println()
app := &CupertinoDemoApp{}
_ = app // In a real app, this would be passed to the GoFlow runtime
}