[Feat] 아래에서 올라오던 알림 두 곳을 위에서 내려오는 토스트로 통일합니다 - #280
Merged
Merged
Conversation
…ackBar 로 남아 하단 버튼과 탭 바를 가렸다, 삭제 알림은 다이얼로그를 닫은 뒤라 context 가 죽어 있어 넘기지 않고 앱 전체 Overlay 에 맡긴다, 알림이 떠 있는 시간은 부르는 쪽이 아니라 성격이 정하게 옮겨 같은 성공인데 2초와 3초가 섞여 있던 것을 맞춘다 (#279)
…파일과 줄을 알려 주고 실패한다, 이름만 스낵바고 안쪽은 토스트를 부르는 SnackBarDialog 와 AppSnackBar 는 걸리지 않게 앞에 글자나 점이 붙은 경우를 뺀다, 성공은 2초 오류와 주의는 3초라는 규칙과 직접 준 시간이 규칙보다 앞선다는 것도 검사한다 (#279)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✔️ 연관 이슈
📝 작업 내용
앱의 알림은 위에서 내려오는
AppToast로 통일했는데,SnackBar를 직접 띄우는 곳이 두 군데 남아 있었습니다! 그 화면에서만 예전처럼 아래에서 올라와서 하단 버튼과 탭 바를 가렸습니다.PracticeThumbnailScreen복습 세트가 삭제되었습니다!SharedProblemTab문제를 공유했어요!두 곳 모두
AppToast.success로 바꿨습니다. 삭제 알림은 다이얼로그를 닫은 뒤에 뜨기 때문에 그 자리의context가 이미 죽어 있습니다.context를 넘기지 않고 앱 전체 Overlay 에 맡겼습니다.SnackBarDialog.showSnackBar와AppSnackBar.showError는 이름만 스낵바고 안쪽은 이미AppToast를 부르고 있어서 그대로 뒀습니다!표시 시간 규칙을 AppToast 안으로 옮겼습니다
그동안 부르는 쪽마다
duration을 적어서 같은 성공 알림인데도 2초와 3초가 섞여 있었습니다. 이제 성격이 시간을 정합니다. 잘 됐다는 말은 읽지 않아도 그만이라 짧게(2초) 지나가고, 잘못됐다는 말과 주의는 무엇이 문제인지 읽어야 해서 길게(3초) 남습니다.호출부 5곳(
ApiHelper2곳,SnackBarDialog,InviteCodeSheet,LearningCalendarScreen)에 적혀 있던duration을 걷어냈습니다. 기존 값이 모두 이 규칙과 같아서 실제로 뜨는 시간은 달라지지 않습니다!다시 생기지 않게 테스트로 잠갔습니다
test/util/toast_guard_test.dart—lib안에서SnackBar위젯을 직접 만드는 곳이 있으면 파일과 줄을 알려 주고 실패합니다. 이름만 스낵바인SnackBarDialog와showSnackBar(가 오탐되지 않도록 앞에 글자나 점이 붙은 경우는 뺐습니다.test/module/design/app_toast_test.dart— 성공 2초, 오류와 주의 3초, 그리고duration을 직접 주면 규칙보다 그것을 따른다는 것을 검사합니다.곁가지로 정리된 것
PracticeThumbnailScreen._showDeletePracticeDialog의themeProvider지역변수와SharedProblemTab._openPicker의themeProvider인자가 스낵바 배경색에만 쓰이고 있어서 같이 없앴습니다.📱 반응형 대응
토스트는 화면 가로 여백(
AppSpacing.screenHorizontal)을 기준으로left/right를 잡고 상태바 높이와 앱바 높이만큼 내려오므로, 폰과 태블릿 모두 고정 크기 없이 그대로 동작합니다. 이번 PR에서 레이아웃 값은 건드리지 않았습니다.✅ 검증
dart format .— 변경 없음flutter analyze— warning/error 0개. 남은 611건은 전부 기존 info 급 스타일 린트(withOpacity,file_names등)입니다.flutter test— 새 테스트 포함 2152개 통과.낮습니다. 알림을 띄우는 방식만 바뀌고 데이터나 API 호출은 건드리지 않았습니다.
확인해 주시면 좋을 것:
context없이 전역 Overlay 로 뜹니다)AppSnackBar.messengerKey는 이제main.dart의scaffoldMessengerKey등록에만 쓰이지만, 지울지 남길지는 이번 PR에서 판단하지 않고 그대로 뒀습니다.