Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter turns the raw pointer data of a touch input (Android, iOS) (change, kind, device, position, no identifier and no delta) into the data the framework needs: it gives each contact a pointer identifier, works out the deltas, and keeps the order the framework checks by synthesizing the add before a hover or a down, the hover before a down at another place, the move before an up at another place, the cancel and remove before a second add, and the hover or move before a signal at another place.
down -> move -> up becomes add(synthesized) -> down -> move -> up
Deviation: Flutter's converter is built over a delegate that tells which views exist; here the converter has the function viewExists, which is nil (every view exists) as long as the platform has only the implicit view. The converter does not log the FML_DCHECKs: a change for a pointer that is in a state the checks forbid is handled as the release build of C++ handles it, and a move, up, pan update or pan end for a device the converter has not seen is dropped.
Flutter: lib/ui/window/pointer_data_packet_converter.cc PointerDataPacketConverter
func New ¶
func New() *Converter
New makes a converter that has seen no pointer.
Flutter: lib/ui/window/pointer_data_packet_converter.cc PointerDataPacketConverter.PointerDataPacketConverter
func (*Converter) Convert ¶
func (c *Converter) Convert(in []ui.PointerData) []ui.PointerData
Convert converts a packet of raw data to the data for the framework, in order.
Flutter: lib/ui/window/pointer_data_packet_converter.cc PointerDataPacketConverter.Convert