使用 qidgets 快速构建组件层级。 快速组件 → qidgets。

特点

Qidgets 添加了快捷访问方式,用于构建常见的组件层级。

示例。

// qidgets
[
  'Hello'.wText,
  'world!'.wText,
].column.center,

// Normal
Center(
  child: Column(
    children: [
      Text('Hello'),
      Text('world!'),
    ],
  ),
),

入门

添加到 pubspec.yaml

  qidgets:
    git: https://github.com/epatel/flutter_qidgets.git

用法

使用点扩展将组件快速包装在其他组件中,例如 .red 会将任何组件包装在 color: 设置为 Colors.redContainer 中。

使用 setQidgetsValues(…) 为彩色文本扩展上的填充和颜色设置值,例如 .wHeadline4Custom()

List<Widget> 上也有扩展,可以使用 RowColumn 快速包装。

查看 lib/src/qidgets.dart 以了解其原理。

附加信息

GitHub

查看 Github