<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by CoorChice on Medium]]></title>
        <description><![CDATA[Stories by CoorChice on Medium]]></description>
        <link>https://medium.com/@icechenx?source=rss-2ad24251934b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lAgBT-0PtEKEGzypL-P_5w@2x.jpeg</url>
            <title>Stories by CoorChice on Medium</title>
            <link>https://medium.com/@icechenx?source=rss-2ad24251934b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:33:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@icechenx/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[【FBroadcast】An artifact for building complex Flutter Application]]></title>
            <link>https://medium.com/@icechenx/fbroadcast-an-artifact-for-building-complex-flutter-application-3e8c1616b5a8?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e8c1616b5a8</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Wed, 12 Aug 2020 06:42:05 GMT</pubDate>
            <atom:updated>2020-08-12T06:42:05.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*9aOuckPB6GkQLo40.png" /></figure><blockquote><em>FWidget seriously provide exquisite widget to help you build exquisite application.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CFjNOkH2uWqkpUux.png" /></figure><p>FWidget has been dedicated to creating Widget that is easy to build beautiful applications for developers.</p><p>So far, FWidget has received 1215 Star from developers. Thanks to the developers for their support, which is important for FWidget.</p><p>Today, FWidget brings a brand new component FBroadcast to developers to help developers build more complex and beautiful applications more easily.</p><p>For example, in the official website of FWidget <a href="https://fwidget.cn/">https://fwidget.cn</a>, through FBroadcast, the cost is very low. , And easy to maintain Global Real-time Language Switch. It is very simple, effective and clear!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*TE6emigqW-1DmRsV.gif" /></figure><h3>✨ Features</h3><p>Let’s take a look at FBroadcast that provides developer with incredible capabilities:</p><ul><li>Support send and receive specified types of messages</li><li>Message support to carry any type data packets</li><li>Provided Context Bind, one line of code can remove all receivers in the context</li><li>Incredible Sticky Broadcast</li><li>Two-way communication support</li><li>Easy to build simple and clear local and global state management</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*AkQwsAZ6XWBpFu5A.png" /></figure><h3>🛸 Portal</h3><h3>🛸 <a href="https://github.com/Fliggy-Mobile/fbroadcast">【Portal: FBroadcast Github homepage-Thanks for your Star 🌟】</a></h3><h3>📖 <a href="https://pub.dev/documentation/fbroadcast/latest/fbroadcast/fbroadcast-library.html">【Portal: FBroadcast documentation】</a></h3><h3>🍹 FBroadcast dedicated to developers</h3><p>FBroadcast is an efficient and flexible Broadcasting System that can help developer easy and orderly build associated interaction and state changes with great complexity、beautiful application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gzHpHm0FjDlu3Uxm.png" /></figure><p>FBroadcast will bring those obvious changes to building complex and beautiful application?</p><ul><li>Complete decoupling between Widget/Module</li></ul><p>Through the FBroadcast efficient broadcast system, developer can easily complete the decoupling of Widget/Module. When building an application, it is often necessary to change the state or data between Widget/Modules A, B, C, .. according to interactive operations. Developer have to make each Widget/Module depend on each other for this purpose, or create a Unified State Managerfor them, which can solve the problem, but it makes the build cumbersome and also makes the change difficult.</p><p>FBroadcast has established a simple, effective, and clear broadcasting system, so that changes at any time/location in any Widget/Module can be actively broadcast, and it needs to be broadcast based on these. The Widget/Module that changes response or updates the view only needs to register the corresponding information receiver, and it can receive the message and respond when the change occurs. This makes the associated modules no longer need to depend on each other, or design and establish a unified state manager for them.</p><p>Very simple, lightweight, and easy to change. When a Widget/Module no longer needs to be updated according to the changes of another Widget/Module, just remove the receiver in it, instead of making major changes Dependency or State Manager.</p><ul><li>Simple, flexible, clear and easy to manage</li></ul><p>FBroadcast provides developer with the ability to send broadcasts and register/remove receivers at any time, without restriction and flexibility.</p><p>The broadcast and the receiver confirm each other’s identities through a clear type (string), and the specified type of broadcast can only be received by the specified type of receiver.</p><p>FBroadcast provides environment registration support. Developer can remove all types of receivers in the environment at one time through the [unregister()] function when the environment is deconstructed, without having to remember and care about which receivers need to be removed. . For example, the developer can remove all receivers registered in the Widget in the dispose() of Widget.</p><p>With the capabilities of modern IDEA, developer can create a unified broadcast type index table (or multiple) for the broadcast system. Through the reference index of IDEA, developer can easily , It can be seen at a glance that this type of broadcast has been sent in those places, and the receivers are registered in those places, which is very easy to manage and maintain. The use of character strings as type identifiers allows developer to describe the meaning of different types of broadcasts clearly enough.</p><ul><li>Sticky Broadcast Support</li></ul><p>FBroadcast provides support for sending sticky broadcast. In the case that no receiver has been registered, the developer can send a sticky broadcast in advance when the event occurs. Sticky Broadcast will be temporarily stuck in the broadcast system, and when a receiver is registered, it will broadcast immediately. This helps developer to adopt clearer and more effective thinking when doing logic design.</p><p>For example, when the switch button in a control module is turned on, and the module controlled by the switch has not been built yet, you can send a sticky broadcast first, and after the module is built and the receiver is registered, It will immediately receive the sticky broadcast and enter the open state (this is essentially different from the idea of ​​mutual dependence, defining unified state management or parameter transfer, and then checking the switch state).</p><h3>📡 This is really not an ordinary Broadcast</h3><h3>🛠 Base Broadcast</h3><blockquote><em>Communication needs to be simple and clear Register through FBroadcast, sending broadcast is very easy.</em></blockquote><pre><em>/// register</em><br>FBroadcast.instance().register(Key_Message, (value, callback) {<br>  <em>/// do something</em><br>});<em>/// send message</em><br>FBroadcast.instance().broadcast(Key_Message);</pre><p>FBroadcast allows developer to include data when sending messages.</p><pre>/// register<br><strong>FBroadcast</strong>.<strong>instance</strong>().register(<strong>Key_Message</strong>, (value, callback) {  /// get <strong>data</strong><br>  var <strong>data</strong> = value;<br>});/// send message and <strong>data</strong><br><strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(  /// message <strong>type</strong><br>  <strong>Key_Message</strong>,   /// <strong>data</strong><br>  value: <strong>data</strong>,<br>);</pre><p>Developer can choose to persist specific types of messages, so that they can easily implement broadcast-style global state management.</p><pre><strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>,   /// <strong>data</strong><br>  value: <strong>data</strong>,   /// <strong>Persist</strong> the message types<br>  persistence: true,<br>);</pre><p>After the developer persists a message type, he can use FBroadcast.value(String key) to get the latest data of the message type in the broadcast system at any location. The update of the data in the broadcast system only needs to be done through broadcast().</p><blockquote><em>⚠️Note that once a message type is persisted, it can only be removed from the broadcast system through </em><em>FBroadcast.instance().clear(String key).</em></blockquote><h3>🧲 Sticky Broadcast</h3><blockquote><em>More choices, build more beautiful applications</em></blockquote><p>FBroadcast allows developer to send Sticky Broadcasts.</p><pre><strong>FBroadcast</strong>.<strong>instance</strong>().stickyBroadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>,   /// <strong>data</strong><br>  value: <strong>data</strong>, <br>);</pre><p>When there is no corresponding type of receiver in the broadcast system, sticky broadcast will temporarily stay in the system until a receiver of this type is registered, and the broadcast will be sent out immediately (when there is a corresponding type in the broadcast system The receiver has the same performance as ordinary broadcast).</p><h3>⛓ Two-way communication</h3><blockquote><em>Two-way communication, double efficiency</em></blockquote><p>FBroadcast supports receiving messages returned by receiver at the broadcast sending point.</p><pre>/// send message<br><strong>FBroadcast</strong>.instance().broadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>,   /// data<br>  value: data,   /// <strong>The</strong> message returned by the receiver<br>  callback: (value, callback){<br>    // <strong>do</strong> something<br>  }<br>);<br>/// register<br><strong>FBroadcast</strong>.instance().register(<strong>Key_Message</strong>, (value, callback) {<br>  /// get data<br>  <strong>var</strong> data = value;  /// <strong>do</strong> something<br>  <strong>var</strong> result = logic();  /// <strong>return</strong> message<br>  callback(result);<br>});</pre><p>Through FBroadcast, two-way communication can be realized very easily.</p><h3>🌏 Bind Context</h3><blockquote><em>One-code uninstall, fast and accurate</em></blockquote><p>FBroadcast supports passing in an environment object (can be of any type) when registering the receiver, which will register the receiver in the environment. When the environment is deconstructed, developer can easily move it all at once. Except for all receivers registered in the environment.</p><pre><em>/// register</em><br>FBroadcast.instance().register(<br>  <em>/// Message type</em><br>  Key_Message1,  <em>/// Receiver</em><br>  (value, callback) {<br>    <em>/// do something</em><br>  },  <em>/// more receiver</em><br>  more: {<br>    <em>/// Message type: Receiver</em><br>    Key_Message2: (value, callback) {<br>      <em>/// do something</em><br>    },<br>    Key_Message3: (value, callback) {<br>      <em>/// do something</em><br>    },<br>    Key_Message4: (value, callback) {<br>      <em>/// do something</em><br>    },<br>  },  <em>/// context</em><br>  context: this,<br>);<em>/// Remove all receivers from the environment</em><br>FBroadcast.instance().unregister(this);</pre><h3>👀 What can be done with FBroadcast?</h3><h3>💫 Messaging</h3><p>Scene: Click Start, the Runner starts Run, and the display needs to update the status of the athlete in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*721kZ7QcaLwHOcFu.gif" /></figure><h3>🏃 1. Create Runner:</h3><pre><em>/// Runner</em><br><strong>class</strong> <strong>Runner</strong> {<br>  Runner() {<br>    <em>/// register</em><br>    FBroadcast.instance().register(Key_RunnerState, (<strong>value</strong>, callback) {<br>      <strong>if</strong> (<strong>value</strong> <strong>is</strong> String &amp;&amp; <strong>value</strong>.contains(&quot;Run&quot;)) {<br>        <em>/// receive start run message</em><br>        FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;0m..&quot;);<br>        run(20);<br>      }<br>    });<br>  }  run(<strong>double</strong> distance) {<br>    <em>/// send running message</em><br>    Timer(Duration(milliseconds: 500), () {<br>      FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;${distance.toInt()}m..&quot;);<br>      <strong>var</strong> newDistance = distance + 20;<br>      <strong>if</strong> (newDistance &gt; 100) {<br>        FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;Win!\nTotal time is 2.5s&quot;);<br>      } <strong>else</strong> {<br>        run(newDistance);<br>      }<br>    });<br>  }<br>}</pre><h3>🍭 2. Create UI:</h3><pre>Column(<br>  mainAxisAlignment: MainAxisAlignment.center,<br>  children: &lt;Widget&gt;[<br>    Stateful(<br>      /// init<br>      initState: (setState, data) {<br>        FBroadcast.instance().register(<br>          Key_RunnerState,<br>          (value, callback) {<br>            /// refresh ui<br>            setState(() {})<em>;</em><br>          },<br>          /// bind context<br>          context: data,<br>        )<em>;</em><br>      },<br>      builder: (context, setState, data) {<br>        return FSuper(<br>          ...<br>          /// get running message<br>          text: FBroadcast.value(Key_RunnerState) ?? &quot;Preparing..&quot;,<br>        )<em>;</em><br>      },<br>    ),<br>    const SizedBox(height: 100),<br>    FButton(<br>      text: &quot;Start&quot;<br>      ...<br>      onPressed: () {<br>        /// send start run message<br>        FBroadcast.instance().broadcast(Key_RunnerState, value: &quot;Running...&quot;)<em>;</em><br>      },<br>    ),<br>  ],<br>)</pre><p>In the above example, the communication between the Runner and the UI is realized simply and clearly through FBroadcast.</p><ul><li>Click the Start button and send the start message to the Runner through FBroadcast;</li><li>After the Runner receives the message, it starts to run and continuously sends out Running info through FBroadcast;</li><li>Since the UI is registered with the receiver, when it receives Running info, it gets the message data through FBroadcast.value() and automatically updates the view.</li></ul><p>Throughout the process, the Runner and the UI are completely decoupled, and the UI only needs to register the receiver in init (call setState((){}) in the receiver), The view can be automatically updated in real time according to the changes in the message data, without the developer needing to care about the entire process.</p><h3>⛓ Two-way communication</h3><blockquote><em>Scene: Click the button to request positioning, receive the result after positioning is successful, and refresh the positioning point</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rB1vfZS8Yk9DY_Ox.gif" /></figure><h3>📝 1. Global Positioning Service Provider</h3><pre><strong>class</strong> <strong>LocationServer</strong> {<br>  <strong>LocationServer</strong>() {<br>    init();<br>  }  init() {<br>    /// register <strong>Key_Location</strong> receiver<br>    <strong>FBroadcast</strong>.<strong>instance</strong>().register(<strong>Key_Location</strong>, (<strong>value</strong>, <strong>callback</strong>) async {<br>      var loc = await location();      /// return message<br>      callback(<strong>loc</strong>);<br>    });<br>  }  /// <strong>Analog</strong> positioning<br>  <strong>Future</strong>&lt;<strong>List</strong>&lt;double&gt;&gt; location() async {<br>    await <strong>Future</strong>.delayed(<strong>Duration</strong>(<strong>milliseconds</strong>: 2000));<br>    return [<strong>Random</strong>().nextDouble() * 280, <strong>Random</strong>().nextDouble() * 150];<br>  }<br>}</pre><h3>📝 2. Click to send location request and receive return message</h3><pre>FButton(<br>  ...<br>  text: &quot;Location&quot;,<br>  onPressed: () {<br>    FLoading.show(context,<br>        color: Colors.black26, loading: buildLoading())<em>;</em><br>    /// request location<br>    FBroadcast.instance().broadcast(Key_Location,<br>        callback: (location) {<br>      /// The message returned by the receiver<br>      setState(() {<br>        FLoading.hide()<em>;</em><br>        this.location = location<em>;</em><br>      })<em>;</em><br>    })<em>;</em><br>  },<br>)</pre><p>FBroadcast can further simplify scenarios that require two-way communication. Developers can see that in this example, through FBroadcast, the two-way communication scenario of location request can be easily realized, and the location service provider and UI can be completely realized. Decoupling.</p><p>The UI interaction point only needs to send a broadcast of the positioning request, and any location service provider registered for the broadcast can receive the request for processing, and then return the result to the UI interaction point. In other words, as the project evolves, developers can provide new location service providers at any time without having to care about any UI changes.</p><h3>📱 Local state management</h3><blockquote><em>Scene: Click to change the UI color</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LQWWYEMy9-3FpLqc.gif" /></figure><h3>📝 1. Click to emit event</h3><pre>FButton(<br>  text: &quot;Change Color&quot;,<br>  ...<br>  onPressed: () {<br>    /// send change color message<br>    FBroadcast.instance().broadcast(Key_Color, value: reduceColor())<em>;</em><br>  },<br>)</pre><h3>📝 2. UI register receiver</h3><pre>Stateful(<br>  /// init<br>  initState: (setState, data) {<br>    /// register<br>    FBroadcast.instance().register(<br>      Key_Color,<br>      (value, callback) {<br>        /// refresh ui<br>        setState(() {<br>        })<em>;</em><br>      },<br>      /// bind context<br>      context: data,<br>    )<em>;</em><br>  },<br>  builder: (context, setState, data) {<br>    return FSuper(<br>      ...<br>      /// get color value<br>      backgroundColor: FBroadcast.value&lt;Color&gt;(Key_Color) ?? mainBackgroundColor,<br>    )<em>;</em><br>  },<br>)</pre><p>Through FBroadcast, partial status updates between UI interactions can be easily completed. The above example shows the color change. The data object has only one parameter. In the actual development process, the developer can enrich the communication data object as needed.</p><p>Developer only need to register the receiver in the Widget that needs to update the UI, call setState((){}) once to send a message at the interaction point. Instead of actively writing the trigger logic and setState((){}) at all interaction points.</p><h3>💻 Global state management</h3><blockquote><em>Scene: Click on the avatar to jump to the login page. When the account password is not null, the login button can be clicked. Click the login button to send a login request. After the login is successful, return to the previous page and refresh the user information.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oo5UEv70i_CjLv1J.gif" /></figure><h3>📝 1. User Information Widget registration receiver</h3><pre><strong>class</strong> <strong>Avatar</strong> <strong>extends</strong> <strong>StatefulWidget</strong> {<br>  @override<br>  _AvatarState createState() =&gt; _AvatarState();<br>}<strong>class</strong> <strong>_AvatarState</strong> <strong>extends</strong> <strong>State&lt;Avatar&gt;</strong> {  <strong>User</strong> user;<br>  int msgCount = 0;<br>  @override<br>  void initState() {<br>    <strong>super</strong>.initState();<br>    <strong>FBroadcast</strong>.instance().register(<br>      <strong>Key_MsgCount</strong>,<br>      <em>/// register Key_MsgCount reviver</em><br>      (value, callback) =&gt; setState(() {<br>        msgCount = value;<br>      }),<br>      more: {<br>        <em>/// register Key_User reviver</em><br>        <strong>Key_User</strong>: (value, callback) =&gt; setState(() {<br>          <em>/// get value</em><br>          user = value;<br>        }),<br>      },<br>      <em>/// bind context</em><br>      context: <strong>this</strong>,<br>    );<br>  }  @override<br>  <strong>Widget</strong> build(<strong>BuildContext</strong> context) {<br>    <strong>return</strong> <strong>FSuper</strong>(<br>      ...<br>      backgroundImage: (user == null || _textIsEmpty(user.avatar)) ? null : <strong>AssetImage</strong>(user.avatar),<br>      redPoint: user != null &amp;&amp; msgCount &gt; 0,<br>      redPointText: msgCount.toString(),<br>      text: user != null ? null : &quot;Click Login&quot;,<br>      onClick: user != null<br>          ? null<br>          : () =&gt; <strong>Navigator</strong>.push(context, <strong>MaterialPageRoute</strong>( builder: (context) =&gt; <strong>LoginPage</strong>())),<br>    );<br>  }  @override<br>  void dispose() {<br>    <strong>super</strong>.dispose();<br>    <em>/// remove all receivers from the environment</em><br>    <strong>FBroadcast</strong>.instance().unregister(<strong>this</strong>);<br>  }<br>}</pre><p>Register the Key_User receiver in the login page. When the login message is received, the data in it will be retrieved and the UI will be refreshed.</p><h3>📝 2. Build a data model</h3><pre><strong>class</strong> User{<br>  <strong>String</strong> name;<br>  <strong>String</strong> avatar;<br>  <strong>int</strong> messageCount = 0;<br>  <strong>String</strong> info;<br>}</pre><h3>📝 3. Build logical processing objects</h3><pre><strong>class</strong> <strong>LoginHandler</strong> {<br>  <strong>String</strong> _userName;<br>  <strong>String</strong> _password;  /// set user name, check to see if login is allowed<br>  set userName(<strong>String</strong> <strong>v</strong>) {<br>    _userName = v;<br>    if (<strong>_textNoEmpty</strong>(<strong>_userName</strong>) &amp;&amp; _textNoEmpty(<strong>_password</strong>)) {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>true</strong>);<br>    } else {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>false</strong>);<br>    }<br>  }  /// set user password, check to see if login is allowed<br>  set password(<strong>String</strong> <strong>v</strong>) {<br>    _password = v;<br>    if (<strong>_textNoEmpty</strong>(<strong>_userName</strong>) &amp;&amp; _textNoEmpty(<strong>_password</strong>)) {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>true</strong>);<br>    } else {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>false</strong>);<br>    }<br>  }  /// login<br>  void login() {<br>    <strong>Timer</strong>(<strong>Duration</strong>(<strong>milliseconds</strong>: 1500), () {<br>      /// login success，send login success message —— <strong>Key_User</strong><br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<br>        <strong>Key_User</strong>,<br>        <strong>value</strong>: <strong>User</strong>()<br>          ..avatar = &quot;assets/logo.png&quot;<br>          ..name = _userName<br>          ..info =<br>              &quot;<strong>Seriously</strong> provide exquisite widget to help you build exquisite application.&quot;,<br>        /// <strong>Persistence</strong> <strong>Key_User</strong><br>        persistence: true,<br>      );<br>    });<br>  }<br>}</pre><p>The logical processing is transferred to LoginHandler for isolation, and all processing results are broadcasted through FBroadcast, so that the corresponding receivers registered in the broadcasting system can respond.</p><h3>📝 4. Login page</h3><pre><strong>class</strong> <strong>LoginPage</strong> <strong>extends</strong> <strong>StatefulWidget</strong> {<br>  @override<br>  _LoginPageState createState() =&gt; _LoginPageState();<br>}<strong>class</strong> <strong>_LoginPageState</strong> <strong>extends</strong> <strong>State&lt;LoginPage&gt;</strong> {<br>  <em>/// Logic handler</em><br>  <strong>LoginHandler</strong> handler = <strong>LoginHandler</strong>();<br>  <em>/// input controller</em><br>  <strong>FSearchController</strong> _controller1 = <strong>FSearchController</strong>();<br>  <strong>FSearchController</strong> _controller2 = <strong>FSearchController</strong>();  @override<br>  void initState() {<br>    <strong>super</strong>.initState();<br>    _controller1.setListener(() {<br>      <em>/// update userName</em><br>      handler.userName = _controller1.text;<br>    });<br>    _controller2.setListener(() {<br>      <em>/// update password</em><br>      handler.password = _controller2.text;<br>    });<br>  }  @override<br>  <strong>Widget</strong> build(<strong>BuildContext</strong> context) {<br>    <strong>return</strong> {<br>      ...<br>      <em>/// userName input</em><br>      <strong>FSearch</strong>(<br>        controller: _controller1,<br>        ...<br>      ),<br>      ...<br>      <em>/// userName input</em><br>      <strong>FSearch</strong>(<br>        controller: _controller2,<br>        ...<br>      ),<br>      ...<br>      <strong>Stateful</strong>(<br>        initState: (setState, data) {<br>          <em>/// register login receiver</em><br>          <strong>FBroadcast</strong>.instance().register(<br>            <strong>Key_Login</strong>,<br>            <em>/// refresh ui</em><br>            (value, callback) =&gt; setState(() {}),<br>            more: {<br>              <em>/// register user receiver</em><br>              <strong>Key_User</strong>: (value, callback) {<br>                <strong>FLoading</strong>.hide();<br>                <strong>Navigator</strong>.pop(context);<br>              },<br>            },<br>            <em>/// bind context</em><br>            context: data,<br>          );<br>        }, <br>        builder: (context, setState, data) {<br>          <strong>return</strong> <strong>FButton</strong>(<br>            ...<br>            text: &quot;LOGIN&quot;,<br>            <em>/// Key_Login value=true is allowed to click login</em><br>            onPressed: !(<strong>FBroadcast</strong>.value(<strong>Key_Login</strong>) ?? false)<br>                ? null<br>                : () {<br>                    _controller1.clearFocus();<br>                    _controller2.clearFocus();<br>                    <strong>FLoading</strong>.show(context);<br>                    <em>/// Execute login logic</em><br>                    handler.login();<br>                  },<br>          );<br>      },),<br>      ...<br>    };<br>  }<br>}</pre><p>When registering the receiver, you only need to call setState((){}) in the receive callback, and all subsequent data changes are refreshed, and the developer can no longer pay attention. The UI assignment can be conveniently done by obtaining the corresponding data through FBroadcast.value().</p><blockquote><em>⚠️Note that for the state/data models that need to be used globally, and their corresponding broadcast types, when sending, need to set persistence to true at least once. In the above example, just after the login is successful, the broadcast of the </em><em>Key_User type is persisted.</em></blockquote><pre><em>/// login success，send login success message —— Key_User</em><br>FBroadcast.instance().broadcast(<br>  Key_User,<br>  <strong>value</strong>: User()<br>    ..avatar = &quot;assets/logo.png&quot;<br>    ..name = _userName<br>    ..info =<br>        &quot;Seriously provide exquisite widget to help you build exquisite application.&quot;,<br>  <em>/// Persistence Key_User</em><br>  persistence: <strong>true</strong>,<br>);</pre><p>The above example shows that through FBroadcast, message transfer can be easily and quickly realized, local and global state management and refresh, and each module, logic and UI are well integrated decoupling. FBroadcast provides a simple, easy-to-understand, and very flexible broadcasting system. With few constraints, developer can quickly get started, easily implement complex logic simplification, and help developer build easy to maintain, complex, Beautiful application.</p><p>FBroadcast In the process of using, with a unified broadcast type registration form (multiple sheets can also be divided into modules), developer can easily use IDEA’s citation retrieval capabilities to view at any time All broadcast conditions are very useful for maintenance in the continuous iteration process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xQxW6_iem19MSg9.gif" /></figure><h3><a href="https://github.com/Fliggy-Mobile/fbroadcast">Want to know more details? Please visit the FBroadcast official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h3><h3>😃 How to use？</h3><p>Add dependencies in the project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  fbroadcast: ^&lt;<strong>version</strong> <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/fbroadcast"><em>pub</em></a><em> to get the latest version number of FBroadcast</em></blockquote><h3>🖥 Git dependency</h3><pre>dependencies:<br>  fbroadcast:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/fbroadcast.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/fbroadcast"><em>FBroadcast</em></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*YznXAgQp7qfHYa6h.png" /></figure><h3><a href="https://github.com/Fliggy-Mobile/fbroadcast">Like it? Please go to the Github homepage of 《FBroadcast》 to vote for it 🌟!</a></h3><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio widget suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li><li><a href="https://github.com/Fliggy-Mobile/fsearch">《FSearch》- A comprehensive search box widget</a></li><li><a href="https://github.com/Fliggy-Mobile/ftoast">《FToast》- Exquisite and flexible Flutter native Toast widget</a></li><li><a href="https://github.com/Fliggy-Mobile/floading">《FLoading》- This may be the Loading widget you want</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e8c1616b5a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FBroadcast】]]></title>
            <link>https://medium.com/@icechenx/fbroadcast-f8332b0e9682?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8332b0e9682</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 11:00:29 GMT</pubDate>
            <atom:updated>2020-08-11T11:02:08.859Z</atom:updated>
            <content:encoded><![CDATA[<h3>【FBroadcast】An artifact for building complex Flutter Application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*LvyRPUL5-Nwv_zKz.png" /></figure><blockquote><em>FWidget seriously provide exquisite widget to help you build exquisite application.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2fK0NUPBcSzF3LTh.png" /></figure><p>FWidget has been dedicated to creating Widget that is easy to build beautiful applications for developers.</p><p>So far, FWidget has received 1215 Star from developers. Thanks to the developers for their support, which is important for FWidget.</p><p>Today, FWidget brings a brand new component FBroadcast to developers to help developers build more complex and beautiful applications more easily.</p><p>For example, in the official website of FWidget <a href="https://fwidget.cn/">https://fwidget.cn</a>, through FBroadcast, the cost is very low. , And easy to maintain Global Real-time Language Switch. It is very simple, effective and clear!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*tvhdATcfO2rpJsQW.gif" /></figure><h3>✨ Features</h3><p>Let’s take a look at FBroadcast that provides developer with incredible capabilities:</p><ul><li>Support send and receive specified types of messages</li><li>Message support to carry any type data packets</li><li>Provided Context Bind, one line of code can remove all receivers in the context</li><li>Incredible Sticky Broadcast</li><li>Two-way communication support</li><li>Easy to build simple and clear local and global state management</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*hDxJY6sfjpqwuOPa.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/fbroadcast">【Portal: FBroadcast Github homepage-Thanks for your Star 🌟】</a></h4><h4>📖 <a href="https://pub.dev/documentation/fbroadcast/latest/fbroadcast/fbroadcast-library.html">【Portal: FBroadcast documentation】</a></h4><h3>🍹 FBroadcast dedicated to developers</h3><p>FBroadcast is an efficient and flexible Broadcasting System that can help developer easy and orderly build associated interaction and state changes with great complexity、beautiful application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X4YnLs6-n-8hsJCN.png" /></figure><p>FBroadcast will bring those obvious changes to building complex and beautiful application?</p><ul><li>Complete decoupling between Widget/Module</li></ul><p>Through the FBroadcast efficient broadcast system, developer can easily complete the decoupling of Widget/Module. When building an application, it is often necessary to change the state or data between Widget/Modules A, B, C, .. according to interactive operations. Developer have to make each Widget/Module depend on each other for this purpose, or create a Unified State Managerfor them, which can solve the problem, but it makes the build cumbersome and also makes the change difficult.</p><p>FBroadcast has established a simple, effective, and clear broadcasting system, so that changes at any time/location in any Widget/Module can be actively broadcast, and it needs to be broadcast based on these. The Widget/Module that changes response or updates the view only needs to register the corresponding information receiver, and it can receive the message and respond when the change occurs. This makes the associated modules no longer need to depend on each other, or design and establish a unified state manager for them.</p><p>Very simple, lightweight, and easy to change. When a Widget/Module no longer needs to be updated according to the changes of another Widget/Module, just remove the receiver in it, instead of making major changes Dependency or State Manager.</p><ul><li>Simple, flexible, clear and easy to manage</li></ul><p>FBroadcast provides developer with the ability to send broadcasts and register/remove receivers at any time, without restriction and flexibility.</p><p>The broadcast and the receiver confirm each other’s identities through a clear type (string), and the specified type of broadcast can only be received by the specified type of receiver.</p><p>FBroadcast provides environment registration support. Developer can remove all types of receivers in the environment at one time through the [unregister()] function when the environment is deconstructed, without having to remember and care about which receivers need to be removed. . For example, the developer can remove all receivers registered in the Widget in the dispose() of Widget.</p><p>With the capabilities of modern IDEA, developer can create a unified broadcast type index table (or multiple) for the broadcast system. Through the reference index of IDEA, developer can easily , It can be seen at a glance that this type of broadcast has been sent in those places, and the receivers are registered in those places, which is very easy to manage and maintain. The use of character strings as type identifiers allows developer to describe the meaning of different types of broadcasts clearly enough.</p><ul><li>Sticky Broadcast Support</li></ul><p>FBroadcast provides support for sending sticky broadcast. In the case that no receiver has been registered, the developer can send a sticky broadcast in advance when the event occurs. Sticky Broadcast will be temporarily stuck in the broadcast system, and when a receiver is registered, it will broadcast immediately. This helps developer to adopt clearer and more effective thinking when doing logic design.</p><p>For example, when the switch button in a control module is turned on, and the module controlled by the switch has not been built yet, you can send a sticky broadcast first, and after the module is built and the receiver is registered, It will immediately receive the sticky broadcast and enter the open state (this is essentially different from the idea of ​​mutual dependence, defining unified state management or parameter transfer, and then checking the switch state).</p><h3>📡 This is really not an ordinary Broadcast</h3><h3>🛠 Base Broadcast</h3><blockquote><em>Communication needs to be simple and clear Register through FBroadcast, sending broadcast is very easy.</em></blockquote><pre><em>/// register</em><br>FBroadcast.instance().register(Key_Message, (value, callback) {<br>  <em>/// do something</em><br>});</pre><pre><em>/// send message</em><br>FBroadcast.instance().broadcast(Key_Message);</pre><p>FBroadcast allows developer to include data when sending messages.</p><pre>/// register<br><strong>FBroadcast</strong>.<strong>instance</strong>().register(<strong>Key_Message</strong>, (value, callback) {</pre><pre>  /// get <strong>data</strong><br>  var <strong>data</strong> = value;<br>});</pre><pre>/// send message and <strong>data</strong><br><strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(</pre><pre>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>, </pre><pre>  /// <strong>data</strong><br>  value: <strong>data</strong>,<br>);</pre><p>Developer can choose to persist specific types of messages, so that they can easily implement broadcast-style global state management.</p><pre><strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>, </pre><pre>  /// <strong>data</strong><br>  value: <strong>data</strong>, </pre><pre>  /// <strong>Persist</strong> the message types<br>  persistence: true,<br>);</pre><p>After the developer persists a message type, he can use FBroadcast.value(String key) to get the latest data of the message type in the broadcast system at any location. The update of the data in the broadcast system only needs to be done through broadcast().</p><blockquote><em>⚠️Note that once a message type is persisted, it can only be removed from the broadcast system through </em><em>FBroadcast.instance().clear(String key).</em></blockquote><h3>🧲 Sticky Broadcast</h3><blockquote><em>More choices, build more beautiful applications</em></blockquote><p>FBroadcast allows developer to send Sticky Broadcasts.</p><pre><strong>FBroadcast</strong>.<strong>instance</strong>().stickyBroadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>, </pre><pre>  /// <strong>data</strong><br>  value: <strong>data</strong>, <br>);</pre><p>When there is no corresponding type of receiver in the broadcast system, sticky broadcast will temporarily stay in the system until a receiver of this type is registered, and the broadcast will be sent out immediately (when there is a corresponding type in the broadcast system The receiver has the same performance as ordinary broadcast).</p><h3>⛓ Two-way communication</h3><blockquote><em>Two-way communication, double efficiency</em></blockquote><p>FBroadcast supports receiving messages returned by receiver at the broadcast sending point.</p><pre>/// send message<br><strong>FBroadcast</strong>.instance().broadcast(<br>  /// message <strong>type</strong><br>  <strong>Key_Message</strong>, </pre><pre>  /// data<br>  value: data, </pre><pre>  /// <strong>The</strong> message returned by the receiver<br>  callback: (value, callback){<br>    // <strong>do</strong> something<br>  }<br>);<br></pre><pre>/// register<br><strong>FBroadcast</strong>.instance().register(<strong>Key_Message</strong>, (value, callback) {<br>  /// get data<br>  <strong>var</strong> data = value;</pre><pre>  /// <strong>do</strong> something<br>  <strong>var</strong> result = logic();</pre><pre>  /// <strong>return</strong> message<br>  callback(result);<br>});</pre><p>Through FBroadcast, two-way communication can be realized very easily.</p><h3>🌏 Bind Context</h3><blockquote><em>One-code uninstall, fast and accurate</em></blockquote><p>FBroadcast supports passing in an environment object (can be of any type) when registering the receiver, which will register the receiver in the environment. When the environment is deconstructed, developer can easily move it all at once. Except for all receivers registered in the environment.</p><pre><em>/// register</em><br>FBroadcast.instance().register(<br>  <em>/// Message type</em><br>  Key_Message1,</pre><pre>  <em>/// Receiver</em><br>  (value, callback) {<br>    <em>/// do something</em><br>  },</pre><pre>  <em>/// more receiver</em><br>  more: {<br>    <em>/// Message type: Receiver</em><br>    Key_Message2: (value, callback) {<br>      <em>/// do something</em><br>    },<br>    Key_Message3: (value, callback) {<br>      <em>/// do something</em><br>    },<br>    Key_Message4: (value, callback) {<br>      <em>/// do something</em><br>    },<br>  },</pre><pre>  <em>/// context</em><br>  context: this,<br>);</pre><pre><em>/// Remove all receivers from the environment</em><br>FBroadcast.instance().unregister(this);</pre><h3>👀 What can be done with FBroadcast?</h3><h3>💫 Messaging</h3><p>Scene: Click Start, the Runner starts Run, and the display needs to update the status of the athlete in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XzAPrTNVJIKDc0I5.gif" /></figure><h3>🏃 1. Create Runner:</h3><pre><em>/// Runner</em><br><strong>class</strong> <strong>Runner</strong> {<br>  Runner() {<br>    <em>/// register</em><br>    FBroadcast.instance().register(Key_RunnerState, (<strong>value</strong>, callback) {<br>      <strong>if</strong> (<strong>value</strong> <strong>is</strong> String &amp;&amp; <strong>value</strong>.contains(&quot;Run&quot;)) {<br>        <em>/// receive start run message</em><br>        FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;0m..&quot;);<br>        run(20);<br>      }<br>    });<br>  }</pre><pre>  run(<strong>double</strong> distance) {<br>    <em>/// send running message</em><br>    Timer(Duration(milliseconds: 500), () {<br>      FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;${distance.toInt()}m..&quot;);<br>      <strong>var</strong> newDistance = distance + 20;<br>      <strong>if</strong> (newDistance &gt; 100) {<br>        FBroadcast.instance().broadcast(Key_RunnerState, <strong>value</strong>: &quot;Win!\nTotal time is 2.5s&quot;);<br>      } <strong>else</strong> {<br>        run(newDistance);<br>      }<br>    });<br>  }<br>}</pre><h3>🍭 2. Create UI:</h3><pre>Column(<br>  mainAxisAlignment: MainAxisAlignment.center,<br>  children: &lt;Widget&gt;[<br>    Stateful(<br>      /// init<br>      initState: (setState, data) {<br>        FBroadcast.instance().register(<br>          Key_RunnerState,<br>          (value, callback) {<br>            /// refresh ui<br>            setState(() {})<em>;</em><br>          },<br>          /// bind context<br>          context: data,<br>        )<em>;</em><br>      },<br>      builder: (context, setState, data) {<br>        return FSuper(<br>          ...<br>          /// get running message<br>          text: FBroadcast.value(Key_RunnerState) ?? &quot;Preparing..&quot;,<br>        )<em>;</em><br>      },<br>    ),<br>    const SizedBox(height: 100),<br>    FButton(<br>      text: &quot;Start&quot;<br>      ...<br>      onPressed: () {<br>        /// send start run message<br>        FBroadcast.instance().broadcast(Key_RunnerState, value: &quot;Running...&quot;)<em>;</em><br>      },<br>    ),<br>  ],<br>)</pre><p>In the above example, the communication between the Runner and the UI is realized simply and clearly through FBroadcast.</p><ul><li>Click the Start button and send the start message to the Runner through FBroadcast;</li><li>After the Runner receives the message, it starts to run and continuously sends out Running info through FBroadcast;</li><li>Since the UI is registered with the receiver, when it receives Running info, it gets the message data through FBroadcast.value() and automatically updates the view.</li></ul><p>Throughout the process, the Runner and the UI are completely decoupled, and the UI only needs to register the receiver in init (call setState((){}) in the receiver), The view can be automatically updated in real time according to the changes in the message data, without the developer needing to care about the entire process.</p><h3>⛓ Two-way communication</h3><blockquote><em>Scene: Click the button to request positioning, receive the result after positioning is successful, and refresh the positioning point</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IezVa7Dvx7m_0hYL.gif" /></figure><h3>📝 1. Global Positioning Service Provider</h3><pre><strong>class</strong> <strong>LocationServer</strong> {<br>  <strong>LocationServer</strong>() {<br>    init();<br>  }</pre><pre>  init() {<br>    /// register <strong>Key_Location</strong> receiver<br>    <strong>FBroadcast</strong>.<strong>instance</strong>().register(<strong>Key_Location</strong>, (<strong>value</strong>, <strong>callback</strong>) async {<br>      var loc = await location();</pre><pre>      /// return message<br>      callback(<strong>loc</strong>);<br>    });<br>  }</pre><pre>  /// <strong>Analog</strong> positioning<br>  <strong>Future</strong>&lt;<strong>List</strong>&lt;double&gt;&gt; location() async {<br>    await <strong>Future</strong>.delayed(<strong>Duration</strong>(<strong>milliseconds</strong>: 2000));<br>    return [<strong>Random</strong>().nextDouble() * 280, <strong>Random</strong>().nextDouble() * 150];<br>  }<br>}</pre><h3>📝 2. Click to send location request and receive return message</h3><pre>FButton(<br>  ...<br>  text: &quot;Location&quot;,<br>  onPressed: () {<br>    FLoading.show(context,<br>        color: Colors.black26, loading: buildLoading())<em>;</em><br>    /// request location<br>    FBroadcast.instance().broadcast(Key_Location,<br>        callback: (location) {<br>      /// The message returned by the receiver<br>      setState(() {<br>        FLoading.hide()<em>;</em><br>        this.location = location<em>;</em><br>      })<em>;</em><br>    })<em>;</em><br>  },<br>)</pre><p>FBroadcast can further simplify scenarios that require two-way communication. Developers can see that in this example, through FBroadcast, the two-way communication scenario of location request can be easily realized, and the location service provider and UI can be completely realized. Decoupling.</p><p>The UI interaction point only needs to send a broadcast of the positioning request, and any location service provider registered for the broadcast can receive the request for processing, and then return the result to the UI interaction point. In other words, as the project evolves, developers can provide new location service providers at any time without having to care about any UI changes.</p><h3>📱 Local state management</h3><blockquote><em>Scene: Click to change the UI color</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h3>📝 1. Click to emit event</h3><pre>FButton(<br>  text: &quot;Change Color&quot;,<br>  ...<br>  onPressed: () {<br>    /// send change color message<br>    FBroadcast.instance().broadcast(Key_Color, value: reduceColor())<em>;</em><br>  },<br>)</pre><h3>📝 2. UI register receiver</h3><pre>Stateful(<br>  /// init<br>  initState: (setState, data) {<br>    /// register<br>    FBroadcast.instance().register(<br>      Key_Color,<br>      (value, callback) {<br>        /// refresh ui<br>        setState(() {<br>        })<em>;</em><br>      },<br>      /// bind context<br>      context: data,<br>    )<em>;</em><br>  },<br>  builder: (context, setState, data) {<br>    return FSuper(<br>      ...<br>      /// get color value<br>      backgroundColor: FBroadcast.value&lt;Color&gt;(Key_Color) ?? mainBackgroundColor,<br>    )<em>;</em><br>  },<br>)</pre><p>Through FBroadcast, partial status updates between UI interactions can be easily completed. The above example shows the color change. The data object has only one parameter. In the actual development process, the developer can enrich the communication data object as needed.</p><p>Developer only need to register the receiver in the Widget that needs to update the UI, call setState((){}) once to send a message at the interaction point. Instead of actively writing the trigger logic and setState((){}) at all interaction points.</p><h3>💻 Global state management</h3><blockquote><em>Scene: Click on the avatar to jump to the login page. When the account password is not null, the login button can be clicked. Click the login button to send a login request. After the login is successful, return to the previous page and refresh the user information.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AkkcXWonHsgzNgzI.gif" /></figure><h3>📝 1. User Information Widget registration receiver</h3><pre><strong>class</strong> <strong>Avatar</strong> <strong>extends</strong> <strong>StatefulWidget</strong> {<br>  @override<br>  _AvatarState createState() =&gt; _AvatarState();<br>}</pre><pre><strong>class</strong> <strong>_AvatarState</strong> <strong>extends</strong> <strong>State&lt;Avatar&gt;</strong> {</pre><pre>  <strong>User</strong> user;<br>  int msgCount = 0;<br>  @override<br>  void initState() {<br>    <strong>super</strong>.initState();<br>    <strong>FBroadcast</strong>.instance().register(<br>      <strong>Key_MsgCount</strong>,<br>      <em>/// register Key_MsgCount reviver</em><br>      (value, callback) =&gt; setState(() {<br>        msgCount = value;<br>      }),<br>      more: {<br>        <em>/// register Key_User reviver</em><br>        <strong>Key_User</strong>: (value, callback) =&gt; setState(() {<br>          <em>/// get value</em><br>          user = value;<br>        }),<br>      },<br>      <em>/// bind context</em><br>      context: <strong>this</strong>,<br>    );<br>  }</pre><pre>  @override<br>  <strong>Widget</strong> build(<strong>BuildContext</strong> context) {<br>    <strong>return</strong> <strong>FSuper</strong>(<br>      ...<br>      backgroundImage: (user == null || _textIsEmpty(user.avatar)) ? null : <strong>AssetImage</strong>(user.avatar),<br>      redPoint: user != null &amp;&amp; msgCount &gt; 0,<br>      redPointText: msgCount.toString(),<br>      text: user != null ? null : &quot;Click Login&quot;,<br>      onClick: user != null<br>          ? null<br>          : () =&gt; <strong>Navigator</strong>.push(context, <strong>MaterialPageRoute</strong>( builder: (context) =&gt; <strong>LoginPage</strong>())),<br>    );<br>  }</pre><pre>  @override<br>  void dispose() {<br>    <strong>super</strong>.dispose();<br>    <em>/// remove all receivers from the environment</em><br>    <strong>FBroadcast</strong>.instance().unregister(<strong>this</strong>);<br>  }<br>}</pre><p>Register the Key_User receiver in the login page. When the login message is received, the data in it will be retrieved and the UI will be refreshed.</p><h3>📝 2. Build a data model</h3><pre><strong>class</strong> User{<br>  <strong>String</strong> name;<br>  <strong>String</strong> avatar;<br>  <strong>int</strong> messageCount = 0;<br>  <strong>String</strong> info;<br>}</pre><h3>📝 3. Build logical processing objects</h3><pre><strong>class</strong> <strong>LoginHandler</strong> {<br>  <strong>String</strong> _userName;<br>  <strong>String</strong> _password;</pre><pre>  /// set user name, check to see if login is allowed<br>  set userName(<strong>String</strong> <strong>v</strong>) {<br>    _userName = v;<br>    if (<strong>_textNoEmpty</strong>(<strong>_userName</strong>) &amp;&amp; _textNoEmpty(<strong>_password</strong>)) {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>true</strong>);<br>    } else {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>false</strong>);<br>    }<br>  }</pre><pre>  /// set user password, check to see if login is allowed<br>  set password(<strong>String</strong> <strong>v</strong>) {<br>    _password = v;<br>    if (<strong>_textNoEmpty</strong>(<strong>_userName</strong>) &amp;&amp; _textNoEmpty(<strong>_password</strong>)) {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>true</strong>);<br>    } else {<br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<strong>Key_Login</strong>, <strong>value</strong>: <strong>false</strong>);<br>    }<br>  }</pre><pre>  /// login<br>  void login() {<br>    <strong>Timer</strong>(<strong>Duration</strong>(<strong>milliseconds</strong>: 1500), () {<br>      /// login success，send login success message —— <strong>Key_User</strong><br>      <strong>FBroadcast</strong>.<strong>instance</strong>().broadcast(<br>        <strong>Key_User</strong>,<br>        <strong>value</strong>: <strong>User</strong>()<br>          ..avatar = &quot;assets/logo.png&quot;<br>          ..name = _userName<br>          ..info =<br>              &quot;<strong>Seriously</strong> provide exquisite widget to help you build exquisite application.&quot;,<br>        /// <strong>Persistence</strong> <strong>Key_User</strong><br>        persistence: true,<br>      );<br>    });<br>  }<br>}</pre><p>The logical processing is transferred to LoginHandler for isolation, and all processing results are broadcasted through FBroadcast, so that the corresponding receivers registered in the broadcasting system can respond.</p><h3>📝 4. Login page</h3><pre><strong>class</strong> <strong>LoginPage</strong> <strong>extends</strong> <strong>StatefulWidget</strong> {<br>  @override<br>  _LoginPageState createState() =&gt; _LoginPageState();<br>}</pre><pre><strong>class</strong> <strong>_LoginPageState</strong> <strong>extends</strong> <strong>State&lt;LoginPage&gt;</strong> {<br>  <em>/// Logic handler</em><br>  <strong>LoginHandler</strong> handler = <strong>LoginHandler</strong>();<br>  <em>/// input controller</em><br>  <strong>FSearchController</strong> _controller1 = <strong>FSearchController</strong>();<br>  <strong>FSearchController</strong> _controller2 = <strong>FSearchController</strong>();</pre><pre>  @override<br>  void initState() {<br>    <strong>super</strong>.initState();<br>    _controller1.setListener(() {<br>      <em>/// update userName</em><br>      handler.userName = _controller1.text;<br>    });<br>    _controller2.setListener(() {<br>      <em>/// update password</em><br>      handler.password = _controller2.text;<br>    });<br>  }</pre><pre>  @override<br>  <strong>Widget</strong> build(<strong>BuildContext</strong> context) {<br>    <strong>return</strong> {<br>      ...<br>      <em>/// userName input</em><br>      <strong>FSearch</strong>(<br>        controller: _controller1,<br>        ...<br>      ),<br>      ...<br>      <em>/// userName input</em><br>      <strong>FSearch</strong>(<br>        controller: _controller2,<br>        ...<br>      ),<br>      ...<br>      <strong>Stateful</strong>(<br>        initState: (setState, data) {<br>          <em>/// register login receiver</em><br>          <strong>FBroadcast</strong>.instance().register(<br>            <strong>Key_Login</strong>,<br>            <em>/// refresh ui</em><br>            (value, callback) =&gt; setState(() {}),<br>            more: {<br>              <em>/// register user receiver</em><br>              <strong>Key_User</strong>: (value, callback) {<br>                <strong>FLoading</strong>.hide();<br>                <strong>Navigator</strong>.pop(context);<br>              },<br>            },<br>            <em>/// bind context</em><br>            context: data,<br>          );<br>        }, <br>        builder: (context, setState, data) {<br>          <strong>return</strong> <strong>FButton</strong>(<br>            ...<br>            text: &quot;LOGIN&quot;,<br>            <em>/// Key_Login value=true is allowed to click login</em><br>            onPressed: !(<strong>FBroadcast</strong>.value(<strong>Key_Login</strong>) ?? false)<br>                ? null<br>                : () {<br>                    _controller1.clearFocus();<br>                    _controller2.clearFocus();<br>                    <strong>FLoading</strong>.show(context);<br>                    <em>/// Execute login logic</em><br>                    handler.login();<br>                  },<br>          );<br>      },),<br>      ...<br>    };<br>  }<br>}</pre><p>When registering the receiver, you only need to call setState((){}) in the receive callback, and all subsequent data changes are refreshed, and the developer can no longer pay attention. The UI assignment can be conveniently done by obtaining the corresponding data through FBroadcast.value().</p><blockquote><em>⚠️Note that for the state/data models that need to be used globally, and their corresponding broadcast types, when sending, need to set persistence to true at least once. In the above example, just after the login is successful, the broadcast of the </em><em>Key_User type is persisted.</em></blockquote><pre><em>/// login success，send login success message —— Key_User</em><br>FBroadcast.instance().broadcast(<br>  Key_User,<br>  <strong>value</strong>: User()<br>    ..avatar = &quot;assets/logo.png&quot;<br>    ..name = _userName<br>    ..info =<br>        &quot;Seriously provide exquisite widget to help you build exquisite application.&quot;,<br>  <em>/// Persistence Key_User</em><br>  persistence: <strong>true</strong>,<br>);</pre><p>The above example shows that through FBroadcast, message transfer can be easily and quickly realized, local and global state management and refresh, and each module, logic and UI are well integrated decoupling. FBroadcast provides a simple, easy-to-understand, and very flexible broadcasting system. With few constraints, developer can quickly get started, easily implement complex logic simplification, and help developer build easy to maintain, complex, Beautiful application.</p><p>FBroadcast In the process of using, with a unified broadcast type registration form (multiple sheets can also be divided into modules), developer can easily use IDEA’s citation retrieval capabilities to view at any time All broadcast conditions are very useful for maintenance in the continuous iteration process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tNvWbDq5742BNmJz.gif" /></figure><h3><a href="https://github.com/Fliggy-Mobile/fbroadcast">Want to know more details? Please visit the FBroadcast official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h3><h3>😃 How to use？</h3><p>Add dependencies in the project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  fbroadcast: ^&lt;<strong>version</strong> <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/fbroadcast"><em>pub</em></a><em> to get the latest version number of FBroadcast</em></blockquote><h3>🖥 Git dependency</h3><pre>dependencies:<br>  fbroadcast:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/fbroadcast.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/fbroadcast"><em>FBroadcast</em></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*F7WeFjQY9WmQiJxq.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/fbroadcast">Like it? Please go to the Github homepage of 《FBroadcast》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio widget suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li><li><a href="https://github.com/Fliggy-Mobile/fsearch">《FSearch》- A comprehensive search box widget</a></li><li><a href="https://github.com/Fliggy-Mobile/ftoast">《FToast》- Exquisite and flexible Flutter native Toast widget</a></li><li><a href="https://github.com/Fliggy-Mobile/floading">《FLoading》- This may be the Loading widget you want</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8332b0e9682" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FLoading】Happy to use Loading-Widget in Flutter]]></title>
            <link>https://medium.com/@icechenx/floading-happy-to-use-loading-widget-in-flutter-b7cd803439cc?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7cd803439cc</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Mon, 10 Aug 2020 06:36:15 GMT</pubDate>
            <atom:updated>2020-08-10T06:36:15.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*YHC1oTwgoGt0TQDi.png" /></figure><blockquote><em>FWidget seriously provide exquisite widget to help you build exquisite application.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VKy3AosKVZOmrJ2L.png" /></figure><p>Today, the exquisite component that FWidget brings to developers is ~~ FLoading.</p><p>In actual application scenarios, building Loading elements seems to be a skill that every developer must master. Now, FLoading is here to help developers further refine their skills.</p><p>FLoading provides a minimalistic way to build Loading elements, and provides developers with many highly customizable configurations, allowing developers to easily create beautiful Loading .</p><h3>✨ Features</h3><p>So, let’s take a look at what FLoading brings.</p><ul><li>Provide the most convenient way to control Showing/Hiding of Loading</li><li>Support to modify background color</li><li>Support timing auto hide</li><li>Support local and global custom styles</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*bLoVPlb1juUvHYsu.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/floading">【Portal: FLoading Github homepage-Thanks for your Star 🌟】</a></h4><h4>📖 <a href="https://pub.dev/documentation/floading/latest/floading/floading-library.html">【Portal: FLoading documentation】</a></h4><h3>🌈 Show/hide</h3><blockquote><em>Simple and effective, all in one go</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*ILnD3vWOoxCkj6XW.gif" /></figure><pre>/// <strong>show</strong> <br>FLoading.<strong>show</strong>(<strong>context</strong>);<br></pre><pre>/// hide <br>FLoading.hide();</pre><p>It’s too simple to implement Show/Hide of Loading through FLoading.</p><h3>💎 Custom style</h3><blockquote><em>Flexible enough to shine</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*fRKy_lsdxzKqZHz7.gif" /></figure><p>FLoading allows developers to freely define the global Loading style or the Loading style for a single impression.</p><h3>Custom global style</h3><pre><em>///Define global loading style</em><br>FLoading.init(CupertinoActivityIndicator(), backgroundColor: Colors.black38);</pre><pre><em>/// show</em><br>FLoading.show(context);</pre><p>After customizing the global style, developers can easily use FLoading.show(context); to build a unified Loading style anywhere in the world.</p><h3>Custom one-shot style</h3><pre>FLoading.show(context,</pre><pre>  <em>/// One-shot style configuration via loading</em><br>  loading: Image.asset(<br>    &quot;assets/loading_gif_2.gif&quot;,<br>    width: 100,<br>    height: 100,<br>  ));</pre><p>Even after defining the global style, in a special location, FLoading still allows developers to specify a special Loading style in a single build.</p><h3>🛰 Timed hiding and background color</h3><blockquote><em>From the details, care about developers</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*CGJb9fUXhPttZJCK.gif" /></figure><pre>FLoading.show(<br>  context,<br>  loading: Image.asset(<br>    &quot;assets/loading_gif_1.gif&quot;,<br>    width: 200,<br>    height: 200,<br>  ),</pre><pre>  <em>/// Timed hiding</em><br>  duration: 3000,</pre><pre>  <em>/// Configure background style</em><br>  color: Colors.red[300].<strong>withOpacity</strong>(0.3),<br>)</pre><p>FLoading provides configurations for automatically hide at a fixed time and change background color to satisfy the unlimited creativity of developers.</p><h3><a href="https://github.com/Fliggy-Mobile/floading">Want to know more details? Please visit the FLoading official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h3><h3>😃 How to use？</h3><p>Add dependencies in the project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  floading: ^&lt;<strong>version</strong> <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/floading"><em>pub</em></a><em> to get the latest version number of FLoading</em></blockquote><h3>🖥 Git dependency</h3><pre>dependencies:<br>  floading:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/floading.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/floading"><em>FLoading</em></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*cyd1DFk-G_CZ3Ncq.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/floading">Like it? Please go to the Github homepage of 《FLoading》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio widget suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li><li><a href="https://github.com/Fliggy-Mobile/fsearch">《FSearch》- A comprehensive search box widget</a></li><li><a href="https://github.com/Fliggy-Mobile/ftoast">《FToast》- Exquisite and flexible Flutter native Toast widget</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7cd803439cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FToast】Build beautiful Toast in Flutter]]></title>
            <link>https://medium.com/@icechenx/ftoast-build-beautiful-toast-in-flutter-9bb4165267e7?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb4165267e7</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Mon, 10 Aug 2020 06:31:01 GMT</pubDate>
            <atom:updated>2020-08-10T06:31:01.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*DOsrOQP6Vb0-fyMF.png" /></figure><blockquote><em>FWidget seriously provide exquisite widget to help you build exquisite application.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oxBUcoA9NNY9tRn7.png" /></figure><p>Toast tip is an essential visual element that is regarded as a modern application.</p><p>Today, FWidget will send developers the familiar and unfamiliar Toast** components for developers.</p><h3>✨ Features</h3><p>Developers, come and see if this is the Toast you are familiar with?</p><ul><li>Provide a convenient way to create Toast</li><li>Support primary information, secondary information, and customize their style</li><li>Support flexible icon view</li><li>Support to configure corner size and background color</li><li>Support queue display</li><li>Support custom Toast style</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*Dh0DyHCjOsp40Gm6.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/ftoast">【Portal: FToast Github homepage-Thanks for your Star 🌟】</a></h4><h4>📖 <a href="https://pub.dev/documentation/ftoast/latest/ftoast/ftoast-library.html">【Portal: FToast documentation】</a></h4><h3>🔩 Base</h3><blockquote><em>Familiar usage, but better than ever</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*8oHm3IYWMHuHr4vY.gif" /></figure><pre>FToast.toast(<br>  context,</pre><pre>  <em>/// Configure display duration</em><br>  duration: 800,</pre><pre>  <em>/// set Msg</em><br>  msg: &quot;I&#39;m FToast: ${count++}&quot;,</pre><pre>  <em>/// set Msg style</em><br>  msgStyle: TextStyle(color: Colors.white),<br>)</pre><p>In the simplest case, creating a Toast element is as simple as ever.</p><pre>FToast.toast(context, msg: &quot;Hi, FWidget&quot;);</pre><p>Of course, in FToast, developers can easily configure the copywriting style through the msgStyle property.</p><p>Even, FToast implements the ability of queue display in Flutter, which has the same performance as Toast in Android.</p><h3>🔆 SubMsg</h3><blockquote><em>More tips</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*7YBF6VJFuLNcgWQB.gif" /></figure><pre>FToast.toast(<br>  context,<br>  msg: &quot;This is Msg&quot;,</pre><pre>  <em>/// set subMsg</em><br>  subMsg: &quot;Welcome to use FToast. This is subMsg!&quot;,</pre><pre>  <em>/// set SubMsg style</em><br>  subMsgStyle: <strong>TextStyle</strong>(color: Colors.white, fontSize: 13),<br>)</pre><p>FToast is different from the previous Toast, FToast supports the configuration of sub-text. In view of this, developers can display more prompt information.</p><h3>🔳 Icon</h3><blockquote><em>More beauty</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*c-Wrr7ILGNv-pUDj.gif" /></figure><pre>FToast.toast(<br>  context,<br>  msg: &quot;This is Msg&quot;,<br>  subMsg: &quot;Welcome to use FToast. This is subMsg!&quot;,</pre><pre>  <em>/// set image</em><br>  image: Icon(<br>    Icons.star,<br>    color: Colors.yellow,<br>  ),</pre><pre>  <em>/// set position of icon relative to text</em><br>  imageDirection: up,<br>)</pre><p>FToast allows developers to configure a decorative icon, and supports controlling its relative position. Pursuing exquisiteness, FWidget is not just talking about it.</p><h3>🔩 Custom style</h3><blockquote><em>Unlimited, creative</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*F4_mMMEkZAoc_2ov.gif" /></figure><pre>FToast.toast(<br>  context,<br>  <em>/// Custom Toast style</em><br>  toast: FSuper(<br>    text: &quot;Custom Toast&quot;,<br>    style: <strong>TextStyle</strong>(color: Colors.grey),<br>    padding: EdgeInsets.<strong>all</strong>(12),<br>    shadowColor: Colors.yellow,<br>    shadowBlur: 80,<br>  ),<br>)</pre><p>If the default style of Toast still does not satisfy the developer’s wishful thinking, it does not matter, FToast supports developers to customize any style of Toast.</p><p>Developers only need to care about the style and leave the rest to be handled by FToast.</p><h3><a href="https://github.com/Fliggy-Mobile/ftoast">Want to know more details? Please visit the FToast official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h3><h3>😃 How to use？</h3><p>Add dependencies in the project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  ftoast: ^&lt;<strong>version</strong> <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/ftoast"><em>pub</em></a><em> to get the latest version number of FToast</em></blockquote><h3>🖥 Git dependency</h3><pre>dependencies:<br>  ftoast:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/ftoast.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/ftoast"><em>FToast</em></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*Pae8vSva-9mmxDNC.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/ftoast">Like it? Please go to the Github homepage of 《FToast》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio widget suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li><li><a href="https://github.com/Fliggy-Mobile/fsearch">《FSearch》- A comprehensive search box widget</a></li><li><a href="https://github.com/Fliggy-Mobile/floading">《FLoading》- This may be the Loading widget you want</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb4165267e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recently, we have carried out an advanced upgrade to FWidget  .]]></title>
            <link>https://medium.com/@icechenx/recently-we-have-carried-out-an-advanced-upgrade-to-fwidget-b502fe7f23fe?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b502fe7f23fe</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Thu, 30 Jul 2020 09:29:16 GMT</pubDate>
            <atom:updated>2020-07-30T09:29:16.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>【FWidget】Build beautiful Flutter App</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*R63J2uE9GzJqUQy7.png" /></figure><blockquote><a href="https://github.com/Fliggy-Mobile"><strong><em>FWidget</em></strong><em> </em></a><em>seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>Recently, we have carried out an <strong>advanced</strong> upgrade to <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>🚀.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uIGK59krCvElv_wh.png" /></figure><p><a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>is created by <a href="https://github.com/Fliggy-Mobile"><strong>[Alibaba-FliggyMobile Technical Team]</strong></a> Developed series widget library, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong></a>always pursues the belief of <strong>“Seriously provide exquisite widget to help you build exquisite application.”</strong>, and strives to provide developer with a A set of exquisite and easy-to-use widget libraries helps developers build wonderful applications more easily.</p><p>So far, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>has created a batch of exquisite widgets for developer. At present, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>has released more than <strong>10</strong> widgets to the community, and has received more than <strong>1120 Star</strong> from community developer. The recognition and support given by the developer is also an important motivation for <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>to continue to provide more new widgets.</p><p>Recently, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>has brought an unprecedented <strong>advanced</strong> upgrade for developer, empowering developer to build more amazing, Ability to apply high quality.</p><h3>🧩 So, what’s sense of luxury?</h3><p>Developer, please check the list carefully, from the newly upgraded <a href="https://github.com/Fliggy-Mobile/fbutton"><strong>FButton</strong></a> and <a href="https://github.%20com/Fliggy-Mobile/fsuper"><strong>FSuper</strong></a> high-quality visual effects.</p><blockquote><em>#FButton</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/0*oLIrLo_eFVKCPryf.gif" /></figure><p>Through the delicate processing of <strong>light source, shadow, light and shade changes</strong>, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>has created a very artistic and high-quality texture for developer Widgets.</p><p>As you can see, these detailed processing of light and shadow effects can make interface elements <strong>“out of”</strong> the interface. Presenting lifelike <strong>outstanding</strong>, <strong>falling into</strong> visual effects, bringing unprecedented visual impact.</p><blockquote><em>#FSuper</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*IQxleKK6YeCRnzz8.gif" /></figure><p>At the same time, what <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>provides is not a simple light and shadow effect under a fixed light source. Developer can freely set the direction of the light source according to their preferences or needs to fully present the artistic design of the coders.</p><p>Yes, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>can dynamically adjust suitable shadows and shading effects according to different light source directions to perfectly present lifelike visual effects.</p><h3>👀 Is it difficult?</h3><p>No!</p><p>For developer, the amazing expressive power provided by <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>keeps the implementation consistent and concise. Furthermore, developer only need to add an attribute to immediately build a <strong>high-quality </strong>interface element.</p><p>In <a href="https://github.com/Fliggy-Mobile/fbutton"><strong>FButton</strong></a>:</p><pre>FButton(</pre><pre>  <em>/// 开启 Neumorphism 支持</em><br>  <em>///</em><br>  <em>/// Turn on Neumorphism support</em><br>  isSupportNeumorphism: <strong>true</strong>,</pre><pre>  <em>/// 配置光源方向</em><br>  <em>///</em><br>  <em>/// Configure light source direction</em><br>  lightOrientation: lightOrientation,</pre><pre>  <em>/// 配置亮部阴影</em><br>  <em>///</em><br>  <em>/// Configure highlight shadow</em><br>  highlightShadowColor: Colors.white,</pre><pre>  <em>/// 配置暗部阴影</em><br>  <em>///</em><br>  <em>/// Configure dark shadows</em><br>  shadowColor: mainShadowColor,<br>  strokeColor: mainBackgroundColor,<br>  strokeWidth: 3.0,<br>  width: 190,<br>  height: 60,<br>  text: &quot;FWidget&quot;,<br>  style: TextStyle(<br>      color: mainTextTitleColor, fontSize: neumorphismSize_2_2),<br>  alignment: Alignment.center,<br>  color: mainBackgroundColor,<br>  ...<br>)</pre><p>In <a href="https://github.com/Fliggy-Mobile/fsuper"><strong>FSuper</strong></a>:</p><pre>FSuper(</pre><pre>  <em>/// 开启 Neumorphism 支持</em><br>  <em>///</em><br>  <em>/// Turn on Neumorphism support</em><br>  isSupportNeumorphism: <strong>true</strong>,</pre><pre>  <em>/// 配置光源方向</em><br>  <em>///</em><br>  <em>/// Configure light source direction</em><br>  lightOrientation: lightOrientation,</pre><pre>  <em>/// 配置暗部阴影</em><br>  <em>///</em><br>  <em>/// Configure dark shadows</em><br>  shadowColor: Colors.black87,</pre><pre>  <em>/// 配置亮部阴影</em><br>  <em>///</em><br>  <em>/// Configure highlight shadow</em><br>  highlightShadowColor: Colors.white24,</pre><pre>  <em>/// 是否呈浮起视效</em><br>  <em>///</em><br>  <em>/// Whether it is floating visual effect</em><br>  float: <strong>false</strong>,<br>  shadowOffset: Offset(0.0, 1.0),<br>  width: 50,<br>  height: 50,<br>  backgroundColor: Color(0xff28292f),<br>  corner: FCorner.all(40),<br>  child1: Icon(<br>    Icons.star,<br>    color: Color(0xfffff176),<br>    size: 23,<br>  ),<br>),</pre><p>Just configure isSupportNeumorphism: true for the widget, and you can instantly build exquisite elements with <strong>high quality</strong>.</p><p>With lightOrientation, developer can freely configure the direction of the light source to create more unexpected and stunning effects.</p><p>Of course, <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>provides developer with freely configurable parameters for <strong>shadow brightness and darkness</strong>, and developer can create whatever they like according to their preferences.</p><h3>🛠 How to use it quickly?</h3><p>In the project pubspec.yaml, configure (upgrade) <a href="https://github.com/Fliggy-Mobile/fbutton"><strong>FButton</strong></a> and <a href="https://github.%20com/Fliggy-Mobile/fsuper"><strong>FSuper</strong></a> to version 2.0.0.</p><pre><em>/// fbutton</em><br>fbutton: ^2.0.0</pre><pre><em>/// fsuper</em><br>fsuper: ^2.0.0</pre><blockquote><em>⚠️Note that the </em><em>2.0.0 version widget only supports </em><strong><em>Flutter</em></strong><em> versions above </em><em>1.17!</em></blockquote><blockquote><em>⚠Note that in the </em><em>2.0.0 version, </em><a href="https://github.com/Fliggy-Mobile/fbutton"><strong><em>FButton</em></strong></a><em> and </em><a href="https://github.com/Fliggy%20-Mobile/fsuper"><strong><em>FSuper</em></strong></a><em> Some parameters have changed. Please refer to the widget warehouse homepage for details, </em><strong><em>check the latest documentation</em></strong><em>. Or you can refer to </em><a href="https://pub.dev/packages/fbutton/changelog"><strong><em>FButton Changelod</em></strong></a><em> and </em><a href="https://pub.dev/packages/fsuper/changelog"><strong><em>FSuper Changelod</em></strong></a><em> Get change information.</em></blockquote><h3>😘 Please support us</h3><p>Developer, if you think <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>can be helpful to you, or if you like <a href="https://github.%20com/Fliggy-Mobile"><strong>FWidget</strong> </a>, please go to <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong></a><strong> </strong>homepage, and vote <strong>Star </strong>for your favorite <strong>widget</strong>.</p><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio widget suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li><li><a href="https://github.com/Fliggy-Mobile/fsearch">《FSearch》- A comprehensive search box widget</a></li><li><a href="https://github.com/Fliggy-Mobile/ftoast">《FToast》- Exquisite and flexible <strong>Flutter</strong> native <strong>Toast</strong> widget</a></li><li><a href="https://github.com/Fliggy-Mobile/floading">《FLoading》- This may be the <strong>Loading</strong> widget you want</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/0*E3vXCSyzCb-fXFkV.jpg" /></figure><h3>🌏 Welcome to visit FWidget.cn</h3><p>Now, we have started to develop the <strong>only</strong> official website for <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a><a href="https://fwidget.cn/">[<strong>https://fwidget.cn</strong>]</a>, provides developer with:</p><ul><li>Unified <a href="https://github.com/Fliggy-Mobile"><strong>FWidget</strong> </a>acquisition platform</li><li>Exquisite documents with interactive <strong>Demo</strong></li><li>Support one-click quick reference to widget</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/0*saSpZTs8qK_P6C_W.png" /></figure><p>Developers are welcome to <strong>collect to visit</strong>, <a href="https://github.com/Fliggy-Mobile/fwidget.github.io">provide us with more <strong>exquisite ideas</strong> 🥰</a>.</p><blockquote><em>It is worth mentioning that the </em><a href="https://github.com/Fliggy-Mobile"><strong><em>FWidget</em></strong><em> </em></a><em>official website is completely developed using </em><strong><em>Flutter</em></strong><em>, and most of the interface elements and functions are developed by </em><a href="https://github.com/Fliggy-Mobile"><strong><em>FWidget</em></strong><em> </em></a><em>provides support.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b502fe7f23fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[FSearch] Beautiful Flutter search bar]]></title>
            <link>https://medium.com/@icechenx/fsearch-beautiful-flutter-search-bar-410ba5e956fc?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/410ba5e956fc</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 15:59:22 GMT</pubDate>
            <atom:updated>2020-06-17T15:59:22.279Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*xcLHHgvU_5rzCcwR.png" /></figure><blockquote><strong><em>FWidget</em></strong><em> seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>Speaking of <strong>home travel, bi~bi~bi~bi~</strong> must-have items, I believe that developers can always pop out so few favorite items from their knowledge bases accumulated in their minds 🧠 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*tFt6dG-i8ivSyYj6.png" /></figure><p>However, just today, we tried to add a brand new <strong>must-have item</strong> to the developer’s knowledge base — — <strong>F~~Search</strong> 🎊.</p><p><strong>FSearch</strong> has a sacred mission. It tries to help developers build their own beautiful <strong>search bar</strong> 🔍 in the most comfortable way.</p><p>Today in the information 💥, we always want to add a search bar to our application, the users of the application need it, so the developers also need it.</p><p>So now, please adjust the spotlight angle and put the BGM, please <strong>F~~Search</strong> 👏👏👏.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*R9VmcdMzxogOx5GE.png" /></figure><h3>✨ Features</h3><p>Allow me to introduce the amazing features of <strong>FSearch</strong> to all developers.</p><ul><li>Support beautiful border effect</li><li>Provide rich corner configuration</li><li>Support stunning gradient effects</li><li>Provides easy to use shadow capabilities</li><li>Support any number of prefix and suffix action buttons</li><li>Provide colorful, flexible and powerful Hint effects</li><li>Controllers that are easier to use for developers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*6lgG4qKgTrMPkZHR.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/fsearch">【Portal: FSearch Github homepage-Thanks for your Star 🌟】</a></h4><h4>📖 <a href="https://pub.dev/documentation/fsearch/latest/fsearch/fsearch-library.html">【Portal: FSearch documentation】</a></h4><h3>🔩 Base Demo</h3><blockquote><em>Get rid of the shackles and start from scratch</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*tV6zAyJuzJrM4g0y.gif" /></figure><pre>FSearch(<em>/// Set height</em><br>  height: 30.0,<br>  <br>  <em>/// Set background color</em><br>  backgroundColor: color,<em>/// Set input text style</em><br>  style: style,<em>/// Fired when you click on the keyboard to search</em><br>  onSearch: (value) {<br>    <em>/// do something</em><br>  },prefixes: [buildAction()],<br>)</pre><p>Using <strong>FSearch</strong> to build a search bar is very relaxing.</p><p>Through some simple parameters, developers can easily change the size, color, and font of the search bar.</p><p>When the user clicks on the keyboard to search for <strong>Action</strong>, onSearch will be triggered, allowing the developer to perform some search operations here.</p><h3>🌖 Prefixes &amp; Suffixes</h3><blockquote><em>Highly flexible and highly controllable</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*LoSO12NMdMETd0UZ.gif" /></figure><pre>FSearch(<br>  height: 30.0,<br>  backgroundColor: mainBackgroundColor,<br>  style: style,<em>/// prefix widget</em><br>  prefixes: [ buildAction() ],<em>/// suffix widget</em><br>  suffixes: [<br>    buildAction_1(),<br>    buildAction_2(),<br>    buildAction_3(),<br>  ],<br>  onSearch: _onSearch,<br>)</pre><p>In FSearch, developers can configure any number of prefix or suffix action buttons for the search bar through the prefixes and suffixes parameters.</p><p>Such a high degree of flexibility and control may be unprecedented.</p><h3>🌈 Gradient</h3><blockquote><em>Gradient is artist</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*FZ_V6tgTqsVwbRFN.gif" /></figure><pre>FSearch(<br>  height: 30.0,<br>  backgroundColor: mainBackgroundColor,<br>  style: style,<em>/// Set gradient</em><br>  gradient: _gradient,<br>  prefixes: [ buildAction() ],<br>)</pre><p><strong>FSearch</strong> can support developers to create a beautiful gradient search bar.</p><p>Only need to configure through the gradient parameter.</p><h3>🍄 Corner &amp; Stroke &amp; Shadow</h3><blockquote><em>Change as you want</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*BXXsli0OzdZ3LSRf.gif" /></figure><pre><em>/// #1</em><br>FSearch(<br>  height: 30.0,<br>  backgroundColor: color,<br>  style: style,<em>/// Corner</em><br>  corner: FSearchCorner(<br>      leftTopCorner: 15.0,<br>      leftBottomCorner: 15.0,<br>      rightBottomCorner: 15.0),<em>/// border width</em><br>  strokeWidth: 1.0,<em>/// border color</em><br>  strokeColor: mainTextTitleColor,<em>/// shadow</em><br>  shadowColor: Colors.black38,<br>  shadowBlur: 5.0,<br>  shadowOffset: Offset(2.0, 2.0),<br>  prefixes: [buildAction()],<br>)</pre><p>The <strong>Border</strong> and <strong>Shadow</strong> effects of <strong>FSearch</strong> are the same as those of other <strong>FWidget</strong> members, and are simple and easy to use.</p><p>Through the corner parameter, developers can use <strong>FSearchCorner</strong> to freely control the table corner size of <strong>FSearch</strong>.</p><pre><em>/// #2</em><br>FSearch(<br>  height: 30.0,<br>  backgroundColor: color,<br>  style: style,<em>/// Corner</em><br>  corner: FSearchCorner.all(6.0),<em>/// Corner style</em><br>  cornerStyle: FSearchCornerStyle.bevel,<br>  prefixes: [buildAction()],<br>)</pre><p>If combined with cornerStyle, more complex and exquisite effects can be achieved.</p><h3>📍 Cursor</h3><blockquote><em>Controllable details</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*8QwiOWl-xdHKh6pq.gif" /></figure><pre>FSearch(<br>  <em>/// Cursor</em><br>  cursorColor: Colors.red[200],<br>  cursorRadius: 5.0,<br>  cursorWidth: 5.0,height: 36.0,<br>  style: style,<br>  gradient: _gradient,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<br>)</pre><p><strong>FSearch</strong> supports modifying the cursor in the input box of the search bar. You can change it to whatever you want.</p><h3>🗂 Hint</h3><blockquote><em>One step, you can dazzle!</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*doLwvdRzOTjO6vrJ.gif" /></figure><pre><em>/// #1</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<em>/// Hints</em><br>  hints: [<br>    &quot;FSuper is awesome 👍&quot;,<br>    &quot;Come to use FButton&quot;,<br>    &quot;You will love FRefresh&quot;,<br>  ],<em>/// Turn on hint exchange animation</em><br>  hintSwitchEnable: <strong>true</strong>,<em>/// Configure hint exchange animation type</em><br>  hintSwitchType: FSearchAnimationType.Fade,<br>)</pre><p><strong>FSearch</strong> provides developers with a very powerful <strong>Hint</strong> effect.</p><p>Developers can easily set multiple <strong>Hint</strong> for <strong>FSearch</strong>, and can configure multiple <strong>Hint</strong> exchange animations by configuring hintSwitchEnable: true.</p><p>When the user starts typing, Hint will be automatically hidden, and the swap animation will also be stopped.</p><p>When the content of the search input box becomes empty again, Hint will appear again, and the exchange animation will start playing.</p><pre><em>/// #2</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction1(),  buildAction2()],<br>  hints: [<br>    &quot;Do you want to try FFloat?😃&quot;,<br>    &quot;FRadio can do more 😱 !&quot;,<br>    &quot;I heard that you have been waiting for FDottedLine for a long time...&quot;,<br>  ],<br>  hintSwitchEnable: <strong>true</strong>,<br>)</pre><p><strong>FSearch</strong> has prepared rich exchange animations for developers. By default, <strong>FSearch</strong> will use the most common scroll swap animation, which is FSearchAnimationType.Scroll.</p><p>Of course, developers can configure their favorite animation types through the hintSwitchType parameter.</p><blockquote><em>💡 Note that when </em><em>hints.length == 1, the Hint swap animation will not be played. Only an ordinary Hint will be displayed at this time.</em></blockquote><pre><em>/// #3</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<em>/// Hints</em><br>  hints: [<br>    &quot;Embrace FWidget 👬&quot;,<br>    &quot;We care about your app 🥰&quot;,<br>    &quot;Want to build beautiful apps 🤨 ?&quot;,<br>  ],<br>  hintSwitchEnable: <strong>true</strong>,<em>/// Configure hint exchange animation type</em><br>  hintSwitchType: FSearchAnimationType.Scale,<em>/// Whether to stop exchanging animation when focus is obtained</em><br>  stopHintSwitchOnFocus: <strong>false</strong>,<br>)</pre><p>By default, when <strong>FSearch</strong> gains input focus, <strong>FSearch</strong> will automatically pause <strong>Hint</strong> to swap animations; when it gets focus again, it will resume automatically.</p><p>By configuring stopHintSwitchOnFocus: false, you can continue to play <strong>Hint</strong> swap animation until the user starts typing when <strong>FSearch</strong> has the focus.</p><h3>💻 Controller</h3><blockquote><em>Your program, you have the final say</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*ERzr3eAlo7IVVX1w.gif" /></figure><pre>FSearch(<br>  controller: _controller,<br>  height: 36.0,<br>  style: style,<br>  gradient: _gradient,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<br>  hints: [<br>    &quot;Want more beautiful widgets 🤨 ?&quot;,<br>    &quot;We will launch the official website of FWidget&quot;,<br>    &quot;Will you expect it?&quot;,<br>  ],<br>  hintStyle: hintStyle,<br>  hintSwitchEnable: <strong>true</strong>,<br>)<em>/// Get the input box content</em><br>String input = controller.text;<em>/// Clear the contents of the input box</em><br>controller.text = <strong>null</strong>;<em>/// Get the current hint, if any</em><br>String hint = controller.hint;<em>/// Remove focus</em><br>controller.clearFocus();<em>/// Request focus</em><br>controller.requestFocus();</pre><p><strong>FSearch</strong> provides developers with simple, easy-to-use, certain controllers, through which developers can modify or obtain the contents of the search bar at any location.</p><h4><a href="https://github.com/Fliggy-Mobile/fsearch">Want to know more details? Please visit the FSearch official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h4><h3>😃 How to use？</h3><p>Add dependency in project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  fsearch: ^&lt;version <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/fsearch"><strong><em>pub</em></strong></a><em> to get the latest version number of </em><strong><em>FSearch</em></strong></blockquote><h3>🖥 git dependency</h3><pre>dependencies:<br>  fsearch:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/fsearch.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/fsearch"><strong><em>FSearch</em></strong></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*VsRMbkMeTYBN6GwG.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/fsearch">Like it? Please go to the Github homepage of 《FSearch》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio component suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=410ba5e956fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speaking of home travel, bi~bi~bi~bi~ must-have items, I believe that developers can always pop…]]></title>
            <link>https://medium.com/@icechenx/speaking-of-home-travel-bi-bi-bi-bi-must-have-items-i-believe-that-developers-can-always-pop-fde0f7d339c4?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fde0f7d339c4</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 08:11:35 GMT</pubDate>
            <atom:updated>2020-06-17T08:23:38.468Z</atom:updated>
            <content:encoded><![CDATA[<p>[FSearch] Beautiful Flutter search bar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*iQlkbo1bJQWC5QFC.png" /></figure><blockquote><strong><em>FWidget</em></strong><em> seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>Speaking of <strong>home travel, bi~bi~bi~bi~</strong> must-have items, I believe that developers can always pop out so few favorite items from their knowledge bases accumulated in their minds 🧠 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*dPRR8NkRI31MOFPT.png" /></figure><p>However, just today, we tried to add a brand new <strong>must-have item</strong> to the developer’s knowledge base — — <strong>F~~Search</strong> 🎊.</p><p><strong>FSearch</strong> has a sacred mission. It tries to help developers build their own beautiful <strong>search bar</strong> 🔍 in the most comfortable way.</p><p>Today in the information 💥, we always want to add a search bar to our application, the users of the application need it, so the developers also need it.</p><p>So now, please adjust the spotlight angle and put the BGM, please <strong>F~~Search</strong> 👏👏👏.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*knnOy7s6fd2YQ7mTMi5tEQ.png" /></figure><h3>✨ Features</h3><p>Allow me to introduce the amazing features of <strong>FSearch</strong> to all developers.</p><ul><li>Support beautiful border effect</li><li>Provide rich corner configuration</li><li>Support stunning gradient effects</li><li>Provides easy to use shadow capabilities</li><li>Support any number of prefix and suffix action buttons</li><li>Provide colorful, flexible and powerful Hint effects</li><li>Controllers that are easier to use for developers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*lqGJJT-u5_xicup1.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/fsearch">【Portal: FSearch Github homepage-Thanks for your Star 🌟】</a></h4><h4>📖 <a href="https://pub.dev/documentation/fsearch/latest/fsearch/fsearch-library.html">【Portal: FSearch documentation】</a></h4><h3>🔩 Base Demo</h3><blockquote><em>Get rid of the shackles and start from scratch</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*EsR1gY-pSW0MJUbK.gif" /></figure><pre>FSearch(</pre><pre><em>/// Set height</em><br>  height: 30.0,<br>  <br>  <em>/// Set background color</em><br>  backgroundColor: color,</pre><pre><em>/// Set input text style</em><br>  style: style,</pre><pre><em>/// Fired when you click on the keyboard to search</em><br>  onSearch: (value) {<br>    <em>/// do something</em><br>  },</pre><pre>prefixes: [buildAction()],<br>)</pre><p>Using <strong>FSearch</strong> to build a search bar is very relaxing.</p><p>Through some simple parameters, developers can easily change the size, color, and font of the search bar.</p><p>When the user clicks on the keyboard to search for <strong>Action</strong>, onSearch will be triggered, allowing the developer to perform some search operations here.</p><h3>🌖 Prefixes &amp; Suffixes</h3><blockquote><em>Highly flexible and highly controllable</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*mtVWTZniEpcxfcNx.gif" /></figure><pre>FSearch(<br>  height: 30.0,<br>  backgroundColor: mainBackgroundColor,<br>  style: style,</pre><pre><em>/// prefix widget</em><br>  prefixes: [ buildAction() ],</pre><pre><em>/// suffix widget</em><br>  suffixes: [<br>    buildAction_1(),<br>    buildAction_2(),<br>    buildAction_3(),<br>  ],<br>  onSearch: _onSearch,<br>)</pre><p>In FSearch, developers can configure any number of prefix or suffix action buttons for the search bar through the prefixes and suffixes parameters.</p><p>Such a high degree of flexibility and control may be unprecedented.</p><h3>🌈 Gradient</h3><blockquote><em>Gradient is artist</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*adOnMd9fSTGRGQNf.gif" /></figure><pre>FSearch(<br>  height: 30.0,<br>  backgroundColor: mainBackgroundColor,<br>  style: style,</pre><pre><em>/// Set gradient</em><br>  gradient: _gradient,<br>  prefixes: [ buildAction() ],<br>)</pre><p><strong>FSearch</strong> can support developers to create a beautiful gradient search bar.</p><p>Only need to configure through the gradient parameter.</p><h3>🍄 Corner &amp; Stroke &amp; Shadow</h3><blockquote><em>Change as you want</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*iQvr98xsDcD3IMX6.gif" /></figure><pre><em>/// #1</em><br>FSearch(<br>  height: 30.0,<br>  backgroundColor: color,<br>  style: style,</pre><pre><em>/// Corner</em><br>  corner: FSearchCorner(<br>      leftTopCorner: 15.0,<br>      leftBottomCorner: 15.0,<br>      rightBottomCorner: 15.0),</pre><pre><em>/// border width</em><br>  strokeWidth: 1.0,</pre><pre><em>/// border color</em><br>  strokeColor: mainTextTitleColor,</pre><pre><em>/// shadow</em><br>  shadowColor: Colors.black38,<br>  shadowBlur: 5.0,<br>  shadowOffset: Offset(2.0, 2.0),<br>  prefixes: [buildAction()],<br>)</pre><p>The <strong>Border</strong> and <strong>Shadow</strong> effects of <strong>FSearch</strong> are the same as those of other <strong>FWidget</strong> members, and are simple and easy to use.</p><p>Through the corner parameter, developers can use <strong>FSearchCorner</strong> to freely control the table corner size of <strong>FSearch</strong>.</p><pre><em>/// #2</em><br>FSearch(<br>  height: 30.0,<br>  backgroundColor: color,<br>  style: style,</pre><pre><em>/// Corner</em><br>  corner: FSearchCorner.all(6.0),</pre><pre><em>/// Corner style</em><br>  cornerStyle: FSearchCornerStyle.bevel,<br>  prefixes: [buildAction()],<br>)</pre><p>If combined with cornerStyle, more complex and exquisite effects can be achieved.</p><h3>📍 Cursor</h3><blockquote><em>Controllable details</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*eC9Akb6sCZ0_YdwY.gif" /></figure><pre>FSearch(<br>  <em>/// Cursor</em><br>  cursorColor: Colors.red[200],<br>  cursorRadius: 5.0,<br>  cursorWidth: 5.0,</pre><pre>height: 36.0,<br>  style: style,<br>  gradient: _gradient,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<br>)</pre><p><strong>FSearch</strong> supports modifying the cursor in the input box of the search bar. You can change it to whatever you want.</p><h3>🗂 Hint</h3><blockquote><em>One step, you can dazzle!</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*cpJJa7tFL-vMqHCj.gif" /></figure><pre><em>/// #1</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],</pre><pre><em>/// Hints</em><br>  hints: [<br>    &quot;FSuper is awesome 👍&quot;,<br>    &quot;Come to use FButton&quot;,<br>    &quot;You will love FRefresh&quot;,<br>  ],</pre><pre><em>/// Turn on hint exchange animation</em><br>  hintSwitchEnable: <strong>true</strong>,</pre><pre><em>/// Configure hint exchange animation type</em><br>  hintSwitchType: FSearchAnimationType.Fade,<br>)</pre><p><strong>FSearch</strong> provides developers with a very powerful <strong>Hint</strong> effect.</p><p>Developers can easily set multiple <strong>Hint</strong> for <strong>FSearch</strong>, and can configure multiple <strong>Hint</strong> exchange animations by configuring hintSwitchEnable: true.</p><p>When the user starts typing, Hint will be automatically hidden, and the swap animation will also be stopped.</p><p>When the content of the search input box becomes empty again, Hint will appear again, and the exchange animation will start playing.</p><pre><em>/// #2</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction1(),  buildAction2()],<br>  hints: [<br>    &quot;Do you want to try FFloat?😃&quot;,<br>    &quot;FRadio can do more 😱 !&quot;,<br>    &quot;I heard that you have been waiting for FDottedLine for a long time...&quot;,<br>  ],<br>  hintSwitchEnable: <strong>true</strong>,<br>)</pre><p><strong>FSearch</strong> has prepared rich exchange animations for developers. By default, <strong>FSearch</strong> will use the most common scroll swap animation, which is FSearchAnimationType.Scroll.</p><p>Of course, developers can configure their favorite animation types through the hintSwitchType parameter.</p><blockquote><em>💡 Note that when </em><em>hints.length == 1, the Hint swap animation will not be played. Only an ordinary Hint will be displayed at this time.</em></blockquote><pre><em>/// #3</em><br>FSearch(<br>  height: 36.0,<br>  style: style,<br>  color: _color,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],</pre><pre><em>/// Hints</em><br>  hints: [<br>    &quot;Embrace FWidget 👬&quot;,<br>    &quot;We care about your app 🥰&quot;,<br>    &quot;Want to build beautiful apps 🤨 ?&quot;,<br>  ],<br>  hintSwitchEnable: <strong>true</strong>,</pre><pre><em>/// Configure hint exchange animation type</em><br>  hintSwitchType: FSearchAnimationType.Scale,</pre><pre><em>/// Whether to stop exchanging animation when focus is obtained</em><br>  stopHintSwitchOnFocus: <strong>false</strong>,<br>)</pre><p>By default, when <strong>FSearch</strong> gains input focus, <strong>FSearch</strong> will automatically pause <strong>Hint</strong> to swap animations; when it gets focus again, it will resume automatically.</p><p>By configuring stopHintSwitchOnFocus: false, you can continue to play <strong>Hint</strong> swap animation until the user starts typing when <strong>FSearch</strong> has the focus.</p><h3>💻 Controller</h3><blockquote><em>Your program, you have the final say</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*JENuVI14iaPCij0_.gif" /></figure><pre>FSearch(<br>  controller: _controller,<br>  height: 36.0,<br>  style: style,<br>  gradient: _gradient,<br>  corner: _corner,<br>  prefixes: [ buildAction() ],<br>  suffixes: [ buildAction() ],<br>  hints: [<br>    &quot;Want more beautiful widgets 🤨 ?&quot;,<br>    &quot;We will launch the official website of FWidget&quot;,<br>    &quot;Will you expect it?&quot;,<br>  ],<br>  hintStyle: hintStyle,<br>  hintSwitchEnable: <strong>true</strong>,<br>)</pre><pre><em>/// Get the input box content</em><br>String input = controller.text;</pre><pre><em>/// Clear the contents of the input box</em><br>controller.text = <strong>null</strong>;</pre><pre><em>/// Get the current hint, if any</em><br>String hint = controller.hint;</pre><pre><em>/// Remove focus</em><br>controller.clearFocus();</pre><pre><em>/// Request focus</em><br>controller.requestFocus();</pre><p><strong>FSearch</strong> provides developers with simple, easy-to-use, certain controllers, through which developers can modify or obtain the contents of the search bar at any location.</p><h4><a href="https://github.com/Fliggy-Mobile/fsearch">Want to know more details? Please visit the FSearch official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h4><h3>😃 How to use？</h3><p>Add dependency in project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  fsearch: ^&lt;version <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/fsearch"><strong><em>pub</em></strong></a><em> to get the latest version number of </em><strong><em>FSearch</em></strong></blockquote><h3>🖥 git dependency</h3><pre>dependencies:<br>  fsearch:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/fsearch.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/fsearch"><strong><em>FSearch</em></strong></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*B_d4-O6p3lc7Fl9v.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/fsearch">Like it? Please go to the Github homepage of 《FSearch》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio component suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fdottedline">《FDottedLine》- Brilliant dotted line effect</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fde0f7d339c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FDottedLine】How to create a dashed line in Flutter?]]></title>
            <link>https://medium.com/@icechenx/fdottedline-how-to-create-a-dashed-line-in-flutter-287e3f499e6f?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/287e3f499e6f</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 09:29:32 GMT</pubDate>
            <atom:updated>2020-06-08T09:29:32.460Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*P1IZgwQ7Dv2DK6Gh.png" /></figure><blockquote><strong><em>FWidget</em></strong><em> seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>For a <strong>Flutter</strong> developer, it is not an easy task to achieve the dotted line effect in the picture below 🤔.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*k0pC_IzJ9bDx2Dex.png" /></figure><p>Because the official does not prepare <strong>Widget</strong> about the dotted line for developers to eat.</p><p>Many times, developers have to manually draw or use some special methods to achieve, but the process is always not so easy.</p><p>Now, <strong>FDottedLine</strong> is about to change the current situation. Provide developers with a sufficiently elegant way to complete the construction of the dashed view.</p><p><strong>FDottedLine</strong> is regarded as the main component of the <strong>FWidget</strong> series developed and maintained by <a href="https://github.com/Fliggy-Mobile"><strong>【Alibaba-FliggyMobile Team】</strong></a> The seventh component is dedicated to community developers. Hope to help developers create beautiful applications more easily.</p><p>In the past few weeks, the <strong>FWidget</strong> component that has been opened has received continuous attention from community developers, and developers have currently invested nearly <a href="https://github.com/Fliggy-Mobile"><strong>800 Star</strong></a>.</p><p>Today, we bring powerful components to developers that support the flexible construction of dotted line effects-<strong>FDottedLine</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r8flvQCXGfT-6G2G.png" /></figure><h3>✨ Features</h3><p>See what changes <strong>FDottedLine</strong> brings:</p><ul><li>Supports dotted lines in both horizontal and vertical directions</li><li>Support to create dashed shapes</li><li>Provide super easy way to add dotted border to <strong>Widget</strong></li><li>Support creating flexible dotted corner effects</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*WrWx9bvnKci4OToO.png" /></figure><h3>🛸 Portal</h3><h4>🛸 <a href="https://github.com/Fliggy-Mobile/fdottedline">【Portal: FDottedLine Github homepage】</a></h4><h4>📖 <a href="https://pub.dev/documentation/fdottedline/latest/fdottedline/fdottedline-library.html">【Portal: FRefresh documentation】</a></h4><h3>🔩 Horizontal dotted line</h3><blockquote><em>Consistent simplicity</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*5JowmPwgOrtdBXzz.png" /></figure><pre>FDottedLine(<br>  color: color,<br>  width: 160.0,<br>)</pre><p>It is very simple to create a horizontal dotted line through <strong>FDottedLine</strong> 😱.</p><p>Stop the fear of the dotted view!</p><h3>⛓ Vertical dotted line</h3><blockquote><em>It’s also simple to change the effect</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*p8LYW3rkzOVUWabY.png" /></figure><pre>FDottedLine(<br>  color: color,<br>  height: 160.0,<br>)</pre><p>It is as simple as <strong>horizontal dotted line</strong>.</p><p>At this point, perhaps the careful developer will find out. The only difference between constructing <strong>horizontal dotted line</strong> and <strong>vertical dotted line</strong> is:</p><blockquote><em>When the </em><strong><em>horizontal dotted line</em></strong><em> needs to be constructed, only the </em><em>width parameter needs to be assigned; and when the </em><strong><em>vertical dotted line</em></strong><em> needs to be constructed, only the </em><em>height parameter needs to be assigned.</em></blockquote><p>God, this is too convenient 😱.</p><h3>🔹 Dotted graphics</h3><blockquote><em>Always, not only that</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*bOpEp7O1FijzCPu2.png" /></figure><pre>FDottedLine(<br>  color: Colors.lightBlue[600],<br>  height: 100.0,<br>  width: 50,<br>  strokeWidth: 2.0,<br>  dottedLength: 10.0,<br>  space: 2.0,<br>)</pre><p>If you assign both width and height, developers will be surprised to find that a dotted line appears.</p><p>Yes, <strong>FDottedLine</strong> can not only help developers build a one-dimensional dashed line view very concisely, but also construct two-dimensional dashed line graphics in the same concise way.</p><h3>🌏 Corner</h3><blockquote><em>Change a little bit more</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/0*XVFK9gJZhkHjxC-h.png" /></figure><pre>FDottedLine(<br>  color: Colors.lightBlue[600],<br>  height: 70.0,<br>  width: 70.0,<br>  space: 2.0,<br>  <br>  <em>/// Set corner</em><br>  corner: FDottedLineCorner.all(50),<br>)</pre><p>With <strong>FDottedLine</strong>, developers can even create corner effects of dotted graphics. For example: dotted rounded rectangle, dotted round..</p><p>And the construction is always simple, just configure a corner parameter, you can complete many amazing effects.</p><h3>🧩 Child</h3><blockquote><em>Make things simple</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*K9TqiwawN9K8oych.png" /></figure><pre>FDottedLine(<br>  color: color,<br>  corner: FDottedLineCorner.all(6.0),<br>  <br>  <em>/// add widget</em><br>  child: Container(<br>    color: Colors.blue[100],<br>    width: 130,<br>    height: 70,<br>    alignment: Alignment.center,<br>    child: Text(&quot;0873&quot;),<br>  ),<br>)</pre><p>I believe that developers all feel deeply. In the past, it was very difficult to add a dotted border to a <strong>Widget</strong>.</p><p>But <strong>FDottedLine</strong> will make things easier than ever. Developers only need to use their <strong>Widget</strong> as a child of <strong>FDottedLine</strong> to complete all the work.</p><p>Behind <strong>FDottedLine</strong>, <strong>FDottedLine</strong> will help developers calculate the size of <strong>Widget</strong> to further determine how to create the correct dashed border.</p><p>This work has opened up a new path for developers.</p><h3>💡 Explore more fun</h3><p>See what <strong>FDottedLine</strong> can do!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*W1GKojfJw3kIBQMP.png" /></figure><p>When there is such a simple way to create a dotted line, developers can freely build more wonderful views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*-TbzWOFxZv99BJPW.gif" /></figure><p>Next for more applications of <strong>FDottedLine</strong>, look forward to the exploration of developers 🔆.</p><h4><a href="https://github.com/Fliggy-Mobile/fdottedline">Want to know more details? Please visit the FDottedLine official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h4><h3>😃 How to use？</h3><p>Add dependency in project pubspec.yaml file:</p><h3>🌐 pub dependency</h3><pre>dependencies:<br>  fdottedline: ^&lt;version <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/fdottedline"><strong><em>pub</em></strong></a><em> to get the latest version number of </em><strong><em>FDottedLine</em></strong></blockquote><h3>🖥 git dependency</h3><pre>dependencies:<br>  fdottedline:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/fdottedline.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/fdottedline"><strong><em>FDottedLine</em></strong></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*Q6hIkAawQluW0Zx-.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/fdottedline">Like it? Please go to the Github homepage of 《FDottedLine》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio component suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li><li><a href="https://github.com/Fliggy-Mobile/frefresh">《FRefresh》- Easily build pull-down refresh effects</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=287e3f499e6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FRefresh】Flutter drop-down refresh widget]]></title>
            <link>https://medium.com/@icechenx/frefresh-flutter-drop-down-refresh-widget-c7b351d711be?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7b351d711be</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 11:18:15 GMT</pubDate>
            <atom:updated>2020-06-04T11:18:15.018Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*Mr3AlGP3EiMnoVtp.png" /></figure><blockquote><strong><em>FWidget</em></strong><em> seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>Now, developer, please pay attention 🤭.</p><p>Think 🤔，how can we create the visual effects in the picture below?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SgqRd9meCeYSwBfa.gif" /></figure><p>After the brain 🧠 is thinking fast, maybe we will eventually find that there is fraud 😧!En～This is not an easy task。</p><p>In the process of pulling-down, as the scroll distance changes, we need to continuously handle with several different stages of the situation:</p><pre>1. Pull-down process before trigger position</pre><pre>2. Reach trigger position</pre><pre>3. Pull-down process over trigger position</pre><pre>4. Free rebound <strong>to</strong> refresh position</pre><pre>5. Keeping refresh</pre><pre>6. After refresh, freely rebound <strong>to</strong> 0 position</pre><pre>7. Rebound <strong>to</strong> 0 o&#39;clock without reaching the trigger position</pre><pre>.<br>    .<br>    .</pre><p>Each process requires us to make a lot of calculations and logical judgments. If you want to adjust the head <strong>Widget</strong> according to the scroll distance, then things are really complicated.</p><p>Are you anxious?</p><p>Developer, it is not necessary!</p><p>Because, <strong>FRefresh</strong> appears! 🎉🎉🎉</p><p><strong>FRefresh</strong> is one of the <strong>FWidget</strong> series widgets developed and maintained by <a href="https://github.com/Fliggy-Mobile"><strong>【Alibaba-FliggyMobile Team】</strong></a>.</p><p>In the past period of time, we have opened to the community successively <strong>5</strong> practical and beautiful <strong>Widget</strong> （<a href="https://github.com/Fliggy-Mobile/fsuper"><strong><em> FSuper </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fbutton"><strong><em> FButton </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fswitch"><strong><em> FSwitch </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fradio"><strong><em> FRadio </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/ffloat"><strong><em> FFloat</em></strong> </a>），to help developers more easily build pleasing applications.</p><p>We are very happy to get the recognition and support from the developers. At present, we have received a total of 800<a href="https://github.com/Fliggy-Mobile"><strong><em> Star</em></strong></a><strong><em>s</em></strong> voted by the developers.</p><p>The <strong>FRefresh</strong> offered to developers today is the <strong>6</strong> member of the <strong>FWidget</strong> series of widgets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*HW2f8_F0YOqoixnZV3O3HQ.gif" /></figure><h3>✨ Features</h3><p>Take a look at what <strong>FRefresh</strong> has prepared for developers:</p><ul><li>Provide super simple pull-down refresh and pull-up loading construction methods</li><li>Support partial update refresh area and load area view</li><li>Sufficient and comprehensive state machine support</li><li>Practical controller</li><li>Support active trigger refresh</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*arNZyXeJ8W-TqUo7.png" /></figure><h3>🛸 Portal</h3><p>🛸 <a href="https://github.com/Fliggy-Mobile/frefresh">【Portal: FRefresh Github homepage】</a></p><p>📖 <a href="https://pub.dev/documentation/frefresh/latest/frefresh/frefresh-library.html">【Portal: </a><a href="https://github.com/Fliggy-Mobile/frefresh">FRefresh</a><a href="https://pub.dev/documentation/frefresh/latest/frefresh/frefresh-library.html"> documentation】</a></p><h3>💫 Basic version pull-down refresh</h3><blockquote><em>Just simpler</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*P6VHcY60Soa1x352.gif" /></figure><p>This is our most common pull-down refresh example 🌰 in daily development. Believe me, if you want to build such an effect, it will be very difficult!</p><p>But if you use <strong>FRefresh</strong>, the situation is completely different.</p><p>Now, we only need a few lines of code to complete the create of this effect.</p><pre>FRefresh(</pre><pre><em>/// Build refresh header</em><br>  header: buildRefreshView(),</pre><pre><em>/// Need to pass the size of the header area</em><br>  headerHeight: 75.0,</pre><pre><em>/// create content area widget</em><br>  child: ListView.builder(<br>      physics: NeverScrollableScrollPhysics(),<br>      shrinkWrap: <strong>true</strong>,<br>      ...<br>  ),</pre><pre><em>/// This function will be called after entering Refreshing</em><br>  onRefresh: () {},<br>);</pre><p>Done 🔨！</p><p>This is all you need to do to create a pull-down refresh.</p><p><strong>FRefresh</strong> takes care of everything, developers only need to focus on the construction of the <strong>Header area</strong>and <strong>content area</strong>.</p><h3>🚀 Advanced version pull-down refresh</h3><blockquote><em>Simple enough, efficient enough</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*s5fgaauiFAYWONG3.gif" /></figure><pre>FRefresh(</pre><pre><em>/// Build the header area with headerBuilder</em><br>  headerBuilder: (setter, constraints) {<br>    <strong>return</strong> FSuper(</pre><pre><em>/// Get the available space in the current header area</em><br>       width: constraints.maxWidth,<br>       height: constraints.maxHeight,<br>       ...<br>       onClick:{<br>          setter((){<br>             <em>/// just refresh the header area</em><br>          })<br>       },<br>    );<br>  },<br>  headerHeight: 100.0,</pre><pre><em>/// Build content area</em><br>  child: GridView.builder(),</pre><pre><em>/// This function will be called back after entering the refreshing state</em><br>  onRefresh: () {}<br>)</pre><p><strong>FRefresh</strong> provides a very flexible <strong>Header area</strong> construction method, which is to complete the construction through the <strong>HeaderBuilder</strong> function.</p><p>In the <strong>HeaderBuilder</strong> function, developer can get the refresh function <strong>StateSetter</strong> for partial refresh <strong>Header area</strong> and the real-time size of <strong>Header area</strong> through parameter.</p><p>This way, the <strong>Header area</strong> is given more open creativity.</p><h3>💫 Basic version pull-up loading</h3><blockquote><em>Two modes, one way</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*s13faNMtwk_H41VE.gif" /></figure><p>Corresponding to the pull-down refresh, the construction of the pull-up loading effect is also very simple.</p><pre>FRefresh(</pre><pre><em>/// create Footer area</em><br>  footer: LinearProgressIndicator(),</pre><pre><em>/// Need to configure the height of the footer area</em><br>  footerHeight: 20.0,</pre><pre><em>/// create content area</em><br>  child: builderContent(),</pre><pre><em>/// This function will be called after entering the Loading state</em><br>  onLoad: () { },<br>)</pre><p>Building pull-ups is equally simple enough. Developers only need to pay attention to the construction of <strong>Footer area</strong> and <strong>content area</strong>, and the state changes and visual effects control during the pull-up loading process can be safely handed over to <strong>FRefresh</strong>.</p><h3>🚀 Advanced version pull-up loading</h3><blockquote><em>Never stop pursuing beauty</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*1HQFpEpJt-KAXJU5.gif" /></figure><pre>FRefresh(</pre><pre><em>/// Build Footer Area Widget by FooterBuilder</em><br>  footerBuilder: (setter) {</pre><pre><em>/// Get refresh status, partially update the content of Footer area</em><br>    controller.setOnStateChangedCallback((state) {<br>      setter(() {<br>        ...<br>      });<br>    });<br>    <strong>return</strong> buildFooter();<br>  },<br>  footerHeight: 38.0,<br>  child: buildContent(),<br>  onLoad: () {<br>    controller.finishLoad();<br>  },<br>)</pre><p><strong>FRefresh</strong> also provides a builder function <strong>FooterBuilder</strong> for building the <strong>Footer area</strong>. Through this function, you can get the refresh function <strong>StateSetter</strong> which refreshes only the <strong>Footer area</strong>.</p><p>In this way, the developer can easily change the view of the <strong>Footer area</strong> according to the status or some other conditions.</p><p>Very intimate 🥰.</p><h3>⚙️ FRefreshController</h3><blockquote><em>You can control everything</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*oGY4yKzSy3PBEhiP.gif" /></figure><p><strong>FRefresh</strong> provides developers with intimate controllers <strong>FRefreshController</strong>, which supports many convenient capabilities.</p><h4>1. Add controller to FRefresh</h4><pre><em>/// Create Controller</em><br>FRefreshController controller = FRefreshController()</pre><pre><em>/// Configure controller for FRefresh</em><br>FRefresh(<br>  controller: controller,<br>)</pre><p>When the developer creates a controller and then sets it into a <strong>FRefresh</strong>, the controller can start to monitor the status of this <strong>FRefresh</strong> and control it.</p><h4>2. Stop refreshing or loading</h4><p>When the refresh state or loading state is triggered, data processing tasks such as network requests are usually performed. After these tasks are completed, we need to stop the refresh state or loading state. How to do it?</p><ul><li>controller.finishRefresh()：Can stop refreshing</li><li>controller.finishLoad()：Can stop loading</li></ul><h4>3. State Change Listen</h4><pre>controller.setOnStateChangedCallback((state) {<br>  <em>/// Refresh status</em><br>  <strong>if</strong> (state <strong>is</strong> RefreshState) {<br>  }<br>  <em>/// Loading state</em><br>  <strong>if</strong> (state <strong>is</strong> LoadState) {<br>  }<br>});</pre><p>Through the above simple code, you can monitor the status change of FRefresh, whether it is pull-down refresh or pull-up loading.</p><h4>4. Scroll Listen</h4><pre>controller.setOnScrollListener((metrics) {<br>  <em>/// Get scroll information</em><br>});</pre><p><strong>FRefreshController</strong> It is really convenient to add sliding monitor. The parameters received is <a href="https://api.flutter.dev/flutter/widgets/ScrollMetrics-class.html">[ScrollMetrics]</a>，it can get very comprehensive information such as <strong>current scroll distance</strong>, <strong>maximum scroll distance</strong>, <strong>whether it exceeds the scroll range</strong>, etc..</p><h4>5. Actively trigger refresh</h4><p>Through <strong>FRefreshController</strong> , developers can also actively trigger a refresh, and can specify the length of time to slide to the refresh position.</p><pre>controller.refresh(duration: Duration(milliseconds: 2000));</pre><p>This feature is very useful in many scenarios.</p><h4><a href="https://github.com/Fliggy-Mobile/frefresh">Want to know more details? Please visit the FRefresh official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h4><h3>😃 How to use？</h3><p>Add dependency in project pubspec.yaml file:</p><h4>🌐 pub dependency</h4><pre>dependencies:<br>  frefresh: ^&lt;version <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/frefresh"><strong><em>pub</em></strong></a><em> to get the latest version number of </em><strong><em>FRefresh</em></strong></blockquote><h4>🖥 git dependency</h4><pre>dependencies:<br>  frefresh:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/frefresh.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/frefresh"><strong><em>FRefresh</em></strong></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*Wk27jcgRwaIRZjjm.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/frefresh">Like it? Please go to the Github homepage of 《FRefresh》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio component suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7b351d711be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【FRefresh】How to easily build pull-down refresh in Flutter]]></title>
            <link>https://medium.com/@icechenx/frefresh-how-to-easily-build-pull-down-refresh-in-flutter-61311bf9ff56?source=rss-2ad24251934b------2</link>
            <guid isPermaLink="false">https://medium.com/p/61311bf9ff56</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[CoorChice]]></dc:creator>
            <pubDate>Thu, 21 May 2020 12:05:24 GMT</pubDate>
            <atom:updated>2020-05-21T12:05:24.734Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*Mr3AlGP3EiMnoVtp.png" /></figure><blockquote><strong><em>FWidget</em></strong><em> seriously provide exquisite widget to help you build exquisite application.</em></blockquote><p>Now, developer, please pay attention 🤭.</p><p>Think 🤔，how can we create the visual effects in the picture below?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SgqRd9meCeYSwBfa.gif" /></figure><p>After the brain 🧠 is thinking fast, maybe we will eventually find that there is fraud 😧!En～This is not an easy task。</p><p>In the process of pulling-down, as the scroll distance changes, we need to continuously handle with several different stages of the situation:</p><pre>1. Pull-down process before trigger position</pre><pre>2. Reach trigger position</pre><pre>3. Pull-down process over trigger position</pre><pre>4. Free rebound <strong>to</strong> refresh position</pre><pre>5. Keeping refresh</pre><pre>6. After refresh, freely rebound <strong>to</strong> 0 position</pre><pre>7. Rebound <strong>to</strong> 0 o&#39;clock without reaching the trigger position</pre><pre>    .<br>    .<br>    .</pre><p>Each process requires us to make a lot of calculations and logical judgments. If you want to adjust the head <strong>Widget</strong> according to the scroll distance, then things are really complicated.</p><p>Are you anxious?</p><p>Developer, it is not necessary!</p><p>Because, <strong>FRefresh</strong> appears! 🎉🎉🎉</p><p><strong>FRefresh</strong> is one of the <strong>FWidget</strong> series widgets developed and maintained by <a href="https://github.com/Fliggy-Mobile"><strong>【Alibaba-FliggyMobile Team】</strong></a>.</p><p>In the past period of time, we have opened to the community successively <strong>5</strong> practical and beautiful <strong>Widget</strong> （<a href="https://github.com/Fliggy-Mobile/fsuper"><strong><em> FSuper </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fbutton"><strong><em> FButton </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fswitch"><strong><em> FSwitch </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/fradio"><strong><em> FRadio </em></strong></a><strong><em>、</em></strong><a href="https://github.com/Fliggy-Mobile/ffloat"><strong><em> FFloat</em></strong> </a>），to help developers more easily build pleasing applications.</p><p>We are very happy to get the recognition and support from the developers. At present, we have received a total of <a href="https://github.com/Fliggy-Mobile"><strong><em>440 Star</em></strong></a><strong><em>s</em></strong> voted by the developers.</p><p>The <strong>FRefresh</strong> offered to developers today is the <strong>6</strong> member of the <strong>FWidget</strong> series of widgets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*HW2f8_F0YOqoixnZV3O3HQ.gif" /></figure><h3>✨ Features</h3><p>Take a look at what <strong>FRefresh</strong> has prepared for developers:</p><ul><li>Provide super simple pull-down refresh and pull-up loading construction methods</li><li>Support partial update refresh area and load area view</li><li>Sufficient and comprehensive state machine support</li><li>Practical controller</li><li>Support active trigger refresh</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*arNZyXeJ8W-TqUo7.png" /></figure><h3>🛸 Portal</h3><p>🛸 <a href="https://github.com/Fliggy-Mobile/frefresh">【Portal: FRefresh Github homepage-Thanks for your Star 🌟】</a></p><p>📖 <a href="https://pub.dev/documentation/frefresh/latest/frefresh/frefresh-library.html">【Portal: FFloat documentation】</a></p><h3>💫 Basic version pull-down refresh</h3><blockquote><em>Just simpler</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*P6VHcY60Soa1x352.gif" /></figure><p>This is our most common pull-down refresh example 🌰 in daily development. Believe me, if you want to build such an effect, it will be very difficult!</p><p>But if you use <strong>FRefresh</strong>, the situation is completely different.</p><p>Now, we only need a few lines of code to complete the create of this effect.</p><pre>FRefresh(</pre><pre>  <em>/// Build refresh header</em><br>  header: buildRefreshView(),</pre><pre>  <em>/// Need to pass the size of the header area</em><br>  headerHeight: 75.0,</pre><pre>  <em>/// create content area widget</em><br>  child: ListView.builder(<br>      physics: NeverScrollableScrollPhysics(),<br>      shrinkWrap: <strong>true</strong>,<br>      ...<br>  ),</pre><pre>  <em>/// This function will be called after entering Refreshing</em><br>  onRefresh: () {},<br>);</pre><p>Done 🔨！</p><p>This is all you need to do to create a pull-down refresh.</p><p><strong>FRefresh</strong> takes care of everything, developers only need to focus on the construction of the <strong>Header area</strong>and <strong>content area</strong>.</p><h3>🚀 Advanced version pull-down refresh</h3><blockquote><em>Simple enough, efficient enough</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*s5fgaauiFAYWONG3.gif" /></figure><pre>FRefresh(</pre><pre>  <em>/// Build the header area with headerBuilder</em><br>  headerBuilder: (setter, constraints) {<br>    <strong>return</strong> FSuper(</pre><pre>       <em>/// Get the available space in the current header area</em><br>       width: constraints.maxWidth,<br>       height: constraints.maxHeight,<br>       ...<br>       onClick:{<br>          setter((){<br>             <em>/// just refresh the header area</em><br>          })<br>       },<br>    );<br>  },<br>  headerHeight: 100.0,</pre><pre>  <em>/// Build content area</em><br>  child: GridView.builder(),</pre><pre>  <em>/// This function will be called back after entering the refreshing state</em><br>  onRefresh: () {}<br>)</pre><p><strong>FRefresh</strong> provides a very flexible <strong>Header area</strong> construction method, which is to complete the construction through the <strong>HeaderBuilder</strong> function.</p><p>In the <strong>HeaderBuilder</strong> function, developer can get the refresh function <strong>StateSetter</strong> for partial refresh <strong>Header area</strong> and the real-time size of <strong>Header area</strong> through parameter.</p><p>This way, the <strong>Header area</strong> is given more open creativity.</p><h3>💫 Basic version pull-up loading</h3><blockquote><em>Two modes, one way</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*s13faNMtwk_H41VE.gif" /></figure><p>Corresponding to the pull-down refresh, the construction of the pull-up loading effect is also very simple.</p><pre>FRefresh(</pre><pre>  <em>/// create Footer area</em><br>  footer: LinearProgressIndicator(),</pre><pre>  <em>/// Need to configure the height of the footer area</em><br>  footerHeight: 20.0,</pre><pre>  <em>/// create content area</em><br>  child: builderContent(),</pre><pre>  <em>/// This function will be called after entering the Loading state</em><br>  onLoad: () { },<br>)</pre><p>Building pull-ups is equally simple enough. Developers only need to pay attention to the construction of <strong>Footer area</strong> and <strong>content area</strong>, and the state changes and visual effects control during the pull-up loading process can be safely handed over to <strong>FRefresh</strong>.</p><h3>🚀 Advanced version pull-up loading</h3><blockquote><em>Never stop pursuing beauty</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*1HQFpEpJt-KAXJU5.gif" /></figure><pre>FRefresh(</pre><pre>  <em>/// Build Footer Area Widget by FooterBuilder</em><br>  footerBuilder: (setter) {</pre><pre>    <em>/// Get refresh status, partially update the content of Footer area</em><br>    controller.setOnStateChangedCallback((state) {<br>      setter(() {<br>        ...<br>      });<br>    });<br>    <strong>return</strong> buildFooter();<br>  },<br>  footerHeight: 38.0,<br>  child: buildContent(),<br>  onLoad: () {<br>    controller.finishLoad();<br>  },<br>)</pre><p><strong>FRefresh</strong> also provides a builder function <strong>FooterBuilder</strong> for building the <strong>Footer area</strong>. Through this function, you can get the refresh function <strong>StateSetter</strong> which refreshes only the <strong>Footer area</strong>.</p><p>In this way, the developer can easily change the view of the <strong>Footer area</strong> according to the status or some other conditions.</p><p>Very intimate 🥰.</p><h3>⚙️ FRefreshController</h3><blockquote><em>You can control everything</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*oGY4yKzSy3PBEhiP.gif" /></figure><p><strong>FRefresh</strong> provides developers with intimate controllers <strong>FRefreshController</strong>, which supports many convenient capabilities.</p><h4>1. Add controller to FRefresh</h4><pre><em>/// Create Controller</em><br>FRefreshController controller = FRefreshController()</pre><pre><em>/// Configure controller for FRefresh</em><br>FRefresh(<br>  controller: controller,<br>)</pre><p>When the developer creates a controller and then sets it into a <strong>FRefresh</strong>, the controller can start to monitor the status of this <strong>FRefresh</strong> and control it.</p><h4>2. Stop refreshing or loading</h4><p>When the refresh state or loading state is triggered, data processing tasks such as network requests are usually performed. After these tasks are completed, we need to stop the refresh state or loading state. How to do it?</p><ul><li>controller.finishRefresh()：Can stop refreshing</li><li>controller.finishLoad()：Can stop loading</li></ul><h4>3. State Change Listen</h4><pre>controller.setOnStateChangedCallback((state) {<br>  <em>/// Refresh status</em><br>  <strong>if</strong> (state <strong>is</strong> RefreshState) {<br>  }<br>  <em>/// Loading state</em><br>  <strong>if</strong> (state <strong>is</strong> LoadState) {<br>  }<br>});</pre><p>Through the above simple code, you can monitor the status change of FRefresh, whether it is pull-down refresh or pull-up loading.</p><h4>4. Scroll Listen</h4><pre>controller.setOnScrollListener((metrics) {<br>  <em>/// Get scroll information</em><br>});</pre><p><strong>FRefreshController</strong> It is really convenient to add sliding monitor. The parameters received is <a href="https://api.flutter.dev/flutter/widgets/ScrollMetrics-class.html">[ScrollMetrics]</a>，it can get very comprehensive information such as <strong>current scroll distance</strong>, <strong>maximum scroll distance</strong>, <strong>whether it exceeds the scroll range</strong>, etc..</p><h4>5. Actively trigger refresh</h4><p>Through <strong>FRefreshController</strong> , developers can also actively trigger a refresh, and can specify the length of time to slide to the refresh position.</p><pre>controller.refresh(duration: Duration(milliseconds: 2000));</pre><p>This feature is very useful in many scenarios.</p><h4><a href="https://github.com/Fliggy-Mobile/frefresh">Want to know more details? Please visit the FRefresh official homepage (PS: Do n’t forget to vote for a Star you approved 😘)</a></h4><h3>😃 How to use？</h3><p>Add dependency in project pubspec.yaml file:</p><h4>🌐 pub dependency</h4><pre>dependencies:<br>  frefresh: ^&lt;version <strong>number</strong>&gt;</pre><blockquote><em>⚠️ Attention，please go to </em><a href="https://pub.dev/packages/frefresh"><strong><em>pub</em></strong></a><em> to get the latest version number of </em><strong><em>FRefresh</em></strong></blockquote><h4>🖥 git dependency</h4><pre>dependencies:<br>  ffloat:<br>    git:<br>      url: &#39;git@github.com:<strong>Fliggy</strong>-<strong>Mobile</strong>/frefresh.git&#39;<br>      <strong>ref</strong>: &#39;&lt;<strong>Branch</strong> number <strong>or</strong> tag number&gt;&#39;</pre><blockquote><em>⚠️ Attention，please refer to </em><a href="https://github.com/Fliggy-Mobile/frefresh"><strong><em>FRefresh</em></strong></a><em> official project for branch number or tag.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*Wk27jcgRwaIRZjjm.png" /></figure><h4><a href="https://github.com/Fliggy-Mobile/frefresh">Like it? Please go to the Github homepage of 《FRefresh》 to vote for it 🌟!</a></h4><h3>Past Widget</h3><ul><li><a href="https://github.com/Fliggy-Mobile/fsuper">《FSuper》- Help developers quickly build beautifully complex views</a></li><li><a href="https://github.com/Fliggy-Mobile/fbutton">《FButton》- Many wonderful configuration items are prepared for developers</a></li><li><a href="https://github.com/Fliggy-Mobile/fswitch">《FSwitch》- Exquisite switching elements with excellent interaction and visual effects</a></li><li><a href="https://github.com/Fliggy-Mobile/fradio">《FRadio》- A radio component suitable for almost any radio scenario</a></li><li><a href="https://github.com/Fliggy-Mobile/ffloat">《FFloat》- Satisfy all your imagination of floating elements</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61311bf9ff56" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>