이미지 소스 및 UI 개선(rental_process_screen)
This commit is contained in:
BIN
assets/images/info1.png
Normal file
BIN
assets/images/info1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
BIN
assets/images/info2.png
Normal file
BIN
assets/images/info2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
@@ -1,8 +1,9 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
|
|
||||||
class RentalProcessScreen extends StatelessWidget {
|
class RentalProcessScreen extends StatefulWidget {
|
||||||
final String stationName;
|
final String stationName;
|
||||||
|
|
||||||
const RentalProcessScreen({
|
const RentalProcessScreen({
|
||||||
@@ -10,6 +11,11 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
required this.stationName,
|
required this.stationName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RentalProcessScreen> createState() => _RentalProcessScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RentalProcessScreenState extends State<RentalProcessScreen> {
|
||||||
static const Color _mainBlueColor = Color(0xFF002FA7);
|
static const Color _mainBlueColor = Color(0xFF002FA7);
|
||||||
static const Color _mainTextColor = Color(0xFF1C1C1E);
|
static const Color _mainTextColor = Color(0xFF1C1C1E);
|
||||||
static const Color _subTextColor = Color(0xFF6A717B);
|
static const Color _subTextColor = Color(0xFF6A717B);
|
||||||
@@ -20,6 +26,46 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
static const Color _primaryGreen = Color(0xFF4CAF50);
|
static const Color _primaryGreen = Color(0xFF4CAF50);
|
||||||
static const Color _primaryOrange = Color(0xFFFF3D00);
|
static const Color _primaryOrange = Color(0xFFFF3D00);
|
||||||
|
|
||||||
|
final PageController _pageController = PageController();
|
||||||
|
int _currentPage = 0;
|
||||||
|
Timer? _timer;
|
||||||
|
final List<String> _imageList = [
|
||||||
|
'assets/images/top.png',
|
||||||
|
'assets/images/info1.png',
|
||||||
|
'assets/images/info2.png',
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_startAutoScroll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_timer?.cancel();
|
||||||
|
_pageController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _startAutoScroll() {
|
||||||
|
_timer = Timer.periodic(const Duration(seconds: 3), (Timer timer) {
|
||||||
|
if (_currentPage < _imageList.length - 1) {
|
||||||
|
_currentPage++;
|
||||||
|
} else {
|
||||||
|
_currentPage = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_pageController.hasClients) {
|
||||||
|
_pageController.animateToPage(
|
||||||
|
_currentPage,
|
||||||
|
duration: const Duration(milliseconds: 350),
|
||||||
|
curve: Curves.easeIn,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -27,7 +73,7 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
stationName,
|
widget.stationName,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -123,18 +169,63 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 150,
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _accentContainerColor,
|
color: _accentContainerColor,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
children: [
|
||||||
|
PageView.builder(
|
||||||
|
controller: _pageController,
|
||||||
|
itemCount: _imageList.length,
|
||||||
|
onPageChanged: (int index) {
|
||||||
|
setState(() {
|
||||||
|
_currentPage = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(10, 10, 10, 25),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/top.png',
|
_imageList[index],
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
errorBuilder: (context, error, stackTrace) => const Icon(
|
errorBuilder: (context, error, stackTrace) =>
|
||||||
Icons.inventory_2,
|
const Icon(Icons.inventory_2,
|
||||||
size: 50,
|
size: 50, color: _subTextColor),
|
||||||
color: _subTextColor),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 10,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: List.generate(_imageList.length, (index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_pageController.animateToPage(
|
||||||
|
index,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 30,
|
||||||
|
height: 6,
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(3),
|
||||||
|
color: _currentPage == index
|
||||||
|
? _mainTextColor
|
||||||
|
: Colors.grey.shade300,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 20),
|
||||||
@@ -210,7 +301,7 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
Widget _buildStepRow(int step, String title, IconData icon,
|
Widget _buildStepRow(int step, String title, IconData icon,
|
||||||
{bool isCompleted = false, bool showDivider = true}) {
|
{bool isCompleted = false, bool showDivider = true}) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 18),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
@@ -220,7 +311,9 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text('STEP $step',
|
Text('STEP $step',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: _mainTextColor, fontWeight: FontWeight.bold)),
|
color: _mainBlueColor,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w700)),
|
||||||
if (isCompleted) ...[
|
if (isCompleted) ...[
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
const Icon(Icons.check_circle,
|
const Icon(Icons.check_circle,
|
||||||
@@ -228,15 +321,19 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 6),
|
||||||
Text(title,
|
Text(title,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: _mainTextColor, fontSize: 18, letterSpacing: 0.6)),
|
color: _mainTextColor,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
height: 1.2)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Icon(icon,
|
Icon(icon,
|
||||||
color: isCompleted ? _mainBlueColor : _subTextColor, size: 48),
|
color: isCompleted ? _mainBlueColor : _subTextColor.withOpacity(0.5),
|
||||||
|
size: 32),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -244,7 +341,7 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildDivider() {
|
Widget _buildDivider() {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: _subTextColor.withOpacity(0.5),
|
color: _subTextColor.withOpacity(0.1),
|
||||||
height: 1,
|
height: 1,
|
||||||
thickness: 1,
|
thickness: 1,
|
||||||
indent: 20,
|
indent: 20,
|
||||||
@@ -295,22 +392,21 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
color: _mainTextColor, fontWeight: FontWeight.bold)),
|
color: _mainTextColor, fontWeight: FontWeight.bold)),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => _showLogHistory(context),
|
onTap: () => _showLogHistory(context),
|
||||||
child: Text('더보기 >',
|
child: const Text('더보기 >',
|
||||||
style: TextStyle(color: _subTextColor, fontSize: 12)),
|
style: TextStyle(color: _subTextColor, fontSize: 12)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: const [
|
||||||
const Icon(Icons.check_circle, color: _mainBlueColor, size: 16),
|
Icon(Icons.check_circle, color: _mainBlueColor, size: 16),
|
||||||
const SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
const Text('Available: 문 닫힘',
|
Text('Available: 문 닫힘', style: TextStyle(color: _mainTextColor)),
|
||||||
style: TextStyle(color: _mainTextColor)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.only(left: 210, top: 4),
|
padding: EdgeInsets.only(left: 210, top: 4),
|
||||||
child: Text('(2025-11-19)/(08:58)',
|
child: Text('(2025-11-19)/(08:58)',
|
||||||
style: TextStyle(color: _subTextColor, fontSize: 12)),
|
style: TextStyle(color: _subTextColor, fontSize: 12)),
|
||||||
),
|
),
|
||||||
@@ -327,9 +423,9 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Container(
|
return Container(
|
||||||
height: MediaQuery.of(context).size.height * 0.6,
|
height: MediaQuery.of(context).size.height * 0.6,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: _cardBackgroundColor,
|
color: _cardBackgroundColor,
|
||||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -354,12 +450,12 @@ class RentalProcessScreen extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
children: [
|
children: [
|
||||||
_buildLogItem("08:58:33", "문 열림",
|
_buildLogItem("08:58:33", "문 열림", Icons.door_front_door,
|
||||||
Icons.door_front_door, _mainBlueColor),
|
_mainBlueColor),
|
||||||
_buildLogItem("08:58:30", "헬멧 반납 확인(센서 A)",
|
_buildLogItem("08:58:30", "헬멧 반납 확인(센서 A)",
|
||||||
Icons.check_circle_outline, _mainBlueColor),
|
Icons.check_circle_outline, _mainBlueColor),
|
||||||
_buildLogItem("08:55:12", "사용자 문 잠금 해제",
|
_buildLogItem("08:55:12", "사용자 문 잠금 해제", Icons.lock_open,
|
||||||
Icons.lock_open, _mainTextColor),
|
_mainTextColor),
|
||||||
_buildLogItem("08:30:00", "UV 살균 완료",
|
_buildLogItem("08:30:00", "UV 살균 완료",
|
||||||
Icons.cleaning_services, _mainBlueColor),
|
Icons.cleaning_services, _mainBlueColor),
|
||||||
_buildLogItem("08:00:00", "시스템 가동 중",
|
_buildLogItem("08:00:00", "시스템 가동 중",
|
||||||
|
|||||||
Reference in New Issue
Block a user