하단 무한 조닝 추가.,
This commit is contained in:
@@ -95,6 +95,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_caseStudyPlans = _fetchCaseStudyPlans();
|
_caseStudyPlans = _fetchCaseStudyPlans();
|
||||||
|
|
||||||
_newCoursesFuture = _fetchNewCourses(); // Initialize new courses future
|
_newCoursesFuture = _fetchNewCourses(); // Initialize new courses future
|
||||||
_fetchTimezone();
|
_fetchTimezone();
|
||||||
_clockStream = Stream.periodic(const Duration(seconds: 1), (_) {
|
_clockStream = Stream.periodic(const Duration(seconds: 1), (_) {
|
||||||
@@ -353,7 +354,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
final plans = snapshot.data!;
|
final plans = snapshot.data!;
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
scrollDirection: Axis.horizontal, // 가로 스크롤로 변경
|
scrollDirection: Axis.horizontal, // 가로 스크롤로 변경
|
||||||
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
|
padding: const EdgeInsets.only(left: 10.0, right: 5.0, top: 8.0, bottom: 5.0),
|
||||||
itemCount: plans.length,
|
itemCount: plans.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final plan = plans[index];
|
final plan = plans[index];
|
||||||
@@ -395,7 +396,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
final courses = snapshot.data!;
|
final courses = snapshot.data!;
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
|
padding: const EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||||
itemCount: courses.length,
|
itemCount: courses.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final course = courses[index];
|
final course = courses[index];
|
||||||
@@ -410,6 +411,47 @@ class _HomePageState extends State<HomePage> {
|
|||||||
// --- ▼▼▼ 추천 클래스 섹션 호출 ▼▼▼ ---
|
// --- ▼▼▼ 추천 클래스 섹션 호출 ▼▼▼ ---
|
||||||
_buildRecommendSection(),
|
_buildRecommendSection(),
|
||||||
// --- ▲▲▲ 추천 클래스 섹션 호출 끝 ▲▲▲ ---
|
// --- ▲▲▲ 추천 클래스 섹션 호출 끝 ▲▲▲ ---
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0),
|
||||||
|
child: Text('Trending On New Study', style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 200, // 가로 리스트의 높이를 줄입니다.
|
||||||
|
child: FutureBuilder<List<CaseStudyPlan>>(
|
||||||
|
future: _caseStudyPlans,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const Center(child: CircularProgressIndicator());
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Center(child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Text('Error loading upcoming classes: ${snapshot.error}', textAlign: TextAlign.center),
|
||||||
|
));
|
||||||
|
} else if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
||||||
|
return const Center(child: Text('No upcoming classes available.'));
|
||||||
|
} else {
|
||||||
|
final plans = snapshot.data!;
|
||||||
|
return ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal, // 가로 스크롤로 변경
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, right: 5.0, top: 8.0, bottom: 5.0),
|
||||||
|
itemCount: plans.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final plan = plans[index];
|
||||||
|
return Align(
|
||||||
|
alignment: Alignment.topCenter, // 항목을 상단 중앙에 정렬
|
||||||
|
child: UpcomingClassCard(
|
||||||
|
plan: plan,
|
||||||
|
onTap: () {
|
||||||
|
widget.onNavigateToPlanTab(1);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user