2019 Latest Collection Flutter interview knowledge points (b)

Immediately above 2019 interview Flutter latest knowledge points Collection (a)

PlatformView

Flutter can be nested by PlatformView native View to Flutter UI, which there actually is used broadly to achieve the principle of Presentation + VirtualDisplay + Surface and so is this:

Used a similar vice-screen display technology, VirtualDisplay class represents a virtual display, call DisplayManager of createVirtualDisplay () method, the contents of the virtual display is rendered on a Surface control, and then id inform Surface to Dart, allow engine to draw upon, Surface picture memory to find the corresponding data in memory, and then plotted. em ... Real-Time Control screenshot rendering display technology.

  • Flutter is under the JIT Debug mode, the next release is AOT mode.
  • Flutter can by mixins AutomaticKeepAliveClientMixin, then rewrite wantKeepAlive hold the page, remember to call super.build is retained in the pages build in. (Because mixins characteristics).
  • Flutter gesture event mainly through competitive judgment:
    There are hitTest to all controls need to be addressed corresponding RenderObject, from child to parent all combined into a list, has been added from the innermost to the outermost layer.

Then the child head of the queue for loop begins execution handleEvent method, performed handleEvent interrupted process can not be intercepted.

Down event does not decide the winner in general, most of the time will decide the winner of the MOVE UP or time.

Only a win on the direct response arena is closed, there is no winner in the queue took the first victory of a forced response.

As well as additional processing didExceedDeadline processing Down event when held down gesture while treatment is generally carried out in a subclass of GestureRecognizer.

  • Flutter in ListView slide actually be achieved by changing the layout ViewPort child in the display.
  • Common state management: There scope_model, flutter_redux, fish_redux, bloc + Stream several other modes, visible

Platform Channel

Flutter can allow Dart code and native code to communicate through the Platform Channel:

BasicMessageChannel: string for communicating information and semi-structured.
MethodChannel: A method for transferring calls (method invocation).
EventChanne l: a communication data flow (event streams) of.

Meanwhile Platform Channel is not thread-safe
where the underlying data type mapping is as follows:
Here Insert Picture Description

Android start page

Flutter Android, reads the tag AndroidManifset.xml meta-data when the default startup FlutterActivityDelegate.java, wherein if the flag is io.flutter.app.android.SplashScreenUntilFirstFrame ture, starts Splash screen effect starting (similar to the IOS page).

When native code reads the boot android.R.attr.windowBackground specified Drawable obtained, starting splash screen for displaying results, and then through flutterView.addFirstFrameListener, removing the splash screen onFirstFrame.

Well, here we are temporary, there is a problem or if changes will supplement, followed by plus.

Guess you like

Origin blog.csdn.net/Android_SE/article/details/90605921