이벤트 가져오기 위젯 테스트 추가 및 테스트 훅 도입
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DialogActions {
|
||||
static List<Widget> confirm({
|
||||
required VoidCallback onConfirm,
|
||||
required VoidCallback onCancel,
|
||||
String confirmText = '확인',
|
||||
String cancelText = '취소',
|
||||
bool destructive = false,
|
||||
}) {
|
||||
return [
|
||||
TextButton(
|
||||
onPressed: onCancel,
|
||||
child: Text(cancelText),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: destructive
|
||||
? ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.redAccent,
|
||||
foregroundColor: Colors.white,
|
||||
)
|
||||
: null,
|
||||
onPressed: onConfirm,
|
||||
child: Text(confirmText),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user