From 7b76ca513851c1981d83c529eac99942e10313f7 Mon Sep 17 00:00:00 2001 From: codeJiwon Date: Fri, 27 Dec 2024 02:48:10 +0900 Subject: [PATCH] =?UTF-8?q?[Chore/#62]=20=EB=82=B4=EC=9A=A9=20hintText=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 --- outfoot/lib/screens/upload.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/outfoot/lib/screens/upload.dart b/outfoot/lib/screens/upload.dart index a79edb4..75b44e7 100644 --- a/outfoot/lib/screens/upload.dart +++ b/outfoot/lib/screens/upload.dart @@ -96,19 +96,20 @@ final Data = UploadData("24.12.26", "하루에 물 2리터 마시기", "건강 class _UploadState extends State { final AuthAdditionApi _api = AuthAdditionApi(); - final TextEditingController _titleController = TextEditingController(); + final TextEditingController _titleController = + TextEditingController(text: ""); final TextEditingController _contentController = TextEditingController(); File? _image; @override void initState() { super.initState(); + _titleController.text = ""; + _contentController.text = ""; WidgetsBinding.instance.addPostFrameCallback((_) { final goalProvider = Provider.of(context, listen: false); - _titleController.text = - goalProvider.contentTitle; // GoalProvider에서 가져온 데이터 - _contentController.text = goalProvider.content; // GoalProvider에서 가져온 데이터 + _titleController.text = goalProvider.contentTitle; }); } @@ -361,9 +362,9 @@ class _UploadState extends State { controller: _titleController, keyboardType: TextInputType.text, decoration: InputDecoration( - border: InputBorder.none, hintText: '제목을 입력하세요', // GoalProvider와 분리된 hintText + border: InputBorder.none, hintStyle: TextStyle( fontSize: 14.sp, color: greyColor3, @@ -490,9 +491,7 @@ class _UploadState extends State { } void main() { - runApp(MaterialApp( - home: Upload( - ), + home: Upload(), )); }