fixing a ton of sloppy mess...
This commit is contained in:
+15
-18
@@ -1,6 +1,5 @@
|
||||
// ignore_for_file: use_build_context_synchronously, deprecated_member_use
|
||||
// ignore_for_file: use_build_context_synchronously, deprecated_member_use, prefer_const_constructors
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -36,7 +35,6 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
bool _loading = true;
|
||||
String? _error;
|
||||
String _guardianName = 'Guardian';
|
||||
int _refreshCount = 0;
|
||||
|
||||
// ── Live location (WebSocket) ────────────────────────────────────────────────
|
||||
LatLng? _liveLatLng;
|
||||
@@ -156,7 +154,6 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
_liveLatLng = newLatLng;
|
||||
}
|
||||
_loading = false;
|
||||
_refreshCount++;
|
||||
});
|
||||
|
||||
// If SOS pending, start flash
|
||||
@@ -672,7 +669,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
Border.all(color: const Color(0xFFE2E8F0), width: 1),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.04),
|
||||
color: Colors.black.withValues(alpha: 0.04),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 2)),
|
||||
],
|
||||
@@ -708,7 +705,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: const Color(0xFF1A56DB)
|
||||
.withOpacity(0.25 * _pulseAnim.value),
|
||||
.withValues(alpha: 0.25 * _pulseAnim.value),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@@ -760,11 +757,11 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.92),
|
||||
color: Colors.white.withValues(alpha: 0.92),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 8),
|
||||
],
|
||||
),
|
||||
@@ -801,7 +798,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
horizontal: 10, vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
const Color(0xFF1A56DB).withOpacity(0.9),
|
||||
const Color(0xFF1A56DB).withValues(alpha: 0.9),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text('Buka Peta',
|
||||
@@ -823,11 +820,11 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.92),
|
||||
color: Colors.white.withValues(alpha: 0.92),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.08),
|
||||
color: Colors.black.withValues(alpha: 0.08),
|
||||
blurRadius: 6),
|
||||
],
|
||||
),
|
||||
@@ -859,7 +856,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.04),
|
||||
color: Colors.black.withValues(alpha: 0.04),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 2)),
|
||||
],
|
||||
@@ -872,7 +869,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundColor:
|
||||
const Color(0xFF1A56DB).withOpacity(0.1),
|
||||
const Color(0xFF1A56DB).withValues(alpha: 0.1),
|
||||
child: Text(
|
||||
d.userName.isNotEmpty
|
||||
? d.userName[0].toUpperCase()
|
||||
@@ -1051,7 +1048,7 @@ class _GuardianDashboardScreenState extends State<GuardianDashboardScreen>
|
||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.04),
|
||||
color: Colors.black.withValues(alpha: 0.04),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 2)),
|
||||
],
|
||||
@@ -1357,7 +1354,7 @@ class _KpiCard extends StatelessWidget {
|
||||
width: 1),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.03),
|
||||
color: Colors.black.withValues(alpha: 0.03),
|
||||
blurRadius: 8),
|
||||
],
|
||||
),
|
||||
@@ -1421,7 +1418,7 @@ class _ActivityTile extends StatelessWidget {
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: cfg.color.withOpacity(0.1),
|
||||
color: cfg.color.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(cfg.icon, size: 16, color: cfg.color),
|
||||
@@ -1485,7 +1482,7 @@ class _QuickActionCard extends StatelessWidget {
|
||||
width: 28,
|
||||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
color: item.color.withOpacity(0.1),
|
||||
color: item.color.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Icon(item.icon,
|
||||
@@ -1527,7 +1524,7 @@ class _SosBadge extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFFDC2626).withOpacity(0.4),
|
||||
color: const Color(0xFFDC2626).withValues(alpha: 0.4),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 1),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user