Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions accessibility.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package flutter

import "github.com/go-flutter-desktop/go-flutter/plugin"

type accessibilityPlugin struct{}

var _ Plugin = &accessibilityPlugin{} // compile-time type check

// hardcoded because there is no swappable renderer interface.
var defaultAccessibilityPlugin = &accessibilityPlugin{}

func (p *accessibilityPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
channel := plugin.NewBasicMessageChannel(messenger, "flutter/accessibility", plugin.StandardMessageCodec{})
// Ignored: go-flutter dosn't support accessibility events
channel.HandleFunc(func(_ interface{}) (interface{}, error) { return nil, nil })
return nil
}
1 change: 1 addition & 0 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func NewApplication(opt ...Option) *Application {
opt = append(opt, AddPlugin(defaultTextinputPlugin))
opt = append(opt, AddPlugin(defaultLifecyclePlugin))
opt = append(opt, AddPlugin(defaultKeyeventsPlugin))
opt = append(opt, AddPlugin(defaultAccessibilityPlugin))

// apply all configs
for _, o := range opt {
Expand Down
4 changes: 4 additions & 0 deletions platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func (p *platformPlugin) InitPluginGLFW(window *glfw.Window) (err error) {
p.channel.HandleFunc("SystemNavigator.pop", p.handleSystemNavigatorPop)
// Ignored: Desktop's don't have system overlays
p.channel.HandleFuncSync("SystemChrome.setSystemUIOverlayStyle", func(_ interface{}) (interface{}, error) { return nil, nil })
// Ignored: Desktop's don't have haptic feedback
p.channel.HandleFuncSync("HapticFeedback.vibrate", func(_ interface{}) (interface{}, error) { return nil, nil })
// Ignored: Desktop's don't play sound on every clicks
p.channel.HandleFuncSync("SystemSound.play", func(_ interface{}) (interface{}, error) { return nil, nil })
return nil
}

Expand Down
1 change: 1 addition & 0 deletions textinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (p *textinputPlugin) InitPluginGLFW(window *glfw.Window) error {
p.channel.HandleFuncSync("TextInput.setEditingState", p.handleSetEditingState)
// Ignored: Desktop's don't have a virtual keyboard, so there is no need to show or hide it
p.channel.HandleFuncSync("TextInput.show", func(_ interface{}) (interface{}, error) { return nil, nil })
p.channel.HandleFuncSync("TextInput.hide", func(_ interface{}) (interface{}, error) { return nil, nil })
return nil
}

Expand Down