Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
chore: update pubspec path
appflowy0abd62829ce5
diff --git a/frontend/app_flowy/packages/appflowy_board/example/lib/multi_board_list_example.dart b/frontend/app_flowy/packages/appflowy_board/example/lib/multi_board_list_example.dartindex 7fe24362d2..3edb32c3bf 100644--- a/frontend/app_flowy/packages/appflowy_board/example/lib/multi_board_list_example.dart+++ b/frontend/app_flowy/packages/appflowy_board/example/lib/multi_board_list_example.dart@@ -26,11 +26,11 @@ class _MultiBoardListExampleState extends State<MultiBoardListExample> {final column1 = BoardColumnData(id: "To Do", items: [TextItem("Card 1"),TextItem("Card 2"),- TextItem("Card 3"),+ RichTextItem(title: "Card 3", subtitle: 'Aug 1, 2020 4:05 PM'),TextItem("Card 4"),]);final column2 = BoardColumnData(id: "In Progress", items: [- TextItem("Card 5"),+ RichTextItem(title: "Card 5", subtitle: 'Aug 1, 2020 4:05 PM'),TextItem("Card 6"),]);@@ -73,16 +73,9 @@ class _MultiBoardListExampleState extends State<MultiBoardListExample> {);},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),- ),- ),+ child: _buildCard(item),);},columnConstraints: const BoxConstraints.tightFor(width: 240),@@ -93,6 +86,41 @@ class _MultiBoardListExampleState extends State<MultiBoardListExample> {),);}++ Widget _buildCard(ColumnItem item) {+ if (item is TextItem) {+ return Align(+ alignment: Alignment.centerLeft,+ child: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 20),+ child: Text(item.s),+ ),+ );+ }++ if (item is RichTextItem) {+ return Padding(+ padding: const EdgeInsets.all(20),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ item.title,+ style: const TextStyle(fontSize: 14),+ textAlign: TextAlign.left,+ ),+ const SizedBox(height: 10),+ Text(+ item.subtitle,+ style: const TextStyle(fontSize: 12, color: Colors.grey),+ )+ ],+ ),+ );+ }++ throw UnimplementedError();+ }}class TextItem extends ColumnItem {@@ -104,6 +132,16 @@ class TextItem extends ColumnItem {String get id => s;}+class RichTextItem extends ColumnItem {+ final String title;+ final String subtitle;++ RichTextItem({required this.title, required this.subtitle});++ @override+ String get id => title;+}+extension HexColor on Color {static Color fromHex(String hexString) {final buffer = StringBuffer();diff --git a/frontend/app_flowy/packages/appflowy_board/example/test/widget_test.dart b/frontend/app_flowy/packages/appflowy_board/example/test/widget_test.dartindex 092d222f7e..29cad86982 100644--- a/frontend/app_flowy/packages/appflowy_board/example/test/widget_test.dart+++ b/frontend/app_flowy/packages/appflowy_board/example/test/widget_test.dart@@ -4,27 +4,4 @@// utility in the flutter_test package. For example, you can send tap and scroll// gestures. You can also use WidgetTester to find child widgets in the widget// tree, read text, and verify that the values of widget properties are correct.--import 'package:flutter/material.dart';-import 'package:flutter_test/flutter_test.dart';--import 'package:example/main.dart';--void main() {- testWidgets('Counter increments smoke test', (WidgetTester tester) async {- // Build our app and trigger a frame.- await tester.pumpWidget(const MyApp());-- // Verify that our counter starts at 0.- expect(find.text('0'), findsOneWidget);- expect(find.text('1'), findsNothing);-- // Tap the '+' icon and trigger a frame.- await tester.tap(find.byIcon(Icons.add));- await tester.pump();-- // Verify that our counter has incremented.- expect(find.text('0'), findsNothing);- expect(find.text('1'), findsOneWidget);- });-}+void main() {}diff --git a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dartindex 04de8cae7b..6354b25c33 100644--- a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart+++ b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_flex/reorder_flex.dart@@ -500,7 +500,7 @@ class ReorderFlexState extends State<ReorderFlex>case Axis.horizontal:return Row(mainAxisSize: MainAxisSize.min,- crossAxisAlignment: CrossAxisAlignment.start,+ crossAxisAlignment: CrossAxisAlignment.stretch,mainAxisAlignment: widget.mainAxisAlignment,children: children,);@@ -508,7 +508,7 @@ class ReorderFlexState extends State<ReorderFlex>default:return Column(mainAxisSize: MainAxisSize.min,- crossAxisAlignment: CrossAxisAlignment.start,+ crossAxisAlignment: CrossAxisAlignment.stretch,mainAxisAlignment: widget.mainAxisAlignment,children: children,);diff --git a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_phantom/phantom_controller.dart b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_phantom/phantom_controller.dartindex 266c83d873..ccff83b502 100644--- a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_phantom/phantom_controller.dart+++ b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/reorder_phantom/phantom_controller.dart@@ -1,5 +1,3 @@-import 'dart:async';-import 'package:flutter/material.dart';import '../../utils/log.dart';import '../board_column/board_column_data.dart';@@ -204,8 +202,7 @@ class BoardPhantomController extends OverlapDragTargetDelegate@overridebool canMoveTo(String dragTargetId) {- // TODO: implement shouldReceive- return delegate.controller(dragTargetId)?.columnData.items.length == 0;+ return delegate.controller(dragTargetId)?.columnData.items.isEmpty ?? false;}}diff --git a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/card.dart b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/card.dartindex b2e5085649..323964c75f 100644--- a/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/card.dart+++ b/frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/card.dart@@ -4,13 +4,15 @@ class AppFlowyColumnItemCard extends StatefulWidget {final Widget? child;final Color backgroundColor;final double cornerRadius;+ final EdgeInsets margin;final BoxConstraints boxConstraints;const AppFlowyColumnItemCard({this.child,- this.backgroundColor = Colors.white,this.cornerRadius = 0.0,- this.boxConstraints = const BoxConstraints.tightFor(height: 60),+ this.margin = const EdgeInsets.all(4),+ this.backgroundColor = Colors.white,+ this.boxConstraints = const BoxConstraints(minHeight: 40),Key? key,}) : super(key: key);@@ -22,10 +24,10 @@ class _AppFlowyColumnItemCardState extends State<AppFlowyColumnItemCard> {@overrideWidget build(BuildContext context) {return Padding(- padding: const EdgeInsets.all(4.0),+ padding: const EdgeInsets.all(4),child: Container(- constraints: widget.boxConstraints,clipBehavior: Clip.hardEdge,+ constraints: widget.boxConstraints,decoration: BoxDecoration(color: widget.backgroundColor,borderRadius: BorderRadius.circular(widget.cornerRadius),diff --git a/frontend/app_flowy/packages/appflowy_board/pubspec.yaml b/frontend/app_flowy/packages/appflowy_board/pubspec.yamlindex b0955998ea..92b1782ea0 100644--- a/frontend/app_flowy/packages/appflowy_board/pubspec.yaml+++ b/frontend/app_flowy/packages/appflowy_board/pubspec.yaml@@ -5,7 +5,7 @@ homepage: https://github.com/AppFlowy-IO/AppFlowyrepository: https://github.com/AppFlowy-IO/AppFlowyenvironment:- sdk: ">=2.17.6 <3.0.0"+ sdk: ">=2.17.0 <3.0.0"flutter: ">=1.17.0"dependencies:diff --git a/frontend/app_flowy/pubspec.yaml b/frontend/app_flowy/pubspec.yamlindex 60b99061bc..56e96e96dd 100644--- a/frontend/app_flowy/pubspec.yaml+++ b/frontend/app_flowy/pubspec.yaml@@ -37,6 +37,8 @@ dependencies:path: packages/flowy_infra_uiflowy_infra:path: packages/flowy_infra+ appflowy_board:+ path: packages/appflowy_boardflutter_quill:git:url: https://github.com/appflowy/flutter-quill.git