Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ fair Public
forked from wuba/Fair

A Flutter package used to update widget tree dynamically. Flutter Fair是为Flutter设计的,UI&模板动态化框架

License

BSD-3-Clause, BSD-3-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE
BSD-3-Clause
LICENSE-FLUTTER
Notifications You must be signed in to change notification settings

maxleexyz/fair

 
 

social preview

pub github doc license build Gitter

简体中文|English


Fair is a lightweight package for Flutter, which can be used to update widget tree and state dynamically. This package is still at an early stage.

We create Fair so we can dispatch any pages changes to users as bundle(s), the way similar to React Native. With Flutter Fair integrated, you can publish your pages without waiting for the next release date of your App. Fair provides standard widget and some logic plugins, it can be used as a new dynamic page or as part of existing Flutter page.

🏛Architecture

fair architecture

🚀 Running

Use Flutter Fair require few steps.

step1:download fair project source code

It is recommended to download fair to the local and dependencies on the relative path.

The download method is as follows:

git clone https://github.com/wuba/fair.git

step2:Add dependency inside pubspec.yaml

Assuming that the fair project and your own project are in the same folder:

# add Fair dependency
dependencies:
  fair: 2.4.0

# add compiler dependency
dev_dependencies:
  build_runner: ^2.0.0
  fair_compiler:
    path: ../fair/compiler
 
# switch "fair_version" according to the local Flutter SDK version.
# Flutter SDK 2.5.x(2.5.0、2.5.1、2.5.2、2.5.3) -> fair_version: 2.5.0
# Flutter SDK 2.0.6 -> fair_version: 2.0.6+1
# Flutter SDK 1.22.6 -> fair_version: 1.22.6
dependency_overrides:
  fair_version: 2.0.6+1

step3:Wrap your app with FairApp Widget

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  FairApp.runApplication(
    _getApp(),
    plugins: {
    },
  );
}

dynamic _getApp() => FairApp(
  modules: {
  },
  delegate: {
  },
  child: MaterialApp(
    home: FairWidget(
            name: 'DynamicWidget',
            path: 'assets/bundle/lib_src_page_dynamic_widget.fair.json',
            data: {"fairProps": json.encode({})}),
  ),
);

step4:Import a dynamic widget as FairWidget

FairWidget(
  name: 'DynamicWidget',
  path: 'assets/bundle/lib_src_page_dynamic_widget.fair.json',
  data: {"fairProps": json.encode({})}),

Documentation

For more details, please refer to https://fair.58.com

🕰2022 Roadmap

  • Major release plan
    • null-safe version support, expected to be launched on April 22 ✅
    • Flutter 2.8.0 version adaptation, expected to be launched in mid-May
    • Flutter 2.10.0 version adaptation, is expected to be launched in early June
    • IDE syntax detection and hint plugin
    • Rich syntactic sugar
  • Hot update platform
    • Dart Server project construction ✅
    • Flutter Web project construction ✅
    • Patch/resource management
    • Project management
    • Mobile Update&Download
  • Online dynamic
    • Flutter Web project construction ✅
    • Dart Server project construction ✅
    • ActionEdit
    • Code editing
    • Component editing
    • Page editing
    • Engineering editor
    • Flutter effect preview
    • Fair DSL preview

✨Contributors

Thanks goes to these wonderful people (emoji key):


Wu

💻 📖

Penta

💻 📖

haijun

💻 📖

陈有余

💻 📖

yangyang

💻

wan

💻

bujie

💻

Kc

💻

gongpengyang

💻

qixu

💻

waynesonic

💻

paozhuanyinyu

💻

alzzzz

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

👏🏻Supporters

Stargazers repo roster for @wuba/fair

Forkers repo roster for @wuba/fair

License

Copyright (C) 2005-present, 58.com. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the following
  disclaimer in the documentation and/or other materials provided
  with the distribution.
* Neither the name of 58.com nor the names of its
  contributors may be used to endorse or promote products derived
  from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

A Flutter package used to update widget tree dynamically. Flutter Fair是为Flutter设计的,UI&模板动态化框架

Resources

License

BSD-3-Clause, BSD-3-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE
BSD-3-Clause
LICENSE-FLUTTER

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 85.8%
  • Java 7.1%
  • JavaScript 5.9%
  • Objective-C 0.6%
  • Ruby 0.2%
  • HTML 0.1%
  • Other 0.3%