feat: sync the icon & title (#4150)

* feat: sync the icon & title

* feat: diff the view data when refreshing

* fix: unable to update folder

* test: refactor bloc tests
This commit is contained in:
Lucas.Xu
2023-12-20 10:08:35 +08:00
committed by GitHub
parent b466b425a5
commit 9a1ea138fc
24 changed files with 378 additions and 789 deletions

View File

@ -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,

View File

@ -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,
@ -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,