A Flutter package used to update widget tree dynamically

Overview

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.

Quick Start

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:
    path: ../fair/fair

# add compiler dependency
dev_dependencies:
  build_runner: ^1.4.0
  fair_compiler:
    path: ../fair/compiler
 
# switch "fair_version" according to the local Flutter SDK version
dependency_overrides:
  fair_version:
    path: ../fair/flutter_version/flutter_2_0_6

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

Support

The simplest way to show us your support is by giving the project a star.

Comments
  • run build_runner build error

    run build_runner build error

    问题

    执行 flutter pub run build_runner build 转换时,报错。

    Bad state: Unexpected diagnostics:
    /Users/yyinc/fvm/versions/2.5.0/bin/cache/dart-sdk/lib/core/int.dart:117:18 - Operator declarations must be preceded by the keyword 'operator'.
    /Users/yyinc/fvm/versions/2.5.0/bin/cache/dart-sdk/lib/core/int.dart:117:16 - Methods must have an explicit list of parameters.
    /Users/yyinc/fvm/versions/2.5.0/bin/cache/dart-sdk/lib/core/int.dart:117:18 - A function body must be provided.
    

    环境信息

    [✓] Flutter (Channel unknown, 2.5.0, on macOS 11.5.2 20G95 darwin-x64, locale zh-Hans-CN)
        • Flutter version 2.5.0 at /Users/yyinc/fvm/versions/2.5.0
        • Upstream repository unknown
        • Framework revision 4cc385b4b8 (3 months ago), 2021-09-07 23:01:49 -0700
        • Engine revision f0826da7ef
        • Dart version 2.14.0
        • Flutter download mirror https://storage.flutter-io.cn
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/yyinc/Library/Android/sdk
        ✗ cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 13.0, Build version 13A233
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin version 203.7759
    
    [✓] VS Code (version 1.62.3)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.28.0
    
    [✓] Connected device (3 available)
        • V1824BA (mobile) • 9ce2cf42                  • android-arm64  • Android 11 (API 30)
        • iPhone (mobile)  • 00008030-001269112EE3402E • ios            • iOS 14.8.1 18H107
        • Chrome (web)     • chrome                    • web-javascript • Google Chrome 96.0.4664.55
    
    ! Doctor found issues in 1 category.
    

    复现步骤

    在 master 分支下的 fair example 运行命令。

    commit: e76062a61da0de870862b2897b032e1fb6fafd87

    opened by silan-liu 18
  • Fair2.0执行flutter pub run build_runner build问题

    Fair2.0执行flutter pub run build_runner build问题

    问题

    执行flutter pub run build_runner build无法获得产物

    环境信息

    likairandeMacBook-Pro:fair_list_demo zyb$ flutter --version
    Flutter 2.0.6 • channel unknown • unknown source
    Framework • revision 1d9032c7e1 (4 months ago) • 2021-04-29 17:37:58 -0700
    Engine • revision 05e680e202
    Tools • Dart 2.12.3
    
    likairandeMacBook-Pro:fair_list_demo zyb$ flutter doctor --verbose
    [✓] Flutter (Channel unknown, 2.0.6, on macOS 11.0.1 20B50 darwin-x64, locale zh-Hans-CN)
        • Flutter version 2.0.6 at /Users/zyb/flutter
        • Framework revision 1d9032c7e1 (4 months ago), 2021-04-29 17:37:58 -0700
        • Engine revision 05e680e202
        • Dart version 2.12.3
        • Pub download mirror https://pub.flutter-io.cn
        • Flutter download mirror https://storage.flutter-io.cn
    

    Fair版本号

    dependencies:
      fair: x.y.z
    fair main分支,
    commit 241fa80c0ca84a9da1376a6004f02b99f0ad6c50
    
    image

    操作过程

    以samples/fair_list_demo为例 image

    likairandeMacBook-Pro:fair_list_demo zyb$ flutter pub run build_runner build
    [INFO] Generating build script...
    [INFO] Generating build script completed, took 385ms
    
    [INFO] Creating build script snapshot......
    [INFO] Creating build script snapshot... completed, took 11.0s
    
    [INFO] Initializing inputs
    [INFO] Building new asset graph...
    [INFO] Building new asset graph completed, took 625ms
    
    [INFO] Checking for unexpected pre-existing outputs....
    [INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
    
    [INFO] Running build...
    [WARNING] fair_compiler:fairc on lib/main.dart:
    Your current `analyzer` version may not fully support your current SDK version.
    
    Please try upgrading to the latest `analyzer` by running `flutter packages upgrade`.
    
    Analyzer language version: 2.10.0
    SDK language version: 2.12.0
    
    If you are getting this message and have the latest analyzer please file
    an issue at https://github.com/dart-lang/sdk/issues/new with the title
    "No published analyzer available for language version 2.12.0".
    Please search the issue tracker first and thumbs up and/or subscribe to
    existing issues if present to avoid duplicates.
    
    [INFO] Generating SDK summary...
    [SEVERE] fair_compiler:fairc on lib/main.dart:
    
    Bad state: Unexpected diagnostics:
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:166:25 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:539:15 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:390:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:30:49 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:62 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:42:22 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:327:34 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:376:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:516:13 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:224:29 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:65:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:58:17 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:41:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:29 - This requires the 'non-nullable' language feature to be enabled.
    [SEVERE] fair_compiler:fairc on lib/main.dart:
    
    Bad state: Unexpected diagnostics:
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:166:25 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:539:15 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:390:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:30:49 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:62 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:42:22 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:327:34 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:376:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:516:13 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:224:29 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:65:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:58:17 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:41:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:29 - This requires the 'non-nullable' language feature to be enabled.
    [SEVERE] fair_compiler:fairc on lib/main.dart:
    
    Bad state: Unexpected diagnostics:
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:166:25 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:539:15 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:390:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:30:49 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:62 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:42:22 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:327:34 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:376:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:516:13 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:224:29 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:65:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:58:17 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:41:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:29 - This requires the 'non-nullable' language feature to be enabled.
    [SEVERE] fair_compiler:fairc on lib/main.dart:
    
    Bad state: Unexpected diagnostics:
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:166:25 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:539:15 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:390:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:30:49 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:62 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:42:22 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:327:34 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:376:19 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:516:13 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:224:29 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:65:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:58:17 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:41:23 - This requires the 'non-nullable' language feature to be enabled.
    /Users/zyb/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:29 - This requires the 'non-nullable' language feature to be enabled.
    [INFO] 2.6s elapsed, 1/4 actions completed.
    [INFO] 3.7s elapsed, 1/4 actions completed.
    [INFO] 4.7s elapsed, 1/4 actions completed.
    [INFO] 5.7s elapsed, 1/4 actions completed.
    [INFO] 6.8s elapsed, 1/4 actions completed.
    [INFO] 7.9s elapsed, 1/4 actions completed.
    [INFO] 8.9s elapsed, 1/4 actions completed.
    [INFO] 10.0s elapsed, 1/4 actions completed.
    [INFO] 11.1s elapsed, 1/4 actions completed.
    [INFO] 12.2s elapsed, 1/4 actions completed.
    [INFO] 13.3s elapsed, 1/4 actions completed.
    [INFO] 14.4s elapsed, 1/4 actions completed.
    [INFO] 15.5s elapsed, 1/4 actions completed.
    [WARNING] No actions completed for 15.0s, waiting on:
      - fair_compiler:fairc on lib/JRList.dart
      - fair_compiler:fairc on lib/my_list.dart
      - fair_compiler:fairc on lib/list_proxy.dart
    

    之后会一直循环输出

    [INFO] 17.6s elapsed, 1/4 actions completed.
    [INFO] 18.7s elapsed, 1/4 actions completed.
    [INFO] 19.8s elapsed, 1/4 actions completed.
    [INFO] 20.9s elapsed, 1/4 actions completed.
    [INFO] 22.0s elapsed, 1/4 actions completed.
    [INFO] 23.1s elapsed, 1/4 actions completed.
    [INFO] 24.1s elapsed, 1/4 actions completed.
    [INFO] 25.2s elapsed, 1/4 actions completed.
    [INFO] 26.3s elapsed, 1/4 actions completed.
    [INFO] 27.4s elapsed, 1/4 actions completed.
    [INFO] 28.5s elapsed, 1/4 actions completed.
    [INFO] 29.6s elapsed, 1/4 actions completed.
    [INFO] 30.7s elapsed, 1/4 actions completed.
    [WARNING] No actions completed for 15.1s, waiting on:
      - fair_compiler:fairc on lib/JRList.dart
      - fair_compiler:fairc on lib/my_list.dart
      - fair_compiler:fairc on lib/list_proxy.dart
    

    请问是设置的问题吗,.dart_tool文件夹删除过并没有解决问题 如何才能输出json文件

    opened by Karl87 10
  • 打开demo中的page_two出现异常错误:exceptionValue:TypeError: undefined is not an object

    打开demo中的page_two出现异常错误:exceptionValue:TypeError: undefined is not an object

    问题

    打开demo中的page_two出现异常错误:exceptionValue:TypeError: undefined is not an object

    页面源码:

    Navigator.pushNamed(context, 'fair_page_two', arguments: { 'path': 'assets/fair/lib_developer_page2page_page_two.fair.json', 'data': {'title': 'PageTwo'} });

    import 'package:fair/fair.dart'; import 'package:flutter/material.dart';

    @FairPatch() class PageTwo extends StatefulWidget { PageTwo({Key? key, this.fairProps}) : super(key: key);

    dynamic fairProps;

    @override _PageTwoState createState() => _PageTwoState(); }

    class _PageTwoState extends State { @FairProps() var fairProps;

    @override void initState() { super.initState(); fairProps = widget.fairProps; }

    String getTitle() { return fairProps['title']; }

    @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( /// 如果需要进行字符串拼接的话,在build()方法里进行拼接即可,不建议在getTitle() /// 方法里做字符串拼接 title: Text('参数:${getTitle()}'), ), body: Container( child: Padding( padding: EdgeInsets.all(20), child: Text('xxxxx'), )), ); } }

    错误日志: [Fair]: File:FairDartBridge.m, Function:-[FairDartBridge obtainModelWithMessage:], Line:103 >> {"path":"GLOBAL['null#1']=(function(initProps){const global=this;return runCallback(function(mod){with(mod.imports){function _PageTwoState(){const inner=_PageTwoState.inner;if(this==global){return new _PageTwoState({args:arguments});}else{const args=arguments.length>0?arguments[0].args||arguments:[];inner.apply(this,args);_PageTwoState.prototype.ctor.apply(this,args);return this;}}_PageTwoState.inner=function inner(){this.fairProps=initProps;};_PageTwoState.prototype={initState:function initState(){const thiz=this;with(thiz){fairProps=widget.fairProps;}},getTitle:function getTitle(){const thiz=this;with(thiz){return fairProps.op_idx('title');}},};_PageTwoState.prototype.ctor=function(){Object.prototype.ctor.call(this);};;return _PageTwoState();}},[]);})(convertObjectLiteralToSetOrMap(JSON.parse('{"title":"PageTwo"}')));","pageName":"null#1"} [Fair]: File:FairProcessManager.m, Function:-[FairProcessManager injectionJSScriptWtihJSScript:callback:], Line:59 >> GLOBAL['null#1']=(function(initProps){const global=this;return runCallback(function(mod){with(mod.imports){function _PageTwoState(){const inner=_PageTwoState.inner;if(this==global){return new _PageTwoState({args:arguments});}else{const args=arguments.length>0?arguments[0].args||arguments:[];inner.apply(this,args);_PageTwoState.prototype.ctor.apply(this,args);return this;}}_PageTwoState.inner=function inner(){this.fairProps=initProps;};_PageTwoState.prototype={initState:function initState(){const thiz=this;with(thiz){fairProps=widget.fairProps;}},getTitle:function getTitle(){const thiz=this;with(thiz){return fairProps.op_idx('title');}},};_PageTwoState.prototype.ctor=function(){Object.prototype.ctor.call(this);};;return _PageTwoState();}},[]);})(convertObjectLiteralToSetOrMap(JSON.parse('{"title":"PageTwo"}'))); [Fair]: File:FairJSBridge.m, Function:-[FairJSBridge context]_block_invoke, Line:220 >> exceptionValue:ReferenceError: Can't find variable: GLOBAL [Fair]:

    环境信息

    [✓] Flutter (Channel stable, 2.10.5, on macOS 12.3 21E230 darwin-arm, locale zh-Hans-CN) • Flutter version 2.10.5 at /Users/xxx/fvm/versions/2.10.5 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (4 months ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

    提供Fair版本号
    

    dependencies: fair: ^2.6.1

    相关截图 WX20220810-112618

    opened by softAlexs 8
  • dart2dsl和json_serializable冲突

    dart2dsl和json_serializable冲突

    dart2dsl中AstNodeMapBuilder没有指定generatedExtension,导致与json_serializable冲突出错。 报错:Both fair_dart2dsl:ast_node_map_builder and source_gen:combining_builder may output test/widget_test.g.dart. Potential outputs must be unique across all builders. See https://github.com/dart-lang/build/blob/master/docs/faq.md#why-do-builders-need-unique-outputs。

    opened by cuocuo 5
  • flutter 3.3.0+ support

    flutter 3.3.0+ support

    Support flutter 3.3.0. Fix Shortcuts supports. See flutter/flutter#104215 & https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.3.0.

    opened by hlwhl 4
  • can not compiler the demo DynamicWidget!!!!

    can not compiler the demo DynamicWidget!!!!

    C:\Users\asus>flutter --version Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 7891006299 (3 months ago) • 2020-12-10 11:54:40 -0800 Engine • revision ae90085a84 Tools • Dart 2.10.4

    error as flow:

    [SEVERE] fair_compiler:fairc on lib/gunview/dynamicwidget.dart:

    line 1, column 42 of package:flutterapp/gunview/dynamicwidget.dart: Could not resolve annotation for class DynamicWidget exten ds StatelessWidget ╷ 1 │ @FairBinding() │ ^^^^^^^^^^^^^^ ╵ [INFO] 14.9s elapsed, 2/3 actions completed.

    bug 
    opened by yejianhui168 4
  • demo在iOS 10系统上运行报错

    demo在iOS 10系统上运行报错

    问题

    Text(_name)这种写法在iOS10系统上无法被正确解析。自带的demo是可以完全复现的。 在执行到bind_data->bindRuntimeValueOf的方法,var result = _functions?['runtimeParseVar']?.call({name: ''});这个语句返回的result为undefined。

    环境信息

    • iOS: 10.3.3

    • Flutter SDK:2.8.1

    • Dart SDK:2.15.1

    • fair: ^2.7.0

    • build_runner: ^2.1.1

    • fair_compiler: ^1.2.0

    @avenwu

    opened by cuocuo 3
  • 项目中引入 Fair 后,构建出 Release 包,安装后启动 APP 直接闪退

    项目中引入 Fair 后,构建出 Release 包,安装后启动 APP 直接闪退

    问题

    在本地一个 demo 工程中引入了 Fair,然后使用 flutter build apk 构建出 Release 包,安装 APK,启动 APP 直接闪退。

    环境信息

    执行下面的语句,并粘贴结果

    [✓] Flutter (Channel stable, 3.0.5, on macOS 12.2.1 21D62 darwin-arm, locale
        zh-Hans-CN)
        • Flutter version 3.0.5 at /Users/chenyouyu/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f1875d570e (4 weeks ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/chenyouyu/Library/Android/sdk
        ✗ cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/macos#android-setup for
          more details.
    
    [✗] Xcode - develop for iOS and macOS
        ✗ Xcode installation is incomplete; a full installation is necessary for iOS
          development.
          Download at: https://developer.apple.com/xcode/download/
          Or install Xcode via the App Store.
          Once installed, run:
            sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
            sudo xcodebuild -runFirstLaunch
        ✗ CocoaPods not installed.
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin
            code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To install see
          https://guides.cocoapods.org/using/getting-started.html#installation for
          instructions.
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build
          11.0.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.69.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension can be installed from:
          🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [✓] Connected device (3 available)
        • JEF AN00 (mobile) • E6EDU20429059373 • android-arm64  • Android 10 (API
          29)
        • macOS (desktop)   • macos            • darwin-arm64   • macOS 12.2.1 21D62
          darwin-arm
        • Chrome (web)      • chrome           • web-javascript • Google Chrome
          104.0.5112.79
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 2 categories.
    

    提供Fair版本号

    dependencies:
      fair: 2.7.0
    

    复现操作【可选】

    1.使用 flutter build apk 构建出 Release 包; 2.安装并启动 APP,直接闪退。

    opened by yancechen 3
  • flutter pub run build_runner build 报错

    flutter pub run build_runner build 报错

    flutter版本 2.5.0 使用 flutter pub run build_runner build 转换报错

    Failed to build build_runner:build_runner: ../../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.

    • 'TargetKind' is from 'package:meta/meta_meta.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/meta_meta.dart'). Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope. var kindNames = kinds.map((kind) => kind.displayString).toList() ^^^^^^^^^^^^^ ../../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:1950:14: Context: This is one of the extension members. String get displayString { ^^^^^^^^^^^^^ ../../../../../../.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members. String get displayString { ^^^^^^^^^^^^^ ../../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List'.
    • 'List' is from 'dart:core'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'. var validKinds = kindNames.commaSeparatedWithOr; ^^^^^^^^^^^^^^^^^^^^ pub finished with exit code 1
    opened by LeeRHuang 2
  • build runner没有生成js文件(fair自带的demo工程,并且已经删除了best_ui的部分)

    build runner没有生成js文件(fair自带的demo工程,并且已经删除了best_ui的部分)

    问题: fair自带的demo,执行flutter pub run build_runner build --delete-conflicting-outputs之后无法生成js文件

    版本 Fair最新版 删掉了bestUI部分的代码,其他没变

    生成文件截图 image

    日志 % flutter pub run build_runner build --delete-conflicting-outputs

    [INFO] Generating build script... [INFO] Generating build script completed, took 408ms

    [INFO] Precompiling build script...... [INFO] Precompiling build script... completed, took 6.1s

    [INFO] There was output on stdout while precompiling the build script; run with --verbose to see it (you will need to run a clean first to re-generate it).

    [INFO] Initializing inputs [INFO] Building new asset graph... [INFO] Building new asset graph completed, took 779ms

    [INFO] Checking for unexpected pre-existing outputs.... [INFO] Deleting 1 declared outputs which already existed on disk. [INFO] Checking for unexpected pre-existing outputs. completed, took 3ms

    [INFO] Running build... [INFO] Generating SDK summary... [INFO] 3.0s elapsed, 0/13 actions completed. [INFO] Generating SDK summary completed, took 2.9s

    [INFO] 4.0s elapsed, 0/13 actions completed. [INFO] 5.0s elapsed, 0/13 actions completed. [INFO] 6.0s elapsed, 0/13 actions completed. [INFO] 7.1s elapsed, 0/13 actions completed. [INFO] 15.2s elapsed, 0/13 actions completed. [WARNING] No actions completed for 15.2s, waiting on:

    fair_compiler:fairc on lib/json_file_explain.dart fair_compiler:fairc on lib/fair_widget/fair_props_widget.dart fair_compiler:fairc on lib/fair_widget/plugin/fair_basic_plugin.dart fair_compiler:fairc on lib/fair_widget/fair_delegate_widget.dart fair_compiler:fairc on lib/fair_widget/delegate/test_fair_delegate.dart .. and 8 more [WARNING] fair_compiler:fairc on lib/fair_widget/fair_delegate_widget.dart: [Fair] Compile lib/fair_widget/fair_delegate_widget.dart into bundle... [WARNING] fair_compiler:fairc on lib/json_file_explain.dart: [Fair] Compile lib/json_file_explain.dart into bundle... [WARNING] fair_compiler:fairc on lib/fair_widget/fairbinding/fair_binding_sample.dart: [Fair] Compile lib/fair_widget/fairbinding/fair_binding_sample.dart into bundle... 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->@OverRide State createState() => _FairDelegateWidgetState();---->State 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text("fair delegate的使用")), body: ListView.builder(itemBuilder: _itemBuilder, itemCount: 10));}---->Widget 不支持的节点NamedTypeImpl<---->List getData() {return ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'];}---->List 不支持的节点NamedTypeImpl<---->Widget _itemBuilder(context, index) {return Container();}---->Widget 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->@OverRide _JsonFileExplainState createState() => _JsonFileExplainState();---->_JsonFileExplainState 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->int _counter = 0---->int 不支持的节点NamedTypeImpl<---->void _incrementCounter() {setState(() {_counter++;});}---->void 不支持的节点NamedTypeImpl<---->Widget _buildTitle() {return Text('title');}---->Widget 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: _buildTitle()), body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [const Text('You have pushed the button this many times:'), Text('$_counter', style: TextStyle(fontSize: 40, color: Color(0xffeb4237), wordSpacing: 0))])), floatingActionButton: FloatingActionButton(onPressed: _incrementCounter, tooltip: 'Increment', child: const Icon(Icons.add)));}---->Widget 不支持的节点NamedTypeImpl<---->extends StatelessWidget---->StatelessWidget 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('FairBinding 注解演示')), body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [const Text('Hello World!'), FairBindingWidget()])));}---->Widget [WARNING] fair_compiler:fairc on lib/fair_widget/fair_props_widget.dart: [Fair] Compile lib/fair_widget/fair_props_widget.dart into bundle... [WARNING] fair_compiler:fairc on lib/fair_widget/fair_plugin_widget.dart: [Fair] Compile lib/fair_widget/fair_plugin_widget.dart into bundle... 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->@OverRide State createState() => _FairPropsWidgetState();---->State 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->String fairText() {return data["fairText"];}---->String 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(backgroundColor: Colors.white, appBar: AppBar(), body: Container(child: Center(child: Text(fairText(), style: TextStyle(color: Colors.red, fontSize: 20)))));}---->Widget 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->@OverRide State createState() => _FairPluginWidgetState();---->State 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text("Fair plugin介绍和使用")), body: Container(child: Center(child: GestureDetector(onTap: callPhone, child: Container(height: 50, width: 100, alignment: Alignment.center, child: Text('拨打电话'))))));}---->Widget [WARNING] fair_compiler:fairc on lib/main.dart: [Fair] Compile lib/main.dart into bundle... 不支持的节点AwaitExpressionImpl<---->await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);---->await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]) 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->String key---->String 不支持的节点ConditionalExpressionImpl<---->=> (ModalRoute.of(context)?.settings.arguments is Map) ? (ModalRoute.of(context)?.settings.arguments as Map)[key] : null;---->(ModalRoute.of(context)?.settings.arguments is Map) ? (ModalRoute.of(context)?.settings.arguments as Map)[key] : null 不支持的节点NamedTypeImpl<---->extends StatelessWidget---->StatelessWidget 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return MaterialApp(title: 'Flutter Demo', theme: ThemeData(primarySwatch: Colors.blue), home: HomePage());}---->Widget 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->dynamic fairProps---->dynamic 不支持的节点NamedTypeImpl<---->@OverRide State createState() => _MyHomePageState();---->State 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->int _counter = 0---->int 不支持的节点SuperExpressionImpl<---->super.initState()---->super 不支持的节点AssignmentExpressionImpl<---->fairProps = widget.fairProps;---->fairProps = widget.fairProps 不支持的节点NamedTypeImpl<---->@OverRide void initState() {super.initState(); fairProps = widget.fairProps;}---->void 不支持的节点NamedTypeImpl<---->String getTitle() {return fairProps['title'];}---->String 不支持的节点NamedTypeImpl<---->void _incrementCounter() {setState(() {_counter++;});}---->void 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text(getTitle())), body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [const Text('You have pushed the button this many times:'), Text('$_counter', style: TextStyle(fontSize: 40, color: Color(0xffeb4237), wordSpacing: 0))])), floatingActionButton: FloatingActionButton(onPressed: _incrementCounter, tooltip: 'Increment', child: const Icon(Icons.add)));}---->Widget [WARNING] fair_compiler:fairc on lib/page2page/page_two.dart: [Fair] Compile lib/page2page/page_two.dart into bundle... [WARNING] fair_compiler:fairc on lib/page2page/page_one.dart: [Fair] Compile lib/page2page/page_one.dart into bundle... 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->dynamic fairProps---->dynamic 不支持的节点NamedTypeImpl<---->@OverRide _PageTwoState createState() => _PageTwoState();---->_PageTwoState 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点SuperExpressionImpl<---->super.initState()---->super 不支持的节点AssignmentExpressionImpl<---->fairProps = widget.fairProps;---->fairProps = widget.fairProps 不支持的节点NamedTypeImpl<---->@OverRide void initState() {super.initState(); fairProps = widget.fairProps;}---->void 不支持的节点NamedTypeImpl<---->String getTitle() {return fairProps['title'];}---->String 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('参数:${getTitle()}')), body: Container(child: Padding(padding: EdgeInsets.all(20), child: Text('xxxxx'))));}---->Widget 不支持的节点NamedTypeImpl<---->extends StatefulWidget---->StatefulWidget 不支持的节点NamedTypeImpl<---->@OverRide _PageOneState createState() => _PageOneState();---->_PageOneState 不支持的节点NamedTypeImpl<---->extends State---->State 不支持的节点NamedTypeImpl<---->BuildContext context---->BuildContext 不支持的节点NamedTypeImpl<---->@OverRide Widget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('PageOne')), body: Container(child: Padding(padding: EdgeInsets.all(20), child: Text('点击右下角按钮跳转到下个页面'))), floatingActionButton: FloatingActionButton(onPressed: () {Navigator.pushNamed(context, 'fair_page_two', arguments: {'path' : 'assets/fair/lib_page2page_page_two.fair.json', 'data' : {'title' : 'PageTwo'}});}, tooltip: 'Increment', child: const Icon(Icons.arrow_forward_sharp)));}---->Widget [WARNING] fair_compiler:package on lib/$lib$: FairBindingWidget 😀 [WARNING] fair_compiler:package on lib/$lib$: constructors ➡️ [WARNING] fair_compiler:package on lib/$lib$: FairBindingWidget [WARNING] fair_compiler:package on lib/$lib$: constructors ⬅️️ [WARNING] fair_compiler:package on lib/$lib$: skip _FairBindingWidgetState [WARNING] fair_compiler:package on lib/$lib$: 😀 1 widgets found inside /Users/******/Downloads/Fair-3.0.0 2/example/.dart_tool/build/fairc/source/example/lib/fair_widget/fairbinding/fair_binding_widget.fair.dart [WARNING] fair_compiler:package on lib/$lib$: ➡️ FairBindingWidget({Key key, }) [WARNING] fair_compiler:package on lib/$lib$: [Fair] New binding generated. package:example/src/generated.fair.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/json_file_explain.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/json_file_explain.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/json_file_explain.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/json_file_explain.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_delegate_widget.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/fair_widget/fair_delegate_widget.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_delegate_widget.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/fair_widget/fair_delegate_widget.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fairbinding/fair_binding_sample.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/fair_widget/fairbinding/fair_binding_sample.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fairbinding/fair_binding_sample.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/fair_widget/fairbinding/fair_binding_sample.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_props_widget.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/fair_widget/fair_props_widget.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_props_widget.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/fair_widget/fair_props_widget.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_plugin_widget.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/fair_widget/fair_plugin_widget.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_plugin_widget.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/fair_widget/fair_plugin_widget.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/main.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/main.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/main.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/main.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_two.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/page2page/page_two.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_two.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/page2page/page_two.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_one.bundle.json: [Fair Dart2JS] partPath => /Users/******/Downloads/Fair-3.0.0 2/example/lib/page2page/page_one.dart [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_one.bundle.json: [Fair Dart2JS] e => FileSystemException(path=/Users/******/Downloads/Fair-3.0.0%202/example/lib/page2page/page_one.dart; message=Cannot open file) [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_delegate_widget.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_fair_widget_fair_delegate_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_delegate_widget.bundle.json: [Fair] New bundle generated => build/fair/lib_fair_widget_fair_delegate_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_delegate_widget.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/json_file_explain.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_json_file_explain.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/json_file_explain.bundle.json: [Fair] New bundle generated => build/fair/lib_json_file_explain.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/json_file_explain.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fairbinding/fair_binding_sample.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_fair_widget_fairbinding_fair_binding_sample.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fairbinding/fair_binding_sample.bundle.json: [Fair] New bundle generated => build/fair/lib_fair_widget_fairbinding_fair_binding_sample.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fairbinding/fair_binding_sample.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_props_widget.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_fair_widget_fair_props_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_props_widget.bundle.json: [Fair] New bundle generated => build/fair/lib_fair_widget_fair_props_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_props_widget.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_plugin_widget.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_fair_widget_fair_plugin_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_plugin_widget.bundle.json: [Fair] New bundle generated => build/fair/lib_fair_widget_fair_plugin_widget.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/fair_widget/fair_plugin_widget.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/main.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_main.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/main.bundle.json: [Fair] New bundle generated => build/fair/lib_main.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/main.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_two.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_page2page_page_two.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_two.bundle.json: [Fair] New bundle generated => build/fair/lib_page2page_page_two.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_two.bundle.json: [fair] fair_config.json cannot be found [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_one.bundle.json: [Fair] FlatBuffer format generated for build/fair/lib_page2page_page_one.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_one.bundle.json: [Fair] New bundle generated => build/fair/lib_page2page_page_one.fair.json [WARNING] Instance of 'ArchiveBuilder' on example|lib/page2page/page_one.bundle.json: [fair] fair_config.json cannot be found [INFO] Running build completed, took 23.5s

    [INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 44ms

    [INFO] Succeeded after 23.6s with 10 outputs (50 actions)

    环境:flutter doctor --verbose [✓] Flutter (Channel stable, 3.3.2, on macOS 12.2.1 21D62 darwin-x64, locale zh-Hans-CN) • Flutter version 3.3.2 on channel stable at /Users/******/Dev/Flutter/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision e3c29ec00c (3 months ago), 2022-09-14 08:46:55 -0500 • Engine revision a4ff2c53d8 • Dart version 2.18.1 • DevTools version 2.15.0 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/******/Library/Android/sdk ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13F100 • CocoaPods version 1.11.2

    [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 48.1.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

    [✓] VS Code (version 1.73.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.54.0

    [✓] Connected device (3 available) • iPhone 12 Pro (mobile) • 23E5780C-5DDC-4573-91C1-7C25F2699A51 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 12.2.1 21D62 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.94

    [✓] HTTP Host Availability • All required HTTP hosts are available

    ! Doctor found issues in 1 category.

    opened by tangTBug 1
  • 执行flutter pub run build_runner build 命令 没有生成目录及任何文件

    执行flutter pub run build_runner build 命令 没有生成目录及任何文件

    环境信息

    执行下面的语句,并粘贴结果

    flutter doctor --verbose
    

    flutter版本

    2.10.5
    

    yaml文件配置

    dependencies:
      fair: fair-2.6.1
    dev_dependencies:
     fair-2.6.1/compiler
     build_runner: 2.2.0
    dependency_overrides:
     fair_version:fair-2.6.1/flutter_version/flutter_2_10_0
    

    相关截图【可选】

    image image image image

    其他【可选】 代码为文档提供的计数器案例代码,没有改动

    opened by a1239897580 1
  • This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

    This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

    环境: fair 3.0.0

    错误信息: This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

    • file:///Users/cinson/.pub-cache/hosted/pub.flutter-io.cn/fair_version-3.0.0+2/lib/src/widgets/$$w.dart:3648:30 FAILURE: Build failed with an exception.

    暂时加上--no-tree-shake-icons规避了一下,但是还是fair本身要解决一下这个问题

    opened by cinsondev 0
  • - assets/images/ 无效的资源路径

    - assets/images/ 无效的资源路径

    错误信息: Error: unable to find directory entry in pubspec.yaml: /Users/cinson/.pub-cache/hosted/pub.flutter-io.cn/fair-3.0.0/assets/images/

    查看fair_release_3.0分支和v3.0.0的tag,发现代码有差异,tag中多引了- assets/images/ ,但是asset中并没有这个目录

    麻烦重新打下tag

    opened by cinsondev 3
  • 这个能用Windows开发么?   Can I develop it with Windows???

    这个能用Windows开发么? Can I develop it with Windows???

    Windows开发寸步难行,一大堆坑,第一步就出问题。

    执行 faircli create -n dynamic_project_name 就报错了: Creating dynamic project from template, wait a moment please... Failed to create project LocalDirectory: 'D:\Android\workspace\dynamic_project_name': ProcessException: 系统找不到指定的文件。

    Command: /bin/sh project_rename.sh dynamic_project_name D:\Android\workspace\dynamic_project_name com.example.fair_template app_name fair_template

    有没有趟过坑的大佬们, 求指导

    opened by hust-MC 5
  • 生成的js代码语法错误

    生成的js代码语法错误

    本地环境

     Flutter (Channel stable, 3.0.3, on macOS 13.0 22A380 darwin-arm (Rosetta), locale zh-Hans-CN)
        • Flutter version 3.0.3 at  /fvm/versions/3.0.3
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 676cefaaff (4 months ago), 2022-06-22 11:34:49 -0700
        • Engine revision ffe7b86a1e
        • Dart version 2.17.5
        • DevTools version 2.12.2
        • Pub download mirror https://pub.flutter-io.cn
        • Flutter download mirror https://storage.flutter-io.cn
    
    

    image 这部分代码进行fair改造。当然并没有一次性全部代码改为fair,而是将 item抽取为一个widget。代码如下

    image image image fair对应的json

    {
      "className": "Container",
      "na": {
        "height": 216,
        "width": 400,
        "child": {
          "className": "ListView",
          "na": {
            "padding": {
              "className": "EdgeInsets.only",
              "na": {
                "top": 0,
                "bottom": 0,
                "right": 16,
                "left": 16
              }
            },
            "scrollDirection": "#(Axis.horizontal)",
            "children": {
              "className": "Sugar.map",
              "pa": [
                "#(MealsListData.tabIconsList)"
              ],
              "na": {
                "builder": {
                  "className": "MealsView",
                  "na": {
                    "mealsListData": "^(item)"
                  }
                }
              }
            }
          }
        }
      },
      "methodMap": {}
    }
    

    对应的js

    GLOBAL['#FairKey#']=(function(__initProps__){const __global__=this;defineModule(1,function(__mod__){with(__mod__.imports){function MealsView(){const inner=MealsView.__inner__;if(this==__global__){return new MealsView({__args__:arguments});}else{const args=arguments.length>0?arguments[0].__args__||arguments:[];inner.apply(this,args);MealsView.prototype.ctor.apply(this,args);return this;}}MealsView.__inner__=function inner(){StatelessWidget.__inner__.call(this);this.mealsListData=null;};MealsView.prototype={ctor:function ctor({key,mealsListData}={}){const __thiz__=this;const __arg_ctx__={key,mealsListData,};with(__thiz__){with(__arg_ctx__){this.mealsListData=mealsListData;StatelessWidget.prototype.ctor.call(__thiz__,key:key);}}},};inherit(MealsView,StatelessWidget);}__mod__.exports.MealsView=MealsView;},[]);return runCallback(function(__mod__){with(__mod__.imports){function _MealsListViewState(){const inner=_MealsListViewState.__inner__;if(this==__global__){return new _MealsListViewState({__args__:arguments});}else{const args=arguments.length>0?arguments[0].__args__||arguments:[];inner.apply(this,args);_MealsListViewState.prototype.ctor.apply(this,args);return this;}}_MealsListViewState.__inner__=function inner(){};_MealsListViewState.prototype={};_MealsListViewState.prototype.ctor=function(){Object.prototype.ctor.call(this);};;return _MealsListViewState();}},[1]);})(convertObjectLiteralToSetOrMap(JSON.parse('#FairProps#')));
    

    错误信息 image

    opened by justLXX 1
Releases(v3.0.0)
Owner
Wuba
Wuba Open Source
Wuba
Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

widget_tree_depth_counter Widget Tree Depth Counter WidgetTreeDepthCounter is a simple widget to count the amount of nested widget tree, useful in the

Riccardo Cucia 4 Aug 1, 2022
🆙🚀 Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in

???? Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in (with notice bar progress), supports full upgrade, hot update and incremental upgrade

PengHui Li 344 Dec 30, 2022
Behruz Hurramov 0 Dec 29, 2021
A Flutter widget to dynamically add links to your text.

linkable A Flutter widget to add links to your text. By default, the Text or RichText widgets render the URLs in them as simple text which are not cli

Anup Kumar Panwar 18 Dec 15, 2021
MindInventory 15 Sep 5, 2022
Achieve ~60 FPS, no matter how heavy the tree is to build/layout

flutter_smooth Achieve ~60 FPS, no matter how heavy the tree is to build/layout. ?? 3-second video output_small.mp4 (left = without smooth, right = sm

fzyzcjy 1k Jan 9, 2023
Dynamically themed Music Player built with flutter

?? Flutter Music Player Contact me email: [email protected] Gitter: https://gitter.im/Moda20TuneIn/community Thank you in advance ?? Getting Started

null 135 Dec 31, 2022
A Flutter plugin than allow expand and collapse text dynamically

readmore A Flutter plugin than allow expand and collapse text. usage: add to your pubspec readmore: ^1.0.2 and import: import 'package:readmore/readm

Jonny Borges 173 Dec 28, 2022
Flutter dynamically load translation in your app.

Flutter dynamically load translation in your app.

null 1 Apr 4, 2022
Polymaker is an application that can create polygon locations dynamically in mobile apps and save the data into SQFlite to be permanent.

Polymaker Polymaker is an application that can create polygon locations dynamically in mobile apps and save the data into SQFlite to be permanent. Ins

Yusril Rapsanjani 15 Apr 17, 2022
Dynamically translate text

auto_localization A new Flutter plugin. Flutter package to dynamically translate your app. This plugin will AUTOMATICALLY detect the app Localization

Matteo Sipione 5 Jan 27, 2022
Tool made in Dart that allows you to dynamically generate JSON files from data models written in Dart.

Dart JSON Generator Versión v1.1.1 Dart JSON Generator es una herramienta que permite generar archivos JSON a partir de mapas como modelos de datos en

Joinner Medina 7 Nov 23, 2022
A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A most easily usable Flutter widget about application version check! 1. About 1.

Kato Shinya 1 Dec 16, 2021
Flutter Insert, Update, Delete and add form view dynamic

salesapp Insert, Update, Delete and form view add dynamic. Getting Started This project is a starting point for a Flutter application. A few resources

null 1 Dec 22, 2021
App movil desarrollada en Flutter con manejo de GET POST UPDATE DELETE ,,etc con Firebase

productos_app Requerimientos : tener instalado extension de dart y flutter Emulador de android o dispositivo fisico /IOS Emulador Ejecutar : flutter r

Wilson Lluilema 1 Dec 10, 2021
Flutter App - Add Firebase Crud Operation can Create Delete Update Read real time data

Firebase-Crud-Operation In This Flutter App I Will Add Firebase Crud Operation like you can Create Delete Update Read real time data. Sample Images Re

Justin Roy 5 Nov 7, 2022
Rest Api Crud funtion . Created, Update, Delete , Read

flutter_application_10 A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Jamirul islam (Joy) 2 Nov 30, 2022
The prime objective of this app is to store the real time information of the user using firebase cloud firestore and also can delete, remove and update the customer information

crud_firestore A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Muhammad Zakariya 0 Mar 15, 2022