Git Product home page Git Product logo

flutter-weui's Introduction

flutter-weui源码

weui pub package

用flutter实现的weui框架, 实现了weui大部分的组件, 同时支持android 和 ios, 欢迎大家使用和交流

app下载

  • ios 暂无下载地址, 需手动执行安装

预览图

  

  

安装

weui: 0.0.8

如何运行案例

1. clone 代码

git clone https://github.com/allan-hx/flutter-weui.git

2. 安装依赖

flutter packages get

3. 进入flutter-weui-example目录 执行以下命令

flutter run

flutter-weui's People

Contributors

hxlovexc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-weui's Issues

关于`WeInput`异步设置默认值问题的解决方案

WeInput中暴露setText方法:

  void setText(value) {
    if (widget.onChange is Function) {
      widget.onChange(value);
    }
    _setValue(value);
  }
final GlobalKey<WeInputState> phoneInputStateKey = new GlobalKey<WeInputState>();
  @override
  void initState() {
    super.initState();
    JavaBridge.getPhoneNumber().then((value) {
      phoneInputStateKey.currentState.setText(value);
    });
  }
        WeInput(
          key: phoneInputStateKey,
          label: '账号',
          hintText: '请输入您的手机号',
          clearable: true,
          type: TextInputType.text,
          onChange: (value) {},
        ),

flutter 2.0似乎不兼容

./../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/weui-0.0.8/lib/theme/index.dart:86:20: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
return context.inheritFromWidgetOfExactType(WeUi);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

能否提供PreView相关组件?

非常感谢作者提供weui风格的flutter组件。在weui reactjs版本中有下列组件:

Preview
PreviewHeade
PreviewBody
PreviewItem
近期有计划开发这些组件吗?

有没有添加表单验证的计划啊

现在的表单有以下不太友好的地方:

  1. 没有办法制御(限制输入数字等)
  2. 没有办法提示验证错误(原生的表单是可以的)

这两点我感觉是项目中必备的。

关于夜间模式的支持?

好多组件默认都把背景色写死了,以至于不能正常支持夜间模式。比如cell/index.dart的第44行为Colors.white,可考虑改为WeUi.getTheme(context).defaultBackgroundColor.withAlpha(50)以便支持夜间模式。
夜间模式/自定义色彩配置示例:

...
    return WeUi(
      theme: WeTheme(
        defaultBackgroundColor: _themeData.backgroundColor,
        defaultBorderColor: _themeData.dividerColor,
        primaryColor: _themeData.primaryColor,
        primaryColorDisabled: _themeData.primaryColor.withAlpha(50),
        warnColor: _themeData.errorColor,
        warnColorDisabled: _themeData.errorColor.withAlpha(50),
      ),
      config: WeConfig(
        toastSuccessDuration: 4500,
        notifyDuration: 5000,
      ),
      child: _buildMaterialApp(homeWidget),
    );
...

有编译警告(button/index.dart)

info • This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final:
WeButton.child, WeButton.sizeType, WeButton.theme, WeButton.size • cmps/weui/button/index.dart:13:7 • must_be_immutable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.