搜索插件、代码仓与 APP 分类

appflowy_board 封面
插件详情v0.1.2

appflowy_board

AppFlowyBoard 是一个基于面板的组件,由多个分组组成。它支持在不同分组之间进行拖放操作。

AndroidiOSmacOSWindowsLinux
近 30 天下载
3040
喜欢数
225
Pub 分数
130

安装插件

flutter pub add appflowy_board

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

AppFlowyBoard 是一个 Flutter 小部件,专为创建具有多个组的板式界面而设计,支持组间直观的拖放交互。它非常适合以可视化、灵活的布局来组织任务、项目或内容。该小部件支持跨平台使用,兼容 Android、iOS、macOS、Windows 和 Linux。它是 AppFlowy 生态系统的一部分,强调生产力和用户友好的数据管理。其模块化设计使开发者能够无缝自定义组行为和项目交互。

适合场景

  • 任务管理
  • 项目规划
  • 内容组织
  • 可视化工作流设计
  • 协作编辑

主要特点

  • 多组板布局
  • 组间拖放
  • 跨平台支持
  • 可自定义的组项目
  • 可扩展的 UI 组件

适合对象

  • 生产力应用
  • 看板式工具
  • 仪表板构建器
  • 开发者工具
  • 交互式数据展示

使用建议

  • 需要了解 Flutter 手势
  • 可能需要额外的状态管理
  • 除了 GitHub 外,文档有限
  • 最适合中到大型棋盘
  • 依赖 AppFlowy 生态系统以实现完整功能

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

appflowy_board

AppFlowy Board

A customizable and draggable Kanban Board widget for Flutter

Discord • Twitter

AppFlowyBoard

Intro

appflowy_board is a customizable and draggable Kanban Board widget for Flutter. You can use it to create a Kanban Board tool like those in Trello.

Check out appflowy_board to see to build a BoardView database.

AppFlowyBoard

Getting Started

Add the AppFlowy Board Flutter package to your environment.

With Flutter:

flutter pub add appflowy_board
flutter pub get

This will add a line like this to your package's pubspec.yaml:

dependencies:
  appflowy_board: ^0.1.0

Create your first board

Initialize an AppFlowyBoardController for the board. It contains the data used by the board. You can register callbacks to receive the changes of the board.


final AppFlowyBoardController controller = AppFlowyBoardController(
  onMoveGroup: (fromGroupId, fromIndex, toGroupId, toIndex) {
    debugPrint('Move item from $fromIndex to $toIndex');
  },
  onMoveGroupItem: (groupId, fromIndex, toIndex) {
    debugPrint('Move $groupId:$fromIndex to $groupId:$toIndex');
  },
  onMoveGroupItemToGroup: (fromGroupId, fromIndex, toGroupId, toIndex) {
    debugPrint('Move $fromGroupId:$fromIndex to $toGroupId:$toIndex');
  },
);

Provide an initial value of the board by initializing the AppFlowyGroupData. It represents a group data and contains list of items. Each item displayed in the group requires to implement the AppFlowyGroupItem class.


void initState() {
  final group1 = AppFlowyGroupData(id: "To Do", items: [
    TextItem("Card 1"),
    TextItem("Card 2"),
  ]);
  final group2 = AppFlowyGroupData(id: "In Progress", items: [
    TextItem("Card 3"),
    TextItem("Card 4"),
  ]);

  final group3 = AppFlowyGroupData(id: "Done", items: []);

  controller.addGroup(group1);
  controller.addGroup(group2);
  controller.addGroup(group3);
  super.initState();
}

class TextItem extends AppFlowyGroupItem {
  final String s;
  TextItem(this.s);

  @override
  String get id => s;
}

Finally, return a AppFlowyBoard widget in the build method.


@override
Widget build(BuildContext context) {
  return AppFlowyBoard(
    controller: controller,
    cardBuilder: (context, group, groupItem) {
      final textItem = groupItem as TextItem;
      return AppFlowyGroupCard(
        key: ObjectKey(textItem),
        child: Text(textItem.s),
      );
    },
    groupConstraints: const BoxConstraints.tightFor(width: 240),
  );
}

Usage Example

To quickly grasp how it can be used, look at the /example/lib folder. First, run main.dart to play with the demo.

Second, let's delve into multi_board_list_example.dart to understand a few key components:

  • A Board widget is created via instantiating an AppFlowyBoard object.
  • In the AppFlowyBoard object, you can find the AppFlowyBoardController, which is defined in board_data.dart, is fed with pre-populated mock data. It also contains callback functions to materialize future user data.
  • Three builders: AppFlowyBoardHeaderBuilder, AppFlowyBoardFooterBuilder, AppFlowyBoardCardBuilder. See below image for what they are used for.

AppFlowyBoard

Glossary

Please refer to the API documentation.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Please look at CONTRIBUTING.md for details.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目