From 481ee8a148870c14f180e742cb7a16ea5aa3cd02 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 21:15:22 +0900 Subject: [PATCH 01/23] =?UTF-8?q?feat=20::=20empty=20=EC=BC=80=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 888a05d5..4d0c756d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -108,6 +108,11 @@ enum DeviceType { text: "건조기", icon: LoturaIcons.dry, imagePath: "assets/dry_image.jpeg", + ), + empty( + text: "", + icon: Icons.abc, + imagePath: "", ); final String text, imagePath; From d12ce7ae04f472228eff8f269b467bf5abaca4b4 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 21:15:54 +0900 Subject: [PATCH 02/23] =?UTF-8?q?feat=20::=20viewId=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/laundry/dto/response/laundry_response.dart | 10 +++++++++- lib/domain/laundry/entity/laundry_entity.dart | 2 ++ .../laundry_room_page/bloc/laundry_bloc.dart | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/data/laundry/dto/response/laundry_response.dart b/lib/data/laundry/dto/response/laundry_response.dart index df0364e8..1e7b0ba6 100644 --- a/lib/data/laundry/dto/response/laundry_response.dart +++ b/lib/data/laundry/dto/response/laundry_response.dart @@ -3,11 +3,13 @@ import 'package:lotura/main.dart'; class LaundryResponse { final int id; + final int viewId; final int state; final String deviceType; const LaundryResponse({ required this.id, + required this.viewId, required this.state, required this.deviceType, }); @@ -15,6 +17,7 @@ class LaundryResponse { factory LaundryResponse.fromJson(Map json) { return LaundryResponse( id: json['id'], + viewId: json['view_id'], state: json['state'], deviceType: json['device_type'], ); @@ -23,8 +26,13 @@ class LaundryResponse { LaundryEntity toEntity() { return LaundryEntity( id: id, + viewId: viewId, state: CurrentState.values.elementAt(state), - deviceType: deviceType == "WASH" ? DeviceType.wash : DeviceType.dry, + deviceType: deviceType == "WASH" + ? DeviceType.wash + : deviceType == "DRY" + ? DeviceType.dry + : DeviceType.empty, ); } } diff --git a/lib/domain/laundry/entity/laundry_entity.dart b/lib/domain/laundry/entity/laundry_entity.dart index 81190d4a..01e98f30 100644 --- a/lib/domain/laundry/entity/laundry_entity.dart +++ b/lib/domain/laundry/entity/laundry_entity.dart @@ -2,11 +2,13 @@ import 'package:lotura/main.dart'; class LaundryEntity { final int id; + final int viewId; final CurrentState state; final DeviceType deviceType; const LaundryEntity({ required this.id, + required this.viewId, required this.state, required this.deviceType, }); diff --git a/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart b/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart index 1188b9a7..7aaee4d9 100644 --- a/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart +++ b/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart @@ -30,6 +30,7 @@ class LaundryBloc extends Bloc> { .map((e) => e.id == data.id ? LaundryEntity( id: e.id, + viewId: e.viewId, state: data.state, deviceType: data.deviceType) : e) From 2143ae574d153486a306990e8f53d8195b132999 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 21:20:47 +0900 Subject: [PATCH 03/23] move :: machine card --- .../{utils => apply_page/ui/widget}/machine_card.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/presentation/{utils => apply_page/ui/widget}/machine_card.dart (100%) diff --git a/lib/presentation/utils/machine_card.dart b/lib/presentation/apply_page/ui/widget/machine_card.dart similarity index 100% rename from lib/presentation/utils/machine_card.dart rename to lib/presentation/apply_page/ui/widget/machine_card.dart From 5d20db45e70edc52802277737e897cc1c0d8dbb5 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 21:32:39 +0900 Subject: [PATCH 04/23] =?UTF-8?q?refactor=20::=20emptyContainer=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/presentation/utils/machine_widget.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/presentation/utils/machine_widget.dart b/lib/presentation/utils/machine_widget.dart index 3f1c04a0..1de53a32 100644 --- a/lib/presentation/utils/machine_widget.dart +++ b/lib/presentation/utils/machine_widget.dart @@ -14,13 +14,9 @@ abstract class MachineWidget extends StatelessWidget { }); final int deviceId; - final bool isEnableNotification, isWoman; - - final CurrentState state; final DeviceType deviceType; - - bool get isEmptyContainer => - (!isWoman && deviceId == 32) || (isWoman && deviceId == -1); + final CurrentState state; + final bool isEnableNotification, isWoman; void showModalOSJBottomSheet({required BuildContext context}) => showModalBottomSheet( From c6f927cc8765c0513f3ff1003ef0ede82c8e1672 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 21:38:48 +0900 Subject: [PATCH 05/23] =?UTF-8?q?feat=20::=20empty=20DeviceType=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/presentation/apply_page/ui/view/apply_page.dart | 8 ++++---- lib/presentation/apply_page/ui/widget/machine_card.dart | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/presentation/apply_page/ui/view/apply_page.dart b/lib/presentation/apply_page/ui/view/apply_page.dart index fe6f505f..664b931b 100644 --- a/lib/presentation/apply_page/ui/view/apply_page.dart +++ b/lib/presentation/apply_page/ui/view/apply_page.dart @@ -5,6 +5,7 @@ import 'package:lotura/main.dart'; import 'package:lotura/presentation/apply_page/bloc/apply_bloc.dart'; import 'package:lotura/presentation/apply_page/bloc/apply_model.dart'; import 'package:lotura/presentation/apply_page/bloc/apply_state.dart'; +import 'package:lotura/presentation/apply_page/ui/widget/machine_card.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_bloc.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_event.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_model.dart'; @@ -13,7 +14,6 @@ import 'package:lotura/presentation/notice_page/ui/view/notice_page.dart'; import 'package:lotura/presentation/setting_page/ui/view/setting_page.dart'; import 'package:lotura/presentation/utils/lotura_colors.dart'; import 'package:lotura/presentation/utils/lotura_icons.dart'; -import 'package:lotura/presentation/utils/machine_card.dart'; class ApplyPage extends StatelessWidget { ApplyPage({super.key}); @@ -150,7 +150,7 @@ class ApplyPage extends StatelessWidget { .value .applyList[index * 2] .deviceId > - 31 + 64 ? true : false, deviceType: state.value @@ -168,7 +168,7 @@ class ApplyPage extends StatelessWidget { .applyList[ index * 2 + 1] .deviceId > - 31 + 64 ? true : false, deviceType: state @@ -181,7 +181,7 @@ class ApplyPage extends StatelessWidget { deviceId: -1, isEnableNotification: false, isWoman: true, - deviceType: DeviceType.dry, + deviceType: DeviceType.empty, state: CurrentState.working) ], ), diff --git a/lib/presentation/apply_page/ui/widget/machine_card.dart b/lib/presentation/apply_page/ui/widget/machine_card.dart index 04ae1e34..671c8527 100644 --- a/lib/presentation/apply_page/ui/widget/machine_card.dart +++ b/lib/presentation/apply_page/ui/widget/machine_card.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart' as s; +import 'package:lotura/main.dart'; import 'package:lotura/presentation/utils/machine_widget.dart'; class MachineCard extends MachineWidget { @@ -14,7 +15,7 @@ class MachineCard extends MachineWidget { @override Widget build(BuildContext context) { - return isEmptyContainer + return deviceType == DeviceType.empty ? Container( width: 170.0.r, padding: EdgeInsets.only(top: 10.0.r), @@ -27,7 +28,7 @@ class MachineCard extends MachineWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - deviceType.imagePath, + "assets/dry_image.jpeg", width: 100.0.r, height: 100.0.r, color: Colors.transparent, From 2a4f10a73fe462baf835bfc279c011399bede8a9 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:26:06 +0900 Subject: [PATCH 06/23] =?UTF-8?q?feat=20::=20=EC=84=B8=ED=83=81=EC=8B=A4?= =?UTF-8?q?=20=EB=B3=B5=EC=B8=B5=20=EC=9D=B8=EB=8D=B1=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/view/laundry_room_page.dart | 132 ++++++------------ 1 file changed, 41 insertions(+), 91 deletions(-) diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index 7263ee2b..e0174235 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -19,8 +19,6 @@ import 'package:lotura/presentation/setting_page/ui/view/setting_page.dart'; import 'package:lotura/presentation/utils/lotura_colors.dart'; import 'package:lotura/presentation/utils/lotura_icons.dart'; import 'package:lotura/presentation/utils/machine_button.dart'; -import 'package:lotura/presentation/utils/machine_card.dart'; -import 'package:lotura/presentation/utils/machine_widget.dart'; import 'package:lotura/presentation/utils/osj_bottom_sheet.dart'; import 'package:lotura/presentation/utils/osj_text_button.dart'; @@ -30,12 +28,20 @@ class LaundryRoomPage extends StatelessWidget { final int nfcTagData; final Map place = { - 0: "남자 학교측 세탁실", - 1: "남자 기숙사측 세탁실", - 2: "여자 세탁실", + 0: "남자 학교측 세탁실 1층", + 1: "남자 학교측 세탁실 2층", + 2: "남자 기숙사측 세탁실 1층", + 3: "남자 기숙사측 세탁실 2층", + 4: "여자 세탁실 1층", }; - final Map placeIndex = {0: 0, 1: 16, 2: 31}; + final Map placeIndex = { + 0: 0, + 1: 16, + 2: 31, + 3: 47, + 4: 63, + }; @override Widget build(BuildContext context) { @@ -258,26 +264,7 @@ class LaundryList extends StatelessWidget { final LaundryRoomModel laundryRoomModel; final int nfcData; - final Map placeIndex = {0: 0, 1: 16, 2: 31}; - - MachineWidget machineWidget( - {required LaundryRoomModel roomState, - required int deviceId, - required CurrentState state, - required DeviceType deviceType}) => - roomState.buttonView == ButtonView.image - ? MachineCard( - deviceId: deviceId, - isEnableNotification: true, - isWoman: roomState.roomLocation == RoomLocation.womanRoom, - state: state, - deviceType: deviceType) - : MachineButton( - deviceId: deviceId, - isEnableNotification: true, - isWoman: roomState.roomLocation == RoomLocation.womanRoom, - state: state, - deviceType: deviceType); + final Map placeIndex = {0: 0, 1: 16, 2: 31, 3: 47, 4: 63}; @override Widget build(BuildContext context) { @@ -310,80 +297,43 @@ class LaundryList extends StatelessWidget { return ScrollConfiguration( behavior: const ScrollBehavior().copyWith(overscroll: false), child: ListView.builder( - itemCount: - laundryRoomModel.roomLocation == RoomLocation.womanRoom ? 10 : 8, + itemCount: 8, + // laundryRoomModel.roomLocation == RoomLocation.womanRoom ? 10 : 8, itemBuilder: (context, index) { return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - machineWidget( - roomState: laundryRoomModel, - deviceId: list[ - placeIndex[laundryRoomModel.roomLocation.index]! + - index] - .id, - deviceType: list[ - placeIndex[laundryRoomModel.roomLocation.index]! + - index] - .deviceType, - state: list[ - placeIndex[laundryRoomModel.roomLocation.index]! + - index] - .state), - laundryRoomModel.buttonView.triangle, - machineWidget( - roomState: laundryRoomModel, - deviceId: placeIndex[laundryRoomModel.roomLocation.index]! + - index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8) < - 44 - ? list[placeIndex[ - laundryRoomModel.roomLocation.index]! + + MachineButton( + laundryEntity: laundryRoomModel.buttonView == + ButtonView.image + ? list[ + placeIndex[laundryRoomModel.roomLocation.index]! + + index] + : list[ + placeIndex[laundryRoomModel.roomLocation.index]! + index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8)] - .id - : -1, - deviceType: - placeIndex[laundryRoomModel.roomLocation.index]! + - index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8) < - 44 - ? list[placeIndex[ - laundryRoomModel.roomLocation.index]! + - index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8)] - .deviceType - : DeviceType.dry, - state: placeIndex[laundryRoomModel.roomLocation.index]! + + 32], + isEnableNotification: true, + isWoman: + laundryRoomModel.roomLocation == RoomLocation.womanRoom, + ), + laundryRoomModel.buttonView.triangle, + MachineButton( + laundryEntity: laundryRoomModel.buttonView == + ButtonView.image + ? list[ + placeIndex[laundryRoomModel.roomLocation.index]! + index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8) < - 44 - ? list[placeIndex[ - laundryRoomModel.roomLocation.index]! + + 8] + : list[ + placeIndex[laundryRoomModel.roomLocation.index]! + index + - (laundryRoomModel.roomLocation == - RoomLocation.womanRoom - ? 10 - : 8)] - .state - : CurrentState.breakdown, + 40], + isEnableNotification: true, + isWoman: + laundryRoomModel.roomLocation == RoomLocation.womanRoom, ), ], ), From 26a3aebf3226933c58684bf68cdaa08c2b1f58c2 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:41:34 +0900 Subject: [PATCH 07/23] =?UTF-8?q?refactor=20::=20=EC=97=AC=EC=9E=90=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apply_page/ui/view/apply_page.dart | 16 ------- .../apply_page/ui/widget/machine_card.dart | 3 +- lib/presentation/utils/machine_widget.dart | 4 +- lib/presentation/utils/osj_bottom_sheet.dart | 45 ++++++------------- 4 files changed, 15 insertions(+), 53 deletions(-) diff --git a/lib/presentation/apply_page/ui/view/apply_page.dart b/lib/presentation/apply_page/ui/view/apply_page.dart index 664b931b..200c6a17 100644 --- a/lib/presentation/apply_page/ui/view/apply_page.dart +++ b/lib/presentation/apply_page/ui/view/apply_page.dart @@ -146,13 +146,6 @@ class ApplyPage extends StatelessWidget { deviceId: state.value .applyList[index * 2].deviceId, isEnableNotification: false, - isWoman: state - .value - .applyList[index * 2] - .deviceId > - 64 - ? true - : false, deviceType: state.value .applyList[index * 2].deviceType, state: CurrentState.working), @@ -163,14 +156,6 @@ class ApplyPage extends StatelessWidget { .applyList[index * 2 + 1] .deviceId, isEnableNotification: false, - isWoman: state - .value - .applyList[ - index * 2 + 1] - .deviceId > - 64 - ? true - : false, deviceType: state .value .applyList[index * 2 + 1] @@ -180,7 +165,6 @@ class ApplyPage extends StatelessWidget { //리팩토링 꼭 하기 deviceId: -1, isEnableNotification: false, - isWoman: true, deviceType: DeviceType.empty, state: CurrentState.working) ], diff --git a/lib/presentation/apply_page/ui/widget/machine_card.dart b/lib/presentation/apply_page/ui/widget/machine_card.dart index 671c8527..cb382b9e 100644 --- a/lib/presentation/apply_page/ui/widget/machine_card.dart +++ b/lib/presentation/apply_page/ui/widget/machine_card.dart @@ -8,7 +8,6 @@ class MachineCard extends MachineWidget { super.key, required super.deviceId, required super.isEnableNotification, - required super.isWoman, required super.deviceType, required super.state, }); @@ -75,7 +74,7 @@ class MachineCard extends MachineWidget { height: 100.0.r, ), Text( - "${isWoman ? deviceId - 31 : deviceId}번 ${deviceType.text}", + "$deviceId번 ${deviceType.text}", textScaler: TextScaler.noScaling, style: TextStyle( fontSize: 20.0.sp, diff --git a/lib/presentation/utils/machine_widget.dart b/lib/presentation/utils/machine_widget.dart index 1de53a32..58b15d4e 100644 --- a/lib/presentation/utils/machine_widget.dart +++ b/lib/presentation/utils/machine_widget.dart @@ -8,7 +8,6 @@ abstract class MachineWidget extends StatelessWidget { super.key, required this.deviceId, required this.isEnableNotification, - required this.isWoman, required this.state, required this.deviceType, }); @@ -16,7 +15,7 @@ abstract class MachineWidget extends StatelessWidget { final int deviceId; final DeviceType deviceType; final CurrentState state; - final bool isEnableNotification, isWoman; + final bool isEnableNotification; void showModalOSJBottomSheet({required BuildContext context}) => showModalBottomSheet( @@ -29,7 +28,6 @@ abstract class MachineWidget extends StatelessWidget { builder: (context) => OSJBottomSheet( deviceId: deviceId, isEnableNotification: isEnableNotification, - isWoman: isWoman, state: state, machine: deviceType, ), diff --git a/lib/presentation/utils/osj_bottom_sheet.dart b/lib/presentation/utils/osj_bottom_sheet.dart index b1d49927..25f7da94 100644 --- a/lib/presentation/utils/osj_bottom_sheet.dart +++ b/lib/presentation/utils/osj_bottom_sheet.dart @@ -14,13 +14,12 @@ class OSJBottomSheet extends StatefulWidget { super.key, required this.deviceId, required this.isEnableNotification, - required this.isWoman, required this.state, required this.machine, }); final int deviceId; - final bool isEnableNotification, isWoman; + final bool isEnableNotification; final CurrentState state; final DeviceType machine; @@ -29,37 +28,20 @@ class OSJBottomSheet extends StatefulWidget { } class _OSJBottomSheetState extends State { - String text(bool isEnableNotification, isWoman, CurrentState state) { + String text(bool isEnableNotification, CurrentState state) { if (isEnableNotification) { - if (isWoman) { - switch (state) { - case CurrentState.working: - return "여자 세탁실 ${widget.deviceId - 31}번 ${widget.machine.text}를\n알림 설정 하실건가요?"; - case CurrentState.available: - return "여자 세탁실 ${widget.deviceId - 31}번 ${widget.machine.text}는\n현재 사용 가능한 상태에요."; - case CurrentState.disconnected: - return "여자층 ${widget.deviceId - 31}번 ${widget.machine.text}의 연결이 끊겨서\n상태를 확인할 수 없어요."; - case CurrentState.breakdown: - return "여자 세탁실 ${widget.deviceId - 31}번 ${widget.machine.text}는\n고장으로 인해 사용이 불가능해요."; - } - } else { - switch (state) { - case CurrentState.working: - return "${widget.deviceId}번 ${widget.machine.text}를\n알림 설정 하실건가요?"; - case CurrentState.available: - return "${widget.deviceId}번 ${widget.machine.text}는\n현재 사용 가능한 상태에요."; - case CurrentState.disconnected: - return "${widget.deviceId}번 ${widget.machine.text}의 연결이 끊겨서\n상태를 확인할 수 없어요."; - case CurrentState.breakdown: - return "${widget.deviceId}번 ${widget.machine.text}는\n고장으로 인해 사용이 불가능해요."; - } + switch (state) { + case CurrentState.working: + return "${widget.deviceId}번 ${widget.machine.text}를\n알림 설정 하실건가요?"; + case CurrentState.available: + return "${widget.deviceId}번 ${widget.machine.text}는\n현재 사용 가능한 상태에요."; + case CurrentState.disconnected: + return "${widget.deviceId}번 ${widget.machine.text}의 연결이 끊겨서\n상태를 확인할 수 없어요."; + case CurrentState.breakdown: + return "${widget.deviceId}번 ${widget.machine.text}는\n고장으로 인해 사용이 불가능해요."; } } else { - if (isWoman) { - return "여자 세탁실 ${widget.deviceId - 31}번 ${widget.machine.text}의\n알림 설정을 해제하실건가요?"; - } else { - return "${widget.deviceId}번 ${widget.machine.text}의\n알림 설정을 해제하실건가요?"; - } + return "${widget.deviceId}번 ${widget.machine.text}의\n알림 설정을 해제하실건가요?"; } } @@ -104,8 +86,7 @@ class _OSJBottomSheetState extends State { ), SizedBox(height: 10.0.r), Text( - text(widget.isEnableNotification, widget.isWoman, - widget.state), + text(widget.isEnableNotification, widget.state), style: TextStyle( color: Colors.black, fontSize: 22.0.sp, From a0d9400a4fd220f6f90210adefc55cd8e5dfed19 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:41:47 +0900 Subject: [PATCH 08/23] =?UTF-8?q?refactor=20::=20=EC=97=AC=EC=9E=90=20?= =?UTF-8?q?=EC=84=B8=ED=83=81=EC=8B=A4=20=EB=B2=84=ED=8A=BC=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/view/laundry_room_page.dart | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index e0174235..a62ff94a 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -164,24 +164,6 @@ class LaundryRoomPage extends StatelessWidget { padding: EdgeInsets.symmetric(horizontal: 5.0.r), radius: 8.0, ), - SizedBox(width: 8.0.w), - OSJTextButton( - function: () => context.read().add( - ModifyRoomIndexEvent( - roomLocation: RoomLocation.womanRoom)), - fontSize: 18.0.sp, - color: roomBlocState.value.roomLocation == - RoomLocation.womanRoom - ? LoturaColors.white - : LoturaColors.gray100, - fontColor: roomBlocState.value.roomLocation == - RoomLocation.womanRoom - ? LoturaColors.primary700 - : LoturaColors.gray300, - text: "여자", - padding: EdgeInsets.symmetric(horizontal: 5.0.r), - radius: 8.0, - ), ], ), ), @@ -286,7 +268,6 @@ class LaundryList extends StatelessWidget { builder: (context) => OSJBottomSheet( deviceId: nfcData, isEnableNotification: true, - isWoman: nfcData > 31 ? true : false, state: list[nfcData - 1].state, machine: list[nfcData - 1].deviceType, ), @@ -316,8 +297,6 @@ class LaundryList extends StatelessWidget { index + 32], isEnableNotification: true, - isWoman: - laundryRoomModel.roomLocation == RoomLocation.womanRoom, ), laundryRoomModel.buttonView.triangle, MachineButton( @@ -332,8 +311,6 @@ class LaundryList extends StatelessWidget { index + 40], isEnableNotification: true, - isWoman: - laundryRoomModel.roomLocation == RoomLocation.womanRoom, ), ], ), From 4a7c9d9f876a06cbdc8a31bc4ab60a6adae8c723 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:44:41 +0900 Subject: [PATCH 09/23] =?UTF-8?q?refactor=20::=20LoomRocation=20=EC=97=AC?= =?UTF-8?q?=EC=9E=90=20=EC=84=B8=ED=83=81=EC=8B=A4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 3 +-- .../setting_page/ui/widget/setting_page_bottom_sheet.dart | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4d0c756d..7ba407b7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -127,8 +127,7 @@ enum DeviceType { enum RoomLocation { schoolSide(roomName: "남자 학교측 세탁실"), - dormitorySide(roomName: "남자 기숙사측 세탁실"), - womanRoom(roomName: "여자 세탁실"); + dormitorySide(roomName: "남자 기숙사측 세탁실"); const RoomLocation({required this.roomName}); diff --git a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart index 92b18ffd..fea0cbbb 100644 --- a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart +++ b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart @@ -54,10 +54,6 @@ class SettingPageBottomSheet extends StatelessWidget { currentRoomLocation: state.value.roomLocation, roomLocation: RoomLocation.dormitorySide, ), - CheckButton( - currentRoomLocation: state.value.roomLocation, - roomLocation: RoomLocation.womanRoom, - ), ], ), ), From 3e12116b992024da4844d3145417c64775c4f9c3 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:47:46 +0900 Subject: [PATCH 10/23] =?UTF-8?q?refactor=20::=20=EC=97=AC=EC=9E=90=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EC=A0=9C=EA=B1=B0=20&=20laundryEntity=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/presentation/utils/machine_button.dart | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/presentation/utils/machine_button.dart b/lib/presentation/utils/machine_button.dart index f626a8b0..4193c76f 100644 --- a/lib/presentation/utils/machine_button.dart +++ b/lib/presentation/utils/machine_button.dart @@ -1,22 +1,27 @@ import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart' as s; +import 'package:lotura/domain/laundry/entity/laundry_entity.dart'; +import 'package:lotura/main.dart'; import 'package:lotura/presentation/utils/lotura_colors.dart'; import 'package:lotura/presentation/utils/lotura_icons.dart'; import 'package:lotura/presentation/utils/machine_widget.dart'; class MachineButton extends MachineWidget { - const MachineButton({ + MachineButton({ super.key, - required super.deviceId, + required this.laundryEntity, required super.isEnableNotification, - required super.isWoman, - required super.state, - required super.deviceType, - }); + }) : super( + deviceId: laundryEntity.id, + deviceType: laundryEntity.deviceType, + state: laundryEntity.state, + ); + + final LaundryEntity laundryEntity; @override Widget build(BuildContext context) { - return isEmptyContainer + return laundryEntity.deviceType == DeviceType.empty ? Container( padding: EdgeInsets.all(12.0.r), constraints: BoxConstraints( @@ -71,7 +76,7 @@ class MachineButton extends MachineWidget { maxWidth: 185.0.w, ), decoration: BoxDecoration( - color: state.color, + color: laundryEntity.state.color, borderRadius: BorderRadius.circular(16.0), border: Border.all(color: LoturaColors.gray200)), child: Row( @@ -84,23 +89,24 @@ class MachineButton extends MachineWidget { height: 32.0.r, decoration: BoxDecoration( shape: BoxShape.circle, - color: state.color, - border: - Border.all(color: state.deviceIconColor, width: 2), + color: laundryEntity.state.color, + border: Border.all( + color: laundryEntity.state.deviceIconColor, width: 2), ), - child: Icon(deviceType.icon, - size: 20.0.r, color: state.deviceIconColor), + child: Icon(laundryEntity.deviceType.icon, + size: 20.0.r, + color: laundryEntity.state.deviceIconColor), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text("${isWoman ? deviceId - 31 : deviceId}번", + Text("${laundryEntity.viewId}번", style: TextStyle( fontSize: 15.0.sp, fontWeight: FontWeight.w500)), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Text(deviceType.text, + Text(laundryEntity.deviceType.text, style: TextStyle(fontSize: 14.0.sp)), ], ), From 2968e79841e4de9088d91be6e2021c4554421353 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 22:51:26 +0900 Subject: [PATCH 11/23] move :: machine button --- .../laundry_room_page/ui/view/laundry_room_page.dart | 2 +- .../{utils => laundry_room_page/ui/widget}/machine_button.dart | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/presentation/{utils => laundry_room_page/ui/widget}/machine_button.dart (100%) diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index a62ff94a..08b54710 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -6,6 +6,7 @@ import 'package:lotura/main.dart'; import 'package:lotura/presentation/laundry_room_page/bloc/laundry_bloc.dart'; import 'package:lotura/presentation/laundry_room_page/bloc/laundry_model.dart'; import 'package:lotura/presentation/laundry_room_page/bloc/laundry_state.dart'; +import 'package:lotura/presentation/laundry_room_page/ui/widget/machine_button.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_bloc.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_event.dart'; import 'package:lotura/presentation/notice_page/bloc/notice_model.dart'; @@ -18,7 +19,6 @@ import 'package:lotura/presentation/setting_page/bloc/room_state.dart'; import 'package:lotura/presentation/setting_page/ui/view/setting_page.dart'; import 'package:lotura/presentation/utils/lotura_colors.dart'; import 'package:lotura/presentation/utils/lotura_icons.dart'; -import 'package:lotura/presentation/utils/machine_button.dart'; import 'package:lotura/presentation/utils/osj_bottom_sheet.dart'; import 'package:lotura/presentation/utils/osj_text_button.dart'; diff --git a/lib/presentation/utils/machine_button.dart b/lib/presentation/laundry_room_page/ui/widget/machine_button.dart similarity index 100% rename from lib/presentation/utils/machine_button.dart rename to lib/presentation/laundry_room_page/ui/widget/machine_button.dart From e57155151fdd0385d451ef4499aab77b1b9b398b Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 23:54:23 +0900 Subject: [PATCH 12/23] =?UTF-8?q?refactor=20::=20Button=20View=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LaundryRoomLayer로 변경 --- lib/main.dart | 12 +++--- .../ui/view/laundry_room_page.dart | 43 ++++++++++--------- .../setting_page/bloc/laundry_room_model.dart | 8 ++-- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7ba407b7..4531a62a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -134,11 +134,11 @@ enum RoomLocation { final String roomName; } -enum ButtonView { - image, - icon; +enum LaundryRoomLayer { + first(icon: Icons.looks_one_outlined), + second(icon: Icons.looks_two_outlined); - Widget get triangle => this == ButtonView.image - ? const SizedBox.shrink() - : const Icon(LoturaIcons.triangleUp, color: Colors.grey); + const LaundryRoomLayer({required this.icon}); + + final IconData icon; } diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index 08b54710..3e011a54 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -167,7 +167,8 @@ class LaundryRoomPage extends StatelessWidget { ], ), ), - ViewTypeFilter(buttonView: roomBlocState.value.buttonView), + LaundryRoomLayerFilter( + laundryRoomLayer: roomBlocState.value.laundryRoomLayer), Expanded( child: BlocBuilder>( @@ -197,10 +198,10 @@ class LaundryRoomPage extends StatelessWidget { } } -class ViewTypeFilter extends StatelessWidget { - const ViewTypeFilter({super.key, required this.buttonView}); +class LaundryRoomLayerFilter extends StatelessWidget { + const LaundryRoomLayerFilter({super.key, required this.laundryRoomLayer}); - final ButtonView buttonView; + final LaundryRoomLayer laundryRoomLayer; @override Widget build(BuildContext context) { @@ -208,23 +209,23 @@ class ViewTypeFilter extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ IconButton( - onPressed: () => context - .read() - .add(ModifyButtonViewEvent(buttonView: ButtonView.image)), - icon: Icon(LoturaIcons.grid, - size: 18.0.r, - color: buttonView == ButtonView.image + onPressed: () => context.read().add( + ModifyLaundryRoomLayerEvent( + laundryRoomLayer: LaundryRoomLayer.first)), + icon: Icon(LaundryRoomLayer.first.icon, + size: 24.0.r, + color: laundryRoomLayer == LaundryRoomLayer.first ? LoturaColors.black : LoturaColors.gray300), ), IconButton( - onPressed: () => context - .read() - .add(ModifyButtonViewEvent(buttonView: ButtonView.icon)), + onPressed: () => context.read().add( + ModifyLaundryRoomLayerEvent( + laundryRoomLayer: LaundryRoomLayer.second)), icon: Icon( - LoturaIcons.list, - size: 18.0.r, - color: buttonView == ButtonView.icon + Icons.looks_two_outlined, + size: 24.0.r, + color: laundryRoomLayer == LaundryRoomLayer.second ? LoturaColors.black : LoturaColors.gray300, ), @@ -287,8 +288,8 @@ class LaundryList extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ MachineButton( - laundryEntity: laundryRoomModel.buttonView == - ButtonView.image + laundryEntity: laundryRoomModel.laundryRoomLayer == + LaundryRoomLayer.first ? list[ placeIndex[laundryRoomModel.roomLocation.index]! + index] @@ -298,10 +299,10 @@ class LaundryList extends StatelessWidget { 32], isEnableNotification: true, ), - laundryRoomModel.buttonView.triangle, + const Icon(LoturaIcons.triangleUp, color: Colors.grey), MachineButton( - laundryEntity: laundryRoomModel.buttonView == - ButtonView.image + laundryEntity: laundryRoomModel.laundryRoomLayer == + LaundryRoomLayer.first ? list[ placeIndex[laundryRoomModel.roomLocation.index]! + index + diff --git a/lib/presentation/setting_page/bloc/laundry_room_model.dart b/lib/presentation/setting_page/bloc/laundry_room_model.dart index a1771fe4..44d51242 100644 --- a/lib/presentation/setting_page/bloc/laundry_room_model.dart +++ b/lib/presentation/setting_page/bloc/laundry_room_model.dart @@ -2,12 +2,12 @@ import 'package:lotura/main.dart'; class LaundryRoomModel { final RoomLocation roomLocation; - final ButtonView buttonView; + final LaundryRoomLayer laundryRoomLayer; final bool isClick, isNFCShowBottomSheet, showingBottomSheet; const LaundryRoomModel({ required this.roomLocation, - required this.buttonView, + required this.laundryRoomLayer, required this.isClick, required this.isNFCShowBottomSheet, required this.showingBottomSheet, @@ -15,13 +15,13 @@ class LaundryRoomModel { LaundryRoomModel copyWith( {RoomLocation? roomLocation, - ButtonView? buttonView, + LaundryRoomLayer? laundryRoomLayer, bool? isClick, bool? isNFCShowBottomSheet, bool? showingBottomSheet}) { return LaundryRoomModel( roomLocation: roomLocation ?? this.roomLocation, - buttonView: buttonView ?? this.buttonView, + laundryRoomLayer: laundryRoomLayer ?? this.laundryRoomLayer, isClick: isClick ?? this.isClick, isNFCShowBottomSheet: isNFCShowBottomSheet ?? this.isNFCShowBottomSheet, showingBottomSheet: showingBottomSheet ?? this.showingBottomSheet); From 82092f7d66b9a786ec92809332ad76c85e3f89e7 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Wed, 15 May 2024 23:54:58 +0900 Subject: [PATCH 13/23] =?UTF-8?q?refactor=20::=20ModifyButtonViewEvent=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/presentation/setting_page/bloc/room_bloc.dart | 11 ++++++----- lib/presentation/setting_page/bloc/room_event.dart | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/presentation/setting_page/bloc/room_bloc.dart b/lib/presentation/setting_page/bloc/room_bloc.dart index 941a5b2f..da2e884e 100644 --- a/lib/presentation/setting_page/bloc/room_bloc.dart +++ b/lib/presentation/setting_page/bloc/room_bloc.dart @@ -18,14 +18,14 @@ class RoomBloc extends Bloc> { super(Initial( data: const LaundryRoomModel( roomLocation: RoomLocation.schoolSide, - buttonView: ButtonView.icon, + laundryRoomLayer: LaundryRoomLayer.first, isClick: false, isNFCShowBottomSheet: false, showingBottomSheet: false))) { on(_updateRoomIndexEventHandler); on(_getRoomIndexEventHandler); on(_modifyRoomIndexEventHandler); - on(_modifyPlaceIconIndexEventHandler); + on(_modifyPlaceIconIndexEventHandler); on(_showBottomSheetEventHandler); on(_initialShowBottomSheetEventHandler); on(_showingBottomSheetEventHandler); @@ -51,9 +51,10 @@ class RoomBloc extends Bloc> { emit(Changed(data: state.value.copyWith(roomLocation: event.roomLocation))); } - void _modifyPlaceIconIndexEventHandler( - ModifyButtonViewEvent event, Emitter> emit) { - emit(Changed(data: state.value.copyWith(buttonView: event.buttonView))); + void _modifyPlaceIconIndexEventHandler(ModifyLaundryRoomLayerEvent event, + Emitter> emit) { + emit(Changed( + data: state.value.copyWith(laundryRoomLayer: event.laundryRoomLayer))); } void _showBottomSheetEventHandler( diff --git a/lib/presentation/setting_page/bloc/room_event.dart b/lib/presentation/setting_page/bloc/room_event.dart index c8f9c3b0..1e6d8393 100644 --- a/lib/presentation/setting_page/bloc/room_event.dart +++ b/lib/presentation/setting_page/bloc/room_event.dart @@ -16,10 +16,10 @@ class ModifyRoomIndexEvent extends RoomEvent { ModifyRoomIndexEvent({required this.roomLocation}); } -class ModifyButtonViewEvent extends RoomEvent { - final ButtonView buttonView; +class ModifyLaundryRoomLayerEvent extends RoomEvent { + final LaundryRoomLayer laundryRoomLayer; - ModifyButtonViewEvent({required this.buttonView}); + ModifyLaundryRoomLayerEvent({required this.laundryRoomLayer}); } class ShowBottomSheetEvent extends RoomEvent {} From d98d527fb3868168b41c7e0682d07091c00cebb5 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 16 May 2024 08:43:09 +0900 Subject: [PATCH 14/23] =?UTF-8?q?refactor=20::=20viewId=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/laundry/dto/response/laundry_response.dart | 4 ---- lib/domain/laundry/entity/laundry_entity.dart | 2 -- lib/presentation/laundry_room_page/bloc/laundry_bloc.dart | 1 - .../laundry_room_page/ui/widget/machine_button.dart | 2 +- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/data/laundry/dto/response/laundry_response.dart b/lib/data/laundry/dto/response/laundry_response.dart index 1e7b0ba6..34eb7c2b 100644 --- a/lib/data/laundry/dto/response/laundry_response.dart +++ b/lib/data/laundry/dto/response/laundry_response.dart @@ -3,13 +3,11 @@ import 'package:lotura/main.dart'; class LaundryResponse { final int id; - final int viewId; final int state; final String deviceType; const LaundryResponse({ required this.id, - required this.viewId, required this.state, required this.deviceType, }); @@ -17,7 +15,6 @@ class LaundryResponse { factory LaundryResponse.fromJson(Map json) { return LaundryResponse( id: json['id'], - viewId: json['view_id'], state: json['state'], deviceType: json['device_type'], ); @@ -26,7 +23,6 @@ class LaundryResponse { LaundryEntity toEntity() { return LaundryEntity( id: id, - viewId: viewId, state: CurrentState.values.elementAt(state), deviceType: deviceType == "WASH" ? DeviceType.wash diff --git a/lib/domain/laundry/entity/laundry_entity.dart b/lib/domain/laundry/entity/laundry_entity.dart index 01e98f30..81190d4a 100644 --- a/lib/domain/laundry/entity/laundry_entity.dart +++ b/lib/domain/laundry/entity/laundry_entity.dart @@ -2,13 +2,11 @@ import 'package:lotura/main.dart'; class LaundryEntity { final int id; - final int viewId; final CurrentState state; final DeviceType deviceType; const LaundryEntity({ required this.id, - required this.viewId, required this.state, required this.deviceType, }); diff --git a/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart b/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart index 7aaee4d9..1188b9a7 100644 --- a/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart +++ b/lib/presentation/laundry_room_page/bloc/laundry_bloc.dart @@ -30,7 +30,6 @@ class LaundryBloc extends Bloc> { .map((e) => e.id == data.id ? LaundryEntity( id: e.id, - viewId: e.viewId, state: data.state, deviceType: data.deviceType) : e) diff --git a/lib/presentation/laundry_room_page/ui/widget/machine_button.dart b/lib/presentation/laundry_room_page/ui/widget/machine_button.dart index 4193c76f..6f184ba2 100644 --- a/lib/presentation/laundry_room_page/ui/widget/machine_button.dart +++ b/lib/presentation/laundry_room_page/ui/widget/machine_button.dart @@ -100,7 +100,7 @@ class MachineButton extends MachineWidget { Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text("${laundryEntity.viewId}번", + Text("${laundryEntity.id}번", style: TextStyle( fontSize: 15.0.sp, fontWeight: FontWeight.w500)), Row( From 6dfd377d6cb34d0cc8d6a0dbf09a0da9bea6b9dc Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 21:34:25 +0900 Subject: [PATCH 15/23] =?UTF-8?q?style=20::=20device=20list=20url=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../laundry/data_source/remote/remote_laundry_data_source.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/data/laundry/data_source/remote/remote_laundry_data_source.dart b/lib/data/laundry/data_source/remote/remote_laundry_data_source.dart index c4db5ee6..f1a007a6 100644 --- a/lib/data/laundry/data_source/remote/remote_laundry_data_source.dart +++ b/lib/data/laundry/data_source/remote/remote_laundry_data_source.dart @@ -28,7 +28,7 @@ class RemoteLaundryDataSource { } Future> getAllLaundryList() async { - final response = await http.get(Uri.parse("$baseurl/device_list")); + final response = await http.get(Uri.parse("$baseurl/device_list_boy")); if (response.statusCode != 200) { throw Exception(response.body); } From e809e2db3c97647f7326472c669723a0f577aca6 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 21:35:08 +0900 Subject: [PATCH 16/23] =?UTF-8?q?feat=20::=20=ED=95=9C=EA=B5=AD=EC=96=B4?= =?UTF-8?q?=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EB=B2=84=ED=8A=BC=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/view/laundry_room_page.dart | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index 3e011a54..d66361f9 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -208,26 +208,32 @@ class LaundryRoomLayerFilter extends StatelessWidget { return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - IconButton( + TextButton( onPressed: () => context.read().add( ModifyLaundryRoomLayerEvent( laundryRoomLayer: LaundryRoomLayer.first)), - icon: Icon(LaundryRoomLayer.first.icon, - size: 24.0.r, + child: Text( + "1층", + style: TextStyle( + fontSize: 18.0.sp, color: laundryRoomLayer == LaundryRoomLayer.first ? LoturaColors.black - : LoturaColors.gray300), + : LoturaColors.gray300, + ), + ), ), - IconButton( + TextButton( onPressed: () => context.read().add( ModifyLaundryRoomLayerEvent( laundryRoomLayer: LaundryRoomLayer.second)), - icon: Icon( - Icons.looks_two_outlined, - size: 24.0.r, - color: laundryRoomLayer == LaundryRoomLayer.second - ? LoturaColors.black - : LoturaColors.gray300, + child: Text( + "2층", + style: TextStyle( + fontSize: 18.0.sp, + color: laundryRoomLayer == LaundryRoomLayer.second + ? LoturaColors.black + : LoturaColors.gray300, + ), ), ), ], From 392e003913df2199d0e8fc2b5d853204672e3d6e Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 23:11:10 +0900 Subject: [PATCH 17/23] =?UTF-8?q?feat=20::=20Gender=20enum=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 4531a62a..a7148c7c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -125,9 +125,19 @@ enum DeviceType { }); } +enum Gender { + boy(text: "남자 세탁실"), + girl(text: "여자 세탁실"); + + const Gender({required this.text}); + + final String text; +} + enum RoomLocation { schoolSide(roomName: "남자 학교측 세탁실"), - dormitorySide(roomName: "남자 기숙사측 세탁실"); + dormitorySide(roomName: "남자 기숙사측 세탁실"), + schoolGirlSide(roomName: "여자 기숙사측 세탁실"); const RoomLocation({required this.roomName}); From c63554ba931db607943fcb2ef583481dc9a474c6 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 23:13:09 +0900 Subject: [PATCH 18/23] =?UTF-8?q?feat=20::=20=EC=84=B1=EB=B3=84=EC=97=90?= =?UTF-8?q?=20=EB=A7=9E=EB=8A=94=20=EB=B7=B0=EB=A7=8C=20=EB=B3=B4=EC=97=AC?= =?UTF-8?q?=EC=A3=BC=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/view/laundry_room_page.dart | 145 +++++++++++------- 1 file changed, 87 insertions(+), 58 deletions(-) diff --git a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart index d66361f9..97febb98 100644 --- a/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart +++ b/lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart @@ -127,48 +127,68 @@ class LaundryRoomPage extends StatelessWidget { SingleChildScrollView( scrollDirection: Axis.horizontal, padding: EdgeInsets.symmetric(vertical: 12.0.h), - child: Row( - children: [ - OSJTextButton( - function: () => context.read().add( - ModifyRoomIndexEvent( - roomLocation: RoomLocation.schoolSide)), - fontSize: 18.0.sp, - color: roomBlocState.value.roomLocation == - RoomLocation.schoolSide - ? LoturaColors.white - : LoturaColors.gray100, - fontColor: roomBlocState.value.roomLocation == - RoomLocation.schoolSide - ? LoturaColors.primary700 - : LoturaColors.gray300, - text: "남자 학교측", - padding: EdgeInsets.symmetric(horizontal: 5.0.r), - radius: 8.0, - ), - SizedBox(width: 8.0.w), - OSJTextButton( - function: () => context.read().add( - ModifyRoomIndexEvent( - roomLocation: RoomLocation.dormitorySide)), - fontSize: 18.0.sp, - color: roomBlocState.value.roomLocation == - RoomLocation.dormitorySide - ? LoturaColors.white - : LoturaColors.gray100, - fontColor: roomBlocState.value.roomLocation == - RoomLocation.dormitorySide - ? LoturaColors.primary700 - : LoturaColors.gray300, - text: "남자 기숙사측", - padding: EdgeInsets.symmetric(horizontal: 5.0.r), - radius: 8.0, - ), - ], - ), + child: roomBlocState.data.roomLocation != + RoomLocation.schoolGirlSide + ? Row( + children: [ + OSJTextButton( + function: () => context.read().add( + ModifyRoomIndexEvent( + roomLocation: + RoomLocation.schoolSide)), + fontSize: 18.0.sp, + color: roomBlocState.value.roomLocation == + RoomLocation.schoolSide + ? LoturaColors.white + : LoturaColors.gray100, + fontColor: roomBlocState.value.roomLocation == + RoomLocation.schoolSide + ? LoturaColors.primary700 + : LoturaColors.gray300, + text: "남자 학교측", + padding: + EdgeInsets.symmetric(horizontal: 5.0.r), + radius: 8.0, + ), + SizedBox(width: 8.0.w), + OSJTextButton( + function: () => context.read().add( + ModifyRoomIndexEvent( + roomLocation: + RoomLocation.dormitorySide)), + fontSize: 18.0.sp, + color: roomBlocState.value.roomLocation == + RoomLocation.dormitorySide + ? LoturaColors.white + : LoturaColors.gray100, + fontColor: roomBlocState.value.roomLocation == + RoomLocation.dormitorySide + ? LoturaColors.primary700 + : LoturaColors.gray300, + text: "남자 기숙사측", + padding: + EdgeInsets.symmetric(horizontal: 5.0.r), + radius: 8.0, + ), + ], + ) + : OSJTextButton( + function: () => context.read().add( + ModifyRoomIndexEvent( + roomLocation: + RoomLocation.schoolGirlSide)), + fontSize: 18.0.sp, + color: LoturaColors.white, + fontColor: LoturaColors.primary700, + text: "여자 기숙사측", + padding: EdgeInsets.symmetric(horizontal: 5.0.r), + radius: 8.0, + ), ), LaundryRoomLayerFilter( - laundryRoomLayer: roomBlocState.value.laundryRoomLayer), + laundryRoomLayer: roomBlocState.value.laundryRoomLayer, + currentRoomLocation: roomBlocState.data.roomLocation, + ), Expanded( child: BlocBuilder>( @@ -179,11 +199,14 @@ class LaundryRoomPage extends StatelessWidget { const Center(child: CircularProgressIndicator()), Error() => const Center(child: Text("인터넷 연결을 확인해주세요")), - Loaded() => LaundryList( - list: state.data.laundryList, - laundryRoomModel: roomBlocState.value, - nfcData: nfcTagData, - ), + Loaded() => roomBlocState.data.roomLocation != + RoomLocation.schoolGirlSide + ? LaundryList( + list: state.data.laundryList, + laundryRoomModel: roomBlocState.value, + nfcData: nfcTagData, + ) + : const Center(child: Text("여자 세탁실은 준비중~")), }; }, ), @@ -199,9 +222,14 @@ class LaundryRoomPage extends StatelessWidget { } class LaundryRoomLayerFilter extends StatelessWidget { - const LaundryRoomLayerFilter({super.key, required this.laundryRoomLayer}); + const LaundryRoomLayerFilter({ + super.key, + required this.laundryRoomLayer, + required this.currentRoomLocation, + }); final LaundryRoomLayer laundryRoomLayer; + final RoomLocation currentRoomLocation; @override Widget build(BuildContext context) { @@ -222,20 +250,21 @@ class LaundryRoomLayerFilter extends StatelessWidget { ), ), ), - TextButton( - onPressed: () => context.read().add( - ModifyLaundryRoomLayerEvent( - laundryRoomLayer: LaundryRoomLayer.second)), - child: Text( - "2층", - style: TextStyle( - fontSize: 18.0.sp, - color: laundryRoomLayer == LaundryRoomLayer.second - ? LoturaColors.black - : LoturaColors.gray300, + if (currentRoomLocation != RoomLocation.schoolGirlSide) + TextButton( + onPressed: () => context.read().add( + ModifyLaundryRoomLayerEvent( + laundryRoomLayer: LaundryRoomLayer.second)), + child: Text( + "2층", + style: TextStyle( + fontSize: 18.0.sp, + color: laundryRoomLayer == LaundryRoomLayer.second + ? LoturaColors.black + : LoturaColors.gray300, + ), ), ), - ), ], ); } From 89159f4551ea3ca8f9301987503d37e85c8c1875 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 23:13:29 +0900 Subject: [PATCH 19/23] =?UTF-8?q?feat=20::=20=EC=84=B8=ED=83=81=EC=8B=A4?= =?UTF-8?q?=20=EB=B6=84=EA=B8=B0=20=3D>=20=EC=84=B1=EB=B3=84=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/widget/setting_page_bottom_sheet.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart index fea0cbbb..e78da763 100644 --- a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart +++ b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart @@ -47,12 +47,14 @@ class SettingPageBottomSheet extends StatelessWidget { ), ), CheckButton( - currentRoomLocation: state.value.roomLocation, + gender: Gender.boy, roomLocation: RoomLocation.schoolSide, + currentRoomLocation: state.data.roomLocation, ), CheckButton( - currentRoomLocation: state.value.roomLocation, - roomLocation: RoomLocation.dormitorySide, + gender: Gender.girl, + roomLocation: RoomLocation.schoolGirlSide, + currentRoomLocation: state.data.roomLocation, ), ], ), @@ -66,10 +68,12 @@ class SettingPageBottomSheet extends StatelessWidget { class CheckButton extends StatelessWidget { const CheckButton({ super.key, - required this.currentRoomLocation, + required this.gender, required this.roomLocation, + required this.currentRoomLocation, }); + final Gender gender; final RoomLocation roomLocation, currentRoomLocation; @override @@ -91,7 +95,7 @@ class CheckButton extends StatelessWidget { children: [ Flexible( child: Text( - roomLocation.roomName, + gender.text, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.0.sp, From 4f1292a289a142b01df3a2ca5c856fb3df8d71f4 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Thu, 23 May 2024 23:37:15 +0900 Subject: [PATCH 20/23] =?UTF-8?q?feat=20::=20=EC=84=B8=ED=83=81=EC=8B=A4?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EB=B0=94=ED=85=80=EC=8B=9C=ED=8A=B8=20?= =?UTF-8?q?height=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting_page/ui/widget/setting_page_bottom_sheet.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart index e78da763..626a5ee9 100644 --- a/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart +++ b/lib/presentation/setting_page/ui/widget/setting_page_bottom_sheet.dart @@ -46,6 +46,7 @@ class SettingPageBottomSheet extends StatelessWidget { fontSize: 25.0.sp, color: LoturaColors.black), ), ), + SizedBox(height: 30.0.r), CheckButton( gender: Gender.boy, roomLocation: RoomLocation.schoolSide, From a8fc47a665d0265ce00537977b12a26b21fc6ec6 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sun, 26 May 2024 09:33:38 +0900 Subject: [PATCH 21/23] =?UTF-8?q?chore=20::=20android=20=EC=95=B1=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ac67c83a..130fc4f0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,12 +13,12 @@ if (flutterRoot == null) { def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { - flutterVersionCode = '25' + flutterVersionCode = '26' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { - flutterVersionName = '3.6.0' + flutterVersionName = '3.7.0' } def keystoreProperties = new Properties() From 5b26f7ad5dc38b7bca4315322ffc386cb103b3d4 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sun, 26 May 2024 09:33:50 +0900 Subject: [PATCH 22/23] =?UTF-8?q?chore=20::=20iOS=20=EC=95=B1=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e03c0a3a..90e805c6 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -367,7 +367,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 21; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = Z25H7B85Z8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -376,7 +376,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 3.7.0; PRODUCT_BUNDLE_IDENTIFIER = com.osj.lotura; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -507,7 +507,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 21; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = Z25H7B85Z8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -516,7 +516,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 3.7.0; PRODUCT_BUNDLE_IDENTIFIER = com.osj.lotura; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -537,7 +537,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 21; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = Z25H7B85Z8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -546,7 +546,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 3.7.0; PRODUCT_BUNDLE_IDENTIFIER = com.osj.lotura; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; From 05849e82d686c3afbfe2576b3e89337ea9178018 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sun, 26 May 2024 09:34:22 +0900 Subject: [PATCH 23/23] =?UTF-8?q?chore=20::=20flutter=20=EC=95=B1=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 54b2767e..a3c2b17e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 3.6.0+25 +version: 3.7.0+26 environment: sdk: '>=3.1.3 <4.0.0'