Skip to content

Commit fd6a56c

Browse files
committed
폰트 추가, 로그인 페이지 개발
1 parent 188240e commit fd6a56c

12 files changed

+370
-163
lines changed

fonts/Binggrae2/Binggrae2-Bold.ttf

7.02 MB
Binary file not shown.

fonts/Binggrae2/Binggrae2.ttf

6.43 MB
Binary file not shown.

lib/AuthCheck.dart

+94-29
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:flutter/material.dart';
33
import 'package:restaurant/Widget/NavigatePage.dart';
4+
import 'package:restaurant/inmat/auth/inmat_auth.dart';
5+
import 'package:restaurant/inmat/auth/user_model.dart';
6+
import 'package:restaurant/inmat/inMatAPI/inMatHttp.dart';
47

5-
import 'Widget/SignIn.dart';
6-
import 'Widget/SignIn2.dart';
7-
import 'Widget/SignUp.dart';
8-
import 'Widget/PasswordFind.dart';
8+
import 'Widget/Account/ChooseSignIn.dart';
9+
import 'Widget/account2/SignIn.dart';
10+
import 'Widget/account2/SignIn2.dart';
11+
import 'Widget/account2/SignUp.dart';
12+
import 'Widget/account2/PasswordFind.dart';
913

1014
class AuthCheck extends StatefulWidget {
1115
const AuthCheck({Key? key}) : super(key: key);
@@ -17,6 +21,7 @@ class AuthCheck extends StatefulWidget {
1721
class _AuthCheckState extends State<AuthCheck> {
1822
@override
1923
Widget build(BuildContext context) {
24+
User? user = InMatAuth.instance.currentUser;
2025
return Scaffold(
2126
appBar: AppBar(
2227
title: Text("회원 체크"),
@@ -25,18 +30,20 @@ class _AuthCheckState extends State<AuthCheck> {
2530
child: Column(
2631
mainAxisAlignment: MainAxisAlignment.center,
2732
children: [
33+
34+
Text("user information: ${user ?? "null"}"),
2835
Padding(
2936
padding: const EdgeInsets.all(8.0),
3037
child: CupertinoButton(
3138
color: Colors.grey,
3239
child: Text("메인 페이지 이동"),
3340
onPressed: () {
34-
Navigator.pushAndRemoveUntil(
35-
context,
36-
CupertinoPageRoute(
37-
builder: (context) => const NavigatePage(),
38-
),
39-
(route) => false);
41+
Navigator.push(
42+
context,
43+
CupertinoPageRoute(
44+
builder: (context) => const NavigatePage(),
45+
),
46+
);
4047
}),
4148
),
4249
Padding(
@@ -46,10 +53,67 @@ class _AuthCheckState extends State<AuthCheck> {
4653
child: Text("로그인 페이지 이동"),
4754
onPressed: () {
4855
Navigator.push(
49-
context,
50-
CupertinoPageRoute(
51-
builder: (context) => const SignIn(),
52-
),
56+
context,
57+
CupertinoPageRoute(
58+
builder: (context) => const ChooseSignIn(),
59+
),
60+
);
61+
}),
62+
),
63+
Padding(
64+
padding: const EdgeInsets.all(8.0),
65+
child: CupertinoButton(
66+
color: Colors.redAccent,
67+
child: Text("로그아웃"),
68+
onPressed: () {
69+
InMatAuth.instance.signOut();
70+
}),
71+
),
72+
Padding(
73+
padding: const EdgeInsets.all(8.0),
74+
child: CupertinoButton(
75+
color: Colors.lightGreen,
76+
child: Text("회원 정보 수정"),
77+
onPressed: () async {
78+
try {
79+
await InMatAuth.instance.updateProfile({
80+
"age": 20,
81+
"gender": "F",
82+
});
83+
} on ExpirationAccessToken {
84+
// 액세스 토큰 만료: 로그아웃 후 다시 로그인
85+
} on AccessDenied {
86+
// 접근 권한 없음
87+
} on OverlappingNickName {
88+
// 닉네임 중복 알림
89+
} catch (e) {
90+
print(e);
91+
// 오류 메세지 알림
92+
}
93+
}),
94+
),
95+
Padding(
96+
padding: const EdgeInsets.all(8.0),
97+
child: CupertinoButton(
98+
color: Colors.blue,
99+
child: Text("새로고침"),
100+
onPressed: () {
101+
setState(() {
102+
103+
});
104+
}),
105+
),
106+
Padding(
107+
padding: const EdgeInsets.all(8.0),
108+
child: CupertinoButton(
109+
color: Colors.grey,
110+
child: Text("로그인 페이지 1 이동"),
111+
onPressed: () {
112+
Navigator.push(
113+
context,
114+
CupertinoPageRoute(
115+
builder: (context) => const SignIn(),
116+
),
53117
);
54118
}),
55119
),
@@ -60,10 +124,10 @@ class _AuthCheckState extends State<AuthCheck> {
60124
child: Text("로그인 페이지 2 이동"),
61125
onPressed: () {
62126
Navigator.push(
63-
context,
64-
CupertinoPageRoute(
65-
builder: (context) => const SignIn2(),
66-
),
127+
context,
128+
CupertinoPageRoute(
129+
builder: (context) => const SignIn2(),
130+
),
67131
);
68132
}),
69133
),
@@ -74,11 +138,11 @@ class _AuthCheckState extends State<AuthCheck> {
74138
child: Text("회원가입 페이지 이동"),
75139
onPressed: () {
76140
Navigator.push(
77-
context,
78-
CupertinoPageRoute(
79-
builder: (context) => const SignUp(),
80-
),
81-
);
141+
context,
142+
CupertinoPageRoute(
143+
builder: (context) => const SignUp(),
144+
),
145+
);
82146
}),
83147
),
84148
Padding(
@@ -88,16 +152,17 @@ class _AuthCheckState extends State<AuthCheck> {
88152
child: Text("비밀번호 찾기 페이지 이동"),
89153
onPressed: () {
90154
Navigator.push(
91-
context,
92-
CupertinoPageRoute(
93-
builder: (context) => const PasswordFind(),
94-
),
95-
);
155+
context,
156+
CupertinoPageRoute(
157+
builder: (context) => const PasswordFind(),
158+
),
159+
);
96160
}),
97-
)
161+
),
98162
],
99163
),
100164
),
101165
);
102166
}
103167
}
168+

lib/Widget/Account/ChooseSignIn.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import 'package:flutter/material.dart';
33

44
import '../NavigatePage.dart';
55
import 'RegisterEmail.dart';
6-
import 'RegisterProfile.dart';
6+
77
import 'SignInEmail.dart';
88

9-
class SignIn extends StatefulWidget {
10-
const SignIn({Key? key}) : super(key: key);
9+
class ChooseSignIn extends StatefulWidget {
10+
const ChooseSignIn({Key? key}) : super(key: key);
1111

1212
@override
13-
State<SignIn> createState() => _SignInState();
13+
State<ChooseSignIn> createState() => _ChooseSignInState();
1414
}
1515

16-
class _SignInState extends State<SignIn> {
16+
class _ChooseSignInState extends State<ChooseSignIn> {
1717
@override
1818
Widget build(BuildContext context) {
1919
return Scaffold(

lib/Widget/SignIn.dart

-91
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)