Skip to content

Commit

Permalink
Merge pull request #6 from team-balt/feat/#1
Browse files Browse the repository at this point in the history
Feat/#1
  • Loading branch information
GayeongKimm authored Nov 26, 2024
2 parents 8e5f0d7 + 32fd6b1 commit 3da5213
Show file tree
Hide file tree
Showing 33 changed files with 1,525 additions and 198 deletions.
7 changes: 7 additions & 0 deletions assets/images/ic_splash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
11 changes: 4 additions & 7 deletions lib/component/bottom_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ class EasierDodamBottomNavigationBar extends StatelessWidget {
context,
icon: 'assets/images/ic_moon_plus.svg',
label: '심야자습',
index: 3,
index: 2,
),
_buildNavItem(
context,
icon: 'assets/images/ic_gear.svg',
label: '설정',
index: 2,
index: 3,
),
],
),
Expand All @@ -75,17 +75,14 @@ class EasierDodamBottomNavigationBar extends StatelessWidget {
icon,
height: isSelected ? 30 : 24,
width: isSelected ? 30 : 24,
colorFilter: ColorFilter.mode(
isSelected ? Colors.blue : Colors.grey,
BlendMode.srcIn,
),
color: isSelected ? Colors.blue : Colors.grey,
),
const SizedBox(height: 4),
Text(
label,
style: TextStyle(
color: isSelected ? Colors.blue : Colors.grey,
fontSize: isSelected ? 13 : 12,
fontSize: isSelected ? 14 : 12,
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/component/modal_bottom_sheet_container.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:easier_dodam/component/theme/color.dart';
import 'package:easier_dodam/component/theme/style.dart';
import 'package:flutter/material.dart';

class ModalBottomSheetContainer extends StatelessWidget {
Expand Down
4 changes: 3 additions & 1 deletion lib/feature/logout/logout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import '../../feature/out/out_navigation.dart';
import '../../feature/out_sleeping/out_sleeping_navigation.dart';
import '../logout/logout_viewmodel.dart';
import 'item/setting_item.dart';
import 'logout_navigation.dart';

class SettingScreen extends StatefulWidget {
const SettingScreen({super.key});
Expand All @@ -33,9 +34,10 @@ class _SettingScreenState extends State<SettingScreen> {
Navigator.pushReplacementNamed(context, outRoute);
break;
case 2:
Navigator.pushReplacementNamed(context, nightStudyRoute);
break;
case 3:
Navigator.pushReplacementNamed(context, nightStudyRoute);
Navigator.pushReplacementNamed(context, logoutRoute);
break;
}
});
Expand Down
184 changes: 184 additions & 0 deletions lib/feature/night_study/item/night_study_item.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../../../component/theme/color.dart';
import '../../../component/theme/style.dart';
import '../../../utiles/utile.dart';

enum TagType { PENDING, APPROVE, REJECT }
enum PlaceType { PROGRAMMING_1, PROGRAMMING_2, PROGRAMMING_3 }

extension PlaceTypeExtension on PlaceType {
String get name {
switch (this) {
case PlaceType.PROGRAMMING_1:
return "프로그래밍1실";
case PlaceType.PROGRAMMING_2:
return "프로그래밍2실";
case PlaceType.PROGRAMMING_3:
return "프로그래밍3실";
}
}
}

class NightStudyItem extends StatelessWidget {

final TagType tagType;
final Function() onClickTrash;
final String? rejectReason;
final DateTime startAt;
final DateTime endAt;

const NightStudyItem({
super.key,
required this.tagType,
required this.onClickTrash,
this.rejectReason,
required this.startAt,
required this.endAt,
});

@override
Widget build(BuildContext context) {

final hour = dateDifferenceInDays(DateTime.now(), endAt) ~/ 60;
final minute = dateDifferenceInDays(DateTime.now(), endAt) % 60;

return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.08),
spreadRadius: 0,
blurRadius: 4,
offset: const Offset(0, 4), // changes position of shadow
),
],
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
color: switch (tagType) {
TagType.PENDING => EasierDodamColors.gray600,
TagType.APPROVE => EasierDodamColors.primary300,
TagType.REJECT => EasierDodamColors.staticRed
},
borderRadius: BorderRadius.circular(12),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 4.0,
horizontal: 10.0,
),
child: Text(
switch (tagType) {
TagType.PENDING => "대기중",
TagType.APPROVE => "수락됨",
TagType.REJECT => "거절됨",
},
style: EasierDodamStyles.label1.copyWith(
fontSize: 12.0,
color: EasierDodamColors.staticWhite,
),
),
),
),
Material(
color: EasierDodamColors.staticWhite,
child: InkWell(
onTap: onClickTrash,
child: SizedBox(
width: 24,
height: 24,
child: Image.asset("assets/images/ic_trash.png"),
),
),
)
],
),
const SizedBox(
height: 12,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
hour > 0 ? "$hour시간" : "$minute분",
style: EasierDodamStyles.label2,
),
SizedBox(
width: 2,
),
Text(
"남음",
style: EasierDodamStyles.label2.copyWith(
fontSize: 12.0,
),
)
],
),
const SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"시작",
style: EasierDodamStyles.label2.copyWith(
fontSize: 12.0,
),
),
const SizedBox(
width: 2,
),
Text(
"${startAt.year}-${startAt.month}-${startAt.day}일",
style: EasierDodamStyles.label2,
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"복귀",
style: EasierDodamStyles.label2.copyWith(
fontSize: 12.0,
),
),
const SizedBox(
width: 2,
),
Text(
"${endAt.year}-${endAt.month}-${endAt.day}일",
style: EasierDodamStyles.label2,
),
],
),
],
),
],
),
),
);
}
}
111 changes: 111 additions & 0 deletions lib/feature/night_study/item/night_study_preset_item.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import 'package:easier_dodam/feature/night_study/item/night_study_item.dart';
import 'package:flutter/material.dart';

import '../../../component/theme/color.dart';
import '../../../component/theme/style.dart';

class NightStudyPresetItem extends StatelessWidget {
final String presetTitle;
final PlaceType place;
final String content;
final bool doNeedPhone;
final String phoneReason;
final String startDate;
final String endDate;
final Function() onTrashClick;
final Function() onClickCreate;

const NightStudyPresetItem({
super.key,
required this.presetTitle,
required this.place,
required this.content,
required this.doNeedPhone,
required this.phoneReason,
required this.startDate,
required this.endDate,
required this.onTrashClick,
required this.onClickCreate,
});

@override
Widget build(BuildContext context) {
return Material(
color: EasierDodamColors.staticWhite,
child: InkWell(
onTap: onClickCreate,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
presetTitle,
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray700),
),
SizedBox(
height: 4,
),
Text(
"사유 : $context",
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray600),
),
SizedBox(
height: 4,
),
Row(
children: [
Text(
"시작",
style:
EasierDodamStyles.body2.copyWith(fontSize: 12.0),
),
Text(
" $startDate",
style:
EasierDodamStyles.body2.copyWith(fontSize: 14.0),
),
Expanded(child: SizedBox()),
Text(
"종료",
style:
EasierDodamStyles.body2.copyWith(fontSize: 12.0),
),
Text(
" $endDate",
style:
EasierDodamStyles.body2.copyWith(fontSize: 14.0),
),
],
)
],
),
),
SizedBox(
width: 4,
),
SizedBox(
width: 24,
height: 24,
child: InkWell(
onTap: onTrashClick,
child: Image.asset(
"assets/images/ic_trash.png",
color: EasierDodamColors.gray700,
),
),
)
],
),
),
),
);
}
}
Loading

0 comments on commit 3da5213

Please sign in to comment.