20260330 #730 채팅 화면에서 위치전송 기능 추가#747
Hidden character warning
Conversation
…d 대응 개선 #730 - Fix 1: _onSend 메서드의 불필요한 try/catch 제거 (객체 생성은 예외를 발생시키지 않음) - Fix 2: 보내기 버튼의 iPad 대응 개선 (bottom: isTablet ? 80 : 57.h) - 미사용 import 정리 (CommonSnackBar, SnackBarType) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Walkthrough채팅 앱에 위치 공유 기능을 추가합니다. 메시지 타입에 Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant ChatRoom as ChatRoomScreen
participant InputBar as ChatInputBar
participant Picker as ChatLocationPickerScreen
participant LocService as LocationService
participant MapService as NaverMapService
participant WSService as ChatWebSocketService
User->>ChatRoom: 위치 보내기 메뉴 선택
ChatRoom->>InputBar: onSendLocation 콜백 호출
InputBar->>ChatRoom: _onSendLocation() 실행
ChatRoom->>Picker: navigate(ChatLocationPickerScreen)
Picker->>LocService: 위치 권한 요청
LocService-->>Picker: 권한 승인/거부
Picker->>LocService: 현재 위치 조회
LocService-->>Picker: 좌표 반환
Picker->>MapService: 지도 표시 (현재 위치 중심)
User->>Picker: 지도에서 위치 선택
Picker->>LocService: 선택 위치의 주소 역지오코딩
LocService-->>Picker: 주소 반환
Picker->>Picker: 주소 표시 업데이트
User->>Picker: 보내기 버튼 클릭
Picker-->>ChatRoom: LocationAddress (위도/경도/주소) 반환
ChatRoom->>WSService: sendMessage(type:LOCATION, latitude, longitude, address)
WSService->>WSService: 페이로드 검증 및 구성
WSService-->>ChatRoom: WebSocket 메시지 송신
sequenceDiagram
participant Server as 채팅 서버
participant WSService as ChatWebSocketService
participant ChatRoom as ChatRoomScreen
participant MsgItem as ChatMessageItem
participant Bubble as ChatLocationBubble
participant MapAPI as NaverStaticMapsAPI
participant LocService as LocationService
actor User
Server->>WSService: LOCATION 메시지 수신 (위도/경도/주소)
WSService->>ChatRoom: 메시지 목록 업데이트
ChatRoom->>MsgItem: ChatMessage (type:LOCATION) 렌더링
MsgItem->>Bubble: ChatLocationBubble 위젯 빌드
Bubble->>MapAPI: Static Map 이미지 요청 (마커 포함)
MapAPI-->>Bubble: 지도 썸네일 이미지
Bubble->>LocService: 좌표로부터 상세 주소 조회
LocService-->>Bubble: 주소 정보
Bubble-->>MsgItem: 메시지 버블 표시 (이미지+주소+버튼)
User->>Bubble: "지도에서 보기" 버튼 클릭
Bubble->>Bubble: 네이버지도 앱 딥링크 시도
Bubble-->>User: 네이버지도 앱 또는 웹 URL 실행
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (8)
docs/superpowers/plans/2026-04-02-chat-location-share.md (2)
465-466:iconSize에.h대신.w사용 권장코딩 가이드라인에 따르면 이미지 및 정사각형 요소에는 안전한 iPad 반응형을 위해
height: N.w(너비 기반 스케일링)를 사용해야 합니다.iconSize: 24.h를iconSize: 24.w로 변경하는 것이 좋습니다.child: CurrentLocationButton( onTap: () async { ... }, - iconSize: 24.h, + iconSize: 24.w, ),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/superpowers/plans/2026-04-02-chat-location-share.md` around lines 465 - 466, Change the square/icon sizing to use width-based scaling: replace the property value using the height scaler (iconSize: 24.h) with the width scaler (iconSize: 24.w) wherever the iconSize is used for image or square elements to comply with the iPad responsive guideline; update the occurrence that currently reads "iconSize: 24.h" to "iconSize: 24.w".
406-406:logoMargin의.h스케일링 검토 필요
bottom: 137.h는 iPad에서 과도하게 스케일링될 수 있습니다. 고정 픽셀 값 또는.w기반 스케일링 사용을 고려해 주세요.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/superpowers/plans/2026-04-02-chat-location-share.md` at line 406, logoMargin에 지정된 EdgeInsets(NEdgeInsets.fromEdgeInsets(EdgeInsets.only(left: 24.w, bottom: 137.h)))에서 bottom에 .h 스케일링이 과도하게 적용될 수 있으니 iPad 등 큰 화면에서 안전한 값으로 변경하세요; 해결책으로는 bottom을 고정 픽셀값으로 변경하거나(예: 137 대신 디자인 기준 픽셀), .w 기반 스케일링으로 변환하거나, 화면 크기/플랫폼 조건을 체크해 iPad에는 다른 값(또는 비례 로직)을 적용하는 방식으로 수정하고 해당 변경을 logoMargin이 사용되는 위치와 NEdgeInsets.fromEdgeInsets 호출에서 반영하세요.docs/superpowers/specs/2026-04-02-chat-location-share-design.md (2)
81-91: 펜스 코드 블록에 언어 지정 추가 권장URL 및 헤더 블록에도 언어를 지정해 주세요.
text또는http를 사용할 수 있습니다.-``` +```text URL: https://naveropenapi.apigw.ntruss.com/map-static/v2/raster🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/superpowers/specs/2026-04-02-chat-location-share-design.md` around lines 81 - 91, The fenced code blocks under the "Static Maps API" section currently lack a language specifier; update the three blocks (the opening block that contains the URL parameters, the one labeled "URL: ..." and the "Headers:" block) to use a language tag such as text or http (e.g., change ``` to ```text or ```http) so syntax highlighting and tooling treat them correctly; ensure the markers remain unchanged (center, markers, Headers and header keys X-NCP-APIGW-API-KEY-ID / X-NCP-APIGW-API-KEY) when adding the language specifier.
69-79: 펜스 코드 블록에 언어 지정 추가 권장정적 분석 도구(markdownlint)에서 펜스 코드 블록에 언어가 지정되지 않았다고 경고합니다. ASCII 다이어그램의 경우
text또는plaintext를 사용할 수 있습니다.-``` +```text ┌────────────────────────┐ │ Naver Static Map │ Image.network (264w × 160h)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/superpowers/specs/2026-04-02-chat-location-share-design.md` around lines 69 - 79, The fenced ASCII diagram code block lacks a language tag which triggers markdownlint; update the fence where the map diagram (the block starting with "┌────────────────────────┐" and lines including "Naver Static Map" and "Image.network (264w × 160h)") is defined to include a language specifier such as "text" or "plaintext" (e.g., change ``` to ```text) so the linter stops warning and the block is treated as plain text.lib/screens/chat_location_picker_screen.dart (2)
188-188:iconSize에.h대신.w사용 권장아이콘 크기에
24.h를 사용하고 있는데, iPad에서 과도하게 커질 수 있습니다.♻️ 제안하는 수정
- iconSize: 24.h, + iconSize: 24.w,As per coding guidelines: "Use
height: N.w(width-based scaling) instead ofheight: N.hfor images and square elements for safer iPad responsiveness"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/screens/chat_location_picker_screen.dart` at line 188, In ChatLocationPickerScreen replace the height-based scaling on the icon with width-based scaling: locate the iconSize property (currently set to 24.h) in the widget inside ChatLocationPickerScreen and change it to use 24.w so square elements/icons scale by width (safer for iPad responsiveness).
119-119: iPad 반응형 대응:height에.h대신.w사용 권장지도 이미지 컨테이너의 높이에
176.h를 사용하고 있습니다. 코딩 가이드라인에 따르면 이미지 및 정사각형 요소의 높이는 iPad 반응형을 위해.w기반 스케일링을 사용해야 합니다.♻️ 제안하는 수정
- SizedBox(width: bubbleWidth, height: 176.h, child: _buildMapImage(bubbleWidth)), + SizedBox(width: bubbleWidth, height: 176.w, child: _buildMapImage(bubbleWidth)),As per coding guidelines: "Use
height: N.w(width-based scaling) instead ofheight: N.hfor images and square elements for safer iPad responsiveness"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/screens/chat_location_picker_screen.dart` at line 119, Change the map image container's height scaling from height: 176.h to width-based scaling height: 176.w inside ChatLocationPickerScreen (the 지도 이미지 컨테이너 where you set height: 176.h); replace the `.h` suffix with `.w` so the image/square element uses width-based responsiveness for iPad.lib/widgets/chat_location_bubble.dart (2)
138-138: 버튼 내부 vertical padding에.h사용 주의
EdgeInsets.symmetric(vertical: 12.h)는 iPad에서 과도하게 스케일링될 수 있습니다. 고정 픽셀 값이나.w기반 값을 고려해 보세요.♻️ 제안하는 수정
- padding: EdgeInsets.symmetric(vertical: 12.h), + padding: EdgeInsets.symmetric(vertical: 12.w),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/widgets/chat_location_bubble.dart` at line 138, The vertical padding uses ScreenUtil's `.h` which over-scales on iPad; in the ChatLocationBubble widget replace EdgeInsets.symmetric(vertical: 12.h) with a non-`.h` value (e.g. EdgeInsets.symmetric(vertical: 12) for fixed logical pixels or EdgeInsets.symmetric(vertical: 12.w) if you want width-based scaling) in the padding property so the vertical spacing doesn't grow excessively on tablets.
119-119: iPad 반응형 대응: 이미지/지도 높이에.w사용 권장Line 119와 172에서 지도 이미지 높이에
176.h를 사용하고 있습니다. iPad에서 과도하게 커질 수 있으므로.w기반 스케일링을 권장합니다.♻️ 제안하는 수정
- SizedBox(width: bubbleWidth, height: 176.h, child: _buildMapImage(bubbleWidth)), + SizedBox(width: bubbleWidth, height: 176.w, child: _buildMapImage(bubbleWidth)),- return Image.memory(_mapImageBytes!, width: width, height: 176.h, fit: BoxFit.cover); + return Image.memory(_mapImageBytes!, width: width, height: 176.w, fit: BoxFit.cover);As per coding guidelines: "Use
height: N.w(width-based scaling) instead ofheight: N.hfor images and square elements for safer iPad responsiveness"Also applies to: 172-172
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/widgets/chat_location_bubble.dart` at line 119, Change the height scaling for the map image from height: 176.h to a width-based scale height: 176.w to make iPad layout safer; update the SizedBox usage that wraps _buildMapImage (and any other occurrences mentioned around the same file, e.g., the instance at line ~172) so image/map heights use .w instead of .h throughout; ensure any related constrained containers for the map image or square elements follow the same .w conversion to maintain consistent width-based scaling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/models/app_urls.dart`:
- Line 7: The constant naverStaticMapApiUrl currently uses the wrong host;
update the value of the static const String naverStaticMapApiUrl in the AppUrls
(or containing) class to use the official Naver Static Maps host by replacing
"maps.apigw.ntruss.com" with "naveropenapi.apigw.ntruss.com" so the endpoint
becomes the documented naveropenapi.apigw.ntruss.com domain for map-static v2
raster.
In `@lib/screens/chat_room_screen.dart`:
- Around line 529-535: The sendMessage call to _wsService.sendMessage (with
widget.chatRoomId and MessageType.location) is missing the address payload
required by ChatLocationBubble; update the call to include an address parameter
(e.g., address: address or address: formattedAddress) supplying the resolved
address string (or a safe fallback like empty string if resolution failed),
ensure the address variable is available at that call site (perform
reverse-geocoding earlier if needed), and verify ChatLocationBubble reads the
message.address field to display it.
In `@lib/widgets/chat_location_bubble.dart`:
- Around line 71-77: The calls to dotenv.get('NMF_CLIENT_ID') and
dotenv.get('NMF_CLIENT_SECRET') used when building the headers for the http.get
request can throw StateError if env vars are missing; extend the existing
try-catch that surrounds the HTTP call to also wrap the dotenv.get() calls (or
perform an upfront validation at app init) so missing env vars are handled
gracefully, and update the error handling path in the code that constructs
headers for the http.get call in chat_location_bubble.dart to log/handle
StateError and avoid an uncaught crash.
---
Nitpick comments:
In `@docs/superpowers/plans/2026-04-02-chat-location-share.md`:
- Around line 465-466: Change the square/icon sizing to use width-based scaling:
replace the property value using the height scaler (iconSize: 24.h) with the
width scaler (iconSize: 24.w) wherever the iconSize is used for image or square
elements to comply with the iPad responsive guideline; update the occurrence
that currently reads "iconSize: 24.h" to "iconSize: 24.w".
- Line 406: logoMargin에 지정된
EdgeInsets(NEdgeInsets.fromEdgeInsets(EdgeInsets.only(left: 24.w, bottom:
137.h)))에서 bottom에 .h 스케일링이 과도하게 적용될 수 있으니 iPad 등 큰 화면에서 안전한 값으로 변경하세요; 해결책으로는
bottom을 고정 픽셀값으로 변경하거나(예: 137 대신 디자인 기준 픽셀), .w 기반 스케일링으로 변환하거나, 화면 크기/플랫폼 조건을
체크해 iPad에는 다른 값(또는 비례 로직)을 적용하는 방식으로 수정하고 해당 변경을 logoMargin이 사용되는 위치와
NEdgeInsets.fromEdgeInsets 호출에서 반영하세요.
In `@docs/superpowers/specs/2026-04-02-chat-location-share-design.md`:
- Around line 81-91: The fenced code blocks under the "Static Maps API" section
currently lack a language specifier; update the three blocks (the opening block
that contains the URL parameters, the one labeled "URL: ..." and the "Headers:"
block) to use a language tag such as text or http (e.g., change ``` to ```text
or ```http) so syntax highlighting and tooling treat them correctly; ensure the
markers remain unchanged (center, markers, Headers and header keys
X-NCP-APIGW-API-KEY-ID / X-NCP-APIGW-API-KEY) when adding the language
specifier.
- Around line 69-79: The fenced ASCII diagram code block lacks a language tag
which triggers markdownlint; update the fence where the map diagram (the block
starting with "┌────────────────────────┐" and lines including "Naver Static
Map" and "Image.network (264w × 160h)") is defined to include a language
specifier such as "text" or "plaintext" (e.g., change ``` to ```text) so the
linter stops warning and the block is treated as plain text.
In `@lib/screens/chat_location_picker_screen.dart`:
- Line 188: In ChatLocationPickerScreen replace the height-based scaling on the
icon with width-based scaling: locate the iconSize property (currently set to
24.h) in the widget inside ChatLocationPickerScreen and change it to use 24.w so
square elements/icons scale by width (safer for iPad responsiveness).
- Line 119: Change the map image container's height scaling from height: 176.h
to width-based scaling height: 176.w inside ChatLocationPickerScreen (the 지도 이미지
컨테이너 where you set height: 176.h); replace the `.h` suffix with `.w` so the
image/square element uses width-based responsiveness for iPad.
In `@lib/widgets/chat_location_bubble.dart`:
- Line 138: The vertical padding uses ScreenUtil's `.h` which over-scales on
iPad; in the ChatLocationBubble widget replace EdgeInsets.symmetric(vertical:
12.h) with a non-`.h` value (e.g. EdgeInsets.symmetric(vertical: 12) for fixed
logical pixels or EdgeInsets.symmetric(vertical: 12.w) if you want width-based
scaling) in the padding property so the vertical spacing doesn't grow
excessively on tablets.
- Line 119: Change the height scaling for the map image from height: 176.h to a
width-based scale height: 176.w to make iPad layout safer; update the SizedBox
usage that wraps _buildMapImage (and any other occurrences mentioned around the
same file, e.g., the instance at line ~172) so image/map heights use .w instead
of .h throughout; ensure any related constrained containers for the map image or
square elements follow the same .w conversion to maintain consistent width-based
scaling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98685519-e188-4b18-93ea-f12d29ea3463
⛔ Files ignored due to path filters (1)
ios/Podfile.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
docs/superpowers/plans/2026-04-02-chat-location-share.mddocs/superpowers/specs/2026-04-02-chat-location-share-design.mdlib/enums/message_type.dartlib/models/apis/objects/chat_message.dartlib/models/apis/objects/chat_message.g.dartlib/models/app_urls.dartlib/screens/chat_location_picker_screen.dartlib/screens/chat_room_screen.dartlib/services/chat_websocket_service.dartlib/widgets/chat_input_bar.dartlib/widgets/chat_location_bubble.dartlib/widgets/chat_message_item.dart
| _wsService.sendMessage( | ||
| chatRoomId: widget.chatRoomId, | ||
| content: '위치를 보냈습니다.', | ||
| type: MessageType.location, | ||
| latitude: lat, | ||
| longitude: lng, | ||
| ); |
There was a problem hiding this comment.
address 파라미터가 누락되었습니다
sendMessage 호출 시 address 파라미터가 전달되지 않고 있습니다. 설계 문서와 구현 계획에 따르면 위치 메시지 payload에 주소가 포함되어야 합니다. ChatLocationBubble에서 주소 텍스트를 표시하려면 이 값이 필요합니다.
🐛 수정 제안
+ final address = [result.siDo, result.siGunGu, result.eupMyoenDong]
+ .where((s) => s.isNotEmpty)
+ .join(' ');
+
_wsService.sendMessage(
chatRoomId: widget.chatRoomId,
content: '위치를 보냈습니다.',
type: MessageType.location,
latitude: lat,
longitude: lng,
+ address: address,
);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| _wsService.sendMessage( | |
| chatRoomId: widget.chatRoomId, | |
| content: '위치를 보냈습니다.', | |
| type: MessageType.location, | |
| latitude: lat, | |
| longitude: lng, | |
| ); | |
| final address = [result.siDo, result.siGunGu, result.eupMyoenDong] | |
| .where((s) => s.isNotEmpty) | |
| .join(' '); | |
| _wsService.sendMessage( | |
| chatRoomId: widget.chatRoomId, | |
| content: '위치를 보냈습니다.', | |
| type: MessageType.location, | |
| latitude: lat, | |
| longitude: lng, | |
| address: address, | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/screens/chat_room_screen.dart` around lines 529 - 535, The sendMessage
call to _wsService.sendMessage (with widget.chatRoomId and MessageType.location)
is missing the address payload required by ChatLocationBubble; update the call
to include an address parameter (e.g., address: address or address:
formattedAddress) supplying the resolved address string (or a safe fallback like
empty string if resolution failed), ensure the address variable is available at
that call site (perform reverse-geocoding earlier if needed), and verify
ChatLocationBubble reads the message.address field to display it.
There was a problem hiding this comment.
백엔드에서 address값은 받지 않고 있고 latitude와 longitude로 주소 텍스트를 표시하고 있어서 괜찮아
There was a problem hiding this comment.
@SeoHyun1024, 맞습니다! ChatLocationBubble에서 latitude/longitude를 이용해 클라이언트 측에서 역지오코딩으로 주소를 표시하는 구조군요. 제 리뷰 코멘트가 잘못되었습니다. 이 부분은 현재 구현 방식 그대로가 맞습니다. 감사합니다!
✏️ Learnings added
Learnt from: SeoHyun1024
Repo: TEAM-ROMROM/RomRom-FE PR: 747
File: lib/screens/chat_room_screen.dart:529-535
Timestamp: 2026-04-06T07:32:27.721Z
Learning: In the RomRom-FE project (`lib/widgets/chat_location_bubble.dart`), the `ChatLocationBubble` widget performs reverse-geocoding client-side using `latitude`/`longitude` from the `ChatMessage`. The backend does NOT store or receive an `address` field for location messages; address text is resolved entirely on the client. Therefore, the `sendMessage` call for `MessageType.location` in `lib/screens/chat_room_screen.dart` does not need to pass an `address` parameter.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR
Repo: TEAM-ROMROM/RomRom-FE PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-29T13:04:47.140Z
Learning: Applies to **/*.dart : Implement fallback handling for permission failures (e.g., Seoul City Hall coordinates) and never keep loading screens when `_currentPosition == null`
| final response = await http.get( | ||
| uri, | ||
| headers: { | ||
| 'x-ncp-apigw-api-key-id': dotenv.get('NMF_CLIENT_ID'), | ||
| 'x-ncp-apigw-api-key': dotenv.get('NMF_CLIENT_SECRET'), | ||
| }, | ||
| ); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: .env 파일에서 NMF_CLIENT_ID, NMF_CLIENT_SECRET 설정 여부 확인
# Expected: 환경 변수가 정의되어 있어야 함
# .env 파일 찾기
fd -t f '.env' --hidden | head -5
# 프로젝트에서 dotenv 초기화 방식 확인
rg -n 'dotenv\.load' --type dart -A2Repository: TEAM-ROMROM/RomRom-FE
Length of output: 420
🏁 Script executed:
# Check the full context of the chat_location_bubble.dart file around lines 71-77
cat -n lib/widgets/chat_location_bubble.dart | sed -n '60,85p'Repository: TEAM-ROMROM/RomRom-FE
Length of output: 965
🏁 Script executed:
# Search for how dotenv.get() is used elsewhere in the codebase with error handling
rg -n 'dotenv\.get' --type dart -B2 -A2 | head -50Repository: TEAM-ROMROM/RomRom-FE
Length of output: 3548
🏁 Script executed:
# Check the .env file to see if these keys are defined
cat .env 2>/dev/null || echo "No .env file in root"Repository: TEAM-ROMROM/RomRom-FE
Length of output: 85
🏁 Script executed:
# Search for documentation about required environment variables
find . -name "*.md" -o -name "*.txt" | xargs grep -l "NMF_CLIENT" 2>/dev/null | head -5Repository: TEAM-ROMROM/RomRom-FE
Length of output: 189
🏁 Script executed:
# Check the documentation files for environment variable requirements
cat ./docs/superpowers/specs/2026-04-02-chat-location-share-design.mdRepository: TEAM-ROMROM/RomRom-FE
Length of output: 2855
🏁 Script executed:
# Check app_initializer.dart to understand the initialization flow and error handling
cat -n lib/services/app_initializer.dart | head -60Repository: TEAM-ROMROM/RomRom-FE
Length of output: 1852
🏁 Script executed:
# Check if there's any validation or assertion of required environment variables
rg -n 'assert|throw|NMF_CLIENT_ID|NMF_CLIENT_SECRET' --type dart | grep -E '(assert|throw|validate)' | head -20Repository: TEAM-ROMROM/RomRom-FE
Length of output: 1912
🏁 Script executed:
# Check pubspec.yaml to understand flutter_dotenv version and configuration
rg -n 'flutter_dotenv' pubspec.yaml -A2Repository: TEAM-ROMROM/RomRom-FE
Length of output: 161
환경 변수 누락 시 예외 처리 강화 필요
dotenv.get('NMF_CLIENT_ID')와 dotenv.get('NMF_CLIENT_SECRET')는 환경 변수가 설정되지 않았을 경우 StateError를 발생시킵니다. 현재 try-catch 블록(60-85줄)은 HTTP 요청 에러만 처리하고 dotenv 예외는 처리하지 않아, 앱 초기화 후에도 .env 파일에 이 키들이 누락되면 런타임에 크래시가 발생할 수 있습니다.
설정된 값이 항상 존재한다고 가정하거나, try-catch를 dotenv.get() 호출까지 확대하거나, 앱 초기화 단계에서 필수 환경 변수 존재 여부를 검증해야 합니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/widgets/chat_location_bubble.dart` around lines 71 - 77, The calls to
dotenv.get('NMF_CLIENT_ID') and dotenv.get('NMF_CLIENT_SECRET') used when
building the headers for the http.get request can throw StateError if env vars
are missing; extend the existing try-catch that surrounds the HTTP call to also
wrap the dotenv.get() calls (or perform an upfront validation at app init) so
missing env vars are handled gracefully, and update the error handling path in
the code that constructs headers for the http.get call in
chat_location_bubble.dart to log/handle StateError and avoid an uncaught crash.
#730
Summary by CodeRabbit
릴리스 노트