mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #914 from AppFlowy-IO/fix/card_animation
Fix/card animation
This commit is contained in:
commit
6e947d62ed
@ -36,19 +36,18 @@ class _BoardCheckboxCellState extends State<BoardCheckboxCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardCheckboxCellBloc, BoardCheckboxCellState>(
|
child: BlocBuilder<BoardCheckboxCellBloc, BoardCheckboxCellState>(
|
||||||
|
buildWhen: (previous, current) =>
|
||||||
|
previous.isSelected != current.isSelected,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final icon = state.isSelected
|
final icon = state.isSelected
|
||||||
? svgWidget('editor/editor_check')
|
? svgWidget('editor/editor_check')
|
||||||
: svgWidget('editor/editor_uncheck');
|
: svgWidget('editor/editor_uncheck');
|
||||||
return Padding(
|
return Align(
|
||||||
padding: EdgeInsets.zero,
|
alignment: Alignment.centerLeft,
|
||||||
child: Align(
|
child: FlowyIconButton(
|
||||||
alignment: Alignment.centerLeft,
|
iconPadding: EdgeInsets.zero,
|
||||||
child: FlowyIconButton(
|
icon: icon,
|
||||||
iconPadding: EdgeInsets.zero,
|
width: 20,
|
||||||
icon: icon,
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -5,8 +5,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import 'define.dart';
|
|
||||||
|
|
||||||
class BoardDateCell extends StatefulWidget {
|
class BoardDateCell extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final GridCellControllerBuilder cellControllerBuilder;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
@ -39,21 +37,17 @@ class _BoardDateCellState extends State<BoardDateCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardDateCellBloc, BoardDateCellState>(
|
child: BlocBuilder<BoardDateCellBloc, BoardDateCellState>(
|
||||||
|
buildWhen: (previous, current) => previous.dateStr != current.dateStr,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.dateStr.isEmpty) {
|
if (state.dateStr.isEmpty) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Padding(
|
child: FlowyText.regular(
|
||||||
padding: EdgeInsets.symmetric(
|
state.dateStr,
|
||||||
vertical: BoardSizes.cardCellVPadding,
|
fontSize: 13,
|
||||||
),
|
color: context.read<AppTheme>().shader3,
|
||||||
child: FlowyText.regular(
|
|
||||||
state.dateStr,
|
|
||||||
fontSize: 13,
|
|
||||||
color: context.read<AppTheme>().shader3,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import 'define.dart';
|
|
||||||
|
|
||||||
class BoardNumberCell extends StatefulWidget {
|
class BoardNumberCell extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final GridCellControllerBuilder cellControllerBuilder;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
@ -38,19 +36,16 @@ class _BoardNumberCellState extends State<BoardNumberCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardNumberCellBloc, BoardNumberCellState>(
|
child: BlocBuilder<BoardNumberCellBloc, BoardNumberCellState>(
|
||||||
|
buildWhen: (previous, current) => previous.content != current.content,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.content.isEmpty) {
|
if (state.content.isEmpty) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return Align(
|
||||||
padding:
|
alignment: Alignment.centerLeft,
|
||||||
EdgeInsets.symmetric(vertical: BoardSizes.cardCellVPadding),
|
child: FlowyText.medium(
|
||||||
child: Align(
|
state.content,
|
||||||
alignment: Alignment.centerLeft,
|
fontSize: 14,
|
||||||
child: FlowyText.medium(
|
|
||||||
state.content,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_c
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import 'define.dart';
|
|
||||||
|
|
||||||
class BoardSelectOptionCell extends StatefulWidget {
|
class BoardSelectOptionCell extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final GridCellControllerBuilder cellControllerBuilder;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
@ -37,6 +35,8 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardSelectOptionCellBloc, BoardSelectOptionCellState>(
|
child: BlocBuilder<BoardSelectOptionCellBloc, BoardSelectOptionCellState>(
|
||||||
|
buildWhen: (previous, current) =>
|
||||||
|
previous.selectedOptions != current.selectedOptions,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.selectedOptions
|
if (state.selectedOptions
|
||||||
.where((element) => element.id == widget.groupId)
|
.where((element) => element.id == widget.groupId)
|
||||||
@ -51,13 +51,10 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
return Padding(
|
return Align(
|
||||||
padding: EdgeInsets.only(top: BoardSizes.cardCellVPadding),
|
alignment: Alignment.centerLeft,
|
||||||
child: Align(
|
child: AbsorbPointer(
|
||||||
alignment: Alignment.centerLeft,
|
child: Wrap(children: children, spacing: 4, runSpacing: 2),
|
||||||
child: AbsorbPointer(
|
|
||||||
child: Wrap(children: children, spacing: 4, runSpacing: 2),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import 'define.dart';
|
|
||||||
|
|
||||||
class BoardTextCell extends StatefulWidget {
|
class BoardTextCell extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final GridCellControllerBuilder cellControllerBuilder;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
@ -37,20 +35,16 @@ class _BoardTextCellState extends State<BoardTextCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardTextCellBloc, BoardTextCellState>(
|
child: BlocBuilder<BoardTextCellBloc, BoardTextCellState>(
|
||||||
|
buildWhen: (previous, current) => previous.content != current.content,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.content.isEmpty) {
|
if (state.content.isEmpty) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Padding(
|
child: ConstrainedBox(
|
||||||
padding: EdgeInsets.symmetric(
|
constraints: const BoxConstraints(maxHeight: 120),
|
||||||
vertical: BoardSizes.cardCellVPadding,
|
child: FlowyText.medium(state.content, fontSize: 14),
|
||||||
),
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(maxHeight: 120),
|
|
||||||
child: FlowyText.medium(state.content, fontSize: 14),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import 'package:flowy_infra/theme.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import 'define.dart';
|
|
||||||
|
|
||||||
class BoardUrlCell extends StatefulWidget {
|
class BoardUrlCell extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final GridCellControllerBuilder cellControllerBuilder;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
@ -38,24 +36,21 @@ class _BoardUrlCellState extends State<BoardUrlCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardURLCellBloc, BoardURLCellState>(
|
child: BlocBuilder<BoardURLCellBloc, BoardURLCellState>(
|
||||||
|
buildWhen: (previous, current) => previous.content != current.content,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.content.isEmpty) {
|
if (state.content.isEmpty) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return Align(
|
||||||
padding:
|
alignment: Alignment.centerLeft,
|
||||||
EdgeInsets.symmetric(vertical: BoardSizes.cardCellVPadding),
|
child: RichText(
|
||||||
child: Align(
|
textAlign: TextAlign.left,
|
||||||
alignment: Alignment.centerLeft,
|
text: TextSpan(
|
||||||
child: RichText(
|
text: state.content,
|
||||||
textAlign: TextAlign.left,
|
style: TextStyle(
|
||||||
text: TextSpan(
|
color: theme.main2,
|
||||||
text: state.content,
|
fontSize: 14,
|
||||||
style: TextStyle(
|
decoration: TextDecoration.underline,
|
||||||
color: theme.main2,
|
|
||||||
fontSize: 14,
|
|
||||||
decoration: TextDecoration.underline,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -75,7 +75,7 @@ class _BoardCardState extends State<BoardCard> {
|
|||||||
(cellId) {
|
(cellId) {
|
||||||
final child = widget.cellBuilder.buildCell(widget.groupId, cellId);
|
final child = widget.cellBuilder.buildCell(widget.groupId, cellId);
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
padding: const EdgeInsets.only(left: 4, right: 4, top: 6),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -121,6 +121,10 @@ class AFBoardColumnDataController extends ChangeNotifier with EquatableMixin {
|
|||||||
columnData._items.add(newItem);
|
columnData._items.add(newItem);
|
||||||
Log.debug('[$AFBoardColumnDataController] $columnData add $newItem');
|
Log.debug('[$AFBoardColumnDataController] $columnData add $newItem');
|
||||||
} else {
|
} else {
|
||||||
|
if (index >= columnData._items.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final removedItem = columnData._items.removeAt(index);
|
final removedItem = columnData._items.removeAt(index);
|
||||||
columnData._items.insert(index, newItem);
|
columnData._items.insert(index, newItem);
|
||||||
Log.debug(
|
Log.debug(
|
||||||
|
@ -140,7 +140,7 @@ class _ReorderDragTargetState<T extends DragTargetData>
|
|||||||
widget.insertAnimationController,
|
widget.insertAnimationController,
|
||||||
widget.deleteAnimationController,
|
widget.deleteAnimationController,
|
||||||
) ??
|
) ??
|
||||||
LongPressDraggable<DragTargetData>(
|
Draggable<DragTargetData>(
|
||||||
maxSimultaneousDrags: 1,
|
maxSimultaneousDrags: 1,
|
||||||
data: widget.dragTargetData,
|
data: widget.dragTargetData,
|
||||||
ignoringFeedbackSemantics: false,
|
ignoringFeedbackSemantics: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user