-
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/core/framework"
"github.com/base-go/GoFlow/pkg/ui/material"
"github.com/base-go/GoFlow/pkg/core/widgets"
)
// MaterialDemoApp demonstrates Material Design widgets
type MaterialDemoApp struct {
goflow.BaseWidget
}
func (m *MaterialDemoApp) Build(context goflow.BuildContext) goflow.Widget {
theme := material.DefaultLightTheme()
return &widgets.Column{
Children: []goflow.Widget{
// Material AppBar
material.NewAppBar(&widgets.Text{
Data: "Material Design Demo",
}),
// Theme info card
material.NewCard(&widgets.Column{
Children: []goflow.Widget{
&widgets.Text{
Data: "Material Design Components",
},
&widgets.Text{
Data: fmt.Sprintf("Primary Color: #%02x%02x%02x",
theme.PrimaryColor.R,
theme.PrimaryColor.G,
theme.PrimaryColor.B),
},
},
}),
// Buttons showcase
material.NewCard(&widgets.Column{
Children: []goflow.Widget{
&widgets.Text{
Data: "Material Buttons",
},
// Filled button
material.NewButton(&widgets.Text{
Data: "Filled Button",
}, func() {
fmt.Println("Filled button clicked!")
}),
// Text button
material.NewTextButton("Text Button", func() {
fmt.Println("Text button clicked!")
}),
// Outlined button
material.NewOutlinedButton("Outlined Button", func() {
fmt.Println("Outlined button clicked!")
}),
},
}),
// Additional cards
material.NewCard(&widgets.Text{
Data: "Material Design is Google's design system for Android, Web, and cross-platform apps.",
}),
},
}
}
func main() {
fmt.Println("GoFlow Material Design Demo")
fmt.Println("This example demonstrates Material Design widgets.")
fmt.Println()
app := &MaterialDemoApp{}
_ = app // In a real app, this would be passed to the GoFlow runtime
}