|
1 | 1 | # appflowy_board |
2 | 2 |
|
3 | | -The **appflowy_board** is a package that is used in [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy). For the moment, this package is iterated very fast. |
| 3 | +<h1 align="center"><b>AppFlowy Board</b></h1> |
4 | 4 |
|
| 5 | +<p align="center">A customizable and draggable Kanban Board widget for Flutter</p> |
5 | 6 |
|
6 | | -**appflowy_board** will be a standard git repository when it becomes stable. |
7 | | -## Getting Started |
| 7 | +<p align="center"> |
| 8 | + <a href="https://discord.gg/ZCCYN4Anzq"><b>Discord</b></a> • |
| 9 | + <a href="https://twitter.com/appflowy"><b>Twitter</b></a> |
| 10 | +</p> |
8 | 11 |
|
9 | | -<p> |
10 | | -<img src="https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_board/example/gifs/appflowy_board_video_2.gif?raw=true" width="680" title="AppFlowyBoard"> |
| 12 | +<p align="center"> |
11 | 13 | <img src="https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_board/example/gifs/appflowy_board_video_1.gif?raw=true" width="680" title="AppFlowyBoard"> |
12 | 14 | </p> |
13 | 15 |
|
| 16 | +## Intro |
| 17 | + |
| 18 | +appflowy_board is a customizable and draggable Kanban Board widget for Flutter. |
| 19 | +You can use it to create a Kanban Board tool like those in Trello. |
| 20 | + |
| 21 | +Check out [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy) to see how appflowy_board is used to build a BoardView database. |
| 22 | +<p align="center"> |
| 23 | +<img src="https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_board/example/gifs/appflowy_board_video_2.gif?raw=true" width="680" title="AppFlowyBoard"> |
| 24 | +</p> |
| 25 | + |
| 26 | + |
| 27 | +## Getting Started |
| 28 | +Add the AppFlowy Board [Flutter package](https://docs.flutter.dev/development/packages-and-plugins/using-packages) to your environment. |
| 29 | + |
| 30 | +With Flutter: |
| 31 | +```dart |
| 32 | +flutter pub add appflowy_board |
| 33 | +``` |
| 34 | + |
| 35 | +This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get): |
14 | 36 | ```dart |
15 | | -@override |
16 | | - void initState() { |
17 | | - final column1 = BoardColumnData(id: "To Do", items: [ |
18 | | - TextItem("Card 1"), |
19 | | - TextItem("Card 2"), |
20 | | - TextItem("Card 3"), |
21 | | - TextItem("Card 4"), |
22 | | - ]); |
23 | | - final column2 = BoardColumnData(id: "In Progress", items: [ |
24 | | - TextItem("Card 5"), |
25 | | - TextItem("Card 6"), |
26 | | - ]); |
27 | | -
|
28 | | - final column3 = BoardColumnData(id: "Done", items: []); |
29 | | -
|
30 | | - boardDataController.addColumn(column1); |
31 | | - boardDataController.addColumn(column2); |
32 | | - boardDataController.addColumn(column3); |
33 | | -
|
34 | | - super.initState(); |
35 | | - } |
36 | | -
|
37 | | - @override |
38 | | - Widget build(BuildContext context) { |
39 | | - final config = BoardConfig( |
40 | | - columnBackgroundColor: HexColor.fromHex('#F7F8FC'), |
41 | | - ); |
42 | | - return Container( |
43 | | - color: Colors.white, |
44 | | - child: Padding( |
45 | | - padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20), |
46 | | - child: Board( |
47 | | - dataController: boardDataController, |
48 | | - footBuilder: (context, columnData) { |
49 | | - return AppFlowyColumnFooter( |
50 | | - icon: const Icon(Icons.add, size: 20), |
51 | | - title: const Text('New'), |
52 | | - height: 50, |
53 | | - margin: config.columnItemPadding, |
54 | | - ); |
55 | | - }, |
56 | | - headerBuilder: (context, columnData) { |
57 | | - return AppFlowyColumnHeader( |
58 | | - icon: const Icon(Icons.lightbulb_circle), |
59 | | - title: Text(columnData.id), |
60 | | - addIcon: const Icon(Icons.add, size: 20), |
61 | | - moreIcon: const Icon(Icons.more_horiz, size: 20), |
62 | | - height: 50, |
63 | | - margin: config.columnItemPadding, |
64 | | - ); |
65 | | - }, |
66 | | - cardBuilder: (context, item) { |
67 | | - final textItem = item as TextItem; |
68 | | - return AppFlowyColumnItemCard( |
69 | | - key: ObjectKey(item), |
70 | | - child: Align( |
71 | | - alignment: Alignment.centerLeft, |
72 | | - child: Padding( |
73 | | - padding: const EdgeInsets.symmetric(horizontal: 20), |
74 | | - child: Text(textItem.s), |
75 | | - ), |
76 | | - ), |
77 | | - ); |
78 | | - }, |
79 | | - columnConstraints: const BoxConstraints.tightFor(width: 240), |
80 | | - config: BoardConfig( |
81 | | - columnBackgroundColor: HexColor.fromHex('#F7F8FC'), |
82 | | - ), |
83 | | - ), |
84 | | - ), |
85 | | - ); |
86 | | - } |
87 | | -``` |
| 37 | +dependencies: |
| 38 | + appflowy_board: ^0.0.6 |
| 39 | +``` |
| 40 | + |
| 41 | +Import the package in your Dart file: |
| 42 | +```dart |
| 43 | +import 'package:appflowy_board/appflowy_board.dart'; |
| 44 | +``` |
| 45 | + |
| 46 | +## Usage Example |
| 47 | +To quickly grasp how it can be used, look at the /example/lib folder. |
| 48 | +First, run main.dart to play with the demo. |
| 49 | + |
| 50 | +Second, let's delve into multi_board_list_example.dart to understand a few key components: |
| 51 | +* A Board widget is created via instantiating an AFBoard() object. |
| 52 | +* In the AFBoard() object, you can find: |
| 53 | + * AFBoardDataController, which is defined in board_data.dart, is feeded with prepopulated mock data. It also contains callback functions to materialize future user data. |
| 54 | + * Three builders: AppFlowyColumnHeader, AppFlowyColumnFooter, AppFlowyColumnItemCard. See below image for what they are used for. |
| 55 | +<p> |
| 56 | +<img src="https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_board/example/gifs/appflowy_board_builders.jpg?raw=true" width="100%" title="AppFlowyBoard"> |
| 57 | +</p> |
| 58 | + |
| 59 | +## Glossary |
| 60 | +Please refer to the API documentation. |
| 61 | + |
| 62 | +## Contributing |
| 63 | +Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. |
| 64 | + |
| 65 | +Please look at [CONTRIBUTING.md](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/contributing-to-appflowy) for details. |
| 66 | + |
| 67 | +## License |
| 68 | +Distributed under the AGPLv3 License. See [LICENSE](https://github.com/AppFlowy-IO/AppFlowy-Docs/blob/main/LICENSE) for more information. |
| 69 | + |
| 70 | + |
| 71 | + |
0 commit comments