Skip to content

Commit

Permalink
Merge pull request #119 from pknu-wap/develop-FE
Browse files Browse the repository at this point in the history
feature/119apk 파일 빌드
  • Loading branch information
mututu17 authored May 2, 2024
2 parents 0c978b0 + 1ad5cdb commit c4c5b81
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 135 deletions.
34 changes: 17 additions & 17 deletions client/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 34 additions & 35 deletions client/front/lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class MyApp extends StatelessWidget {
class LogIn extends StatefulWidget {
@override
State<LogIn> createState() => _LogInState();

}
class _LogInState extends State<LogIn> {
final int maxStudentIdLength = 9; // 학번 최대 길이 설정
Expand All @@ -31,21 +30,22 @@ class _LogInState extends State<LogIn> {
TextEditingController _UsernameController = TextEditingController();
TextEditingController _PasswordController = TextEditingController();


request(String username, String password) async{
String url = "http://ec2-43-201-110-178.ap-northeast-2.compute.amazonaws.com:8080/login";
request(String username, String password) async {
String url =
"http://ec2-43-201-110-178.ap-northeast-2.compute.amazonaws.com:8080/login";
String param = "?username=$username&password=$password";
print(url + param);
try {
var post = await http.post(Uri.parse(url+param));
var post = await http.post(Uri.parse(url + param));
if (post.statusCode == 200) {
setState(() {
isVisible = false;
});
Navigator.push( //로그인 버튼 누르면 게시글 페이지로 이동하게 설정
context, MaterialPageRoute(builder: (context) => Main_post_page()));
}
else
Navigator.push(
//로그인 버튼 누르면 게시글 페이지로 이동하게 설정
context,
MaterialPageRoute(builder: (context) => Main_post_page()));
} else
{
setState(() {
isVisible = true;
Expand All @@ -57,7 +57,6 @@ class _LogInState extends State<LogIn> {
}
}


@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -82,7 +81,8 @@ class _LogInState extends State<LogIn> {
width: 320,
height: 50,
child: TextField(
maxLength: maxStudentIdLength, // 최대 길이 설정
maxLength: maxStudentIdLength,
// 최대 길이 설정
controller: _UsernameController,
onChanged: (text) {
if (text.length > maxStudentIdLength) {
Expand All @@ -92,10 +92,10 @@ class _LogInState extends State<LogIn> {
decoration: InputDecoration(
hintText: '학번',
hintStyle: TextStyle(
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF404040),
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF404040),
),
contentPadding: EdgeInsets.only(left: 17, right: 17),
// 텍스트를 수직으로 가운데 정렬
Expand Down Expand Up @@ -136,10 +136,10 @@ class _LogInState extends State<LogIn> {
decoration: InputDecoration(
hintText: '비밀번호',
hintStyle: TextStyle(
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF404040),
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF404040),
),
contentPadding: EdgeInsets.only(left: 17, right: 17),
// 텍스트를 수직으로 가운데 정렬
Expand Down Expand Up @@ -198,22 +198,24 @@ class _LogInState extends State<LogIn> {
// 로그인 버튼 구현(로그인 글자 + 버튼 누르면 메인화면으로 이동)
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,//이거 end로 이동
mainAxisAlignment: MainAxisAlignment.center, //이거 end로 이동
children: [
Container(
margin: EdgeInsets.only(top: 17.0),//비밀번호 찾기 생기면 margin 11로
margin: EdgeInsets.only(top: 17.0),
//비밀번호 찾기 생기면 margin 11로
// margin: EdgeInsets.only(right: 11.0, top: 17.0), // 기존 마진
child: Visibility(visible: isVisible,
child: Text(
"잘못된 학번 또는 비밀번호입니다.",
style: TextStyle(
fontSize: 14,
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
color: Color(0xFFEC5147),
),
),
),
child: Visibility(
visible: isVisible,
child: Text(
"잘못된 학번 또는 비밀번호입니다.",
style: TextStyle(
fontSize: 14,
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
color: Color(0xFFEC5147),
),
),
),
),
// GestureDetector(
// onTap: () {
Expand All @@ -240,9 +242,6 @@ class _LogInState extends State<LogIn> {
),
),




// GestureDetector(
// onTap: () {
// // 클릭 시 수행할 작업을 여기에 추가하세요
Expand Down
8 changes: 8 additions & 0 deletions client/front/lib/main_post_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
import 'request.dart';

class Post_List_view extends StatefulWidget{
@override
Expand Down Expand Up @@ -824,6 +825,13 @@ class _Main_post_pageState extends State<Main_post_page> {
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) =>
Request(),
),
);

},
icon: Image.asset('assets/images/add_icon.png',
color: Color(0xffADADAD),
Expand Down
59 changes: 5 additions & 54 deletions client/front/lib/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
print(u1.name);
print(u1.id.length);

// String str = u1.id;
//
// List<String> charList = str.split('');
//
// for (String char in charList) {
// print(char);
// print("\n");
// }

print(u1.pw);
print(u1.nickname);
}
Expand Down Expand Up @@ -189,13 +180,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
final RegExp nicknameRegex = RegExp(r'^[a-zA-Zㄱ-ㅎ가-힣0-9]{2,12}$');
return nicknameRegex.hasMatch(nickname);
}
// bool isNicknameDuplicate(String nickname, String enteredNickname){
// nickname = Nickname; // 기존에 존재하던 닉네임
// enteredNickname = nicknameController.text;
//
// if(enteredNickname == nickname) return false;
// else return true;
// }

void checkNicknameAvailable(){
String enteredNickname = nicknameController.text;
Expand All @@ -213,24 +197,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
});
}

// void checkNicknameDuplicate(String Nick){
// String nickname = Nick;
// String enteredNickname = nicknameController.text;
// // bool isNicknameDuplicated = isNicknameDuplicate(nickname, enteredNickname);
//
// setState(() {
// // 중복확인 검사
// if ( == false) { // 중복
// nicknameText = "이미 사용하고 있는 닉네임이에요.";
// nicknameTextColor = Color(0xFFE33939);
// }
// else { // 중복x
// nicknameText = "사용 가능한 닉네임이에요.";
// nicknameTextColor = Color(0xFF2BBD28);
// }
// });
// }


bool isValidPassword1(String password) {
// 영문 대문자 최소 1개 이상
Expand Down Expand Up @@ -426,8 +392,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
Container(
margin: EdgeInsets.only(top: 9.74),
// 전체 마진
width: 321,
// 245 + 9.98 + 66.02
width: 320,
// 245 + 8.98 + 66.02
height: 38,
// 텍스트 필드의 높이 설정

Expand Down Expand Up @@ -551,11 +517,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
color: nicknameTextColor

// isValidNickname(nicknameController.text) &&
// !isDuplicateNickname
// ? Color(0XFF2BBD28)
// : Color(0XFFE33939),
),
),
),
Expand Down Expand Up @@ -666,7 +627,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
'', // 입력 길이 표시를 없애는 부분 -> 이 코드 없으면 0/9라는 숫자 생김
),
keyboardType: TextInputType.text,
enabled: nicknameText == "중복 확인이 완료되었습니다.",
enabled: nicknameText == "사용이 가능한 닉네임이에요." || nicknameText == "중복 확인이 완료되었습니다.",
),
),

Expand All @@ -681,10 +642,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
fontFamily: 'Pretendard',
fontWeight: FontWeight.w400,
color: passwordTextColor
// color: isValidNickname(nicknameController.text) &&
// !isDuplicateNickname
// ? Color(0XFF2BBD28)
// : Color(0XFFE33939),
),
),
),
Expand All @@ -709,9 +666,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
margin: EdgeInsets.only(top: 9),
width: 320,
height: 38,
// 텍스트 필드의 높이 설정
/*child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 0),*/
// 가로 패딩 추가
child: TextField(
maxLength: maxPasswordCheckLength,
Expand Down Expand Up @@ -746,7 +700,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
borderSide: BorderSide(
color: Color(0xFFACACAC), width: 0.5 // 테두리 굵기
),
), // 밑줄 없애기
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
Expand Down Expand Up @@ -777,7 +731,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
'', // 입력 길이 표시를 없애는 부분 -> 이 코드 없으면 0/9라는 숫자 생김
),
keyboardType: TextInputType.text,
enabled: passwordText == "",
enabled: nicknameText == "사용이 가능한 닉네임이에요." || nicknameText == "중복 확인이 완료되었습니다.",
),
), // 이메일 텍스트 입력 구현(누르면 글자 사라짐)

Expand Down Expand Up @@ -825,9 +779,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
Color(0xFF7C3D1A))
: MaterialStateProperty.all<Color>(
Color(0xFFBD9E8C)),
/*backgroundColor: MaterialStateProperty.all<Color>(Color(0xFF7C3D1A)),*/
// 0xFF로 시작하는 16진수 색상 코드 사용,
// 버튼의 크기 정하기
minimumSize: MaterialStateProperty.all<Size>(
Size(320, 40)),
// 버튼의 모양 변경하기
Expand Down
Loading

0 comments on commit c4c5b81

Please sign in to comment.