mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #988 from AppFlowy-IO/feat/edit_multi_text_cell
This commit is contained in:
commit
f9235491fe
@ -14,33 +14,37 @@ class EditableCellNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class EditableRowNotifier {
|
class EditableRowNotifier {
|
||||||
Map<EditableCellId, EditableCellNotifier> cells = {};
|
final Map<EditableCellId, EditableCellNotifier> _cells = {};
|
||||||
|
|
||||||
void insertCell(
|
void insertCell(
|
||||||
GridCellIdentifier cellIdentifier,
|
GridCellIdentifier cellIdentifier,
|
||||||
EditableCellNotifier notifier,
|
EditableCellNotifier notifier,
|
||||||
) {
|
) {
|
||||||
cells[EditableCellId.from(cellIdentifier)] = notifier;
|
_cells[EditableCellId.from(cellIdentifier)] = notifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
void becomeFirstResponder() {
|
void becomeFirstResponder() {
|
||||||
for (final notifier in cells.values) {
|
for (final notifier in _cells.values) {
|
||||||
notifier.becomeFirstResponder.notify();
|
notifier.becomeFirstResponder.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void resignFirstResponder() {
|
void resignFirstResponder() {
|
||||||
for (final notifier in cells.values) {
|
for (final notifier in _cells.values) {
|
||||||
notifier.resignFirstResponder.notify();
|
notifier.resignFirstResponder.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear() {
|
||||||
|
_cells.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
for (final notifier in cells.values) {
|
for (final notifier in _cells.values) {
|
||||||
notifier.resignFirstResponder.notify();
|
notifier.resignFirstResponder.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
cells.clear();
|
_cells.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,20 +89,20 @@ class _BoardCardState extends State<BoardCard> {
|
|||||||
List<GridCellIdentifier> cells,
|
List<GridCellIdentifier> cells,
|
||||||
) {
|
) {
|
||||||
final List<Widget> children = [];
|
final List<Widget> children = [];
|
||||||
|
rowNotifier.clear();
|
||||||
cells.asMap().forEach(
|
cells.asMap().forEach(
|
||||||
(int index, GridCellIdentifier cellId) {
|
(int index, GridCellIdentifier cellId) {
|
||||||
final cellNotifier = EditableCellNotifier();
|
final cellNotifier = EditableCellNotifier();
|
||||||
Widget child = widget.cellBuilder.buildCell(
|
Widget child = widget.cellBuilder.buildCell(
|
||||||
widget.groupId,
|
widget.groupId,
|
||||||
cellId,
|
cellId,
|
||||||
widget.isEditing,
|
index == 0 ? widget.isEditing : false,
|
||||||
cellNotifier,
|
cellNotifier,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
rowNotifier.insertCell(cellId, cellNotifier);
|
rowNotifier.insertCell(cellId, cellNotifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
child = Padding(
|
child = Padding(
|
||||||
key: cellId.key(),
|
key: cellId.key(),
|
||||||
padding: const EdgeInsets.only(left: 4, right: 4),
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
||||||
|
Loading…
Reference in New Issue
Block a user