Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/team-balt/easier-dodam into…
Browse files Browse the repository at this point in the history
… feat/#1
  • Loading branch information
GayeongKimm committed Nov 21, 2024
2 parents e0fe831 + 0322376 commit f4828e4
Show file tree
Hide file tree
Showing 22 changed files with 991 additions and 183 deletions.
Binary file added assets/images/ic_happy.png
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.15.2
COCOAPODS: 1.16.2
5 changes: 2 additions & 3 deletions lib/component/preset_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,19 @@ class EasierDodamDefaultPresetAppbar extends StatelessWidget {
height: 24,
child: Image.asset(
"assets/images/ic_arrow_left.png",
color: EasierDodamColors.gray600,
color: EasierDodamColors.staticBlack,
),
),
),
),
),
SizedBox(
width: 12,
width: 4,
),
Text(
title,
style: EasierDodamStyles.title1,
),
Expanded(child: SizedBox()),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/feature/login/login_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LoginViewmodel with ChangeNotifier {
String _testState = "";
String get testState => _testState;

LoginViewModel() {
LoginViewmodel() {
_loginDataSource = LoginDataSource();
}

Expand Down
42 changes: 22 additions & 20 deletions lib/feature/out/item/out_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:easier_dodam/component/theme/color.dart';
import 'package:easier_dodam/component/theme/style.dart';
import 'package:easier_dodam/utiles/utile.dart';
import 'package:flutter/material.dart';

enum TagType { PENDING, APPROVE, REJECT }
Expand All @@ -22,6 +23,9 @@ class OutItem extends StatelessWidget {

@override
Widget build(BuildContext context) {
final hour = timeOfDayDifference(TimeOfDay.now(), endAt) ~/ 60;
final minute = timeOfDayDifference(TimeOfDay.now(), endAt) % 60;

return Container(
decoration: BoxDecoration(
color: Colors.white,
Expand All @@ -31,7 +35,7 @@ class OutItem extends StatelessWidget {
color: Colors.black.withOpacity(0.08),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(0, 4), // changes position of shadow
offset: const Offset(0, 4), // changes position of shadow
),
],
),
Expand All @@ -58,7 +62,7 @@ class OutItem extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
),
child: Padding(
padding: EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric(
vertical: 4.0,
horizontal: 10.0,
),
Expand All @@ -75,10 +79,16 @@ class OutItem extends StatelessWidget {
),
),
),
SizedBox(
width: 24,
height: 24,
child: Image.asset("assets/images/ic_trash.png"),
Material(
color: EasierDodamColors.staticWhite,
child: InkWell(
onTap: onClickTrash,
child: SizedBox(
width: 24,
height: 24,
child: Image.asset("assets/images/ic_trash.png"),
),
),
)
],
),
Expand All @@ -89,9 +99,12 @@ class OutItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"3시간",
hour > 0 ? "$hour시간" : "$minute",
style: EasierDodamStyles.label2,
),
SizedBox(
width: 2,
),
Text(
"남음",
style: EasierDodamStyles.label2.copyWith(
Expand Down Expand Up @@ -120,7 +133,7 @@ class OutItem extends StatelessWidget {
width: 2,
),
Text(
"18시 30분",
"${startAt.hour}시 ${startAt.minute}분",
style: EasierDodamStyles.label2,
),
],
Expand All @@ -138,7 +151,7 @@ class OutItem extends StatelessWidget {
width: 2,
),
Text(
"18시 30분",
"${endAt.hour}시 ${endAt.minute}분",
style: EasierDodamStyles.label2,
),
],
Expand All @@ -151,14 +164,3 @@ class OutItem extends StatelessWidget {
);
}
}

Duration timeOfDayDifference(TimeOfDay start, TimeOfDay end) {
final startMinutes = start.hour * 60 + start.minute;
final endMinutes = end.hour * 60 + end.minute;

// 차이를 계산
final differenceInMinutes = endMinutes - startMinutes;

// 차이를 Duration으로 변환
return Duration(minutes: differenceInMinutes);
}
136 changes: 82 additions & 54 deletions lib/feature/out/item/out_preset_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,100 @@ import 'package:easier_dodam/component/theme/style.dart';
import 'package:flutter/material.dart';

class OutPresetItem extends StatelessWidget {
const OutPresetItem({super.key});
final String title;
final String reason;
final String startAt;
final String endAt;
final Function() onTrashClick;
final Function() onClick;

const OutPresetItem({
super.key,
required this.title,
required this.reason,
required this.startAt,
required this.endAt,
required this.onTrashClick,
required this.onClick,
});

@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"프리셋#1",
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray700),
),
SizedBox(
height: 4,
),
Text(
"사유 : ㅈㅂㄷㅂㅈㄷㅈㄷ",
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray600),
),
SizedBox(
height: 4,
),
Row(
return Material(
color: EasierDodamColors.staticWhite,
child: InkWell(
onTap: onClick,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"시작",
style: EasierDodamStyles.body2.copyWith(fontSize: 12.0),
title,
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray700),
),
Text(
" 13시 50분",
style: EasierDodamStyles.body2.copyWith(fontSize: 14.0),
SizedBox(
height: 4,
),
Expanded(child: SizedBox()),
Text(
"복귀",
style: EasierDodamStyles.body2.copyWith(fontSize: 12.0),
"사유 : $reason",
style: EasierDodamStyles.body2
.copyWith(color: EasierDodamColors.gray600),
),
Text(
" 13시 50분",
style: EasierDodamStyles.body2.copyWith(fontSize: 14.0),
SizedBox(
height: 4,
),
Row(
children: [
Text(
"시작",
style:
EasierDodamStyles.body2.copyWith(fontSize: 12.0),
),
Text(
" $startAt",
style:
EasierDodamStyles.body2.copyWith(fontSize: 14.0),
),
Expanded(child: SizedBox()),
Text(
"복귀",
style:
EasierDodamStyles.body2.copyWith(fontSize: 12.0),
),
Text(
" $endAt",
style:
EasierDodamStyles.body2.copyWith(fontSize: 14.0),
),
],
)
],
)
],
),
),
SizedBox(
width: 4,
),
),
SizedBox(
width: 4,
),
SizedBox(
width: 24,
height: 24,
child: InkWell(
onTap: onTrashClick,
child: Image.asset(
"assets/images/ic_trash.png",
color: EasierDodamColors.gray700,
),
),
)
],
),
SizedBox(
width: 24,
height: 24,
child: Image.asset(
"assets/images/ic_trash.png",
color: EasierDodamColors.gray700,
),
)
],
),
),
);
}
Expand Down
Loading

0 comments on commit f4828e4

Please sign in to comment.