Skip to content

Commit 6290e0c

Browse files
committed
♻️ FindSchoolScreen 리팩토링
1 parent 9329722 commit 6290e0c

File tree

2 files changed

+56
-58
lines changed

2 files changed

+56
-58
lines changed

lib/presentation/sign_up/screens/find_school_screen.dart

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ class _FindSchoolScreenState extends State<FindSchoolScreen> {
3939
static const Color SELECTED_BORDER_COLOR = Color(0xFF2756F1);
4040
static const double SELECTED_BORDER_OPACITY = 0.5;
4141

42-
/// ====================================
4342
final List<SchoolInfo> schools = [
4443
SchoolInfo(name: "대충중학교", address: "대충남도 대충시 대충면 대충로 1-2"),
4544
SchoolInfo(name: "대충고등학교", address: "대충남도 대충시 대충면 대충로 3-4"),
4645
SchoolInfo(name: "가나초등학교", address: "대충남도 대충시 가나동 가나로 5-6"),
4746
SchoolInfo(name: "다라중학교", address: "대충남도 대충시 다라동 다라로 7-8"),
4847
];
4948

50-
/// ====================================
5149
@override
5250
void initState() {
5351
super.initState();
@@ -223,7 +221,7 @@ class _FindSchoolScreenState extends State<FindSchoolScreen> {
223221
],
224222
);
225223

226-
Widget _startButton(bool enabled) => Container(
224+
Widget _startButton(bool enabled) => SizedBox(
227225
width: double.infinity,
228226
height: 54.h,
229227
child: ElevatedButton(
@@ -252,7 +250,10 @@ class _FindSchoolScreenState extends State<FindSchoolScreen> {
252250
return Scaffold(
253251
backgroundColor: JusicoolColor.white,
254252
appBar: AppBar(
255-
leading: const BackButton(),
253+
leading: Padding(
254+
padding: EdgeInsets.only(left: 15.w, top: 20.h),
255+
child: const BackButton(),
256+
),
256257
backgroundColor: JusicoolColor.white,
257258
elevation: 0,
258259
systemOverlayStyle: const SystemUiOverlayStyle(
@@ -264,62 +265,62 @@ class _FindSchoolScreenState extends State<FindSchoolScreen> {
264265
),
265266
body: SafeArea(
266267
child: Padding(
267-
padding: EdgeInsets.symmetric(horizontal: 24.w),
268+
padding: EdgeInsets.fromLTRB(24.w, 26.h, 24.w, 56.h),
268269
child: Column(
269270
crossAxisAlignment: CrossAxisAlignment.start,
271+
spacing: 30.h,
270272
children: [
271-
// 제목
272-
Padding(
273-
padding: EdgeInsets.only(top: 10.h),
274-
child: Text(
275-
'현재 재학 중인 학교 이름을 입력해주세요',
276-
style: JusicoolTypography.subTitle.copyWith(
277-
fontSize: 18.sp,
278-
color: JusicoolColor.black,
279-
),
280-
),
281-
),
282-
// 라벨
283-
Padding(
284-
padding: EdgeInsets.only(top: 30.h),
285-
child: Text(
286-
'학교명',
287-
style: JusicoolTypography.bodySmall.copyWith(
288-
fontSize: 16.sp,
289-
color: JusicoolColor.black,
273+
Column(
274+
children: [
275+
Column(
276+
crossAxisAlignment: CrossAxisAlignment.start,
277+
spacing: 29.h,
278+
children: [
279+
Text(
280+
'현재 재학 중인 학교 이름을 입력해주세요',
281+
style: JusicoolTypography.subTitle.copyWith(
282+
fontSize: 18.sp,
283+
color: JusicoolColor.black,
284+
),
285+
),
286+
Column(
287+
crossAxisAlignment: CrossAxisAlignment.start,
288+
spacing: 4.h,
289+
children: [
290+
Text(
291+
'학교명',
292+
style: JusicoolTypography.bodySmall.copyWith(
293+
fontSize: 16.sp,
294+
color: JusicoolColor.black,
295+
),
296+
),
297+
_searchRow(),
298+
],
299+
),
300+
],
290301
),
291-
),
302+
],
292303
),
293-
// 검색 입력 & 버튼
294-
Padding(padding: EdgeInsets.only(top: 12.h), child: _searchRow()),
295-
// 검색 결과 리스트
296304
Expanded(
297-
child: Padding(
298-
padding: EdgeInsets.only(top: 32.h),
299-
child:
300-
filteredSchools.isEmpty
301-
? Center(
302-
child: Text(
303-
'검색 결과가 없습니다.',
304-
style: JusicoolTypography.bodyMedium.copyWith(
305-
fontSize: 16.sp,
306-
color: JusicoolColor.gray600,
307-
),
305+
child:
306+
filteredSchools.isEmpty
307+
? Center(
308+
child: Text(
309+
'검색 결과가 없습니다.',
310+
style: JusicoolTypography.bodyMedium.copyWith(
311+
fontSize: 16.sp,
312+
color: JusicoolColor.gray600,
308313
),
309-
)
310-
: ListView.builder(
311-
itemCount: filteredSchools.length,
312-
itemBuilder:
313-
(_, index) =>
314-
_schoolCard(filteredSchools[index]),
315314
),
316-
),
317-
),
318-
// 시작하기 버튼
319-
Padding(
320-
padding: EdgeInsets.only(bottom: 24.h),
321-
child: _startButton(isSchoolSelected),
315+
)
316+
: ListView.builder(
317+
padding: EdgeInsets.only(top: 2.h),
318+
itemCount: filteredSchools.length,
319+
itemBuilder:
320+
(_, index) => _schoolCard(filteredSchools[index]),
321+
),
322322
),
323+
Column(children: [_startButton(isSchoolSelected)]),
323324
],
324325
),
325326
),

lib/presentation/sign_up/screens/password_create_screen.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ class _PasswordCreateScreenState extends State<PasswordCreateScreen> {
114114
);
115115
}
116116

117-
/* -------------------------------- WIDGET -------------------------------- */
118-
119117
@override
120118
Widget build(BuildContext context) {
121119
final isButtonEnabled =
@@ -136,12 +134,12 @@ class _PasswordCreateScreenState extends State<PasswordCreateScreen> {
136134
padding: EdgeInsets.fromLTRB(24.w, 26.h, 24.w, 56.h),
137135
child: Column(
138136
crossAxisAlignment: CrossAxisAlignment.start,
139-
spacing: 40.h, // 🔹 주요 간격 한 번에 적용
137+
spacing: 40.h,
140138
children: [
141139
Text('비밀번호를 입력해주세요', style: _titleStyle),
142140
Column(
143141
crossAxisAlignment: CrossAxisAlignment.start,
144-
spacing: 4.h, // 🔸 라벨 ↔ 필드 간격
142+
spacing: 4.h,
145143
children: [
146144
Text(
147145
'비밀번호',
@@ -155,7 +153,7 @@ class _PasswordCreateScreenState extends State<PasswordCreateScreen> {
155153
DefaultTextField(
156154
controller: _passwordController,
157155
hintText: '비밀번호를 입력해주세요',
158-
obscureText: true, // ⭐ 항상 * 표시
156+
obscureText: true,
159157
errorText:
160158
_isPasswordValid
161159
? null
@@ -173,7 +171,6 @@ class _PasswordCreateScreenState extends State<PasswordCreateScreen> {
173171
),
174172
],
175173
),
176-
// ───────── 비밀번호 재입력 섹션 ─────────
177174
Column(
178175
crossAxisAlignment: CrossAxisAlignment.start,
179176
spacing: 4.h,
@@ -190,7 +187,7 @@ class _PasswordCreateScreenState extends State<PasswordCreateScreen> {
190187
DefaultTextField(
191188
controller: _confirmPasswordController,
192189
hintText: '비밀번호를 다시 입력해주세요',
193-
obscureText: true, // ⭐ 항상 * 표시
190+
obscureText: true,
194191
errorText: _isPasswordMatched ? null : '비밀번호가 일치하지 않아요',
195192
validator: (value) {
196193
final confirmPwd = value ?? '';

0 commit comments

Comments
 (0)