Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
d94d3a81
提交
d94d3a81
authored
1月 18, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
笔记详情基本布局
上级
feb8d22d
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
226 行增加
和
3 行删除
+226
-3
controller.dart
lib/pages/user_notes/controller.dart
+7
-1
index.dart
lib/pages/user_notes/index.dart
+2
-0
view.dart
lib/pages/user_notes/view.dart
+7
-2
item.dart
lib/pages/user_notes/widgets/item.dart
+1
-0
controller.dart
lib/pages/user_notes_des/controller.dart
+11
-0
index.dart
lib/pages/user_notes_des/index.dart
+16
-0
view.dart
lib/pages/user_notes_des/view.dart
+72
-0
item.dart
lib/pages/user_notes_des/widgets/item.dart
+66
-0
list.dart
lib/pages/user_notes_des/widgets/list.dart
+32
-0
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+11
-0
没有找到文件。
lib/pages/user_notes/controller.dart
浏览文件 @
d94d3a81
...
@@ -13,6 +13,12 @@ class UserNoteController extends GetxController {
...
@@ -13,6 +13,12 @@ class UserNoteController extends GetxController {
int
_page
=
1
;
int
_page
=
1
;
bool
_noMore
=
false
;
bool
_noMore
=
false
;
@override
void
onReady
()
{
onRefresh
();
super
.
onReady
();
}
@override
@override
void
onClose
()
{
void
onClose
()
{
refreshController
.
dispose
();
refreshController
.
dispose
();
...
@@ -29,7 +35,7 @@ class UserNoteController extends GetxController {
...
@@ -29,7 +35,7 @@ class UserNoteController extends GetxController {
);
);
// 如果是刷新 清理数据
// 如果是刷新 清理数据
if
(
isRefresh
)
notes
.
clear
();
if
(
isRefresh
)
notes
.
clear
();
notes
.
addAll
(
_test
());
//
notes.addAll(_test());
notes
.
addAll
(
result
);
notes
.
addAll
(
result
);
_page
++;
_page
++;
_noMore
=
result
.
length
<
_limit
;
_noMore
=
result
.
length
<
_limit
;
...
...
lib/pages/user_notes/index.dart
浏览文件 @
d94d3a81
...
@@ -8,8 +8,10 @@ import 'package:flutter_book/theme.dart';
...
@@ -8,8 +8,10 @@ import 'package:flutter_book/theme.dart';
import
'package:flutter_book/widgets/index.dart'
;
import
'package:flutter_book/widgets/index.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:go_router/go_router.dart'
;
import
'../../models/index.dart'
;
import
'../../models/index.dart'
;
import
'../../routes/index.dart'
;
import
'../../utils/index.dart'
;
import
'../../utils/index.dart'
;
...
...
lib/pages/user_notes/view.dart
浏览文件 @
d94d3a81
...
@@ -19,7 +19,7 @@ class _UserNotePageState extends State<UserNotePage> {
...
@@ -19,7 +19,7 @@ class _UserNotePageState extends State<UserNotePage> {
),
),
body:
CustomPullScrollView
(
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
//
onRefresh: controller.onRefresh,
onLoading:
controller
.
onLoading
,
onLoading:
controller
.
onLoading
,
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Container
(
child:
Container
(
...
@@ -40,7 +40,12 @@ class _UserNotePageState extends State<UserNotePage> {
...
@@ -40,7 +40,12 @@ class _UserNotePageState extends State<UserNotePage> {
physics:
const
NeverScrollableScrollPhysics
(),
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
notes
[
index
],
index:
index
,
num
:
controller
.
notes
.
length
,);
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
noteDes
,
extra:
controller
.
notes
[
index
]);
},
child:
BuildItem
(
model:
controller
.
notes
[
index
],
index:
index
,
num
:
controller
.
notes
.
length
,)
);
},
},
itemCount:
controller
.
notes
.
length
,
itemCount:
controller
.
notes
.
length
,
),
),
...
...
lib/pages/user_notes/widgets/item.dart
浏览文件 @
d94d3a81
...
@@ -14,6 +14,7 @@ class BuildItem extends StatelessWidget {
...
@@ -14,6 +14,7 @@ class BuildItem extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Container
(
color:
Colors
.
white
,
// margin: const EdgeInsets.symmetric(horizontal: 10),
// margin: const EdgeInsets.symmetric(horizontal: 10),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
// margin: const EdgeInsets.all(10),
// margin: const EdgeInsets.all(10),
...
...
lib/pages/user_notes_des/controller.dart
0 → 100644
浏览文件 @
d94d3a81
part of
user_notes_des
;
class
UserNotesDesController
extends
GetxController
{
final
String
tag
;
UserNotesDesController
(
this
.
tag
);
}
\ No newline at end of file
lib/pages/user_notes_des/index.dart
0 → 100644
浏览文件 @
d94d3a81
library
user_notes_des
;
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:get/get.dart'
;
import
'../../models/index.dart'
;
import
'../../theme.dart'
;
import
'../../utils/index.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
part
'widgets/item.dart'
;
part
'widgets/list.dart'
;
\ No newline at end of file
lib/pages/user_notes_des/view.dart
0 → 100644
浏览文件 @
d94d3a81
part of
user_notes_des
;
class
UserNotesDesPage
extends
StatefulWidget
{
final
CourseModel
model
;
const
UserNotesDesPage
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
@override
State
<
UserNotesDesPage
>
createState
()
=>
_UserNotesDesPageState
();
}
class
_UserNotesDesPageState
extends
State
<
UserNotesDesPage
>
{
List
<
Tab
>
tabs
=
[
const
Tab
(
text:
'全部'
,),
const
Tab
(
text:
'划线'
,),
const
Tab
(
text:
'高亮'
,),
const
Tab
(
text:
'笔记'
,),
];
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'笔记详情'
),
),
body:
DefaultTabController
(
length:
tabs
.
length
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
BuildItem
(
model:
widget
.
model
),
ClipRRect
(
borderRadius:
const
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
5
),
topRight:
Radius
.
circular
(
5
)),
child:
Container
(
width:
double
.
infinity
,
color:
Colors
.
white
,
height:
35
,
child:
TabBar
(
indicator:
UnderlineTabIndicator
(
borderRadius:
BorderRadius
.
circular
(
0.75
),
borderSide:
const
BorderSide
(
width:
1.5
,
color:
AppTheme
.
primary
),
insets:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
// 设置标签下面指示器的水平内边距
),
labelPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
20
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
indicatorWeight:
1.5
,
labelStyle:
const
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
15
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
const
TextStyle
(
color:
Colours
.
c9
,
fontSize:
15
,
height:
1.5
),
isScrollable:
true
,
tabs:
tabs
),
),
),
Expanded
(
child:
TabBarView
(
children:
List
.
generate
(
tabs
.
length
,
(
index
){
return
BuildListPage
(
tag:
'
$index
'
);
})
),
)
],
)
),
);
}
}
lib/pages/user_notes_des/widgets/item.dart
0 → 100644
浏览文件 @
d94d3a81
part of
user_notes_des
;
class
BuildItem
extends
StatelessWidget
{
final
CourseModel
model
;
const
BuildItem
({
Key
?
key
,
required
this
.
model
,
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
margin:
const
EdgeInsets
.
all
(
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
const
Offset
(
3
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
children:
[
Container
(
padding:
const
EdgeInsets
.
only
(
top:
12
,
bottom:
15
),
// color: Colors.red,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
height:
87
,
width:
73
,
color:
Colors
.
cyan
,
),
Container
(
height:
87
,
margin:
const
EdgeInsets
.
only
(
left:
13
),
// color: Colors.green,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
model
.
bookName
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
height:
1.5
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Text
(
model
.
authors
??
''
,
style:
const
TextStyle
(
fontSize:
12
,
height:
1.5
,
color:
Colours
.
c6
),),
],
),
Text
(
'
${model.notesNum.toString()}
个笔记'
,
style:
const
TextStyle
(
fontSize:
11
,
height:
1.5
,
color:
AppTheme
.
primary
)),
],
),
)
],
),
)
],
),
);
}
}
lib/pages/user_notes_des/widgets/list.dart
0 → 100644
浏览文件 @
d94d3a81
part of
user_notes_des
;
class
BuildListPage
extends
StatefulWidget
{
final
String
tag
;
const
BuildListPage
({
Key
?
key
,
required
this
.
tag
})
:
super
(
key:
key
);
@override
State
<
BuildListPage
>
createState
()
=>
_BuildListPageState
();
}
class
_BuildListPageState
extends
State
<
BuildListPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
UserNotesDesController
>(
tag:
widget
.
tag
,
init:
UserNotesDesController
(
widget
.
tag
),
builder:
(
controller
)
=>
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
Container
(
height:
20
,
color:
Colors
.
red
,
);
},
itemCount:
3
,
),
);
}
}
lib/routes/index.dart
浏览文件 @
d94d3a81
...
@@ -27,6 +27,7 @@ import 'package:flutter_book/pages/user_love/index.dart';
...
@@ -27,6 +27,7 @@ import 'package:flutter_book/pages/user_love/index.dart';
import
'package:flutter_book/pages/user_msg/index.dart'
;
import
'package:flutter_book/pages/user_msg/index.dart'
;
import
'package:flutter_book/pages/user_nick/index.dart'
;
import
'package:flutter_book/pages/user_nick/index.dart'
;
import
'package:flutter_book/pages/user_notes/index.dart'
;
import
'package:flutter_book/pages/user_notes/index.dart'
;
import
'package:flutter_book/pages/user_notes_des/index.dart'
;
import
'package:flutter_book/pages/user_point/index.dart'
;
import
'package:flutter_book/pages/user_point/index.dart'
;
import
'package:flutter_book/pages/user_security/index.dart'
;
import
'package:flutter_book/pages/user_security/index.dart'
;
import
'package:flutter_book/pages/user_set/index.dart'
;
import
'package:flutter_book/pages/user_set/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
d94d3a81
...
@@ -74,6 +74,8 @@ abstract class Routes {
...
@@ -74,6 +74,8 @@ abstract class Routes {
static
const
love
=
'love'
;
static
const
love
=
'love'
;
// 笔记
// 笔记
static
const
note
=
'note'
;
static
const
note
=
'note'
;
// 笔记详情
static
const
noteDes
=
'note_des'
;
// 错题
// 错题
static
const
wrong
=
'wrong'
;
static
const
wrong
=
'wrong'
;
// 讨论
// 讨论
...
@@ -412,6 +414,15 @@ abstract class Routes {
...
@@ -412,6 +414,15 @@ abstract class Routes {
child:
const
UserFeedbackPage
()
child:
const
UserFeedbackPage
()
)
)
),
),
GoRoute
(
path:
'/
$noteDes
'
,
name:
noteDes
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
UserNotesDesPage
(
model:
state
.
extra
as
CourseModel
,)
)
),
]
]
);
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论