-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
33 changed files
with
1,525 additions
and
198 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 | ||
|
||
COCOAPODS: 1.16.2 | ||
COCOAPODS: 1.15.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
111
lib/feature/night_study/item/night_study_preset_item.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.