diff --git a/lib/viewModels/script/learning_session_screen_viewmodel.dart b/lib/viewModels/script/learning_session_screen_viewmodel.dart index f5ed4e6..fb788de 100644 --- a/lib/viewModels/script/learning_session_screen_viewmodel.dart +++ b/lib/viewModels/script/learning_session_screen_viewmodel.dart @@ -66,7 +66,10 @@ class LearningSessionScreenViewModel extends GetxController { final title = data?['title'] as String? ?? ''; // title이 없으면 빈 문자열 할당 final text = data?['text'] as String? ?? ''; // text가 없으면 빈 문자열 할당 final dateFormat = data?['dateFormat']?.toDate() ?? "Example"; - return Paragraph(title: title, text: text, dateFormat: dateFormat.toString()); + + String timeFormat = DateFormat('h:mm a').format(DateTime.now()); + + return Paragraph(title: title, text: text, dateFormat: dateFormat.toString(), timeFormat: timeFormat); }).toList(); paragraphs.value = fetchedParagraphs; // 상태 업데이트 diff --git a/lib/views/script/learning_session_screen.dart b/lib/views/script/learning_session_screen.dart index 9fef2fb..faf89b4 100644 --- a/lib/views/script/learning_session_screen.dart +++ b/lib/views/script/learning_session_screen.dart @@ -125,13 +125,14 @@ class _LearningSessionScreenState extends State { alignment: Alignment.centerLeft, margin: EdgeInsets.only(left: 16.0,top: 16.0,bottom: 8.0), child: Text( - "${DateFormat('yyyy년 MM월 dd일 ').format(DateFormat('yyyy/MM/dd').parse(paragraph.dateFormat!))}진행한 학습", + paragraph.dateFormat == "Example" ? "script example" : "${DateFormat('yyyy년 MM월 dd일 ').format(DateFormat('yyyy/MM/dd').parse(paragraph.dateFormat!))}진행한 학습", style: TextStyle( fontSize: 11, color: Color(0xFF6E6A7C), ), ), ), + Container( margin: const EdgeInsets.only(right: 12.0, top: 12.0), child: SvgPicture.asset("assets/icons/book.svg", @@ -147,8 +148,9 @@ class _LearningSessionScreenState extends State { }, child: Container( alignment: Alignment.centerLeft, - margin: EdgeInsets.only(left: 16.0,bottom: 8.0), + margin: EdgeInsets.only(left: 16.0,bottom: 8.0, right: 16.0), child: Text( + overflow: TextOverflow.ellipsis, paragraph.title, style: const TextStyle( fontSize: 14.0,