Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
9850da9c
提交
9850da9c
authored
1月 03, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
重置密码
上级
e5605df8
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
214 行增加
和
110 行删除
+214
-110
view.dart
lib/pages/course/view.dart
+32
-80
book.dart
lib/pages/course/widgets/book.dart
+36
-14
index.dart
lib/pages/forget_pwd/index.dart
+2
-0
view.dart
lib/pages/forget_pwd/view.dart
+2
-2
view.dart
lib/pages/login/view.dart
+1
-0
controller.dart
lib/pages/reset_pwd/controller.dart
+39
-0
index.dart
lib/pages/reset_pwd/index.dart
+13
-0
view.dart
lib/pages/reset_pwd/view.dart
+63
-0
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+22
-11
theme.dart
lib/theme.dart
+2
-2
input.dart
lib/widgets/input.dart
+1
-1
没有找到文件。
lib/pages/course/view.dart
浏览文件 @
9850da9c
...
@@ -16,7 +16,7 @@ class _CoursePageState extends State<CoursePage> {
...
@@ -16,7 +16,7 @@ class _CoursePageState extends State<CoursePage> {
appBar:
CustomAppBar
(
appBar:
CustomAppBar
(
titleSpacing:
0
,
titleSpacing:
0
,
title:
Padding
(
title:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
),
child:
CustomInputSearch
(
child:
CustomInputSearch
(
readOnly:
true
,
readOnly:
true
,
hintText:
'请输入书籍名称'
,
hintText:
'请输入书籍名称'
,
...
@@ -34,8 +34,8 @@ class _CoursePageState extends State<CoursePage> {
...
@@ -34,8 +34,8 @@ class _CoursePageState extends State<CoursePage> {
),
),
badges
.
Badge
(
badges
.
Badge
(
position:
badges
.
BadgePosition
.
topEnd
(
top:
-
5
,
end:
0
),
position:
badges
.
BadgePosition
.
topEnd
(
top:
-
5
,
end:
0
),
badgeContent:
Text
(
'10'
,
style:
TextStyle
(
fontSize:
7
,
color:
Colors
.
white
),),
badgeContent:
const
Text
(
'10'
,
style:
TextStyle
(
fontSize:
7
,
color:
Colors
.
white
),),
badgeStyle:
badges
.
BadgeStyle
(
badgeStyle:
const
badges
.
BadgeStyle
(
badgeColor:
AppTheme
.
primary
,
badgeColor:
AppTheme
.
primary
,
shape:
badges
.
BadgeShape
.
circle
shape:
badges
.
BadgeShape
.
circle
),
),
...
@@ -54,87 +54,39 @@ class _CoursePageState extends State<CoursePage> {
...
@@ -54,87 +54,39 @@ class _CoursePageState extends State<CoursePage> {
// ),
// ),
],
],
),
),
body:
Column
(
body:
Container
(
children:
[
color:
const
Color
(
0xFFF9F9F9
),
const
BuildBanner
(
items:
[
'111'
,
'222'
,
'333'
],),
child:
Column
(
Expanded
(
children:
[
child:
CustomPullScrollView
(
Container
(
controller:
controller
.
refreshController
,
color:
Colors
.
transparent
,
onRefresh:
controller
.
onRefresh
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
onLoading:
controller
.
onLoading
,
child:
const
BuildBanner
(
items:
[
'111'
,
'222'
,
'333'
],),
child:
GridView
.
builder
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
1.5
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
createCellWidget
();
},
itemCount:
10
,
),
// builder: (context,physics) => GridView.builder(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// crossAxisSpacing: 10,
// mainAxisSpacing: 10,
// childAspectRatio: 1.5
// ),
// itemBuilder: (BuildContext context, int index) {
// createCellWidget();
// },
// itemCount: 10,
// )
),
),
),
Expanded
(
],
child:
CustomPullScrollView
(
)
controller:
controller
.
refreshController
,
));
onRefresh:
controller
.
onRefresh
,
}
onLoading:
controller
.
onLoading
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
only
(
left:
13
,
top:
10
),
Widget
createCellWidget
(){
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
return
GestureDetector
(
crossAxisCount:
2
,
child:
Container
(
crossAxisSpacing:
0
,
// height: 40,
mainAxisSpacing:
10
,
decoration:
BoxDecoration
(
childAspectRatio:
0.85
borderRadius:
BorderRadius
.
circular
(
5
),
),
color:
Colors
.
cyan
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
border:
Border
.
all
(
color:
Colours
.
c9
,
width:
2
,
style:
BorderStyle
.
solid
),
return
const
Book
();
),
},
child:
Stack
(
itemCount:
10
,
children:
[
),
Container
(
color:
Colors
.
white
,
// height: double.infinity,
alignment:
Alignment
.
center
,
child:
SizedBox
()
),
Positioned
(
bottom:
0
,
left:
0
,
right:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
height:
24
,
width:
double
.
infinity
,
child:
Text
(
'假按揭啊'
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
5
)),
color:
Color
(
0x20FE250B
),
),
),
),
),
)
,
]
,
]
,
)
,
)
)
),
));
onTap:
(){
},
);
}
}
}
}
...
...
lib/pages/course/widgets/book.dart
浏览文件 @
9850da9c
...
@@ -6,29 +6,51 @@ class Book extends StatelessWidget {
...
@@ -6,29 +6,51 @@ class Book extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
const
Color
(
0xFFF9F9F9
),
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
const
Offset
(
3
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
margin:
const
EdgeInsets
.
only
(
right:
13
),
padding:
const
EdgeInsets
.
only
(
left:
10
,
right:
10
,
bottom:
13.5
,
top:
16.5
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
// icon
Expanded
(
Container
(
child:
AspectRatio
(
color:
Colors
.
red
,
aspectRatio:
0.85
,
height:
102
,
child:
Container
(
width:
85
,
// margin: const EdgeInsets.only(top: 16,bottom: 10),
color:
Colors
.
red
,
// width: 85,
),
),
),
),
Text
(
'从现在开始,为精彩活从现在开始,为精彩活'
),
Gaps
.
vGaps10
,
Text
(
'作者'
),
const
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'从现在开始,为精彩活从现在开始,为精彩活'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.5
,
color:
Colours
.
c3
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
'作者'
,
style:
TextStyle
(
fontSize:
12
,
height:
1.3
,
color:
Colours
.
c6
,),
textAlign:
TextAlign
.
left
,),
],
),
Gaps
.
vGaps5
,
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Container
(
Container
(
color:
Colors
.
cyan
,
color:
Colors
.
cyan
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
3.5
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
3.5
),
child:
Text
(
'未学习'
),
child:
const
Text
(
'未学习'
,
style:
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
Colours
.
c9
),
),
),
),
Container
(
const
Text
(
'继续学习'
,
style:
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
AppTheme
.
primary
),)
color:
Colors
.
cyan
,
width:
40
,
height:
40
,
)
],
],
)
)
],
],
...
...
lib/pages/forget_pwd/index.dart
浏览文件 @
9850da9c
...
@@ -6,7 +6,9 @@ import 'dart:async';
...
@@ -6,7 +6,9 @@ import 'dart:async';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:go_router/go_router.dart'
;
import
'../../routes/index.dart'
;
import
'../../theme.dart'
;
import
'../../theme.dart'
;
import
'../../utils/index.dart'
;
import
'../../utils/index.dart'
;
import
'../../widgets/index.dart'
;
import
'../../widgets/index.dart'
;
...
...
lib/pages/forget_pwd/view.dart
浏览文件 @
9850da9c
...
@@ -68,10 +68,10 @@ class _ForgetPwdPageState extends State<ForgetPwdPage> {
...
@@ -68,10 +68,10 @@ class _ForgetPwdPageState extends State<ForgetPwdPage> {
),
),
Gaps
.
vGaps40
,
Gaps
.
vGaps40
,
CustomGradientButton
(
CustomGradientButton
(
text:
'
立即登录
'
,
text:
'
下一步
'
,
isEnabled:
!
controller
.
enable
,
isEnabled:
!
controller
.
enable
,
onPressed:
()
{
onPressed:
()
{
context
.
pushNamed
(
Routes
.
resetPwd
);
},
},
)
)
],
],
...
...
lib/pages/login/view.dart
浏览文件 @
9850da9c
...
@@ -20,6 +20,7 @@ class _LoginPageState extends State<LoginPage> {
...
@@ -20,6 +20,7 @@ class _LoginPageState extends State<LoginPage> {
builder:
(
controller
)
=>
GestureDetector
(
builder:
(
controller
)
=>
GestureDetector
(
onTap:
()
=>
Tools
.
unfocus
(),
onTap:
()
=>
Tools
.
unfocus
(),
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
CustomAppBar
(
appBar:
CustomAppBar
(
systemOverlayStyle:
Theme
.
of
(
context
).
brightness
==
Brightness
.
light
systemOverlayStyle:
Theme
.
of
(
context
).
brightness
==
Brightness
.
light
?
SystemUiOverlayStyle
.
dark
?
SystemUiOverlayStyle
.
dark
...
...
lib/pages/reset_pwd/controller.dart
0 → 100644
浏览文件 @
9850da9c
part of
reset_pwd
;
class
ResetPwdController
extends
GetxController
{
// 新密码
final
TextEditingController
pwdInput
=
TextEditingController
();
// 确认密码
final
TextEditingController
pwd2Input
=
TextEditingController
();
// 显示密码
final
ValueNotifier
<
bool
>
showPassword
=
ValueNotifier
(
false
);
// 显示密码
final
ValueNotifier
<
bool
>
showPassword2
=
ValueNotifier
(
false
);
// 按钮是否可用
bool
_enable
=
false
;
bool
get
enable
=>
_enable
;
void
onShowPassword
()
=>
showPassword
.
value
=
!
showPassword
.
value
;
void
onShowPassword2
()
=>
showPassword2
.
value
=
!
showPassword2
.
value
;
void
setCanClick
(){
if
(
pwdInput
.
text
==
pwd2Input
.
text
){
_enable
=
true
;
}
else
{
_enable
=
false
;
}
update
();
}
@override
void
onClose
()
{
pwd2Input
.
dispose
();
pwdInput
.
dispose
();
super
.
onClose
();
}
}
lib/pages/reset_pwd/index.dart
0 → 100644
浏览文件 @
9850da9c
library
reset_pwd
;
import
'package:flutter_book/utils/index.dart'
;
import
'package:get/get.dart'
;
import
'package:flutter/material.dart'
;
import
'../../widgets/index.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
\ No newline at end of file
lib/pages/reset_pwd/view.dart
0 → 100644
浏览文件 @
9850da9c
part of
reset_pwd
;
class
ResetPwdPage
extends
StatefulWidget
{
const
ResetPwdPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
ResetPwdPage
>
createState
()
=>
_ResetPwdPageState
();
}
class
_ResetPwdPageState
extends
State
<
ResetPwdPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
ResetPwdController
>(
init:
ResetPwdController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'重置密码'
),
),
body:
Container
(
margin:
const
EdgeInsets
.
only
(
left:
10
,
top:
15
,
right:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
ValueListenableBuilder
<
bool
>(
valueListenable:
controller
.
showPassword
,
builder:
(
context
,
value
,
child
)
=>
CustomFormInput
(
obscureText:
!
value
,
hintText:
'请输入新密码'
,
iconData:
value
?
Icons
.
visibility
:
Icons
.
visibility_off
,
controller:
controller
.
pwdInput
,
onChanged:
(
text
){
controller
.
setCanClick
();
},
onIcon:
controller
.
onShowPassword
,
),
),
ValueListenableBuilder
<
bool
>(
valueListenable:
controller
.
showPassword2
,
builder:
(
context
,
value
,
child
)
=>
CustomFormInput
(
obscureText:
!
value
,
hintText:
'请再次输入密码'
,
iconData:
value
?
Icons
.
visibility
:
Icons
.
visibility_off
,
controller:
controller
.
pwd2Input
,
onChanged:
(
text
){
controller
.
setCanClick
();
},
onIcon:
controller
.
onShowPassword2
,
),
),
Container
(
margin:
const
EdgeInsets
.
only
(
left:
5
,
top:
5
),
child:
const
Text
(
'密码必须是6-20个英文字母、数字或符号'
,
style:
TextStyle
(
fontSize:
10
,
color:
Colours
.
c9
),),
)
],
),
),
),
);
}
}
lib/routes/index.dart
浏览文件 @
9850da9c
...
@@ -8,6 +8,7 @@ import 'package:flutter_book/pages/book_pay/index.dart';
...
@@ -8,6 +8,7 @@ import 'package:flutter_book/pages/book_pay/index.dart';
import
'package:flutter_book/pages/forget_pwd/index.dart'
;
import
'package:flutter_book/pages/forget_pwd/index.dart'
;
import
'package:flutter_book/pages/login/index.dart'
;
import
'package:flutter_book/pages/login/index.dart'
;
import
'package:flutter_book/pages/main/index.dart'
;
import
'package:flutter_book/pages/main/index.dart'
;
import
'package:flutter_book/pages/reset_pwd/index.dart'
;
import
'package:flutter_book/pages/splash/index.dart'
;
import
'package:flutter_book/pages/splash/index.dart'
;
import
'package:flutter_book/pages/user_coin/index.dart'
;
import
'package:flutter_book/pages/user_coin/index.dart'
;
import
'package:flutter_book/pages/user_info/index.dart'
;
import
'package:flutter_book/pages/user_info/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
9850da9c
...
@@ -47,8 +47,8 @@ abstract class Routes {
...
@@ -47,8 +47,8 @@ abstract class Routes {
static
final
GoRouter
config
=
GoRouter
(
static
final
GoRouter
config
=
GoRouter
(
initialLocation:
'/
$login
'
,
//
initialLocation: '/$login',
//
initialLocation: '/',
initialLocation:
'/'
,
observers:
[
observer
],
observers:
[
observer
],
routes:
[
routes:
[
GoRoute
(
GoRoute
(
...
@@ -78,6 +78,7 @@ abstract class Routes {
...
@@ -78,6 +78,7 @@ abstract class Routes {
child:
const
AdPage
()
child:
const
AdPage
()
)
)
),
),
/// 登录模块
GoRoute
(
GoRoute
(
path:
'/
$login
'
,
path:
'/
$login
'
,
name:
login
,
name:
login
,
...
@@ -87,6 +88,24 @@ abstract class Routes {
...
@@ -87,6 +88,24 @@ abstract class Routes {
child:
const
LoginPage
()
child:
const
LoginPage
()
)
)
),
),
GoRoute
(
path:
'/
$forgetPwd
'
,
name:
forgetPwd
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
const
ForgetPwdPage
()
)
),
GoRoute
(
path:
'/
$resetPwd
'
,
name:
resetPwd
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
const
ResetPwdPage
()
)
),
GoRoute
(
GoRoute
(
path:
'/
$web
'
,
path:
'/
$web
'
,
name:
web
,
name:
web
,
...
@@ -159,15 +178,7 @@ abstract class Routes {
...
@@ -159,15 +178,7 @@ abstract class Routes {
child:
const
UserCoinPage
()
child:
const
UserCoinPage
()
)
)
),
),
GoRoute
(
path:
'/
$forgetPwd
'
,
name:
forgetPwd
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
const
ForgetPwdPage
()
)
)
]
]
);
);
...
...
lib/theme.dart
浏览文件 @
9850da9c
...
@@ -71,7 +71,7 @@ abstract class AppTheme {
...
@@ -71,7 +71,7 @@ abstract class AppTheme {
static
ThemeData
get
light
{
static
ThemeData
get
light
{
var
scheme
=
ColorScheme
.
light
(
var
scheme
=
ColorScheme
.
light
(
background:
const
Color
(
0xFFF9F9F9
)
,
background:
Colors
.
white
,
onBackground:
const
Color
(
0xFF333333
),
onBackground:
const
Color
(
0xFF333333
),
surface:
Colors
.
white
,
surface:
Colors
.
white
,
onSurface:
const
Color
(
0xFF333333
),
onSurface:
const
Color
(
0xFF333333
),
...
@@ -79,7 +79,7 @@ abstract class AppTheme {
...
@@ -79,7 +79,7 @@ abstract class AppTheme {
onPrimary:
Colors
.
white
,
onPrimary:
Colors
.
white
,
secondary:
const
Color
(
0xFFFFB800
),
secondary:
const
Color
(
0xFFFFB800
),
onSecondary:
Colors
.
white
,
onSecondary:
Colors
.
white
,
tertiary:
const
Color
(
0xFFF4F6F9
)
,
tertiary:
Colors
.
white
,
outline:
const
Color
(
0xFFD5D5D5
),
outline:
const
Color
(
0xFFD5D5D5
),
shadow:
const
Color
(
0xFFAB1941
).
withOpacity
(
0.08
),
shadow:
const
Color
(
0xFFAB1941
).
withOpacity
(
0.08
),
error:
error
,
error:
error
,
...
...
lib/widgets/input.dart
浏览文件 @
9850da9c
...
@@ -274,7 +274,7 @@ class CustomInput extends StatelessWidget {
...
@@ -274,7 +274,7 @@ class CustomInput extends StatelessWidget {
),
),
decoration:
decoration
.
copyWith
(
decoration:
decoration
.
copyWith
(
hintText:
hintText
,
hintText:
hintText
,
hintStyle:
const
TextStyle
(
fontWeight:
FontWeight
.
normal
,
color:
Colours
.
c9
),
hintStyle:
const
TextStyle
(
fontWeight:
FontWeight
.
normal
,
color:
Colours
.
c9
,
fontSize:
13
),
suffixIconConstraints:
const
BoxConstraints
(),
suffixIconConstraints:
const
BoxConstraints
(),
suffixIcon:
_suffixIcon
(
decorationTheme
),
suffixIcon:
_suffixIcon
(
decorationTheme
),
),
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论