@@ -3,6 +3,7 @@ import 'package:on_time_front/l10n/app_localizations.dart';
33import 'package:on_time_front/core/di/di_setup.dart' ;
44import 'package:on_time_front/domain/use-cases/delete_user_use_case.dart' ;
55import 'package:on_time_front/domain/repositories/user_repository.dart' ;
6+ import 'package:on_time_front/presentation/shared/components/modal_wide_button.dart' ;
67
78class DeleteUserModal {
89 Future <void > showDeleteUserModal (
@@ -68,81 +69,35 @@ class DeleteUserModal {
6869 Column (
6970 mainAxisSize: MainAxisSize .min,
7071 children: [
71- SizedBox (
72- width: 245 ,
73- height: 43 ,
74- child: TextButton (
75- style: ButtonStyle (
76- backgroundColor: WidgetStateProperty .all (
77- colorScheme.surfaceContainerLow),
78- shape: WidgetStateProperty .all (
79- RoundedRectangleBorder (
80- borderRadius: BorderRadius .circular (8 ),
81- ),
82- ),
83- padding: WidgetStateProperty .all (
84- const EdgeInsets .symmetric (
85- vertical: 10 , horizontal: 8 ),
86- ),
87- alignment: Alignment .center,
88- minimumSize:
89- WidgetStateProperty .all (const Size (245 , 43 )),
90- tapTargetSize: MaterialTapTargetSize .shrinkWrap,
91- visualDensity: VisualDensity .compact,
92- ),
93- onPressed: () => Navigator .of (ctx).pop (),
94- child: Text (
95- AppLocalizations .of (context)! .keepUsing,
96- textAlign: TextAlign .center,
97- style: TextStyle (
98- fontFamily: 'Pretendard' ,
99- fontWeight: FontWeight .w600,
100- fontSize: 16 ,
101- height: 1.4 ,
102- color: colorScheme.outline,
103- ),
104- ),
72+ ModalWideButton (
73+ text: AppLocalizations .of (context)! .keepUsing,
74+ color: colorScheme.surfaceContainerLow,
75+ textColor: colorScheme.outline,
76+ textStyle: TextStyle (
77+ fontFamily: 'Pretendard' ,
78+ fontWeight: FontWeight .w600,
79+ fontSize: 16 ,
80+ height: 1.4 ,
81+ color: colorScheme.outline,
10582 ),
83+ onPressed: () => Navigator .of (ctx).pop (),
10684 ),
10785 const SizedBox (height: 8 ),
108- SizedBox (
109- width: 245 ,
110- height: 43 ,
111- child: TextButton (
112- style: ButtonStyle (
113- backgroundColor:
114- WidgetStateProperty .all (colorScheme.error),
115- shape: WidgetStateProperty .all (
116- RoundedRectangleBorder (
117- borderRadius: BorderRadius .circular (8 ),
118- ),
119- ),
120- padding: WidgetStateProperty .all (
121- const EdgeInsets .symmetric (
122- vertical: 10 , horizontal: 8 ),
123- ),
124- alignment: Alignment .center,
125- minimumSize:
126- WidgetStateProperty .all (const Size (245 , 43 )),
127- tapTargetSize: MaterialTapTargetSize .shrinkWrap,
128- visualDensity: VisualDensity .compact,
129- ),
130- onPressed: () {
131- Navigator .of (ctx).pop ();
132- _showDeleteFeedbackModal (context, onConfirm);
133- },
134- child: Text (
135- AppLocalizations .of (context)! .deleteAnyway,
136- textAlign: TextAlign .center,
137- style: TextStyle (
138- fontFamily: 'Pretendard' ,
139- fontWeight: FontWeight .w600,
140- fontSize: 16 ,
141- height: 1.4 ,
142- color: colorScheme.onPrimary,
143- ),
144- ),
86+ ModalWideButton (
87+ text: AppLocalizations .of (context)! .deleteAnyway,
88+ color: colorScheme.error,
89+ textColor: colorScheme.onPrimary,
90+ textStyle: TextStyle (
91+ fontFamily: 'Pretendard' ,
92+ fontWeight: FontWeight .w600,
93+ fontSize: 16 ,
94+ height: 1.4 ,
95+ color: colorScheme.onPrimary,
14596 ),
97+ onPressed: () {
98+ Navigator .of (ctx).pop ();
99+ _showDeleteFeedbackModal (context, onConfirm);
100+ },
146101 ),
147102 ],
148103 )
@@ -262,97 +217,52 @@ class DeleteUserModal {
262217 Column (
263218 mainAxisSize: MainAxisSize .min,
264219 children: [
265- SizedBox (
266- width: 245 ,
267- height: 43 ,
268- child: TextButton (
269- style: ButtonStyle (
270- backgroundColor: WidgetStateProperty .all (
271- colorScheme.surfaceContainerLow),
272- shape: WidgetStateProperty .all (
273- RoundedRectangleBorder (
274- borderRadius: BorderRadius .circular (8 ),
275- ),
276- ),
277- padding: WidgetStateProperty .all (
278- const EdgeInsets .symmetric (
279- vertical: 10 , horizontal: 8 ),
280- ),
281- alignment: Alignment .center,
282- minimumSize:
283- WidgetStateProperty .all (const Size (245 , 43 )),
284- tapTargetSize: MaterialTapTargetSize .shrinkWrap,
285- visualDensity: VisualDensity .compact,
286- ),
287- onPressed: () => Navigator .of (ctx).pop (),
288- child: Text (
289- AppLocalizations .of (context)! .keepUsingLong,
290- textAlign: TextAlign .center,
291- style: TextStyle (
292- fontFamily: 'Pretendard' ,
293- fontWeight: FontWeight .w600,
294- fontSize: 16 ,
295- height: 1.4 ,
296- color: colorScheme.outline,
297- ),
298- ),
220+ ModalWideButton (
221+ text: AppLocalizations .of (context)! .keepUsingLong,
222+ color: colorScheme.surfaceContainerLow,
223+ textColor: colorScheme.outline,
224+ textStyle: TextStyle (
225+ fontFamily: 'Pretendard' ,
226+ fontWeight: FontWeight .w600,
227+ fontSize: 16 ,
228+ height: 1.4 ,
229+ color: colorScheme.outline,
299230 ),
231+ onPressed: () => Navigator .of (ctx).pop (),
300232 ),
301233 const SizedBox (height: 8 ),
302- SizedBox (
303- width: 245 ,
304- height: 43 ,
305- child: TextButton (
306- style: ButtonStyle (
307- backgroundColor:
308- WidgetStateProperty .all (colorScheme.error),
309- shape: WidgetStateProperty .all (
310- RoundedRectangleBorder (
311- borderRadius: BorderRadius .circular (8 ),
312- ),
313- ),
314- padding: WidgetStateProperty .all (
315- const EdgeInsets .symmetric (
316- vertical: 10 , horizontal: 8 ),
317- ),
318- alignment: Alignment .center,
319- minimumSize:
320- WidgetStateProperty .all (const Size (245 , 43 )),
321- tapTargetSize: MaterialTapTargetSize .shrinkWrap,
322- visualDensity: VisualDensity .compact,
323- ),
324- onPressed: () async {
325- Navigator .of (ctx).pop ();
234+ ModalWideButton (
235+ text:
236+ AppLocalizations .of (context)! .sendFeedbackAndDelete,
237+ color: colorScheme.error,
238+ textColor: colorScheme.onPrimary,
239+ textStyle: TextStyle (
240+ fontFamily: 'Pretendard' ,
241+ fontWeight: FontWeight .w600,
242+ fontSize: 16 ,
243+ height: 1.4 ,
244+ color: colorScheme.onPrimary,
245+ ),
246+ onPressed: () async {
247+ Navigator .of (ctx).pop ();
326248
327- try {
328- final deleteUserUseCase =
329- getIt <DeleteUserUseCase >();
330- await deleteUserUseCase (controller.text);
331- } catch (e) {
332- debugPrint (e.toString ());
333- }
249+ try {
250+ final deleteUserUseCase =
251+ getIt <DeleteUserUseCase >();
252+ await deleteUserUseCase (controller.text);
253+ } catch (e) {
254+ debugPrint (e.toString ());
255+ }
334256
335- try {
336- final userRepository = getIt <UserRepository >();
337- await userRepository.signOut ();
338- } catch (e) {
339- debugPrint (e.toString ());
340- }
257+ try {
258+ final userRepository = getIt <UserRepository >();
259+ await userRepository.signOut ();
260+ } catch (e) {
261+ debugPrint (e.toString ());
262+ }
341263
342- onConfirm ();
343- },
344- child: Text (
345- AppLocalizations .of (context)! .sendFeedbackAndDelete,
346- textAlign: TextAlign .center,
347- style: TextStyle (
348- fontFamily: 'Pretendard' ,
349- fontWeight: FontWeight .w600,
350- fontSize: 16 ,
351- height: 1.4 ,
352- color: colorScheme.onPrimary,
353- ),
354- ),
355- ),
264+ onConfirm ();
265+ },
356266 ),
357267 ],
358268 )
0 commit comments