-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from bunju20/Hwang/study
✨ Feat: �메인 학습페이지, 일별 학습 스크린 구현 및 네비게이션 수정
- Loading branch information
Showing
16 changed files
with
232 additions
and
116 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LearningSession { | ||
final String type; // 세션 유형 (음소, 단어, 문장) | ||
final DateTime createdDate; // 세션 생성 날짜 | ||
final String text; // 세션과 관련된 텍스트 | ||
|
||
LearningSession({required this.type, required this.createdDate, required this.text}); | ||
} | ||
|
||
class DateStudyViewModel { | ||
final DateTime date; | ||
|
||
DateStudyViewModel({required this.date}); | ||
|
||
List<LearningSession> getSessions() { | ||
// 실제 애플리케이션에서는 여기서 날짜에 따라 데이터를 조회하거나 필터링하는 로직을 구현할 수 있습니다. | ||
return [ | ||
LearningSession(type: '음소', createdDate: DateTime(2024, 2, 12), text: "가"), | ||
LearningSession(type: '단어', createdDate: DateTime(2024, 2, 13), text: "가다"), | ||
LearningSession(type: '문장', createdDate: DateTime(2024, 2, 14), text: "가다 보면 길이 있다."), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:intl/intl.dart'; | ||
// ViewModel import 경로는 실제 프로젝트 구조에 따라 달라질 수 있습니다. | ||
import 'package:earlips/viewModels/study/date_study_screen_viewmodel.dart'; | ||
|
||
class DateStudyScreen extends StatelessWidget { | ||
final DateTime date; | ||
DateStudyScreen({Key? key, required this.date}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final viewModel = DateStudyViewModel(date: date); | ||
final sessions = viewModel.getSessions(); | ||
|
||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(DateFormat('yyyy년 MM월 dd일').format(date)), // 동적으로 날짜를 표시 | ||
centerTitle: true, | ||
), | ||
body: ListView.separated( | ||
padding: const EdgeInsets.fromLTRB(25, 20, 25, 20), | ||
itemCount: sessions.length, | ||
itemBuilder: (context, index) { | ||
var session = sessions[index]; | ||
return Container( | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(15.0), | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Colors.grey.withOpacity(0.5), | ||
spreadRadius: 1, | ||
blurRadius: 10, | ||
offset: Offset(0, 2), | ||
), | ||
], | ||
), | ||
child: Column( | ||
children: [ | ||
Container( | ||
alignment: Alignment.centerLeft, | ||
margin: EdgeInsets.only(left: 20.0, top: 16.0), | ||
child: _SmallCard(name: session.type)), // 세션 유형을 표시 | ||
ListTile( | ||
contentPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 30), | ||
title: Container( | ||
alignment: Alignment.center, | ||
child: Text( | ||
session.text, // 세션과 관련된 텍스트를 표시 | ||
style: const TextStyle( | ||
fontSize: 24.0, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
onTap: () { | ||
// TODO: 세부 대본 학습 페이지로 이동하도록 구현 | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
separatorBuilder: (context, index) => const SizedBox(height: 20), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _SmallCard extends StatelessWidget { | ||
final String name; | ||
|
||
const _SmallCard({Key? key, required this.name}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(4.0), | ||
color: Color(0xFF1FA9DC), | ||
), | ||
alignment: Alignment.center, | ||
width: 50, | ||
height: 20, | ||
child: Text( | ||
name, | ||
style: TextStyle( | ||
color: Colors.white, | ||
fontSize: 14, | ||
fontFamily: 'Pretendard-Bold', | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.