From 7e452f930cf1e07bcc5e313f1fe0310b9877f274 Mon Sep 17 00:00:00 2001 From: jihunchoi Date: Mon, 29 Apr 2024 00:00:41 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20#57-=EC=95=88=EB=93=9C=EB=A1=9C?= =?UTF-8?q?=EC=9D=B4=EB=93=9C=20=EC=B5=9C=EB=8C=80=20=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/qna/qna_write/qna_write_screen.dart | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/front/capstone_front/lib/screens/qna/qna_write/qna_write_screen.dart b/front/capstone_front/lib/screens/qna/qna_write/qna_write_screen.dart index 902feb5bc8..1beb82eb04 100644 --- a/front/capstone_front/lib/screens/qna/qna_write/qna_write_screen.dart +++ b/front/capstone_front/lib/screens/qna/qna_write/qna_write_screen.dart @@ -118,7 +118,7 @@ class _HelperWriteScreenState extends State { IconButton( onPressed: () async { if (_currentPhotos >= _maxPhotos) { - makeToast("$_maxPhotos의 사진만 가능합니다"); + makeToast("최대 $_maxPhotos개의 사진만 가능합니다"); } else { if (_maxPhotos - _currentPhotos < 2) { var image = await picker.pickImage( @@ -135,10 +135,16 @@ class _HelperWriteScreenState extends State { multiImages = await picker.pickMultiImage( limit: _maxPhotos - _currentPhotos, ); - setState(() { - images.addAll(multiImages); - _currentPhotos += multiImages.length; - }); + if (_currentPhotos + multiImages.length > + 4) { + makeToast( + "최대 $_maxPhotos개의 사진만 가능합니다. 다시 선택해주세요."); + } else { + setState(() { + images.addAll(multiImages); + _currentPhotos += multiImages.length; + }); + } } } },