<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alzzzz</title>
    <description>The latest articles on DEV Community by Alzzzz (@alzzzz).</description>
    <link>https://dev.to/alzzzz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1031494%2Fc344c438-1b65-4964-b89c-0d462262a3bd.jpeg</url>
      <title>DEV Community: Alzzzz</title>
      <link>https://dev.to/alzzzz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alzzzz"/>
    <language>en</language>
    <item>
      <title>Flutter Dynamic Full Process Solution—Fair Tool Introduction</title>
      <dc:creator>Alzzzz</dc:creator>
      <pubDate>Wed, 22 Feb 2023 09:40:46 +0000</pubDate>
      <link>https://dev.to/alzzzz/flutter-dynamic-full-process-solution-fair-tool-introduction-10co</link>
      <guid>https://dev.to/alzzzz/flutter-dynamic-full-process-solution-fair-tool-introduction-10co</guid>
      <description>&lt;h3&gt;
  
  
  Preface
&lt;/h3&gt;

&lt;p&gt;Flutter is Google's open source cross-platform UI framework, which has become the first choice of more and more developers due to its advantages in "multi-terminal consistency" and "rendering performance". However, as the scale of use increases, in order to solve many rapidly iterative business product lines and needs, dynamics has become an urgent problem to be solved.&lt;/p&gt;

&lt;p&gt;Fair is a dynamic framework self-developed by 58. Through the automatic conversion of native Dart source files by the Fair Compiler tool, the project has the ability to dynamically update Widget Tree and State.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvkhzrw4z1xt1xwyl1ddf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvkhzrw4z1xt1xwyl1ddf.png" alt="fair" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently, after absorbing the feedback and suggestions from the open source community, we have improved the construction of Fair's supporting tools for the development experience. Let's get to the topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Background
&lt;/h2&gt;

&lt;p&gt;The Fair supporting tool chain is developed to help developers quickly get started with Fair development, improve Fair development efficiency, and avoid the Flutter syntax that Fair does not support. It mainly includes three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create Project：Quick create Fair dynamic/carrier project&lt;/li&gt;
&lt;li&gt;Template Code：Provide Page/Project template code&lt;/li&gt;
&lt;li&gt;Local Hot Update Service：Offline development and use, realize the rapid preview of Fair dynamic function in the development stage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We provide it to developers in the form of dart command line tools and AS plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flowchart
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The use flow chart is as follows:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjmcm8rjy4praaerh0ip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjmcm8rjy4praaerh0ip.png" alt="fair" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Instructions for use
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step 1: Tool Installation
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Install the Faircli command line tool
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;dart&lt;/span&gt; &lt;span class="n"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;global&lt;/span&gt; &lt;span class="n"&gt;activate&lt;/span&gt; &lt;span class="n"&gt;faircli&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Install AS plugin
&lt;/h5&gt;

&lt;p&gt;The plugin marketplace is now uploaded. Install it by searching for "FairTemplate" from /Android Studio/Preference/Plugins.&lt;/p&gt;

&lt;p&gt;After the preparations are completed, enter the development and use process below.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Faircli-Project Creation
&lt;/h4&gt;

&lt;p&gt;Engineering is divided into carrier engineering and dynamic engineering. Dynamic function modules need to be developed in dynamic engineering. The carrier project provides bundle download, loading and basic capability support.&lt;/p&gt;

&lt;h5&gt;
  
  
  Create dynamic project
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;faircli&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;dynamic_project_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;dynamic_project_name: dynamic project name&lt;/p&gt;

&lt;h5&gt;
  
  
  Create vector project
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;faircli&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="n"&gt;carrier&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="n"&gt;carrier_project_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;carrier_project_name: carrier project name&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: IDE Plugin - Function Development
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Template code usage
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u3lxjr6vleji9gxbhyd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u3lxjr6vleji9gxbhyd.png" alt="fair" width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select a code template to generate the corresponding code file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy8jtznuvchcfbm4cbj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy8jtznuvchcfbm4cbj7.png" alt="fair" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the generated code, secondary development is performed.&lt;/p&gt;

&lt;h5&gt;
  
  
  One-click packaging
&lt;/h5&gt;

&lt;p&gt;After the function development is completed, the AS plugin can be used for one-click packaging.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jez1bim35txm3mtafpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jez1bim35txm3mtafpq.png" alt="fair" width="702" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 4: Start the local hot update service
&lt;/h4&gt;

&lt;p&gt;After the packaging is complete, you can start the local hot update service to preview the development functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F457kmh7q1givz3hch0vk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F457kmh7q1givz3hch0vk.png" alt="fair" width="696" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the console prints the following information, it means that the local hot update service is successfully started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcilzt0pdgtzru55zd47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcilzt0pdgtzru55zd47.png" alt="fair" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  developer option
&lt;/h5&gt;

&lt;p&gt;Run the vector project and go to the developer options page.&lt;/p&gt;

&lt;p&gt;Enter host to load the bundle list. Select the corresponding bundle for function preview.&lt;br&gt;
Shake the phone to trigger the reload function.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 5: IDE Plugin - Upload the bundle to the online environment
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1inno5bgmjffortibo7r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1inno5bgmjffortibo7r.png" alt="fair" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Effect
&lt;/h3&gt;

&lt;p&gt;After using the faircli tool to configure the local hot update service, open the developer options on the mobile device, select the local mode, enter the computer ip address, and you can happily preview the fair dynamic effect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fwuba%2FFair%2Fraw%2Fmain%2Ffair_tools.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fwuba%2FFair%2Fraw%2Fmain%2Ffair_tools.gif" alt="fair" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary and Outlook
&lt;/h3&gt;

&lt;p&gt;This article mainly introduces the use of Fair's supporting tool chain. The supporting tools solve the current pain points in the use of Fair. In the future, we will continue to pay attention to your feedback and suggestions in the open source community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Support us
&lt;/h3&gt;

&lt;p&gt;Everyone is welcome to use Fair, and everyone is welcome to light up the stars for us&lt;br&gt;
Github address: &lt;a href="https://github.com/wuba/fair" rel="noopener noreferrer"&gt;https://github.com/wuba/fair&lt;/a&gt;&lt;br&gt;
Fair official website: &lt;a href="https://fair.58.com/" rel="noopener noreferrer"&gt;https://fair.58.com/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Contributions welcome
&lt;/h3&gt;

&lt;p&gt;Submit issues through &lt;a href="https://github.com/wuba/fair/issues" rel="noopener noreferrer"&gt;Issue&lt;/a&gt;, please submit a Pull Request to contribute code, and the administrator will update the code review.&lt;/p&gt;

</description>
      <category>vibecoding</category>
      <category>discuss</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
