@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
7
7
import 'package:flutter_svg/flutter_svg.dart' ;
8
8
import 'package:tradule/common/app_bar_blur.dart' ;
9
9
import 'package:tradule/common/login_text_form_field.dart' ;
10
+ import 'package:tradule/common/my_text_style.dart' ;
10
11
import 'package:tradule/common/section.dart' ;
11
12
import 'package:tradule/server_wrapper/server_wrapper.dart' ;
12
13
import 'package:tradule/common/color.dart' ;
@@ -254,7 +255,145 @@ class _LoginScreenState extends State<LoginScreen> {
254
255
const SizedBox (height: 10 ),
255
256
TextButton (
256
257
onPressed: () {
257
- print ('비밀번호 찾기 버튼 클릭' );
258
+ // print('비밀번호 찾기 버튼 클릭');
259
+ // 이메일 입력 다이얼로그 표시
260
+ showDialog (
261
+ context: context,
262
+ builder: (_) {
263
+ var emailController =
264
+ TextEditingController ();
265
+ return AlertDialog (
266
+ title: const Text ('비밀번호 찾기' ),
267
+ content: Column (
268
+ mainAxisSize: MainAxisSize .min,
269
+ children: [
270
+ const Text (
271
+ '가입 시 사용한 이메일을 입력하세요.' ,
272
+ style: TextStyle (
273
+ fontSize: 12.0 ,
274
+ fontFamily: 'NotoSansKR' ,
275
+ fontVariations: [
276
+ FontVariation ('wght' , 200.0 ),
277
+ ],
278
+ ),
279
+ ),
280
+ const SizedBox (height: 10 ),
281
+ TextFormField (
282
+ controller: emailController,
283
+ decoration: InputDecoration (
284
+ hintText: 'Email' ,
285
+ hintStyle: TextStyle (
286
+ color: cGray,
287
+ fontFamily: 'NotoSansKR' ,
288
+ fontVariations: const [
289
+ FontVariation ('wght' , 200.0 ),
290
+ ],
291
+ ),
292
+ filled: true ,
293
+ fillColor:
294
+ const Color (0xFFF8F8F8 ),
295
+ border: OutlineInputBorder (
296
+ borderRadius:
297
+ BorderRadius .circular (30.0 ),
298
+ borderSide: BorderSide .none,
299
+ ),
300
+ contentPadding:
301
+ const EdgeInsets .symmetric (
302
+ vertical: 17.0 ,
303
+ horizontal: 25.0 ,
304
+ ),
305
+ ),
306
+ ),
307
+ const SizedBox (height: 10 ),
308
+ ElevatedButton (
309
+ onPressed: () async {
310
+ Navigator .pop (context);
311
+ var result = await ServerWrapper
312
+ .sendPasswordResetEmail (
313
+ emailController.text);
314
+ print (result.message);
315
+ if (! context.mounted) return ;
316
+ if (! result.success) {
317
+ print ('비밀번호 찾기 실패' );
318
+ showDialog (
319
+ context: context,
320
+ builder: (context) {
321
+ return AlertDialog (
322
+ title:
323
+ const Text ('비밀번호 찾기' ),
324
+ content: Column (
325
+ mainAxisSize:
326
+ MainAxisSize .min,
327
+ children: [
328
+ Text (
329
+ result.message! ,
330
+ style: myTextStyle (
331
+ fontSize: 12.0 ,
332
+ ),
333
+ ),
334
+ const SizedBox (
335
+ height: 10 ),
336
+ ElevatedButton (
337
+ onPressed: () {
338
+ Navigator .pop (
339
+ context);
340
+ },
341
+ child: const Text (
342
+ '확인' ),
343
+ ),
344
+ ],
345
+ ),
346
+ );
347
+ },
348
+ );
349
+ return ;
350
+ }
351
+ showDialog (
352
+ context: context,
353
+ builder: (context) {
354
+ return AlertDialog (
355
+ title:
356
+ const Text ('비밀번호 찾기' ),
357
+ content: Column (
358
+ mainAxisSize:
359
+ MainAxisSize .min,
360
+ children: [
361
+ const Text (
362
+ '입력하신 이메일로 비밀번호 재설정 링크를 보냈습니다.' ,
363
+ style: TextStyle (
364
+ fontSize: 12.0 ,
365
+ fontFamily:
366
+ 'NotoSansKR' ,
367
+ fontVariations: [
368
+ FontVariation (
369
+ 'wght' ,
370
+ 200.0 ),
371
+ ],
372
+ ),
373
+ ),
374
+ const SizedBox (
375
+ height: 10 ),
376
+ ElevatedButton (
377
+ onPressed: () {
378
+ Navigator .pop (
379
+ context);
380
+ },
381
+ child:
382
+ const Text ('확인' ),
383
+ ),
384
+ ],
385
+ ),
386
+ );
387
+ },
388
+ );
389
+ },
390
+ child: const Text ('전송' ),
391
+ ),
392
+ ],
393
+ ),
394
+ );
395
+ },
396
+ );
258
397
},
259
398
child: Text (
260
399
'forgot your password?' ,
0 commit comments