출석/무단반출 팝업 중복 표시 버그 수정 + 앱 버전 1.1.2
- 새 팝업(출석완료/무단반출)을 띄우기 전 이전에 열려있던 팝업을 먼저 닫도록 수정 - 재태깅이 짧은 간격으로 반복되면 팝업이 여러 개 겹쳐 쌓이던 문제 해결
This commit is contained in:
@@ -34,6 +34,7 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
|
|||||||
String? _activePocketNumber;
|
String? _activePocketNumber;
|
||||||
|
|
||||||
StreamSubscription<Map<String, dynamic>?>? _violationSub;
|
StreamSubscription<Map<String, dynamic>?>? _violationSub;
|
||||||
|
bool _isDialogOpen = false; // 출석/위반 팝업이 겹쳐서 뜨는 것을 막기 위한 플래그
|
||||||
|
|
||||||
bool get _watchServiceSupported => !kIsWeb && Platform.isAndroid;
|
bool get _watchServiceSupported => !kIsWeb && Platform.isAndroid;
|
||||||
|
|
||||||
@@ -211,7 +212,18 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
|
|||||||
_showSnackBar("✅ 감시가 종료되었습니다. 수고하셨습니다!", Colors.green);
|
_showSnackBar("✅ 감시가 종료되었습니다. 수고하셨습니다!", Colors.green);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 이미 떠 있는 팝업(출석 완료/무단반출 감지)이 있으면 새 팝업을 띄우기 전에 먼저 닫는다.
|
||||||
|
/// (태깅→반출→재태깅이 빠르게 반복되면 팝업이 여러 개 겹쳐 쌓이는 것을 방지)
|
||||||
|
void _closeAnyOpenDialog() {
|
||||||
|
if (_isDialogOpen && mounted) {
|
||||||
|
Navigator.of(context, rootNavigator: true).pop();
|
||||||
|
}
|
||||||
|
_isDialogOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
void _showViolationDialog(String? pocketNumber) {
|
void _showViolationDialog(String? pocketNumber) {
|
||||||
|
_closeAnyOpenDialog();
|
||||||
|
_isDialogOpen = true;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
@@ -230,11 +242,13 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
).then((_) => _isDialogOpen = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 🎊 출석 성공 알림창
|
/// 🎊 출석 성공 알림창
|
||||||
void _showSuccessDialog(String pocketNumber) {
|
void _showSuccessDialog(String pocketNumber) {
|
||||||
|
_closeAnyOpenDialog();
|
||||||
|
_isDialogOpen = true;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
@@ -249,7 +263,7 @@ class _NfcPocketCheckInScreenState extends State<NfcPocketCheckInScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
).then((_) => _isDialogOpen = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showSnackBar(String text, Color color) {
|
void _showSnackBar(String text, Color color) {
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.1.1+2
|
version: 1.1.2+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
|
|||||||
Reference in New Issue
Block a user