mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: update pubspec path
This commit is contained in:
parent
db5b3e3bd3
commit
0abd62829c
@ -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();
|
||||
|
@ -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() {}
|
||||
|
@ -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,
|
||||
);
|
||||
|
@ -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
|
||||
|
||||
@override
|
||||
bool canMoveTo(String dragTargetId) {
|
||||
// TODO: implement shouldReceive
|
||||
return delegate.controller(dragTargetId)?.columnData.items.length == 0;
|
||||
return delegate.controller(dragTargetId)?.columnData.items.isEmpty ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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> {
|
||||
@override
|
||||
Widget 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),
|
||||
|
@ -5,7 +5,7 @@ homepage: https://github.com/AppFlowy-IO/AppFlowy
|
||||
repository: https://github.com/AppFlowy-IO/AppFlowy
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.6 <3.0.0"
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
dependencies:
|
||||
|
@ -37,6 +37,8 @@ dependencies:
|
||||
path: packages/flowy_infra_ui
|
||||
flowy_infra:
|
||||
path: packages/flowy_infra
|
||||
appflowy_board:
|
||||
path: packages/appflowy_board
|
||||
flutter_quill:
|
||||
git:
|
||||
url: https://github.com/appflowy/flutter-quill.git
|
||||
|
Loading…
Reference in New Issue
Block a user