AppFlowy/frontend/app_flowy/packages/appflowy_board
2022-08-18 21:44:22 +08:00
..
example chore: add card container 2022-08-13 11:51:26 +08:00
lib chore: Update row when moving row caused cell data changed 2022-08-18 21:44:22 +08:00
test chore: rename flowy_board to appflowy_board 2022-08-08 10:27:58 +08:00
.gitignore chore: rename flowy_board to appflowy_board 2022-08-08 10:27:58 +08:00
.metadata chore: rename flowy_board to appflowy_board 2022-08-08 10:27:58 +08:00
analysis_options.yaml chore: rename flowy_board to appflowy_board 2022-08-08 10:27:58 +08:00
CHANGELOG.md chore: update appflowy_board pub.dev config 2022-08-09 10:03:42 +08:00
LICENSE chore: rename flowy_board to appflowy_board 2022-08-08 10:27:58 +08:00
pubspec.yaml chore: update appflowy_board pub.dev config 2022-08-09 10:03:42 +08:00
README.md chore: update appflowy_board pub.dev config 2022-08-09 10:03:42 +08:00

appflowy_board

The appflowy_board is a package that is used in AppFlowy. For the moment, this package is iterated very fast.

appflowy_board will be a standard git repository when it becomes stable.

Getting Started

@override
  void initState() {
    final column1 = BoardColumnData(id: "To Do", items: [
      TextItem("Card 1"),
      TextItem("Card 2"),
      TextItem("Card 3"),
      TextItem("Card 4"),
    ]);
    final column2 = BoardColumnData(id: "In Progress", items: [
      TextItem("Card 5"),
      TextItem("Card 6"),
    ]);

    final column3 = BoardColumnData(id: "Done", items: []);

    boardDataController.addColumn(column1);
    boardDataController.addColumn(column2);
    boardDataController.addColumn(column3);

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final config = BoardConfig(
      columnBackgroundColor: HexColor.fromHex('#F7F8FC'),
    );
    return Container(
      color: Colors.white,
      child: Padding(
        padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
        child: Board(
          dataController: boardDataController,
          footBuilder: (context, columnData) {
            return AppFlowyColumnFooter(
              icon: const Icon(Icons.add, size: 20),
              title: const Text('New'),
              height: 50,
              margin: config.columnItemPadding,
            );
          },
          headerBuilder: (context, columnData) {
            return AppFlowyColumnHeader(
              icon: const Icon(Icons.lightbulb_circle),
              title: Text(columnData.id),
              addIcon: const Icon(Icons.add, size: 20),
              moreIcon: const Icon(Icons.more_horiz, size: 20),
              height: 50,
              margin: config.columnItemPadding,
            );
          },
          cardBuilder: (context, item) {
            final textItem = item as TextItem;
            return AppFlowyColumnItemCard(
              key: ObjectKey(item),
              child: Align(
                alignment: Alignment.centerLeft,
                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 20),
                  child: Text(textItem.s),
                ),
              ),
            );
          },
          columnConstraints: const BoxConstraints.tightFor(width: 240),
          config: BoardConfig(
            columnBackgroundColor: HexColor.fromHex('#F7F8FC'),
          ),
        ),
      ),
    );
  }