Fair 2.0 release! What’s new

# Versions

# 2.6.0

updateDate:2022.07.05

# 1.Fair supports loading bundle files on the phone disk path;

FairWidget(
  path: 'Mobile phone disk path/xxx.fair.json',
)
1
2
3

# 2. Adapt to Flutter SDK 2.10.0, 2.10.1, 2.10.2, 2.10.3;

# 3.Dart2JS supports parsing static methods;

# 4. When running, the page error message prompts optimization;

When Fair is running and an error occurs, the following prompt will appear:

Click the error icon to display the error log:

# 5. Syntactic sugar supports parsing Model data.

How to use:

Step1: Define model data:

import 'package:fair/src/render/base_model.dart';

class Person implements BaseModel{}

1
2
3
4

Need to implement toJson, add a from method

Step2: Register the model

  • define a GeneratedModule
class TestGeneratedModule implements GeneratedModule
1
  • register the model in it

  • Pass the defined GeneratedModule into the generated: parameter of FairApp initialization

Step3: Model usage, take Sugar.mapEach as an example:

  • Sugar.mapEach([Person(name: "kk",age: 18, wei: 99)], (index, Person item) {}

  • need to specify the type of item to use item.name to use its model data

  • Support to call it directly or put it in a string Text(item.name), Text("${item.age}"),

# 2.5.0

updateDate:2022.05.31

# Feature

# Fair

  • Adapt to flutter SDK 2.8.0, 2.8.1
  • Dart2js supports parsing singletons
  • New syntax sugar switchCase、Sugar. colorsWithOpacity、Sugar. Converttostring, etc

# example

Comprehensively optimize the example structure and upgrade the example experience, which is more suitable for beginners.

In the source code, an example project is added to provide the standard usage of fair API.

example location:fair/example

# Contributors


xiangwc

💻

WangYk

💻

gongpengyang

💻

qixu

💻

yangyang

💻

陈有余

💻

# 2.4.1

updateDate:2022.05.12

# Feature

# Fair

  • Fix fairlogger file import problem
  • Upgrade analyzer lib to 2.3.0

# Contributors


陈有余

💻

yangyang

💻

# 2.4.0

updateDate:2022.04.26

# Feature

# Fair

  • FlatBuffers supports generating bin files in a null safe environment

# Contributors


陈有余

💻

# 2.3.0

updateDate: 2022.04.22

# Feature

# Fair

  • supports null-safe
  • Adapt to Flutter SDK 2.5.0, 2.5.1, 2.5.2, 2.5.3 and other versions

# demo

  • Upgrade the outdated demo in the sample project
  • Supplement the iOS runtime environment in the sample project

# Contributors


gongpengyang

💻

qixu

💻

陈有余

💻

yangyang

💻

# 2.2.0

  1. Fair 2.2.0 version adds support for Flutter 2.5.0 version;
  2. Fixed some bugs.

# 2.0.0

The Fair 2.0 version adds support for logic dynamics and the Flutter 2.0 version. The logic dynamics support includes Fair Compiler tool support for Dart2JS, and third-party plug-in (network, permission, image selection) custom extension interface support.

# Fair Compiler open sourced

The Fair Compiler tool is completely open sourced this time. The Fair tool includes Dart2DSL which generates layout DSL and Dart2JS which generates logic JS. Since the compiler is in the flutter build command processing entry, but cannot be debugged when the command is running, the core conversion processing modules of dsrt2dsl and dsrt2js have been removed. Both of these modules can be debugged, and the input is the file path.

fair
├── dsrt2dsl // The tool part of dart to dsl to generate layout metadata DSL file
├── dsrt2js // The tool part of dart to dsl to generate logical JS file
└──  compiler  // flutter build automatic dynamic product generation entry
1
2
3
4

# Friendly Named

The directory name is changed from fair_version to flutter_version, and the internal is a Flutter component created when it is dynamic.

fair
└── flutter_version  // Flutter version compatible components
1
2

# Added dynamic logic processing capabilities

Fair 2.0 uses the Fair Compiler tool to extract the logical part of the Widget and convert it into a JS file, which is then sent to JSCore for processing. Android uses the V8 engine and the built-in JSCore used by iOS. Fair 2.0 In addition to JSCore processing logic, we also added Fair syntax sugar and layout method call stack processing capabilities in the JS domain.

# Third-party plug-in extension standardization

Fair 2.0 defines the IFairPlugin standard interface and the standard process for third-party plug-in access. At the same time, a demo of network, permission and picture selection is given in the example.

fair
└── fair  // fair engine module
    └── example
        └── lib/src/page
                └── plugins 
                    ├── net     // Network plug-in
                    ├── permission // Permission plug-in
                    └── pick-image // Pick image plug-in
1
2
3
4
5
6
7
8
Last Update: 7/5/2022, 5:29:57 PM
Copyright © 2020 58.com | Powered by The Fair Authors