From a926d9c7bca4ba5f231c08e1716fd68b61242a3b Mon Sep 17 00:00:00 2001 From: girinb Date: Wed, 16 Jul 2025 00:23:54 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=8C=EB=9E=9C=20=ED=94=84=ED=86=A0?= =?UTF-8?q?=ED=86=A0=ED=83=80=EC=9E=85=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/data/case_study_plan.dart | 2 +- lib/main.dart | 6 +- lib/more_page.dart | 39 ++++++-- lib/plan_page.dart | 134 ++++++++++++++++++--------- 4 files changed, 124 insertions(+), 57 deletions(-) diff --git a/lib/common/data/case_study_plan.dart b/lib/common/data/case_study_plan.dart index bf5e9ec..dd97a7f 100644 --- a/lib/common/data/case_study_plan.dart +++ b/lib/common/data/case_study_plan.dart @@ -16,7 +16,7 @@ class CaseStudyPlan { return CaseStudyPlan( planId: json['casestudy lesson id'] ?? '아이디 없음', planTitle: json['course_name'] ?? '제목 없음', - planTeacher: json['planTeacher'] ?? '', + planTeacher: json['course_description'] ?? '', thumbnail: json['course_thumbnail'] ?? '', ); } diff --git a/lib/main.dart b/lib/main.dart index 81474c9..f005c9b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -112,11 +112,7 @@ class _MyHomePageState extends State { onTap: _navigateToProfileTab, customBorder: const CircleBorder(), child: const CircleAvatar( - backgroundColor: Colors.grey, - child: Icon( - Icons.person, - color: Colors.white, - ), + backgroundImage: NetworkImage('https://manostmboy.github.io/temp/dumass.png'), ), ), ), diff --git a/lib/more_page.dart b/lib/more_page.dart index d58dd9e..7114fc4 100644 --- a/lib/more_page.dart +++ b/lib/more_page.dart @@ -3,15 +3,40 @@ import 'package:flutter/material.dart'; class MorePage extends StatelessWidget { const MorePage({super.key}); - @override Widget build(BuildContext context) { - return const Scaffold( - body: Center( - child: Text( - 'More Page', - style: TextStyle(fontSize: 24), - ), + return Scaffold( + // appBar: AppBar( + // title: const Text('My Page'), + // ), + body: Column( + children: [ + const ListTile( + leading: CircleAvatar( + backgroundImage: NetworkImage('https://manostmboy.github.io/temp/dumass.png'), + ), + title: Text('김보통'), + subtitle: Text('normalkim@manos.kr'), + ), + const Divider(), + + // 메뉴 항목 + _buildMenuItem(Icons.subscriptions, 'My Subscriptions'), + _buildMenuItem(Icons.bookmark, 'Saved Lessons'), + _buildMenuItem(Icons.card_membership, 'Certificates'), + _buildMenuItem(Icons.notifications, 'Notifications'), + ], ), ); } + + Widget _buildMenuItem(IconData icon, String title) { + return ListTile( + leading: Icon(icon), + title: Text(title), + trailing: const Icon(Icons.arrow_forward_ios), + onTap: () { + // 탭 시 동작을 여기에 정의할 수 있어요. + }, + ); + } } \ No newline at end of file diff --git a/lib/plan_page.dart b/lib/plan_page.dart index 7713db3..b053e32 100644 --- a/lib/plan_page.dart +++ b/lib/plan_page.dart @@ -69,27 +69,8 @@ class _PlanPageState extends State { itemBuilder: (context, index) { final plan = plans[index]; return InkWell( - onTap: () { - if (plan.planId == 'ID 없음' || plan.planId.isEmpty) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('유효한 Plan ID가 없어 상세 페이지로 이동할 수 없습니다.')), - ); - return; - } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const PlanPageDetail(), - settings: RouteSettings( - // <<< Map 형태로 planId와 planTitle을 전달 >>> - arguments: { - 'planId': plan.planId, - 'planTitle': plan.planTitle, - }, - ), - ), - ); - }, + // onTap: () { + // }, child: Card( margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), @@ -99,28 +80,7 @@ class _PlanPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - plan.planTitle, - style: const TextStyle( - fontSize: 17.0, fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, - maxLines: 2, - ), - ), - const SizedBox(width: 8.0), - Text( - plan.planTeacher, - style: const TextStyle( - fontSize: 13.0, color: Colors.grey), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ], - ), + const SizedBox(height: 8.0), if (plan.thumbnail.isNotEmpty) @@ -128,7 +88,7 @@ class _PlanPageState extends State { borderRadius: BorderRadius.circular(8.0), child: Image.network( plan.thumbnail, - height: 120, + height: 200, width: double.infinity, fit: BoxFit.contain, alignment: Alignment.centerLeft, @@ -163,6 +123,92 @@ class _PlanPageState extends State { child: const Center( child: Text('No Image', style: TextStyle(color: Colors.grey)))), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + plan.planTitle, + style: const TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold), + overflow: TextOverflow.ellipsis, + maxLines: 2, + ), + const SizedBox(height: 5.0), + // Text( + // plan.planTeacher, + // style: const TextStyle( + // fontSize: 15.0, color: Colors.black45), + // maxLines: 1, + // overflow: TextOverflow.ellipsis, + // ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + "Progress", + style: const TextStyle( + fontSize: 15.0, color: Colors.black45), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + const SizedBox(width: 5.0), + Text( + "50%", + style: const TextStyle( + fontSize: 15.0, color: Colors.black45), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ], + ), + const SizedBox(height: 8.0), + LinearProgressIndicator( + value: 0.5, // TODO: Replace with actual progress value from plan object + backgroundColor: Colors.grey[200], + valueColor: AlwaysStoppedAnimation(Colors.blue), + ), + const SizedBox(height: 16.0), + Column( + mainAxisAlignment: MainAxisAlignment.center, // 세로 중앙 정렬 + crossAxisAlignment: CrossAxisAlignment.stretch, // 버튼이 가로로 꽉 차게 설정 + children: [ElevatedButton( + + onPressed: () { + // TODO: Implement navigation or action for Continue Learning + + if (plan.planId == 'ID 없음' || plan.planId.isEmpty) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('유효한 Plan ID가 없어 상세 페이지로 이동할 수 없습니다.')), + ); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const PlanPageDetail(), + settings: RouteSettings( + // <<< Map 형태로 planId와 planTitle을 전달 >>> + arguments: { + 'planId': plan.planId, + 'planTitle': plan.planTitle, + }, + ), + ), + ); + }, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xB91459DB), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + padding: const EdgeInsets.symmetric(horizontal: 20), + ), + child: const Text('Continue Learning',style: TextStyle(color: Colors.white)), + ),],), + ], + ), ], ), ),