1. 이미지 및 UI 개선

2. UI 텍스트 한국어 번역
3. 환경설정 화면 상세 구현 (SettingScreen)
This commit is contained in:
KIMGYEONGRAN
2025-12-02 17:47:22 +09:00
parent acb297fec1
commit 0dea41c143
9 changed files with 995 additions and 436 deletions

View File

@@ -21,8 +21,9 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
final Color _cardBackgroundColor = Colors.white;
final Color _accentContainerColor = const Color(0xFFF0F2F5);
final Color _toggleOffTrackColor = const Color(0xFFE0E0E0);
final Color _toggleOffKnobBorderColor = const Color(0xFFB0B0B0);
final Color _toggleOffTextColor = const Color(0xFF909090);
final Color _toggleOffKnobBorderColor = const Color(0xFFE0E0E0);
int _selectedImageIndex = 0;
static const BoxShadow _cleanShadow = BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.07),
@@ -103,11 +104,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
padding: const EdgeInsets.fromLTRB(12, 12, 12, 0),
child: Row(
children: [
Text('치 개요',
style: TextStyle(
color: _mainTextColor,
fontSize: 11,
fontWeight: FontWeight.bold)),
Text('비 상태 / 사용자 정보', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const Spacer(),
Icon(Icons.search, color: _subTextColor, size: 20),
const SizedBox(width: 8),
@@ -138,21 +135,19 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Image.asset(
'assets/images/storage.png',
width: 90,
_selectedImageIndex == 0
? 'assets/images/storage.png'
: 'assets/images/top.png',
width: 100,
),
),
Positioned(
bottom: 12,
child: Row(
children: [
_buildLedIndicator(Colors.grey.shade300),
const SizedBox(width: 4),
_buildLedIndicator(Colors.grey.shade300),
const SizedBox(width: 4),
_buildLedIndicator(Colors.grey.shade300),
const SizedBox(width: 4),
_buildLedIndicator(_mainTextColor),
_buildSelectableIndicator(0),
const SizedBox(width: 8),
_buildSelectableIndicator(1),
],
),
)
@@ -162,13 +157,21 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
);
}
Widget _buildLedIndicator(Color color) {
return Container(
width: 18,
height: 6,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(3),
Widget _buildSelectableIndicator(int index) {
final bool isSelected = _selectedImageIndex == index;
return GestureDetector(
onTap: () {
setState(() {
_selectedImageIndex = index;
});
},
child: Container(
width: 30,
height: 6,
decoration: BoxDecoration(
color: isSelected ? _mainTextColor : Colors.grey.shade300,
borderRadius: BorderRadius.circular(3),
),
),
);
}
@@ -179,10 +182,10 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildInfoRow('이름 / \n회원번호', Icon(Icons.person, color: _mainTextColor, size: 20), 'USER', '001',
_buildInfoRow('ID', Icon(Icons.person, color: _mainTextColor, size: 20), 'USER', '001',
value1Color: _mainTextColor, value2Color: _mainTextColor),
const SizedBox(height: 8),
_buildInfoRow('상태', null, '잠금 해제', '● 활성',
_buildInfoRow('STATUS', null, '잠금 해제', '● 활성',
value1Color: _mainTextColor, value2Color: _mainTextColor),
],
),
@@ -234,13 +237,13 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('배터리 상태 (%)', style: TextStyle(color: _mainTextColor, fontSize: 12, fontWeight: FontWeight.bold)),
const SizedBox(height: 16),
Text('배터리 상태 (%)', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const SizedBox(height: 20),
Row(
children: [
SizedBox(
width: 80,
height: 80,
width: 70,
height: 70,
child: Stack(
alignment: Alignment.center,
children: [
@@ -315,7 +318,8 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('', style: TextStyle(color: _mainTextColor, fontSize: 11, fontWeight: FontWeight.bold)),
Text('보관함 원격 제어', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const SizedBox(height: 16),
SizedBox(
height: 70,
@@ -326,7 +330,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
'UV LED',
_controlToggles['UV LED']!,
(val) => setState(() => _controlToggles['UV LED'] = val))),
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
VerticalDivider(color: _mainBlueColor.withOpacity(0.5), indent: 10, endIndent: 10),
Expanded(
child: _buildStyledToggleSwitch(
'CHARGING',
@@ -367,7 +371,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: value ? _mainTextColor.withOpacity(0.8) : _toggleOffTrackColor,
color: value ? _mainBlueColor : _toggleOffTrackColor,
),
child: Stack(
children: [
@@ -383,7 +387,9 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
border: Border.all(color: value ? _mainTextColor : _toggleOffKnobBorderColor, width: 1.5),
border: Border.all(
color: value ? _mainBlueColor : _toggleOffKnobBorderColor,
width: 1.5),
),
),
),
@@ -425,13 +431,13 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('환경 센서', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
Text('환경 모니터링', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const Spacer(),
InkWell(
onTap: () {},
child: Row(
children: [
Text('기록 보기', style: TextStyle(color: _mainTextColor, fontSize: 10)),
Text('보기', style: TextStyle(color: _mainTextColor, fontSize: 9)),
const SizedBox(width: 4),
Icon(Icons.arrow_forward_ios, size: 10, color: _subTextColor),
],
@@ -501,7 +507,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('위치', style: TextStyle(fontSize: 13, color: _mainTextColor, fontWeight: FontWeight.bold)),
Text('현위치', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const SizedBox(height: 4),
Text('주소: 남구 효덕로 277', style: TextStyle(fontSize: 11, color: _mainTextColor)),
],
@@ -510,7 +516,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
onTap: () {},
child: Row(
children: [
Text(' 보기', style: TextStyle(color: _mainTextColor, fontSize: 9)),
Text('더보기', style: TextStyle(color: _mainTextColor, fontSize: 9)),
const SizedBox(width: 4),
Icon(Icons.arrow_forward_ios, size: 10, color: _subTextColor),
],
@@ -561,11 +567,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Activity',
style: TextStyle(
fontSize: 13,
color: _mainTextColor,
fontWeight: FontWeight.bold)),
Text('최근 활동', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
const SizedBox(height: 12),
Row(
children: [
@@ -573,9 +575,9 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_activityText('08:15 AM - Battery fully Charged'),
_activityText('08:15 AM - 배터리 충전 완료'),
const SizedBox(height: 8),
_activityText('9:30 AM - UV LED Actived'),
_activityText('9:30 AM - UV LED 활성화 됨'),
],
),
),
@@ -584,9 +586,9 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_activityText('10:45 AM - Helmet Unlocked'),
_activityText('10:45 AM - 헬멧 잠금 해제'),
const SizedBox(height: 8),
_activityText('11:00 AM - Helmet Off'),
_activityText('11:00 AM - 헬멧 착용 해제'),
],
),
),
@@ -622,9 +624,9 @@ class _LineChartPlaceholder extends StatelessWidget {
CustomPaint(painter: _LineChartPainter(color: lineColor), size: Size.infinite)),
const SizedBox(height: 4),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text('24H AGO', style: TextStyle(fontSize: 8, color: subLabelColor)),
Text('12H AGO', style: TextStyle(fontSize: 8, color: subLabelColor)),
Text('NOW', style: TextStyle(fontSize: 8, color: subLabelColor))
Text('24 시간 전', style: TextStyle(fontSize: 8, color: subLabelColor)),
Text('12시간 전', style: TextStyle(fontSize: 8, color: subLabelColor)),
Text('현재', style: TextStyle(fontSize: 8, color: subLabelColor))
])
]);
}