25.12.04
회원 가입 페이지(Register Screen) UI 구현 , 탈퇴 팝업 UI 개선 및 이미지 수정
This commit is contained in:
@@ -30,19 +30,18 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
final LockerApi _api = LockerApi();
|
||||
bool _isLoading = false;
|
||||
|
||||
Future<void> _runLockerAction(String name, Future<bool> Function() action) async {
|
||||
Future<void> _runLockerAction(String name, Future<bool> Function() action) async {
|
||||
if (_isLoading) return;
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
|
||||
// 실제 명령 전송
|
||||
final success = await action();
|
||||
|
||||
setState(() => _isLoading = false);
|
||||
|
||||
if (!mounted) return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
// 25.12.03 지은 추가 끝
|
||||
|
||||
int _selectedImageIndex = 0;
|
||||
@@ -98,7 +97,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
Widget _buildOverviewSection() {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 5),
|
||||
child: Card(
|
||||
child: DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Column(
|
||||
@@ -160,7 +159,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
_selectedImageIndex == 0
|
||||
? 'assets/images/storage.png'
|
||||
: 'assets/images/top.png',
|
||||
width: 100,
|
||||
width: 90,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -251,7 +250,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
}
|
||||
|
||||
Widget _buildBatteryStatusCard() {
|
||||
return Card(
|
||||
return DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
@@ -332,7 +331,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
}
|
||||
|
||||
Widget _buildControlCard() {
|
||||
return Card(
|
||||
return DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
@@ -348,24 +347,24 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch(
|
||||
'UV LED',
|
||||
_controlToggles['UV LED']!,
|
||||
// 25.12.03 지은 수정 시작
|
||||
(val) {
|
||||
_runLockerAction("UV 제어", () async {
|
||||
bool success = await _api.setUV(val);
|
||||
child: _buildStyledToggleSwitch(
|
||||
'UV LED',
|
||||
_controlToggles['UV LED']!,
|
||||
// 25.12.03 지은 수정 시작
|
||||
(val) {
|
||||
_runLockerAction("UV 제어", () async {
|
||||
bool success = await _api.setUV(val);
|
||||
|
||||
if (success) {
|
||||
setState(() => _controlToggles['UV LED'] = val);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// 25.12.03 지은 수정 끝
|
||||
if (success) {
|
||||
setState(() => _controlToggles['UV LED'] = val);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// 25.12.03 지은 수정 끝
|
||||
VerticalDivider(color: _mainBlueColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch(
|
||||
@@ -380,24 +379,24 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
(val) => setState(() => _controlToggles['HELMET'] = val))),
|
||||
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch('FAN',
|
||||
_controlToggles['FAN']!,
|
||||
// 25.12.03 지은 수정 시작
|
||||
(val) {
|
||||
print("👉 [디버깅] fan 눌림! 값: $val");
|
||||
_runLockerAction("FAN 제어", () async {
|
||||
print("👉 [디버깅] API 요청 시작...");
|
||||
bool success = await _api.setFan(val);
|
||||
|
||||
if (success) {
|
||||
setState(() => _controlToggles['FAN'] = val);
|
||||
}
|
||||
return success;
|
||||
});
|
||||
},
|
||||
// 25.12.03 지은 수정 끝
|
||||
),
|
||||
),
|
||||
child: _buildStyledToggleSwitch('FAN',
|
||||
_controlToggles['FAN']!,
|
||||
// 25.12.03 지은 수정 시작
|
||||
(val) {
|
||||
print("👉 [디버깅] fan 눌림! 값: $val");
|
||||
_runLockerAction("FAN 제어", () async {
|
||||
print("👉 [디버깅] API 요청 시작...");
|
||||
bool success = await _api.setFan(val);
|
||||
|
||||
if (success) {
|
||||
setState(() => _controlToggles['FAN'] = val);
|
||||
}
|
||||
return success;
|
||||
});
|
||||
},
|
||||
// 25.12.03 지은 수정 끝
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -472,7 +471,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
}
|
||||
|
||||
Widget _buildEnvironmentSensorsCard() {
|
||||
return Card(
|
||||
return DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
@@ -542,7 +541,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
|
||||
Widget _buildMyLocationCard() {
|
||||
const LatLng exampleLocation = LatLng(37.5665, 126.9780);
|
||||
return Card(
|
||||
return DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
@@ -610,7 +609,7 @@ Future<void> _runLockerAction(String name, Future<bool> Function() action) async
|
||||
}
|
||||
|
||||
Widget _buildActivityCard() {
|
||||
return Card(
|
||||
return DashboardCard(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
@@ -711,7 +710,7 @@ class _LineChartPainter extends CustomPainter {
|
||||
}
|
||||
}
|
||||
|
||||
class Card extends StatelessWidget {
|
||||
class DashboardCard extends StatelessWidget {
|
||||
final Widget child;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final Clip clipBehavior;
|
||||
@@ -719,7 +718,7 @@ class Card extends StatelessWidget {
|
||||
final Color? cardColor;
|
||||
final BoxShadow? shadow;
|
||||
|
||||
const Card({
|
||||
const DashboardCard({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.padding,
|
||||
|
||||
Reference in New Issue
Block a user