Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
0076ac32
提交
0076ac32
authored
3月 14, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、分类 标签为空展示逻辑
上级
55e4b047
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
11 行删除
+21
-11
controller.dart
lib/pages/library/controller.dart
+14
-3
view.dart
lib/pages/library/view.dart
+4
-3
filter.dart
lib/pages/library/widgets/filter.dart
+3
-5
没有找到文件。
lib/pages/library/controller.dart
浏览文件 @
0076ac32
...
...
@@ -121,12 +121,18 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
for
(
FilterModel
model
in
filterCategories
){
model
.
selected
=
false
;
}
filterCategories
.
first
.
selected
=
true
;
if
(
filterCategories
.
isNotEmpty
){
selectedCategory
=
filterCategories
.
first
;
selectedCategory
.
selected
=
true
;
}
for
(
FilterModel
model
in
filterLabels
){
model
.
selected
=
false
;
}
filterLabels
.
first
.
selected
=
true
;
if
(
filterLabels
.
isNotEmpty
){
selectedLabel
=
filterLabels
.
first
;
selectedLabel
.
selected
=
true
;
}
for
(
FilterModel
model
in
filterFree
){
model
.
selected
=
false
;
...
...
@@ -135,8 +141,9 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
for
(
FilterModel
model
in
filterDown
){
model
.
selected
=
false
;
}
update
();
// onRefresh();
update
();
}
/// 确定
...
...
@@ -206,8 +213,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
filterCategories
=
categories
.
map
((
model
)
{
return
FilterModel
(
id:
model
.
categoryId
.
toString
(),
name:
model
.
name
??
''
,
selected:
model
.
selected
);
}).
toList
();
if
(
filterCategories
.
isNotEmpty
){
selectedCategory
=
filterCategories
.
first
;
selectedCategory
.
selected
=
true
;
}
update
();
}
...
...
@@ -218,8 +227,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
filterLabels
=
labels
.
map
((
model
)
{
return
FilterModel
(
id:
model
.
labelId
.
toString
(),
name:
model
.
name
??
''
,
selected:
model
.
selected
);
}).
toList
();
if
(
filterLabels
.
isNotEmpty
){
selectedLabel
=
filterLabels
.
first
;
selectedLabel
.
selected
=
true
;
}
update
([
'label'
]);
...
...
lib/pages/library/view.dart
浏览文件 @
0076ac32
...
...
@@ -41,8 +41,8 @@ class _LibraryPageState extends State<LibraryPage> {
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
child:
_buildCategory
()),
GestureDetector
(
controller
.
filterCategories
.
isEmpty
?
const
SizedBox
():
Expanded
(
child:
_buildCategory
()),
controller
.
filterCategories
.
isEmpty
?
const
SizedBox
():
GestureDetector
(
onTap:
(){
controller
.
setShow
(
controller
.
show
);
},
...
...
@@ -115,7 +115,8 @@ class _LibraryPageState extends State<LibraryPage> {
controller
.
sureFilter
();
},
resetTap:
(){
// controller.setShow(controller.show);
controller
.
resetFilter
();
},),
),
],
...
...
lib/pages/library/widgets/filter.dart
浏览文件 @
0076ac32
...
...
@@ -41,8 +41,8 @@ class _FilterPageState extends State<FilterPage> {
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
_buildWrapWidget
(
'分类'
,
widget
.
controller
.
filterCategories
),
_buildWrapWidget
(
'标签'
,
widget
.
controller
.
filterLabels
),
widget
.
controller
.
filterCategories
.
isEmpty
?
const
SizedBox
():
_buildWrapWidget
(
'分类'
,
widget
.
controller
.
filterCategories
),
widget
.
controller
.
filterLabels
.
isEmpty
?
const
SizedBox
():
_buildWrapWidget
(
'标签'
,
widget
.
controller
.
filterLabels
),
_buildWrapWidget
(
'是否收费'
,
widget
.
controller
.
filterFree
),
_buildWrapWidget
(
'排序'
,
widget
.
controller
.
filterDown
),
],
...
...
@@ -60,9 +60,7 @@ class _FilterPageState extends State<FilterPage> {
children:
[
Expanded
(
child:
GestureDetector
(
onTap:
(){
widget
.
controller
.
resetFilter
();
},
onTap:
widget
.
resetTap
,
child:
Container
(
alignment:
Alignment
.
center
,
height:
35
.
w
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论