diff --git a/lib/main.dart b/lib/main.dart index 27bfe640..888a05d5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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, }); } 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 a058a23d..2de78d4d 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 @@ -126,8 +126,6 @@ class LaundryRoomPage extends StatelessWidget { function: () => context.read().add( ModifyRoomIndexEvent( roomLocation: RoomLocation.schoolSide)), - width: 99.0.w, - height: 32.0.h, fontSize: 16.0.sp, color: roomBlocState.value.roomLocation == RoomLocation.schoolSide @@ -145,8 +143,6 @@ class LaundryRoomPage extends StatelessWidget { function: () => context.read().add( ModifyRoomIndexEvent( roomLocation: RoomLocation.dormitorySide)), - width: 111.0.w, - height: 32.0.h, fontSize: 16.0.sp, color: roomBlocState.value.roomLocation == RoomLocation.dormitorySide @@ -164,8 +160,6 @@ class LaundryRoomPage extends StatelessWidget { function: () => context.read().add( ModifyRoomIndexEvent( roomLocation: RoomLocation.womanRoom)), - width: 53.0.w, - height: 32.0.h, fontSize: 16.0.sp, color: roomBlocState.value.roomLocation == RoomLocation.womanRoom @@ -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, + ), ), ], ), diff --git a/lib/presentation/utils/lotura_colors.dart b/lib/presentation/utils/lotura_colors.dart index cd417cea..c8831e7e 100644 --- a/lib/presentation/utils/lotura_colors.dart +++ b/lib/presentation/utils/lotura_colors.dart @@ -9,15 +9,18 @@ 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); @@ -25,7 +28,9 @@ class LoturaColors { 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); } diff --git a/lib/presentation/utils/machine_button.dart b/lib/presentation/utils/machine_button.dart index bef50249..67f89349 100644 --- a/lib/presentation/utils/machine_button.dart +++ b/lib/presentation/utils/machine_button.dart @@ -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, ), ], diff --git a/lib/presentation/utils/osj_text_button.dart b/lib/presentation/utils/osj_text_button.dart index 28632542..9deaf767 100644 --- a/lib/presentation/utils/osj_text_button.dart +++ b/lib/presentation/utils/osj_text_button.dart @@ -1,29 +1,32 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class OSJTextButton extends StatelessWidget { const OSJTextButton( {super.key, - required this.width, - required this.height, required this.fontSize, required this.color, required this.fontColor, required this.text, + this.width, + this.height, this.function, this.radius = 16.0}); - final double width, height, fontSize, radius; + final double? width, height; + final double fontSize, radius; final Color color, fontColor; final String text; - final Function? function; + final VoidCallback? function; @override Widget build(BuildContext context) { return GestureDetector( - onTap: function != null ? () => function!() : null, + onTap: function, child: Container( width: width, height: height, + padding: EdgeInsets.symmetric(horizontal: 5.0.r), decoration: BoxDecoration( color: color, borderRadius: BorderRadius.circular(radius), @@ -32,6 +35,7 @@ class OSJTextButton extends StatelessWidget { child: Text( text, style: TextStyle(fontSize: fontSize, color: fontColor), + textAlign: TextAlign.center, ), ), ),