Skip to content

Commit

Permalink
fix: 문단 교정 페이지에 대본 페이지 디자인 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
bunju20 committed Apr 23, 2024
1 parent 14f155f commit a17ece8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/viewModels/script/learning_session_screen_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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; // 상태 업데이트
Expand Down
6 changes: 4 additions & 2 deletions lib/views/script/learning_session_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ class _LearningSessionScreenState extends State<LearningSessionScreen> {
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",
Expand All @@ -147,8 +148,9 @@ class _LearningSessionScreenState extends State<LearningSessionScreen> {
},
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,
Expand Down

0 comments on commit a17ece8

Please sign in to comment.