1.테마/컬러 수정
2. UI 텍스트 한국어 번역 3. SettingScreen(설정 페이지) -현재 페이지는 레이아웃만 완성되었으며, 토글 스위치 및 링크 연결 기능은 미완성 상태입니다.
This commit is contained in:
@@ -14,7 +14,22 @@ class HomeScreenContent extends StatefulWidget {
|
||||
class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
static const double _uniformGap = 16.0;
|
||||
|
||||
final Color _pointColor = Colors.redAccent;
|
||||
final Color _mainBlueColor = const Color(0xFF002FA7);
|
||||
final Color _mainTextColor = Colors.black;
|
||||
final Color _subTextColor = const Color(0xFF6A717B);
|
||||
final Color _pageBackgroundColor = const Color(0xFFF5F7F9);
|
||||
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);
|
||||
|
||||
static const BoxShadow _cleanShadow = BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.07),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
spreadRadius: 0,
|
||||
);
|
||||
|
||||
final Map<String, bool> _controlToggles = {
|
||||
'UV LED': false,
|
||||
@@ -25,53 +40,60 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const CustomHeader(),
|
||||
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: _uniformGap),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildOverviewSection(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildBatteryStatusCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildControlCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildEnvironmentSensorsCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildMyLocationCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildActivityCard(),
|
||||
const SizedBox(height: _uniformGap * 2),
|
||||
],
|
||||
return Container(
|
||||
color: _pageBackgroundColor,
|
||||
child: Column(
|
||||
children: [
|
||||
const CustomHeader(),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: _uniformGap),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildOverviewSection(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildBatteryStatusCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildControlCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildEnvironmentSensorsCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildMyLocationCard(),
|
||||
const SizedBox(height: _uniformGap),
|
||||
_buildActivityCard(),
|
||||
const SizedBox(height: _uniformGap * 2),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildOverviewSection() {
|
||||
return Card(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildOverviewHeader(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: _buildImageCard()),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: _buildInfoCard()),
|
||||
],
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 5),
|
||||
child: Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildOverviewHeader(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: _buildImageCard()),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: _buildInfoCard()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -81,15 +103,15 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 0),
|
||||
child: Row(
|
||||
children: [
|
||||
const Text('SYSTEM OVERVIEW',
|
||||
Text('장치 개요',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: _mainTextColor,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold)),
|
||||
const Spacer(),
|
||||
Icon(Icons.search, color: Colors.grey[400], size: 20),
|
||||
Icon(Icons.search, color: _subTextColor, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Icon(Icons.notifications_outlined, color: Colors.grey[400], size: 20),
|
||||
Icon(Icons.notifications_outlined, color: _subTextColor, size: 20),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -101,36 +123,36 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: _accentContainerColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF2D2F33),
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
color: _cardBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20.0),
|
||||
child: Image.asset(
|
||||
'assets/images/open.png',
|
||||
width: 120,
|
||||
'assets/images/storage.png',
|
||||
width: 90,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 12,
|
||||
child: Row(
|
||||
children: [
|
||||
_buildLedIndicator(Colors.grey.shade700),
|
||||
_buildLedIndicator(Colors.grey.shade300),
|
||||
const SizedBox(width: 4),
|
||||
_buildLedIndicator(Colors.grey.shade700),
|
||||
_buildLedIndicator(Colors.grey.shade300),
|
||||
const SizedBox(width: 4),
|
||||
_buildLedIndicator(Colors.grey.shade700),
|
||||
_buildLedIndicator(Colors.grey.shade300),
|
||||
const SizedBox(width: 4),
|
||||
_buildLedIndicator(Colors.white),
|
||||
_buildLedIndicator(_mainTextColor),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -153,25 +175,28 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _buildInfoCard() {
|
||||
return SizedBox(
|
||||
height: 160,
|
||||
height: 164,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
_buildInfoRow('Name / \nNumber', const Icon(Icons.person, color: Colors.white, size: 20), 'USER', '001'),
|
||||
_buildInfoRow('이름 / \n회원번호', Icon(Icons.person, color: _mainTextColor, size: 20), 'USER', '001',
|
||||
value1Color: _mainTextColor, value2Color: _mainTextColor),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoRow('STATUS', null, 'UNLOCKED', '● ACTIVE', value1Color: _pointColor, value2Color: _pointColor),
|
||||
_buildInfoRow('상태', null, '잠금 해제됨', '● 활성',
|
||||
value1Color: _mainTextColor, value2Color: _mainTextColor),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(String title, Widget? icon, String value1, String value2, {Color? value1Color, Color? value2Color}) {
|
||||
Widget _buildInfoRow(String title, Widget? icon, String value1, String value2,
|
||||
{Color? value1Color, Color? value2Color}) {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: _accentContainerColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -179,18 +204,18 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
flex: 2,
|
||||
child: Text(title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.grey[400], fontSize: 11, height: 1.4)),
|
||||
style: TextStyle(color: _subTextColor, fontSize: 11, height: 1.4)),
|
||||
),
|
||||
VerticalDivider(color: Colors.grey[700], indent: 10, endIndent: 10),
|
||||
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (icon != null) ...[icon, const SizedBox(height: 4)],
|
||||
Text(value1, style: TextStyle(color: value1Color ?? Colors.white, fontWeight: FontWeight.bold, fontSize: 12)),
|
||||
Text(value1, style: TextStyle(color: value1Color ?? _mainTextColor, fontWeight: FontWeight.bold, fontSize: 12)),
|
||||
const SizedBox(height: 2),
|
||||
Text(value2, style: TextStyle(color: value2Color ?? Colors.white, fontWeight: FontWeight.w500, fontSize: 12)),
|
||||
Text(value2, style: TextStyle(color: value2Color ?? _mainTextColor, fontWeight: FontWeight.w500, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -202,16 +227,14 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _buildBatteryStatusCard() {
|
||||
return Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(_uniformGap),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text('BATTERY STATUS (%)',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('배터리 상태 (%)', style: TextStyle(color: _mainTextColor, fontSize: 12, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
@@ -224,15 +247,13 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
SizedBox.expand(
|
||||
child: CustomPaint(
|
||||
painter: _BatteryArcPainter(
|
||||
backgroundColor: Colors.grey.shade800,
|
||||
color: Colors.white,
|
||||
backgroundColor: _accentContainerColor,
|
||||
color: _mainBlueColor,
|
||||
percentage: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Text('86',
|
||||
style: TextStyle(
|
||||
fontSize: 24, fontWeight: FontWeight.w600)),
|
||||
Text('86', style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: _mainTextColor)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -243,55 +264,30 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('NOW',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('사용 중',
|
||||
style: TextStyle(
|
||||
color: _pointColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('현재', style: TextStyle(color: _mainTextColor, fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
Text('사용 중', style: TextStyle(color: _mainBlueColor, fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFF555555),
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
),
|
||||
Divider(color: _subTextColor.withOpacity(0.5), height: 20, thickness: 1),
|
||||
Row(
|
||||
children: [
|
||||
const Expanded(
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Text('Solar Panel',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14)),
|
||||
child: Text('태양광 패널', style: TextStyle(color: _mainTextColor, fontSize: 14)),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Row(
|
||||
children: [
|
||||
const Expanded(
|
||||
child: Text('전압: 00',
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 14)),
|
||||
),
|
||||
Expanded(child: Text('전압: 00', style: TextStyle(color: _subTextColor, fontSize: 14))),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
child: VerticalDivider(
|
||||
color: Colors.grey[700],
|
||||
thickness: 1,
|
||||
),
|
||||
child: VerticalDivider(color: _subTextColor.withOpacity(0.5), thickness: 1),
|
||||
),
|
||||
const Expanded(
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 8.0),
|
||||
child: Text('전류: 00',
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 14)),
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Text('전류: 00', style: TextStyle(color: _subTextColor, fontSize: 14)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -312,16 +308,14 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _buildControlCard() {
|
||||
return Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(_uniformGap),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text('CONTROL',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('', style: TextStyle(color: _mainTextColor, fontSize: 11, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 16),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
@@ -332,24 +326,22 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
'UV LED',
|
||||
_controlToggles['UV LED']!,
|
||||
(val) => setState(() => _controlToggles['UV LED'] = val))),
|
||||
VerticalDivider(
|
||||
color: Colors.grey[700], indent: 10, endIndent: 10),
|
||||
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch(
|
||||
'CHARGING',
|
||||
_controlToggles['CHARGING']!,
|
||||
(val) => setState(() => _controlToggles['CHARGING'] = val))),
|
||||
VerticalDivider(
|
||||
color: Colors.grey[700], indent: 10, endIndent: 10),
|
||||
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch(
|
||||
'HELMET',
|
||||
_controlToggles['HELMET']!,
|
||||
(val) => setState(() => _controlToggles['HELMET'] = val))),
|
||||
VerticalDivider(
|
||||
color: Colors.grey[700], indent: 10, endIndent: 10),
|
||||
VerticalDivider(color: _subTextColor.withOpacity(0.5), indent: 10, endIndent: 10),
|
||||
Expanded(
|
||||
child: _buildStyledToggleSwitch('FAN', _controlToggles['FAN']!,
|
||||
child: _buildStyledToggleSwitch('FAN',
|
||||
_controlToggles['FAN']!,
|
||||
(val) => setState(() => _controlToggles['FAN'] = val))),
|
||||
],
|
||||
),
|
||||
@@ -360,16 +352,11 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStyledToggleSwitch(
|
||||
String title, bool value, ValueChanged<bool> onChanged) {
|
||||
Widget _buildStyledToggleSwitch(String title, bool value, ValueChanged<bool> onChanged) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text(title, style: TextStyle(color: _mainTextColor, fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 12),
|
||||
GestureDetector(
|
||||
onTap: () => onChanged(!value),
|
||||
@@ -380,7 +367,7 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: value ? Colors.white : Colors.grey.shade700,
|
||||
color: value ? _mainTextColor.withOpacity(0.8) : _toggleOffTrackColor,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
@@ -395,7 +382,8 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
height: 26,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: value ? const Color(0xFF27292B) : Colors.white,
|
||||
color: Colors.white,
|
||||
border: Border.all(color: value ? _mainTextColor : _toggleOffKnobBorderColor, width: 1.5),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -408,18 +396,14 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: value
|
||||
? const Color(0xFF27292B)
|
||||
: Colors.transparent)))),
|
||||
color: value ? Colors.white : Colors.transparent)))),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text('OFF',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: value
|
||||
? Colors.transparent
|
||||
: Colors.white)))),
|
||||
color: value ? Colors.transparent : _mainTextColor)))),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -432,6 +416,8 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _buildEnvironmentSensorsCard() {
|
||||
return Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(_uniformGap),
|
||||
child: Column(
|
||||
@@ -439,20 +425,15 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Text('ENVIRONMENT SENSORS',
|
||||
style:
|
||||
TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
Text('환경 센서', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: _mainTextColor)),
|
||||
const Spacer(),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Text('VIEW HISTORY',
|
||||
style:
|
||||
TextStyle(color: Colors.grey[400], fontSize: 10)),
|
||||
Text('기록 보기', style: TextStyle(color: _mainTextColor, fontSize: 10)),
|
||||
const SizedBox(width: 4),
|
||||
Icon(Icons.arrow_forward_ios,
|
||||
size: 10, color: Colors.grey[400]),
|
||||
Icon(Icons.arrow_forward_ios, size: 10, color: _subTextColor),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -466,17 +447,18 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildSensorInfoRow(Icons.water_drop_outlined, 'HUMID: 60%'),
|
||||
_buildSensorInfoRow(Icons.water_drop_outlined, '습도: 60%', '습도'),
|
||||
const SizedBox(height: 24),
|
||||
_buildSensorInfoRow(Icons.thermostat, 'TEMP: 24.5℃'),
|
||||
_buildSensorInfoRow(Icons.thermostat, '온도: 24.5℃', '온도'),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const Expanded(
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: SizedBox(
|
||||
height: 60, child: _LineChartPlaceholder())),
|
||||
height: 60,
|
||||
child: _LineChartPlaceholder(lineColor: _mainTextColor, subLabelColor: _subTextColor))),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -485,29 +467,27 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSensorInfoRow(IconData icon, String text) {
|
||||
Widget _buildSensorInfoRow(IconData icon, String text, String type) {
|
||||
return Row(children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: _accentContainerColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: Colors.black, size: 24),
|
||||
child: Icon(icon, color: _mainTextColor, size: 24),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(text,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600))
|
||||
Text(text, style: TextStyle(fontSize: 14, color: _mainTextColor, fontWeight: FontWeight.w600))
|
||||
]);
|
||||
}
|
||||
|
||||
Widget _buildMyLocationCard() {
|
||||
const LatLng exampleLocation = LatLng(37.5665, 126.9780);
|
||||
return Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: SizedBox(
|
||||
height: 200.0,
|
||||
@@ -518,30 +498,21 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Column(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('My Location',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 4),
|
||||
Text('주소: 남구 효덕로 277',
|
||||
style:
|
||||
TextStyle(fontSize: 11, color: Colors.white70)),
|
||||
Text('현재 위치', style: TextStyle(fontSize: 13, color: _mainTextColor, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 4),
|
||||
Text('주소: 남구 효덕로 277', style: TextStyle(fontSize: 11, color: _mainTextColor)),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Text('VIEW MORE',
|
||||
style:
|
||||
TextStyle(color: Colors.grey[400], fontSize: 9)),
|
||||
Text('더 보기', style: TextStyle(color: _mainTextColor, fontSize: 9)),
|
||||
const SizedBox(width: 4),
|
||||
Icon(Icons.arrow_forward_ios,
|
||||
size: 10, color: Colors.grey[400]),
|
||||
Icon(Icons.arrow_forward_ios, size: 10, color: _subTextColor),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -553,25 +524,22 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
options: const MapOptions(
|
||||
initialCenter: exampleLocation,
|
||||
initialZoom: 15.0,
|
||||
interactionOptions:
|
||||
InteractionOptions(flags: InteractiveFlag.none),
|
||||
interactionOptions: InteractionOptions(flags: InteractiveFlag.none),
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate:
|
||||
'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png',
|
||||
urlTemplate: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',
|
||||
userAgentPackageName: 'com.example.app',
|
||||
subdomains: const ['a', 'b', 'c', 'd'],
|
||||
retinaMode: true,
|
||||
),
|
||||
const MarkerLayer(
|
||||
MarkerLayer(
|
||||
markers: [
|
||||
Marker(
|
||||
point: exampleLocation,
|
||||
width: 80,
|
||||
height: 80,
|
||||
child: Icon(Icons.location_pin,
|
||||
size: 40, color: Colors.white),
|
||||
child: Icon(Icons.location_pin, size: 40, color: _mainTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -586,15 +554,17 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _buildActivityCard() {
|
||||
return Card(
|
||||
shadow: _cleanShadow,
|
||||
cardColor: _cardBackgroundColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(_uniformGap),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text('Activity',
|
||||
Text('Activity',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
color: _mainTextColor,
|
||||
fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
@@ -630,35 +600,44 @@ class _HomeScreenContentState extends State<HomeScreenContent> {
|
||||
|
||||
Widget _activityText(String text) {
|
||||
return Text(text,
|
||||
style: const TextStyle(fontSize: 11, color: Colors.white70));
|
||||
style: TextStyle(fontSize: 11, color: _mainTextColor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class _LineChartPlaceholder extends StatelessWidget {
|
||||
const _LineChartPlaceholder();
|
||||
final Color lineColor;
|
||||
final Color subLabelColor;
|
||||
|
||||
const _LineChartPlaceholder({
|
||||
super.key,
|
||||
required this.lineColor,
|
||||
required this.subLabelColor
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: [
|
||||
Expanded(
|
||||
child:
|
||||
CustomPaint(painter: _LineChartPainter(), size: Size.infinite)),
|
||||
CustomPaint(painter: _LineChartPainter(color: lineColor), size: Size.infinite)),
|
||||
const SizedBox(height: 4),
|
||||
const Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text('24H AGO', style: TextStyle(fontSize: 8, color: Colors.white54)),
|
||||
Text('12H AGO', style: TextStyle(fontSize: 8, color: Colors.white54)),
|
||||
Text('NOW', style: TextStyle(fontSize: 8, color: Colors.white54))
|
||||
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))
|
||||
])
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class _LineChartPainter extends CustomPainter {
|
||||
final Color color;
|
||||
_LineChartPainter({required this.color});
|
||||
|
||||
@override
|
||||
void paint(ui.Canvas canvas, ui.Size size) {
|
||||
final paint = Paint()
|
||||
..color = Colors.white.withOpacity(0.8)
|
||||
..color = color
|
||||
..strokeWidth = 1.5
|
||||
..style = PaintingStyle.stroke;
|
||||
|
||||
@@ -683,12 +662,18 @@ class Card extends StatelessWidget {
|
||||
final Widget child;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final Clip clipBehavior;
|
||||
final Color? borderColor;
|
||||
final Color? cardColor;
|
||||
final BoxShadow? shadow;
|
||||
|
||||
const Card({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.padding,
|
||||
this.clipBehavior = Clip.none,
|
||||
this.borderColor,
|
||||
this.cardColor,
|
||||
this.shadow,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -696,8 +681,9 @@ class Card extends StatelessWidget {
|
||||
return Container(
|
||||
clipBehavior: clipBehavior,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: cardColor ?? Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: shadow != null ? [shadow!] : null,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
@@ -723,7 +709,6 @@ class _BatteryArcPainter extends CustomPainter {
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeCap = StrokeCap.round;
|
||||
|
||||
|
||||
final Paint foregroundPaint = Paint()
|
||||
..color = color
|
||||
..strokeWidth = 8
|
||||
|
||||
Reference in New Issue
Block a user