-
Notifications
You must be signed in to change notification settings - Fork 1
채팅 입력창 멀티라인 입력 시 UI 개선 #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "20260327_#716_\uCC44\uD305_\uC785\uB825\uCC3D_\uBA40\uD2F0\uB77C\uC778_\uC785\uB825_\uC2DC_UI_\uAC1C\uC120"
Changes from all commits
22f72ef
ab0b4d1
980c02c
d9d2d1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import 'dart:io'; | ||
| import 'dart:ui'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| import 'package:romrom_fe/enums/context_menu_enums.dart'; | ||
|
|
@@ -37,11 +38,19 @@ class ChatInputBar extends StatelessWidget { | |
| final bottomPadding = Platform.isIOS ? 8.h + MediaQuery.of(context).padding.bottom : 21.h; | ||
| final bool sendDisabled = !hasText || isInputDisabled || isSendingMessage; | ||
|
|
||
| // 동적 라운드 계산: 1줄(캡슐형) → 여러 줄(20.r 둥근 사각형) | ||
| final double minH = 40.h; | ||
| final double maxH = 130.h; | ||
| final double clampedHeight = inputFieldHeight.clamp(minH, maxH); | ||
| final double t = maxH > minH ? ((clampedHeight - minH) / (maxH - minH)) : 0.0; | ||
| final double borderRadius = lerpDouble(clampedHeight / 2, 20.r, t) ?? clampedHeight / 2; | ||
|
|
||
| return Container( | ||
| padding: EdgeInsets.only(top: 8.h, left: 16.w, bottom: bottomPadding), | ||
| child: Row( | ||
| crossAxisAlignment: CrossAxisAlignment.center, | ||
| crossAxisAlignment: CrossAxisAlignment.end, | ||
| children: [ | ||
| // + 버튼 (하단 고정) | ||
| Padding( | ||
| padding: EdgeInsets.only(right: 8.0.w), | ||
| child: SizedBox( | ||
|
|
@@ -78,9 +87,10 @@ class ChatInputBar extends StatelessWidget { | |
| ), | ||
| ), | ||
| ), | ||
| // 텍스트 입력 필드 (suffixIcon 제거) | ||
| Expanded( | ||
| child: SizedBox( | ||
| height: 40.h <= inputFieldHeight && inputFieldHeight <= 70.h ? inputFieldHeight : 40.h, | ||
| height: clampedHeight, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 고정 높이( Line 84와 Line 107 조합은 가이드에서 금지한 패턴입니다. 세로 패딩은 고정 px로 바꾸는 게 안전합니다. 🔧 제안 수정안- contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h),
+ contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8),As per coding guidelines: "Never combine Also applies to: 107-107 🤖 Prompt for AI Agents |
||
| child: TextField( | ||
| controller: controller, | ||
| enabled: !isInputDisabled, | ||
|
|
@@ -99,49 +109,50 @@ class ChatInputBar extends StatelessWidget { | |
| hintStyle: CustomTextStyles.p2.copyWith(color: AppColors.opacity50White), | ||
| filled: true, | ||
| fillColor: AppColors.opacity10White, | ||
| border: OutlineInputBorder(borderRadius: BorderRadius.circular(100.r), borderSide: BorderSide.none), | ||
| border: OutlineInputBorder( | ||
| borderRadius: BorderRadius.circular(borderRadius), | ||
| borderSide: BorderSide.none, | ||
| ), | ||
| contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h), | ||
| suffixIcon: TextFieldTapRegion( | ||
| child: Material( | ||
| color: Colors.transparent, | ||
| child: ClipOval( | ||
| child: InkWell( | ||
| onTap: sendDisabled ? null : onSend, | ||
| customBorder: const CircleBorder(), | ||
| highlightColor: AppColors.buttonHighlightColorGray, | ||
| splashColor: AppColors.buttonHighlightColorGray.withValues(alpha: 0.3), | ||
| child: Container( | ||
| margin: EdgeInsets.all(4.w), | ||
| width: 40.w, | ||
| height: 40.w, | ||
| decoration: BoxDecoration( | ||
| color: sendDisabled ? AppColors.secondaryBlack2 : AppColors.primaryYellow, | ||
| shape: BoxShape.circle, | ||
| ), | ||
| child: Center( | ||
| child: Icon( | ||
| AppIcons.arrowUpward, | ||
| color: sendDisabled ? AppColors.secondaryBlack1 : AppColors.primaryBlack, | ||
| size: 32.w, | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| onSubmitted: sendDisabled ? null : (_) => onSend(), | ||
| ), | ||
| ), | ||
| ), | ||
| // 전송 버튼 (Row 자식으로 분리, 하단 고정) | ||
| Padding( | ||
| padding: EdgeInsets.only(left: 4.w, right: 16.w), | ||
| child: SizedBox( | ||
| width: 40.w, | ||
| height: 40.w, | ||
| child: Material( | ||
| color: Colors.transparent, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 직접 Line 120은 As per coding guidelines: "Use 🤖 Prompt for AI Agents |
||
| child: ClipOval( | ||
| child: InkWell( | ||
| onTap: sendDisabled ? null : onSend, | ||
| customBorder: const CircleBorder(), | ||
| highlightColor: AppColors.buttonHighlightColorGray, | ||
| splashColor: AppColors.buttonHighlightColorGray.withValues(alpha: 0.3), | ||
| child: Container( | ||
| width: 40.w, | ||
| height: 40.w, | ||
| decoration: BoxDecoration( | ||
| color: sendDisabled ? AppColors.secondaryBlack2 : AppColors.primaryYellow, | ||
| shape: BoxShape.circle, | ||
| ), | ||
| child: Center( | ||
| child: Icon( | ||
| AppIcons.arrowUpward, | ||
| color: sendDisabled ? AppColors.secondaryBlack1 : AppColors.primaryBlack, | ||
| size: 32.w, | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| suffixIconConstraints: BoxConstraints( | ||
| minWidth: 40.w, | ||
| minHeight: 40.w, | ||
| maxWidth: 40.w, | ||
| maxHeight: 40.w, | ||
| ), | ||
| ), | ||
| onSubmitted: sendDisabled ? null : (_) => onSend(), | ||
| ), | ||
| ), | ||
| ), | ||
| SizedBox(width: 16.w), | ||
| ], | ||
| ), | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Dart null-safe, what is the return type ofdouble.clamp(lower, upper)? Is assigning it directly to adoublevariable valid without.toDouble()or a cast?💡 Result:
In null-safe Dart,
double.clamp(lower, upper)has static return typenum(it inheritsnum.clamp), i.e.clamp(num lowerLimit, num upperLimit) → num. [1][2]So this is not directly assignable to a
doublevariable without a conversion/cast:Use either:
or
(At runtime the value will be a
doublewhen the receiver is adouble, but the static type is stillnum.) [1][3]Sources: [1] [2] [3]
🏁 Script executed:
Repository: TEAM-ROMROM/RomRom-FE
Length of output: 932
🏁 Script executed:
Repository: TEAM-ROMROM/RomRom-FE
Length of output: 275
clamp반환 타입 처리 필요 - 타입 오류 방지Line 42에서
double의clamp()메서드는 static 타입으로num을 반환합니다.double변수에 직접 할당하면 타입 오류가 발생하므로 명시적 변환이 필요합니다.🔧 제안 수정안
📝 Committable suggestion
🤖 Prompt for AI Agents