Skip to content

Commit

Permalink
FEAT :: 목표가 없을 때 Screen 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ljyo2o9 committed Jun 21, 2024
1 parent 2f6b3c1 commit 90f0206
Showing 1 changed file with 53 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:maeum_ga_gym_flutter/core/component/image/images.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/provider/purpose/self_care_purpose_my_purposes_provider.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/view/purpose/self_care_purpose_add_screen.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/view/purpose/self_care_purpose_detail_screen.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/view/purpose/self_care_purpose_empty_screen.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/widget/my_routine/self_care_my_routine_button.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/widget/purpose/self_care_purpose_item_widget.dart';
import 'package:maeum_ga_gym_flutter/self_care/presentation/widget/self_care_default_app_bar.dart';
Expand Down Expand Up @@ -75,55 +76,60 @@ class _SelfCarePurposeMainScreenState
iconPath: Images.arrowLeft,
),
body: SafeArea(
child: SingleChildScrollView(
controller: scrollController,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const RoutineDefaultTitleContainer(
title: "목표",
subTitle: "나만의 목표를 세워보세요.",
),
const SizedBox(height: 32),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: myPurposeState.purposeList.length, // 임의로 넣은 아이템 갯수
itemBuilder: (context, index) {
return Column(
children: [
GestureDetector(
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SelfCarePurposeDetailScreen(
purposeId:
myPurposeState.purposeList[index].id!),
child: Builder(
builder: (context) {
if(myPurposeState.purposeList.isEmpty){
return const SelfCarePurposeEmptyScreen();
}

return SingleChildScrollView(
controller: scrollController,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const RoutineDefaultTitleContainer(
title: "목표",
subTitle: "나만의 목표를 세워보세요.",
),
const SizedBox(height: 32),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: myPurposeState.purposeList.length, // 임의로 넣은 아이템 갯수
itemBuilder: (context, index) {
return Column(
children: [
GestureDetector(
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => SelfCarePurposeDetailScreen(purposeId: myPurposeState.purposeList[index].id!),
),
),
child: SelfCarePurposeItemWidget(
purposeId: myPurposeState.purposeList[index].id!,
title: myPurposeState.purposeList[index].title
.toString(),
subTitle: myPurposeState
.purposeList[index].startDate
.toString(),
),
),
SizedBox(
height: index == myPurposeState.purposeList.length - 1 ?
0 : 12
),
),
child: SelfCarePurposeItemWidget(
purposeId: myPurposeState.purposeList[index].id!,
title: myPurposeState.purposeList[index].title
.toString(),
subTitle: myPurposeState
.purposeList[index].startDate
.toString(),
),
),
SizedBox(
height:
index == myPurposeState.purposeList.length - 1
? 0
: 12),
],
);
},
],
);
},
),
const SizedBox(height: 98),
],
),
const SizedBox(height: 98),
],
),
),
),
);
}
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
Expand Down

0 comments on commit 90f0206

Please sign in to comment.