POLISHING STUFF and Smarter AI, and alot i mean.. ALOT OF BUG FIX AND OPTIMIZE

This commit is contained in:
Wowieee4
2026-05-29 15:50:51 +07:00
parent 1110e5a42d
commit d2b3534dde
65 changed files with 4150 additions and 2974 deletions
@@ -16,7 +16,11 @@ import 'package:latlong2/latlong.dart';
import '../../app/injection_container.dart';
import '../../core/network/api_client.dart';
import '../../core/services/tts_service.dart';
import '../../core/theme/app_colors.dart';
import '../../core/theme/app_decorations.dart';
import '../../core/theme/app_text_styles.dart';
import '../../core/utils/operation_guard.dart';
import '../../shared/widgets/animations/animations.dart';
// ─── helpers ────────────────────────────────────────────────────────────────
@@ -498,7 +502,7 @@ class _NavigationModeScreenState extends State<NavigationModeScreen> {
Polyline(
points: _navState.routePoints,
strokeWidth: 5,
color: const Color(0xFF1A56DB),
color: AppColors.primaryBlue,
),
],
),
@@ -536,8 +540,8 @@ class _NavigationModeScreenState extends State<NavigationModeScreen> {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: i == _navState.currentStepIndex
? const Color(0xFF1A56DB)
: const Color(0xFF93C5FD),
? AppColors.primaryBlue
: AppColors.gradientBlueStart,
border: Border.all(color: Colors.white, width: 2),
),
),
@@ -552,26 +556,28 @@ class _NavigationModeScreenState extends State<NavigationModeScreen> {
top: 12,
left: 12,
right: 12,
child: Column(
children: [
// search bar
_SearchBar(
controller: _searchCtrl,
focusNode: _searchFocus,
loading: _searchLoading,
onChanged: _onSearchChanged,
onClear: () {
_searchCtrl.clear();
setState(() => _showSuggestions = false);
},
),
// suggestions dropdown
if (_showSuggestions)
_SuggestionList(
items: _suggestions,
onSelect: _selectPlace,
child: FadeSlideWrapper(
child: Column(
children: [
// search bar
_SearchBar(
controller: _searchCtrl,
focusNode: _searchFocus,
loading: _searchLoading,
onChanged: _onSearchChanged,
onClear: () {
_searchCtrl.clear();
setState(() => _showSuggestions = false);
},
),
],
// suggestions dropdown
if (_showSuggestions)
_SuggestionList(
items: _suggestions,
onSelect: _selectPlace,
),
],
),
),
),
@@ -610,7 +616,7 @@ class _NavigationModeScreenState extends State<NavigationModeScreen> {
child: FloatingActionButton.small(
heroTag: 'nav_center',
backgroundColor: Colors.white,
foregroundColor: const Color(0xFF1A56DB),
foregroundColor: AppColors.primaryBlue,
onPressed: _centerOnUser,
child: const Icon(Icons.my_location),
),
@@ -621,7 +627,13 @@ class _NavigationModeScreenState extends State<NavigationModeScreen> {
Positioned.fill(
child: Container(
color: Colors.black26,
child: const Center(child: CircularProgressIndicator()),
child: Center(
child: Container(
padding: const EdgeInsets.all(20),
decoration: AppDecorations.card,
child: const CircularProgressIndicator(),
),
),
),
),
],
@@ -650,39 +662,41 @@ class _SearchBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
elevation: 4,
borderRadius: BorderRadius.circular(14),
child: TextField(
controller: controller,
focusNode: focusNode,
onChanged: onChanged,
textInputAction: TextInputAction.search,
decoration: InputDecoration(
hintText: 'Cari tujuan…',
prefixIcon: const Icon(Icons.search, color: Color(0xFF1A56DB)),
suffixIcon: loading
? const Padding(
padding: EdgeInsets.all(12),
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: controller.text.isNotEmpty
? IconButton(
icon: const Icon(Icons.close),
onPressed: onClear,
)
: null,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: BorderSide.none,
color: Colors.transparent,
child: Container(
decoration: AppDecorations.card,
child: TextField(
controller: controller,
focusNode: focusNode,
onChanged: onChanged,
textInputAction: TextInputAction.search,
decoration: InputDecoration(
hintText: 'Cari tujuan…',
prefixIcon: const Icon(Icons.search, color: AppColors.primaryBlue),
suffixIcon: loading
? const Padding(
padding: EdgeInsets.all(12),
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: controller.text.isNotEmpty
? IconButton(
icon: const Icon(Icons.close),
onPressed: onClear,
)
: null,
border: const OutlineInputBorder(
borderRadius: AppDecorations.inputRadius,
borderSide: BorderSide.none,
),
filled: true,
fillColor: Colors.white,
contentPadding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
filled: true,
fillColor: Colors.white,
contentPadding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
),
);
@@ -698,36 +712,41 @@ class _SuggestionList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
elevation: 6,
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(14)),
color: Colors.transparent,
child: ClipRRect(
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(14)),
child: Column(
children: [
for (final place in items)
InkWell(
onTap: () => onSelect(place),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
children: [
const Icon(Icons.place_outlined,
color: Color(0xFF64748B), size: 20),
const SizedBox(width: 12),
Expanded(
child: Text(
place.displayName,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 14),
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(20)),
child: Container(
decoration: const BoxDecoration(
color: AppColors.cardWhite,
boxShadow: AppDecorations.cardShadow,
),
child: StaggerWrapper(
children: [
for (final place in items)
BounceTap(
onTap: () => onSelect(place),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 12),
child: Row(
children: [
const Icon(Icons.place_outlined,
color: AppColors.textMuted, size: 20),
const SizedBox(width: 12),
Expanded(
child: Text(
place.displayName,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: AppTextStyles.body,
),
),
),
],
],
),
),
),
),
],
],
),
),
),
);
@@ -761,16 +780,10 @@ class _TurnCard extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: const Color(0xFF1A56DB),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.18),
blurRadius: 12,
offset: const Offset(0, 4),
),
],
decoration: const BoxDecoration(
gradient: AppDecorations.blueGradient,
borderRadius: AppDecorations.cardRadius,
boxShadow: AppDecorations.cardShadow,
),
child: Row(
children: [
@@ -864,13 +877,8 @@ class _StatusBar extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
decoration: BoxDecoration(
color: _bgColor,
borderRadius: BorderRadius.circular(14),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.1),
blurRadius: 10,
),
],
borderRadius: AppDecorations.cardRadius,
boxShadow: AppDecorations.cardShadow,
border: Border.all(
color: phase == _NavPhase.error
? const Color(0xFFFECACA)
@@ -954,11 +962,11 @@ class _PulsingDotState extends State<_PulsingDot>
height: 44,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xFF1A56DB)
color: AppColors.primaryBlue
.withValues(alpha: _opacity.value * 0.4),
border: Border.all(
color:
const Color(0xFF1A56DB).withValues(alpha: _opacity.value),
AppColors.primaryBlue.withValues(alpha: _opacity.value),
width: 2,
),
),
@@ -970,11 +978,11 @@ class _PulsingDotState extends State<_PulsingDot>
height: 20,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xFF1A56DB),
color: AppColors.primaryBlue,
border: Border.all(color: Colors.white, width: 3),
boxShadow: [
BoxShadow(
color: const Color(0xFF1A56DB).withValues(alpha: 0.4),
color: AppColors.primaryBlue.withValues(alpha: 0.4),
blurRadius: 6,
),
],