POLISHING STUFF and Smarter AI, and alot i mean.. ALOT OF BUG FIX AND OPTIMIZE
This commit is contained in:
+48
-38
@@ -8,6 +8,10 @@ import '../../app/injection_container.dart';
|
||||
import '../../core/constants/app_constants.dart';
|
||||
import '../../core/errors/friendly_error.dart';
|
||||
import '../../core/network/api_client.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/theme/app_decorations.dart';
|
||||
import '../../core/theme/app_text_styles.dart';
|
||||
import '../../shared/widgets/animations/animations.dart';
|
||||
|
||||
class ServerConnectScreen extends StatefulWidget {
|
||||
final bool editMode;
|
||||
@@ -64,7 +68,7 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
},
|
||||
onError: (message) => _message = message,
|
||||
fallback:
|
||||
'Tidak bisa terhubung ke server publik. Pastikan backend aktif dan jaringan HP stabil.',
|
||||
'Tidak bisa terhubung ke server. Pastikan backend aktif, URL benar, dan jaringan HP stabil.',
|
||||
);
|
||||
if (mounted) setState(() => _loading = false);
|
||||
}
|
||||
@@ -76,25 +80,27 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
if (mounted) context.go(widget.editMode ? '/login' : '/splash');
|
||||
}
|
||||
|
||||
void _usePublicUrl() =>
|
||||
void _useLocalUrl() =>
|
||||
setState(() => _url.text = AppConstants.defaultServerUrl);
|
||||
void _usePublicUrl() =>
|
||||
setState(() => _url.text = AppConstants.publicServerUrl);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF061421),
|
||||
backgroundColor: AppColors.softBlueBg,
|
||||
body: Stack(
|
||||
children: [
|
||||
const Positioned.fill(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0xFF071226),
|
||||
Color(0xFF0F3B57),
|
||||
Color(0xFF0B6B6C),
|
||||
AppColors.softBlueBg,
|
||||
Colors.white,
|
||||
AppColors.softPinkBg,
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -140,20 +146,14 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.96),
|
||||
color: AppColors.cardWhite,
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact ? 22 : 28,
|
||||
),
|
||||
border: Border.all(
|
||||
color: Colors.white.withValues(alpha: 0.7),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.18),
|
||||
blurRadius: 34,
|
||||
offset: const Offset(0, 22),
|
||||
),
|
||||
],
|
||||
boxShadow: AppDecorations.cardShadow,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
@@ -170,7 +170,7 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
compact ? 14 : 20,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF071226),
|
||||
color: AppColors.softBlueBg,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
@@ -182,9 +182,17 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
width: compact ? 38 : 48,
|
||||
height: compact ? 38 : 48,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF2563EB),
|
||||
gradient:
|
||||
AppDecorations.blueGradient,
|
||||
borderRadius:
|
||||
BorderRadius.circular(16),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color(0x334A90D9),
|
||||
blurRadius: 18,
|
||||
offset: Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(
|
||||
Icons.navigation_rounded,
|
||||
@@ -197,9 +205,9 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
child: Text(
|
||||
'WalkGuide',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.textDark,
|
||||
fontSize: compact ? 16 : 20,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -208,10 +216,9 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
SizedBox(height: compact ? 14 : 18),
|
||||
Text(
|
||||
'Connect to Server',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
style: AppTextStyles.heading.copyWith(
|
||||
fontSize: compact ? 22 : 30,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
@@ -219,11 +226,9 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
Text(
|
||||
widget.editMode
|
||||
? 'Ubah alamat backend Spring Boot WalkGuide yang aktif.'
|
||||
: 'Sambungkan app HP ke backend Spring Boot publik WalkGuide.',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(
|
||||
alpha: 0.72,
|
||||
),
|
||||
: 'Pilih backend WalkGuide yang aktif sebelum login atau register.',
|
||||
style: AppTextStyles.body.copyWith(
|
||||
color: AppColors.muted,
|
||||
height: 1.35,
|
||||
),
|
||||
),
|
||||
@@ -255,9 +260,14 @@ class _ServerConnectScreenState extends State<ServerConnectScreen> {
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_HintChip(
|
||||
icon: Icons.usb_outlined,
|
||||
label: 'USB: 127.0.0.1',
|
||||
onTap: _useLocalUrl,
|
||||
),
|
||||
_HintChip(
|
||||
icon: Icons.public_outlined,
|
||||
label: 'Server: 202.46.28.170',
|
||||
label: 'Kampus: 202.46.28.170',
|
||||
onTap: _usePublicUrl,
|
||||
),
|
||||
],
|
||||
@@ -350,27 +360,27 @@ class _HintChip extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
return BounceTap(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEFF6FF),
|
||||
color: AppColors.softBlueBg,
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: const Color(0xFFBFDBFE)),
|
||||
border:
|
||||
Border.all(color: AppColors.primaryBlue.withValues(alpha: 0.2)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(icon, size: 14, color: const Color(0xFF1D4ED8)),
|
||||
Icon(icon, size: 14, color: AppColors.primaryBlue),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF1D4ED8),
|
||||
color: AppColors.primaryBlue,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -392,7 +402,7 @@ class _StatusBox extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.08),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: color.withValues(alpha: 0.22)),
|
||||
),
|
||||
child: Row(
|
||||
|
||||
Reference in New Issue
Block a user