전체적인 시스템 추가.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:csp2/course.dart';
|
||||
import 'package:csp2/common/data/course.dart';
|
||||
class CourseCard extends StatelessWidget {
|
||||
final Course course;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:csp2/job.dart';
|
||||
import 'package:csp2/common/data/job.dart';
|
||||
class JobCard extends StatelessWidget {
|
||||
final Job job;
|
||||
|
||||
|
||||
91
lib/common/widgets/now_study_class_card.dart
Normal file
91
lib/common/widgets/now_study_class_card.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../data/new_study.dart'; // NewStudy 모델을 import 합니다.
|
||||
|
||||
class StudyClassCard extends StatelessWidget {
|
||||
final NewStudy plan;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const StudyClassCard({
|
||||
super.key,
|
||||
required this.plan,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 2, // 화면 너비의 절반으로 설정
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Card(
|
||||
margin: const EdgeInsets.only(right: 12.0), // 항목 간의 간격 조정
|
||||
elevation: 2.0,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
if (plan.thumbnail.isNotEmpty)
|
||||
Expanded(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Image.network(
|
||||
plan.thumbnail,
|
||||
width: double.infinity,
|
||||
fit: BoxFit.contain,
|
||||
loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
|
||||
if (loadingProgress == null) return child;
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress.expectedTotalBytes != null
|
||||
? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!
|
||||
: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return const Center(child: Icon(Icons.broken_image, color: Colors.grey, size: 50));
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: Colors.grey[200],
|
||||
child: const Center(child: Text('No Image', style: TextStyle(color: Colors.grey)))
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 5.0),
|
||||
SizedBox(
|
||||
height: 70, // 텍스트 영역의 고정 높이 설정 (두 줄 텍스트를 위한 충분한 공간)
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 48.0, // plan.planTitle이 항상 두 줄 공간을 차지하도록 고정
|
||||
child: Text(
|
||||
plan.planTitle,
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.bold),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4.0),
|
||||
Text(
|
||||
plan.planTeacher,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(color: Colors.grey[600]),
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../home_page.dart'; // CaseStudyPlan 모델을 import 합니다.
|
||||
import '../data/upcoming_study.dart'; // UpcomingStudy 모델을 import 합니다.
|
||||
|
||||
class UpcomingClassCard extends StatelessWidget {
|
||||
final CaseStudyPlan plan;
|
||||
final UpcomingStudy plan;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const UpcomingClassCard({
|
||||
|
||||
Reference in New Issue
Block a user