当前位置:网站首页>Talk about the landing of features in the flutterengage Conference

Talk about the landing of features in the flutterengage Conference

2021-04-26 19:38:24 InfoQ

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter engage It's been a while since the conference , Idle fish team is used on a large scale earlier in China flutter The team , Yes flutter I'm very excited with every upgrade of , There are many introductions to the conference on the Internet flutte 2 Feature introduction article , I won't go over the specific features , Today, we will review these new features from the perspective of developers , Evaluate the application of these features in business scenarios , Finally, flutter The outlook for the future , What other functions are expected in the future ."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Flutter2 New characteristics "}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Full support Windows、MacOS、Linux、Web、iOS、Android Six platforms "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" This time flutter engage The highlight of the conference is to support more platforms , On the basis of the original mobile terminal , New desktop 、web End , From now on flutter A more solid step towards a truly multi platform ,flutter2 It looks more like a brand new engine ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f3\/f3289199b6864f63a62e75733b8298b6.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Desktop platform "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter2 Fully support the current mainstream Windows、MacOS、Linux Desktop platform , In fact, for fluttre In terms of Architecture , Because the bottom layer uses skia It's cross platform , It's very smooth to expand from mobile to desktop ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" advantage "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Developers write a Dart Render code , Can be deployed to multiple platforms , It's a very smooth way to develop ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" The current problems "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In addition to writing Dart Rendering out of code , We also need to pay attention to whether the libraries that the project relies on support the desktop platform perfectly . Google claims that it officially maintains all pub The library is fully supported web\/macos\/windows Such as platform , In addition, other libraries in the community need to wait for authors to upgrade , It may take a while for developers to upgrade smoothly ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Developers who want to migrate to the desktop platform can evaluate the libraries their projects depend on . If most of the libraries we rely on come from Google official , And they all support desktop platforms , Less platform related libraries , The upgrade process should be very smooth ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" Idle fish point of view "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Compared with other mature cross platform desktop development frameworks in the industry , Learning cost ratio Qt Partial (Dart Language ), Performance ratio electron good , But off the shelf components don't have electron mature , It is very suitable for the smooth migration of tool applications from the mobile end to the desktop end ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"Flutter web"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter web The initial design idea is to use Dart Code operation css perhaps Dom Interface to render , And then flutter2 Has been upgraded to framework Completely isolated from the render layer , Use the same Dart Code can be compiled into multiple platforms . The following two pictures are based on the operating system flutter Architecture and browser based flutter framework ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f6\/f67ff2578c94573953d01c2da6187007.jpeg","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"Windows\/MacOS\/Linux\/iOS\/Android framework "}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/d0\/d06a5dcbcb6c4278d1836c44d17f2799.jpeg","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"web framework "}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"Flutter web Recommended scenarios "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The same Dart Code can now run on a variety of platforms , Deployment to the server can also run in web Yes , Then use it in the above common situation flutter web It's the most suitable one ?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Google recommends flutter web There are "}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Progressive Web Apps(PWA)"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Single Page Apps(SPA)"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" existing app transfer "}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"PWA and SPA It's relative to tradition web In terms of application , Tradition web The page follows the request - Reply protocol , The refresh and loading of web content is accompanied by many network requests . and PWA and SPA Relatively, there will be less requests , Or data returned on request . such as PWA, It can be simply understood as an expectation to run on various devices , near Native Applications keep consistent with the use of experience web application . In short, it's using web Technology simulates native applications , This application renders most of the code without network requests , Open and use , It can run offline without network , Same as normal native functions , It's just that it's using web Technical writing , Applications running in browsers . A common example is installing in android The equipment web twitter application ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" and SPA and PWA The limit is ,SPA For the first time, the user interface code needs a network request , Then every request is a pure data request ."}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f6\/f6eea08aa6840e3c64d92da416494a44.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"PWA Application principle "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/c0\/c06a7b74b840ad597c178a8eaf204e06.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"SPA Application principle "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" These three scenarios use flutter web The original intention is to make full use of it compared to the traditional web Excellent rendering performance of web pages . If you use flutter web To write very classic web Applications lose their use flutter web Superior rendering performance , I can't keep up with tradition web Make full use of its mature ecology ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" How to move Flutter web?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" No need to configure special settings , Use it directly IDE(VSCode perhaps Android Studio) To write flutter After the project , Use "},{"type":"codeinline","content":[{"type":"text","text":"flutter build web"}]},{"type":"text","text":" You can experience ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" But there are a few things to focus on :"}]},{"type":"numberedlist","attrs":{"start":null,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":" Rely on the Flutter plugin Need support web For cross platform plugin, It needs to be re supported web"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":" Responsive layout Compared with the original mobile device, the screen is small ,web The client may run on various screens , Various interaction modes need to be optimized ."}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":3,"align":null,"origin":null},"content":[{"type":"text","text":" Page Jump \/ Navigation The page jumps from the mobile device's single window , Become a multi window browser , many tab"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":4,"align":null,"origin":null},"content":[{"type":"text","text":" Desktop device interaction style ( mouse 、 keyboard ) Support the more common mouse and keyboard interaction under the browser "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":5,"align":null,"origin":null},"content":[{"type":"text","text":" Rendering mode (HTML\/CanvasKit) It needs to be selected according to business needs flutter web How to render (HTML Rendering installation package is small , Poor performance ,CanvasKit Rendering mode installation package is big , Good performance )"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" The current problems "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Because the existence of browser features determines , If you want to do something that is strongly related to the operating system plugin library web When supported by the features of , There will be difficulties , For example, file system , All kinds of social media login to share sdk etc. . Therefore, the scene of its use is further reduced ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" Idle fish point of view :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter web Although the rendering performance is not as good as the native one based on the operating system architecture flutter application , But it's better than being able to deploy on the server , But more than the average web Slightly better rendering performance , So it's very suitable for those with performance requirements web Activities are used in business scenarios . Or as a native flutter A solution of service degradation in case of interface crash , In an emergency scenario, the business acts as a fireman ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" Support multi screen devices "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" This is Microsoft's effort to bring its own devices surface duo equipment , Open up a separate branch for flutter Support multi screen features ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/81\/81bf0a3ab37ad7a43ed65a05dafe2b9b.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Supported features can well support the features of multi screen devices , such as :"}]},{"type":"numberedlist","attrs":{"start":null,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":"Extended Canvas: Two screens share a big canvas"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"List-Detail: Left list , Right, details "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":3,"align":null,"origin":null},"content":[{"type":"text","text":"Two Page: Multi page , Reading application "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":4,"align":null,"origin":null},"content":[{"type":"text","text":"Dual View: Double screen , Two screens with the same content and different angles "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":5,"align":null,"origin":null},"content":[{"type":"text","text":"Companion Pane: Left hand display , Right configuration "}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Code samples :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" such as TwoPanel It's new Widget,panel1、panel2 Passing in two different screens widget"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"Widget build(BuildContext context) {\n return TwoPane(\n pane1: _widgetA(),\n pane2: _widgetB(),\n paneProportion: 0.3,\n panePriority: MediaQuery.of(context).size.width > 500 ? TwoPanePriority.both : TwoPanePriority.pane1,\n );\n}\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f0\/f01c02e259ca8e26308e2a60930550c5.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" But this branch is currently maintained by Microsoft , I haven't joined in yet flutter In the main branch of flutter github Two of them issue In the special follow-up (issue77156"},{"type":"sup","content":[{"type":"text","text":"[1]"}]},{"type":"text","text":" ,issue24756"},{"type":"sup","content":[{"type":"text","text":"[2]"}]},{"type":"text","text":") , Interested can go to the link below to learn about the Overview  https:\/\/devblogs.microsoft.com\/surface-duo\/flutter-dual-screen-foldable\/ "},{"type":"sup","content":[{"type":"text","text":"[3]"}]}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"Dart New features of language "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter2 In addition to new features such as new platforms , Form a complete set of Dart Language has also introduced new features "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"Sound null safety"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Sound null safety Let's call it the empty security statement for now , The goal is to explicitly declare that it might be null The variable of , increase Dart Language robustness . because Dart Language variables can store null Or specific values , Therefore, in the daily development, it may be because of forgetting the assignment or delaying the assignment of variables , The result of accessing a variable is null, Causes the program to throw exception. When this feature comes out , It can be solved at the source level null An error caused by an exception . The simple operation is to add... After the type declaration ? To identify that this variable can be null Of ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/fa\/fac4ecc83a8ced6953732479a75a4e87.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" How to move ? by Dart This grammar sugar , How to upgrade an existing project ? Google also provides a supporting upgrade tool for this , Just use it in the project directory dart migrate, It can help you scan the entire project for potential variables to be replaced "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/6c\/6c66013f6739606071816504dd509583.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" advantage "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The dependent variable of remission was null And throw exception And the white screen , Users can not operate and other experience problems ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" The current problems "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" But developers are interested in existing projects , once Dart All of a sudden, the code is transformed , There is no doubt that it will increase systemic risk , And it's also a very heavy task for test scope ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" Idle fish point of view :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" This feature is a good way to expose the risk in the coding stage ahead of time , By the way, it can solve the problem of haunting null problem , High cost performance . But large scale transformation will also cause problems , But the reason why this feature is not mandatory , In order to solve the systemic risk caused by large-scale transformation , It can be carried out in batches ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"FFI(Foreign Function Interface)"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Dynamic library function call features . The purpose of this feature is to make it easier for developers to call the dynamic library of the operating system . This feature has been around for a long time , Now I'm officially on the job stable, Developers can use it with confidence ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The way it's used is also very intuitive "}]},{"type":"numberedlist","attrs":{"start":null,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":" Compile a dynamic library under a certain platform "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"Dart Loading dynamic libraries in code , take Dart And dynamic library function binding "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":3,"align":null,"origin":null},"content":[{"type":"text","text":"Dart Call the bound function "}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/68\/684d272e9aee848ef7daa43495c17ffa.png","alt":" picture ","title":"null","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"FFI See here for more details https:\/\/pub.dev\/packages\/ffigen"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" advantage "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" After moving from static library to dynamic library , Can reduce the size of the installation package "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Compared to injection plugin Mode to call the interface of the operating system ,FFI More friendly , Real on demand loading , It is recommended to use... For system calls that are not commonly used and have less frequency FFI, For optimizing the whole engine The loading speed of initialization has a good benefit ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"underline"},{"type":"strong"}],"text":" Idle fish point of view "},{"type":"text","text":": Compared to the old platform channel This kind of C Interactively ,FFI Because of the need for dynamic library loading and symbol binding , Performance is not an advantage , Developers have to weigh these two technical solutions ."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" The rest of the community "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":" Is there any official support for the jump of hybrid stack ?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" For many teams , It was originally introduced by native applications flutter, So how do you interact with flutter The interface jump becomes a function point with strong demand from developers ,flutter boost This is a solution for interface jump of hybrid stack , But it's not perfect either , The biggest problem is multiple flutter The interface needs to be opened more when jumping engine, Can't share engine In the same memory . In response to this question flutter2 China has already supported engine Multiple instances "},{"type":"sup","content":[{"type":"text","text":"[4]"}]},{"type":"text","text":", But the authorities also said , This is a risky function in a formal experiment , But the official does not provide the jump scheme between different technology stacks (iOS\/Android->flutter,flutter->iOS\/Android), But it's also said in the official technology roadmap for this issue , This feature needs to be developed in the future , But it is still recommended to use futter boost programme ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" many flutter Interface technology route :https:\/\/docs.google.com\/document\/d\/1fdKRufqUzQvERcqNIUSq-GdabXc4k8VIsClzRElJ6KY\/edit#"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" all the minor details "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In addition to some of the larger function points above , There are also some efficiency tools "}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"flutter fix"},{"type":"sup","content":[{"type":"text","text":"[5]"}]},{"type":"text","text":":dart Code analysis tools , Can highlight abandoned code and so on "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"dartPad2.0"},{"type":"sup","content":[{"type":"text","text":"[6]"}]},{"type":"text","text":": Browser running flutter Small project , What you see is what you get , Verify the little problem artifact "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"FFI Gen"},{"type":"sup","content":[{"type":"text","text":"[7]"}]},{"type":"text","text":"FFI Dart Code generator , according to C Interface mass production FFI Of Dart Interface "}]}]}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" expectation "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" From the perspective of being a developer ,flutter2 Expanded more platforms , Let it go further and further on the cross platform road . But at the same time , At the same time that many platforms are launched , It will also bring more minor problems , Small issues, At the same time, from the official next action , Next, we will focus on several issues that are more responsive in supporting a community "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Multi engine instance feature developed to solve the problem of excessive memory in hybrid stack "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In order to solve the performance problems during development UI It's hard to debug , We are focusing on developing devtools Tools "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"dart The language lacks a namespace , Similar features being developed and so on "}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" We are also following up on these problems , If there is further progress , We will continue to discuss with you . more flutter Related technology hotspots , Welcome to continue to pay attention to idle fish technology ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"References"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[1]"}]},{"type":"text","text":"issue77156: "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/github.com\/flutter\/flutter\/pull\/77156"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[2]"}]},{"type":"text","text":" issue24756: "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/github.com\/flutter\/engine\/pull\/24756"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[3]"}]},{"type":"text","text":"https:\/\/devblogs.microsoft.com\/surface-duo\/flutter-dual-screen-foldable\/ : "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/devblogs.microsoft.com\/surface-duo\/flutter-dual-screen-foldable\/"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[4]"}]},{"type":"text","text":"engine Multiple instances : "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/flutter.dev\/docs\/development\/add-to-app\/multiple-flutters"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[5]"}]},{"type":"text","text":"flutter fix: "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/flutter.dev\/docs\/development\/tools\/flutter-fix"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[6]"}]},{"type":"text","text":"dartPad2.0: "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/dartpad.dev\/flutter"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"[7]"}]},{"type":"text","text":"FFI Gen: "},{"type":"text","marks":[{"type":"italic"}],"text":"https:\/\/pub.dev\/packages\/ffigen"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Reprinted from : Free fish technology (ID:XYtech_Alibaba)"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Link to the original text :"},{"type":"link","attrs":{"href":"https:\/\/mp.weixin.qq.com\/s\/vUnk8envHZIIYc_IIKKD5Q","title":"xxx","type":null},"content":[{"type":"text","text":" Chat FlutterEngage The features in the conference fall to the ground "}]}]}]}

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/04/20210426141128993z.html

随机推荐