团队开发sprint 第二天
2024-04-20
项目任务进展: 5小时(11/50)
会议照片
过去一天完成了哪些任务
-
今天完成的注册功能
`
//注册功能
Futureregister(
BuildContext context,
String username,
String password,
String username2,
String phoneNumber,
String email)
async {
try {
Dio dio = Dio();
String checkUrl = "http://192.168.211.14:9090/user/checkUserNameExistence?userName=$username";
Response checkResponse = await dio.get(checkUrl);if (checkResponse.data) {
// 用户名已存在,提示用户无法注册
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('注册失败'),
content: Text('用户名已存在,请选择其他用户名'),
actions:[
TextButton(
onPressed: () {
Navigator.of(context).pop(); // 关闭对话框
},
child: Text('确定'),
),
],
);
},
);
return;
}// 用户名不存在,可以进行注册
String registerUrl = "http://192.168.211.14:9090/user";
Map<String, dynamic> data = {
"user_name": username,
"user_password": password,
"user_name2": username2,
"user_phone": phoneNumber,
"user_email": email
};
Response response = await dio.post(registerUrl, data: data);if (response.statusCode == 200) {
// 注册成功
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('注册成功'),
actions:[
TextButton(
onPressed: () {
Navigator.of(context).pop(); // 关闭对话框
Navigator.of(context).pushReplacement( // 替换当前页面为登录页面
MaterialPageRoute(builder: (context) => LoginPage(key: UniqueKey())),
);
},
child: Text('确定'),
),
],
);
},
);
} else {
// 注册失败
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('注册失败'),
content: Text('错误码: ${response.statusCode}'),
actions:[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('确定'),
),
],
);
},
);
}
} catch (e) {
// 请求过程中出现错误
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('请求错误'),
content: Text('$e'),
actions:[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('确定'),
),
],
);
},
);
}
}
`
- 全部组员将因flutter框架的环境配置导致的报错问题进行解决
接下来的计划
- 完成登录功能并主动跳转到主页面
- 计划进行对软件内置chat-gpt的学习
- 继续学习Springboot和flutter
还剩下哪些任务
- 主页面
- 专栏功能
- 内置AI对话功能
- 相应的数据库表
遇到了哪些困难
-
flutter前端无故爆红,每位小组成员都有过爆红经历,经过对环境问题逐个搜索最终解决
收获和疑问 -
学了很多flutter的知识,并且基本了解了flutter前端的运用
-
springboot的学习充满困难
任务面板
燃尽图