플랜 프토토타입 완료
This commit is contained in:
@@ -16,7 +16,7 @@ class CaseStudyPlan {
|
|||||||
return CaseStudyPlan(
|
return CaseStudyPlan(
|
||||||
planId: json['casestudy lesson id'] ?? '아이디 없음',
|
planId: json['casestudy lesson id'] ?? '아이디 없음',
|
||||||
planTitle: json['course_name'] ?? '제목 없음',
|
planTitle: json['course_name'] ?? '제목 없음',
|
||||||
planTeacher: json['planTeacher'] ?? '',
|
planTeacher: json['course_description'] ?? '',
|
||||||
thumbnail: json['course_thumbnail'] ?? '',
|
thumbnail: json['course_thumbnail'] ?? '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,11 +112,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
onTap: _navigateToProfileTab,
|
onTap: _navigateToProfileTab,
|
||||||
customBorder: const CircleBorder(),
|
customBorder: const CircleBorder(),
|
||||||
child: const CircleAvatar(
|
child: const CircleAvatar(
|
||||||
backgroundColor: Colors.grey,
|
backgroundImage: NetworkImage('https://manostmboy.github.io/temp/dumass.png'),
|
||||||
child: Icon(
|
|
||||||
Icons.person,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,15 +3,40 @@ import 'package:flutter/material.dart';
|
|||||||
class MorePage extends StatelessWidget {
|
class MorePage extends StatelessWidget {
|
||||||
const MorePage({super.key});
|
const MorePage({super.key});
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
// appBar: AppBar(
|
||||||
child: Text(
|
// title: const Text('My Page'),
|
||||||
'More Page',
|
// ),
|
||||||
style: TextStyle(fontSize: 24),
|
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: () {
|
||||||
|
// 탭 시 동작을 여기에 정의할 수 있어요.
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -69,27 +69,8 @@ class _PlanPageState extends State<PlanPage> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final plan = plans[index];
|
final plan = plans[index];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
// 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,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
child: Card(
|
||||||
margin:
|
margin:
|
||||||
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||||
@@ -99,28 +80,7 @@ class _PlanPageState extends State<PlanPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: <Widget>[
|
|
||||||
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),
|
const SizedBox(height: 8.0),
|
||||||
|
|
||||||
if (plan.thumbnail.isNotEmpty)
|
if (plan.thumbnail.isNotEmpty)
|
||||||
@@ -128,7 +88,7 @@ class _PlanPageState extends State<PlanPage> {
|
|||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
plan.thumbnail,
|
plan.thumbnail,
|
||||||
height: 120,
|
height: 200,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
@@ -163,6 +123,92 @@ class _PlanPageState extends State<PlanPage> {
|
|||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text('No Image',
|
child: Text('No Image',
|
||||||
style: TextStyle(color: Colors.grey)))),
|
style: TextStyle(color: Colors.grey)))),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
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: <Widget>[
|
||||||
|
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<Color>(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)),
|
||||||
|
),],),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user