플랜 프토토타입 완료
This commit is contained in:
@@ -69,27 +69,8 @@ class _PlanPageState extends State<PlanPage> {
|
||||
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<PlanPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
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),
|
||||
|
||||
if (plan.thumbnail.isNotEmpty)
|
||||
@@ -128,7 +88,7 @@ class _PlanPageState extends State<PlanPage> {
|
||||
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<PlanPage> {
|
||||
child: const Center(
|
||||
child: Text('No Image',
|
||||
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