Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ :: 세탁싀 νŽ˜μ΄μ§€ λ””μžμΈ μˆ˜μ • #224 #228

7 changes: 6 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,36 @@ enum CurrentState {
icon: LoturaIcons.working,
color: LoturaColors.primary50,
deepColor: LoturaColors.primary700,
deviceIconColor: LoturaColors.primary400,
text: "μž‘λ™μ€‘"),
available(
icon: LoturaIcons.checkCircle,
color: LoturaColors.green50,
deepColor: LoturaColors.green700,
deviceIconColor: LoturaColors.green400,
text: "μ‚¬μš© κ°€λŠ₯"),
disconnected(
icon: LoturaIcons.disconnected,
color: LoturaColors.white,
deepColor: LoturaColors.black,
deviceIconColor: LoturaColors.gray400,
text: "μ—°κ²° λŠκΉ€"),
breakdown(
icon: LoturaIcons.cancelCircle,
color: LoturaColors.red50,
deepColor: LoturaColors.red700,
deviceIconColor: LoturaColors.red400,
text: "κ³ μž₯");

final IconData icon;
final Color color, deepColor;
final Color color, deepColor, deviceIconColor;
final String text;

const CurrentState({
required this.icon,
required this.color,
required this.deepColor,
required this.deviceIconColor,
required this.text,
});
}
Expand Down
142 changes: 72 additions & 70 deletions lib/presentation/laundry_room_page/ui/view/laundry_room_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ class LaundryRoomPage extends StatelessWidget {
function: () => context.read<RoomBloc>().add(
ModifyRoomIndexEvent(
roomLocation: RoomLocation.schoolSide)),
width: 99.0.w,
height: 32.0.h,
fontSize: 16.0.sp,
color: roomBlocState.value.roomLocation ==
RoomLocation.schoolSide
Expand All @@ -145,8 +143,6 @@ class LaundryRoomPage extends StatelessWidget {
function: () => context.read<RoomBloc>().add(
ModifyRoomIndexEvent(
roomLocation: RoomLocation.dormitorySide)),
width: 111.0.w,
height: 32.0.h,
fontSize: 16.0.sp,
color: roomBlocState.value.roomLocation ==
RoomLocation.dormitorySide
Expand All @@ -164,8 +160,6 @@ class LaundryRoomPage extends StatelessWidget {
function: () => context.read<RoomBloc>().add(
ModifyRoomIndexEvent(
roomLocation: RoomLocation.womanRoom)),
width: 53.0.w,
height: 32.0.h,
fontSize: 16.0.sp,
color: roomBlocState.value.roomLocation ==
RoomLocation.womanRoom
Expand Down Expand Up @@ -311,72 +305,80 @@ class LaundryList extends StatelessWidget {
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[
Expanded(
child: machineWidget(
roomState: laundryRoomModel,
deviceId: list[placeIndex[
laundryRoomModel.roomLocation.index]! +
index]
.id,
deviceType: 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]! +
index +
(laundryRoomModel.roomLocation ==
RoomLocation.womanRoom
? 10
: 8) <
44
? list[placeIndex[
index]
.deviceType,
state: list[placeIndex[
laundryRoomModel.roomLocation.index]! +
index +
(laundryRoomModel.roomLocation ==
RoomLocation.womanRoom
? 10
: 8)]
.state
: CurrentState.breakdown,
index]
.state),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 5.0.r),
child: laundryRoomModel.buttonView.triangle,
),
Expanded(
child: machineWidget(
roomState: laundryRoomModel,
deviceId:
placeIndex[laundryRoomModel.roomLocation.index]! +
index +
(laundryRoomModel.roomLocation ==
RoomLocation.womanRoom
? 10
: 8) <
44
? 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]! +
index +
(laundryRoomModel.roomLocation ==
RoomLocation.womanRoom
? 10
: 8) <
44
? list[placeIndex[
laundryRoomModel.roomLocation.index]! +
index +
(laundryRoomModel.roomLocation ==
RoomLocation.womanRoom
? 10
: 8)]
.state
: CurrentState.breakdown,
),
),
],
),
Expand Down
5 changes: 5 additions & 0 deletions lib/presentation/utils/lotura_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ class LoturaColors {
static const Color primary900 = Color(0xff164ED4);
static const Color primary700 = Color(0xff3C70EC);
static const Color primary500 = Color(0xff7599ED);
static const Color primary400 = Color(0xff758AC3);
static const Color primary300 = Color(0xff98B1ED);
static const Color primary100 = Color(0xffEBF1FF);
static const Color primary50 = Color(0xffFAFBFF);

static const Color green700 = Color(0xff25BD1D);
static const Color green400 = Color(0xff6ACC64);
static const Color green100 = Color(0xffECFFEB);
static const Color green50 = Color(0xffF8FFF8);

static const Color red700 = Color(0xffD91F1F);
static const Color red400 = Color(0xffD96B6B);
static const Color red100 = Color(0xffFFEBEB);
static const Color red50 = Color(0xffFFFAFA);

static const Color black = Color(0xff000000);
static const Color gray900 = Color(0xff1D1F22);
static const Color gray700 = Color(0xff2E3135);
static const Color gray500 = Color(0xff676C74);
static const Color gray400 = Color(0xffB2B2B2);
static const Color gray300 = Color(0xffADB3BD);
static const Color gray200 = Color(0xffE7E7E7);
static const Color gray100 = Color(0xffF0F3F6);
static const Color white = Color(0xffFFFFFF);
}
101 changes: 82 additions & 19 deletions lib/presentation/utils/machine_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,102 @@ class MachineButton extends MachineWidget {
@override
Widget build(BuildContext context) {
return isEmptyContainer
? SizedBox(width: 154.0.w, height: 84.0.h)
? Container(
constraints: BoxConstraints(
maxWidth: 180.0.r,
),
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(16.0),
),
child: Padding(
padding: EdgeInsets.all(12.0.r),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 32.0.r,
height: 32.0.r,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border:
Border.all(color: Colors.transparent, width: 2),
),
child: Icon(Icons.ac_unit,
size: 20.0.r, color: Colors.transparent),
),
Text("12번",
style: TextStyle(
fontSize: 16.0.sp, color: Colors.transparent)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text("세탁기",
style: TextStyle(
fontSize: 15.0.sp, color: Colors.transparent)),
SizedBox(width: 5.0.r),
Icon(
Icons.abc,
size: 20.0.r,
color: Colors.transparent,
),
],
),
],
),
),
)
: GestureDetector(
onTap: () => showModalOSJBottomSheet(context: context),
child: Container(
width: 154.0.w,
height: 84.0.h,
decoration: BoxDecoration(
color: state.color,
borderRadius: BorderRadius.circular(16.0),
constraints: BoxConstraints(
maxWidth: 180.0.r,
),
decoration: BoxDecoration(
color: state.color,
borderRadius: BorderRadius.circular(16.0),
border: Border.all(color: LoturaColors.gray200)),
child: Padding(
padding:
EdgeInsets.only(top: 12.0.h, bottom: 12.0.h, left: 24.0.w),
padding: EdgeInsets.all(12.0.r),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(deviceType.icon,
size: 24.0.r, color: LoturaColors.gray300),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 32.0.r,
height: 32.0.r,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: state.color,
border: Border.all(
color: state.deviceIconColor, width: 2),
),
child: Icon(deviceType.icon,
size: 20.0.r, color: state.deviceIconColor),
),
Text("${isWoman ? deviceId - 31 : deviceId}번",
style: TextStyle(fontSize: 16.0.sp)),
SizedBox(
width: (isWoman ? deviceId - 31 : deviceId) < 10
? 10.2.w
: 5.0.w),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(deviceType.text,
style: TextStyle(fontSize: 16.0.sp)),
SizedBox(width: 8.0.w),
style: TextStyle(fontSize: 15.0.sp)),
SizedBox(width: 5.0.r),
Icon(
state.icon,
size: 18.0.r,
size: 20.0.r,
color: state.deepColor,
),
],
Expand Down
Loading