사용하지 않는 파일 정리 전 백업 (Phase 10 완료 후 상태)
This commit is contained in:
@@ -110,7 +110,7 @@ class LoginController extends ChangeNotifier {
|
||||
print('[LoginController] 로그인 성공: ${loginResponse.user.email}');
|
||||
|
||||
// 테스트 로그인인 경우 주기적 헬스체크 시작
|
||||
if (loginResponse.user.email == 'admin@superport.kr') {
|
||||
if (loginResponse.user.email == 'admin@example.com') {
|
||||
print('[LoginController] 테스트 로그인 감지 - 헬스체크 모니터링 시작');
|
||||
_healthCheckService.startPeriodicHealthCheck();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:superport/screens/login/widgets/login_view.dart';
|
||||
|
||||
/// 로그인 화면 진입점 (상태/로직은 controller, UI는 LoginView 위젯에 위임)
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({Key? key}) : super(key: key);
|
||||
const LoginScreen({super.key});
|
||||
|
||||
@override
|
||||
State<LoginScreen> createState() => _LoginScreenState();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
import 'package:superport/screens/common/components/shadcn_components.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:superport/screens/login/controllers/login_controller.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
@@ -10,10 +9,10 @@ class LoginView extends StatefulWidget {
|
||||
final VoidCallback onLoginSuccess;
|
||||
|
||||
const LoginView({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.onLoginSuccess,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<LoginView> createState() => _LoginViewState();
|
||||
@@ -72,17 +71,18 @@ class _LoginViewState extends State<LoginView>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ShadTheme.of(context);
|
||||
return ListenableBuilder(
|
||||
listenable: widget.controller,
|
||||
builder: (context, _) {
|
||||
return Scaffold(
|
||||
backgroundColor: ShadcnTheme.background,
|
||||
backgroundColor: theme.colorScheme.background,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing6),
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
child: FadeTransition(
|
||||
@@ -93,9 +93,9 @@ class _LoginViewState extends State<LoginView>
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildHeader(),
|
||||
const SizedBox(height: ShadcnTheme.spacing12),
|
||||
const SizedBox(height: 48),
|
||||
_buildLoginCard(),
|
||||
const SizedBox(height: ShadcnTheme.spacing8),
|
||||
const SizedBox(height: 32),
|
||||
_buildFooter(),
|
||||
],
|
||||
),
|
||||
@@ -112,25 +112,26 @@ class _LoginViewState extends State<LoginView>
|
||||
}
|
||||
|
||||
Widget _buildHeader() {
|
||||
final theme = ShadTheme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
// 로고 및 애니메이션
|
||||
Container(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing4),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
ShadcnTheme.gradient1,
|
||||
ShadcnTheme.gradient2,
|
||||
ShadcnTheme.gradient3,
|
||||
theme.colorScheme.primary,
|
||||
theme.colorScheme.primary.withValues(alpha: 0.8),
|
||||
theme.colorScheme.primary.withValues(alpha: 0.6),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: ShadcnTheme.gradient1.withValues(alpha: 0.3),
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
@@ -144,191 +145,186 @@ class _LoginViewState extends State<LoginView>
|
||||
child: Icon(
|
||||
Icons.directions_boat,
|
||||
size: 48,
|
||||
color: ShadcnTheme.primaryForeground,
|
||||
color: Colors.white,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing6),
|
||||
const SizedBox(height: 24),
|
||||
// 앱 이름
|
||||
Text(
|
||||
'supERPort',
|
||||
style: ShadcnTheme.headingH1.copyWith(
|
||||
style: theme.textTheme.h1.copyWith(
|
||||
foreground:
|
||||
Paint()
|
||||
..shader = LinearGradient(
|
||||
colors: [ShadcnTheme.gradient1, ShadcnTheme.gradient2],
|
||||
colors: [theme.colorScheme.primary, theme.colorScheme.primary.withValues(alpha: 0.7)],
|
||||
).createShader(const Rect.fromLTWH(0, 0, 200, 70)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing2),
|
||||
Text('스마트 ERP 시스템', style: ShadcnTheme.bodyMuted),
|
||||
const SizedBox(height: 8),
|
||||
Text('스마트 ERP 시스템', style: theme.textTheme.muted),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLoginCard() {
|
||||
final controller = widget.controller;
|
||||
return ShadcnCard(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 로그인 헤더
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('로그인', style: ShadcnTheme.headingH3),
|
||||
const SizedBox(height: ShadcnTheme.spacing1),
|
||||
Text('계정 정보를 입력하여 로그인하세요.', style: ShadcnTheme.bodyMuted),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing8),
|
||||
final theme = ShadTheme.of(context);
|
||||
|
||||
return ShadCard(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 로그인 헤더
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('로그인', style: theme.textTheme.h3),
|
||||
const SizedBox(height: 4),
|
||||
Text('계정 정보를 입력하여 로그인하세요.', style: theme.textTheme.muted),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// 아이디/이메일 입력
|
||||
ShadcnInput(
|
||||
label: '아이디/이메일',
|
||||
placeholder: '아이디 또는 이메일을 입력하세요',
|
||||
controller: controller.idController,
|
||||
prefixIcon: const Icon(Icons.person_outline),
|
||||
keyboardType: TextInputType.text,
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing4),
|
||||
// 아이디/이메일 입력
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('아이디/이메일', style: theme.textTheme.small),
|
||||
const SizedBox(height: 4),
|
||||
ShadInputFormField(
|
||||
controller: controller.idController,
|
||||
placeholder: const Text('아이디 또는 이메일을 입력하세요'),
|
||||
keyboardType: TextInputType.text,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 비밀번호 입력
|
||||
ShadcnInput(
|
||||
label: '비밀번호',
|
||||
placeholder: '비밀번호를 입력하세요',
|
||||
controller: controller.pwController,
|
||||
prefixIcon: const Icon(Icons.lock_outline),
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing4),
|
||||
// 비밀번호 입력
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('비밀번호', style: theme.textTheme.small),
|
||||
const SizedBox(height: 4),
|
||||
ShadInputFormField(
|
||||
controller: controller.pwController,
|
||||
placeholder: const Text('비밀번호를 입력하세요'),
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 아이디 저장 체크박스
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: controller.saveId,
|
||||
onChanged: (value) {
|
||||
controller.setSaveId(value ?? false);
|
||||
},
|
||||
activeColor: ShadcnTheme.primary,
|
||||
),
|
||||
const SizedBox(width: ShadcnTheme.spacing2),
|
||||
Text('아이디 저장', style: ShadcnTheme.bodyMedium),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing8),
|
||||
// 아이디 저장 체크박스
|
||||
Row(
|
||||
children: [
|
||||
ShadCheckbox(
|
||||
value: controller.saveId,
|
||||
onChanged: (value) {
|
||||
controller.setSaveId(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text('아이디 저장', style: theme.textTheme.small),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// 에러 메시지 표시
|
||||
if (controller.errorMessage != null)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing3),
|
||||
margin: const EdgeInsets.only(bottom: ShadcnTheme.spacing4),
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.destructive.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
border: Border.all(
|
||||
color: ShadcnTheme.destructive.withValues(alpha: 0.3),
|
||||
// 에러 메시지 표시
|
||||
if (controller.errorMessage != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ShadAlert.destructive(
|
||||
title: const Text('로그인 오류'),
|
||||
description: Text(controller.errorMessage!),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.error_outline,
|
||||
size: 20,
|
||||
color: ShadcnTheme.destructive,
|
||||
),
|
||||
const SizedBox(width: ShadcnTheme.spacing2),
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.errorMessage!,
|
||||
style: ShadcnTheme.bodyMedium.copyWith(
|
||||
color: ShadcnTheme.destructive,
|
||||
|
||||
// 로그인 버튼
|
||||
ShadButton(
|
||||
onPressed: controller.isLoading ? null : _handleLogin,
|
||||
size: ShadButtonSize.lg,
|
||||
child: controller.isLoading
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const Text('로그인'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 로그인 버튼
|
||||
ShadcnButton(
|
||||
text: '로그인',
|
||||
onPressed: _handleLogin,
|
||||
variant: ShadcnButtonVariant.primary,
|
||||
textColor: Colors.white,
|
||||
size: ShadcnButtonSize.large,
|
||||
fullWidth: true,
|
||||
loading: controller.isLoading,
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing4),
|
||||
// 테스트 로그인 버튼
|
||||
ShadButton.outline(
|
||||
onPressed: controller.isLoading ? null : () async {
|
||||
// 테스트 계정 정보 자동 입력
|
||||
widget.controller.idController.text = 'admin@example.com';
|
||||
widget.controller.pwController.text = 'password123';
|
||||
|
||||
// 테스트 로그인 버튼
|
||||
ShadcnButton(
|
||||
text: '테스트 로그인',
|
||||
onPressed: () async {
|
||||
// 테스트 계정 정보 자동 입력
|
||||
widget.controller.idController.text = 'admin@superport.kr';
|
||||
widget.controller.pwController.text = 'admin123!';
|
||||
|
||||
// 실제 로그인 프로세스 실행
|
||||
await _handleLogin();
|
||||
},
|
||||
variant: ShadcnButtonVariant.secondary,
|
||||
size: ShadcnButtonSize.medium,
|
||||
fullWidth: true,
|
||||
),
|
||||
],
|
||||
// 실제 로그인 프로세스 실행
|
||||
await _handleLogin();
|
||||
},
|
||||
size: ShadButtonSize.lg,
|
||||
child: const Text('테스트 로그인'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFooter() {
|
||||
final theme = ShadTheme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
// 기능 소개
|
||||
Container(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing4),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.muted,
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusLg),
|
||||
border: Border.all(color: Colors.black),
|
||||
color: theme.colorScheme.muted,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: theme.colorScheme.border),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(ShadcnTheme.spacing2),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.info.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.info_outline,
|
||||
size: 16,
|
||||
color: ShadcnTheme.info,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: ShadcnTheme.spacing3),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'장비 관리, 회사 관리, 사용자 관리 등\n포트 운영에 필요한 모든 기능을 제공합니다.',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
style: theme.textTheme.small,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ShadcnTheme.spacing6),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// 저작권 정보
|
||||
Text(
|
||||
'Copyright 2025 NatureBridgeAI. All rights reserved.',
|
||||
style: ShadcnTheme.bodySmall.copyWith(
|
||||
color: ShadcnTheme.foreground.withValues(alpha: 0.7),
|
||||
style: theme.textTheme.small.copyWith(
|
||||
color: theme.colorScheme.foreground.withValues(alpha: 0.7),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user