Posts

Showing posts with the label IOS

Flutter messaging classes and their native platform peers

Image
Communication between Flutter modules and Mobile Native code happens over platform channels.  The docs are all over the place so I created this cheat sheet for the different channel types and their class documentation. YouTube walkthrough video Mobile Native Communication Communication between the Mobile native code and Flutter happens over platform channels. Web communication happens via window messaging. Flutter Channel types There are three native platform channel types. V1 of this application uses the  Message Channel Channel type and Flutter class Description Flutter Native Native Flutter Supports Return Method Invoke method on the other side Yes Yes Via result Message Sends a message to a remote listener Yes Yes Via reply Event Streams and sinks. Events can flow in both directions Yes Yes N/A Channel Implementation Classes Dart/Flutter, Android, and iOS have corresponding `channel` classes for each channel type. The three platform channel...

Flutter Cupertino and Material or Fuchsia APIs are different enough to require switches or wrappers for the native look and feel.

Image
Flutter lets you write once and then run anywhere with the native look and feel.  It turns out that getting the native look and feel on mobile devices means using Flutter platform-specific libraries that expose the platform differences. Users expect platform-specific behavior, especially on mobile devices. You either bury switches everywhere in your code or you wrap them. This includes a demonstration of the Material and IOS date pickers and a wrapper that hides their differences from the rest of your code.   References YouTube walkthrough Flutter device Widget wrappers - You'll be wrapping IOS, Fuchsia, and Material widgets everywhere. Code Samples  https://github.com/freemansoft/Flutter-AdaptiveCards Strategies There are really three main strategies for handling mobile device native behavior. Ignore native behavior:  Pick a single interface standard, say Material  in flutter, and force all the users to use it no matter what type of device they have....