-
Notifications
You must be signed in to change notification settings - Fork 282
/
navigation.go
29 lines (21 loc) · 1.05 KB
/
navigation.go
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
package flutter
import (
"github.com/go-flutter-desktop/go-flutter/plugin"
)
const navigationChannelName = "flutter/navigation"
// navigationPlugin implements flutter.Plugin and handles method calls to the
// flutter/navigation channel.
type navigationPlugin struct {
channel *plugin.MethodChannel
}
// all hardcoded because theres not pluggable renderer system.
var defaultNavigationPlugin = &navigationPlugin{}
func (p *navigationPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
p.channel = plugin.NewMethodChannel(messenger, navigationChannelName, plugin.JSONMethodCodec{})
// Ignored: This information isn't properly formated to set the window.SetTitle
p.channel.HandleFuncSync("routeUpdated", func(_ interface{}) (interface{}, error) { return nil, nil })
// Currently ignored on platforms other than web
p.channel.HandleFuncSync("selectSingleEntryHistory", func(_ interface{}) (interface{}, error) { return nil, nil })
p.channel.HandleFuncSync("routeInformationUpdated", func(_ interface{}) (interface{}, error) { return nil, nil })
return nil
}