Skip to content

Commit

Permalink
feat: sync the icon & title (AppFlowy-IO#4150)
Browse files Browse the repository at this point in the history
* feat: sync the icon & title

* feat: diff the view data when refreshing

* fix: unable to update folder

* test: refactor bloc tests
  • Loading branch information
LucasXu0 authored Dec 20, 2023
1 parent b466b42 commit 9a1ea13
Show file tree
Hide file tree
Showing 24 changed files with 374 additions and 785 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extension Expectation on WidgetTester {
return find.descendant(
of: find.byWidgetPredicate(
(widget) =>
widget is ViewItem &&
widget is InnerViewItem &&
widget.view.name == parentName &&
widget.view.layout == parentLayout,
skipOffstage: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MobilePersonalFolder extends StatelessWidget {
...views.map(
(view) => MobileViewItem(
key: ValueKey(
'${FolderCategoryType.personal.name} ${view.hashCode} ',
'${FolderCategoryType.personal.name} ${view.id}',
),
isDraggable: true,
categoryType: FolderCategoryType.personal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,10 @@ class MobileViewItem extends StatelessWidget {
p.lastCreatedView?.id != c.lastCreatedView!.id,
listener: (context, state) => context.pushView(state.lastCreatedView!),
builder: (context, state) {
// don't remove this code. it's related to the backend service.
view.childViews
..clear()
..addAll(state.childViews);
return InnerMobileViewItem(
view: state.view,
parentView: parentView,
childViews: state.childViews,
childViews: state.view.childViews,
categoryType: categoryType,
level: level,
leftPadding: leftPadding,
Expand Down Expand Up @@ -163,7 +159,7 @@ class InnerMobileViewItem extends StatelessWidget {
if (childViews.isNotEmpty) {
final children = childViews.map((childView) {
return MobileViewItem(
key: ValueKey('${categoryType.name} ${childView.hashCode}'),
key: ValueKey('${categoryType.name} ${childView.id}'),
parentView: view,
categoryType: categoryType,
isFirstChild: childView.id == childViews.first.id,
Expand Down
286 changes: 0 additions & 286 deletions frontend/appflowy_flutter/lib/workspace/application/app/app_bloc.dart

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9a1ea13

Please sign in to comment.