Skip to content

Commit 3b21b05

Browse files
authored
fix: 로그인 및 회원가입 중/이후 뒤로가기 가능한 문제 수정 (#44)
1 parent 4b0c39c commit 3b21b05

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

frontend/ongi/lib/screens/login/login_ready_screen.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:ongi/screens/bottom_nav.dart';
55

66
class LoginReadyScreen extends StatefulWidget {
77
final String username;
8+
89
const LoginReadyScreen({required this.username, super.key});
910

1011
@override
@@ -20,8 +21,9 @@ class _LoginReadyScreenState extends State<LoginReadyScreen> {
2021

2122
_timer = Timer(const Duration(seconds: 2), () {
2223
if (!mounted) return;
23-
Navigator.of(context).pushReplacement(
24+
Navigator.of(context).pushAndRemoveUntil(
2425
MaterialPageRoute(builder: (_) => const BottomNavScreen()),
26+
(Route<dynamic> route) => false,
2527
);
2628
});
2729
}
@@ -71,4 +73,4 @@ class _LoginReadyScreenState extends State<LoginReadyScreen> {
7173
),
7274
);
7375
}
74-
}
76+
}

frontend/ongi/lib/screens/signup/mode_screen.dart

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class ModeScreen extends StatelessWidget {
1111
const ModeScreen(this.username, {super.key});
1212

1313
Future<void> _setModeAndRegister(BuildContext context, String mode) async {
14-
final scaffoldMessenger = ScaffoldMessenger.of(context);
1514
ScaffoldMessenger.of(context).showSnackBar(
1615
SnackBar(
1716
content: const Text(
@@ -20,9 +19,7 @@ class ModeScreen extends StatelessWidget {
2019
),
2120
backgroundColor: Colors.white,
2221
behavior: SnackBarBehavior.floating,
23-
shape: RoundedRectangleBorder(
24-
borderRadius: BorderRadius.circular(20),
25-
),
22+
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
2623
duration: const Duration(seconds: 2),
2724
),
2825
);
@@ -63,16 +60,14 @@ class ModeScreen extends StatelessWidget {
6360
);
6461

6562
final loginService = LoginService();
66-
await loginService.login(
67-
email: email,
68-
password: password,
69-
);
63+
await loginService.login(email: email, password: password);
7064

7165
if (!context.mounted) return;
72-
73-
Navigator.push(
66+
67+
Navigator.pushAndRemoveUntil(
7468
context,
7569
MaterialPageRoute(builder: (context) => const FamilynameScreen()),
70+
(route) => false,
7671
);
7772
} catch (e) {
7873
ScaffoldMessenger.of(context).showSnackBar(
@@ -105,18 +100,19 @@ class ModeScreen extends StatelessWidget {
105100
child: Row(
106101
mainAxisAlignment: MainAxisAlignment.center,
107102
children: List.generate(
108-
5, (index) => Container(
109-
width: 58,
110-
height: 7.5,
111-
margin: const EdgeInsets.symmetric(horizontal: 6),
112-
decoration: BoxDecoration(
113-
color: index != 4
114-
? AppColors.ongiOrange
115-
: AppColors.ongiOrange.withOpacity(0.4),
116-
borderRadius: BorderRadius.circular(4),
103+
5,
104+
(index) => Container(
105+
width: 58,
106+
height: 7.5,
107+
margin: const EdgeInsets.symmetric(horizontal: 6),
108+
decoration: BoxDecoration(
109+
color: index != 4
110+
? AppColors.ongiOrange
111+
: AppColors.ongiOrange.withOpacity(0.4),
112+
borderRadius: BorderRadius.circular(4),
113+
),
117114
),
118115
),
119-
),
120116
),
121117
),
122118
Padding(
@@ -206,12 +202,12 @@ class ModeScreen extends StatelessWidget {
206202
height: 1.2,
207203
color: AppColors.ongiOrange,
208204
),
209-
)
210-
)
211-
)
212-
]
205+
),
206+
),
207+
),
208+
],
213209
),
214210
),
215211
);
216212
}
217-
}
213+
}

frontend/ongi/lib/screens/signup/ready_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ class ReadyScreen extends StatelessWidget {
4646
borderRadius: BorderRadius.circular(20),
4747
),
4848
),
49-
onPressed: () => Navigator.push(
49+
onPressed: () => Navigator.pushAndRemoveUntil(
5050
context,
5151
MaterialPageRoute(builder: (_) => const BottomNavScreen()),
52+
(Route<dynamic> route) => false,
5253
),
5354
child: const Text(
5455
'준비완료!',

0 commit comments

Comments
 (0)