fix: address analysis issues - remove unused import, fix deprecated APIs, update test
This commit is contained in:
parent
85249acc84
commit
07bae466cf
32 changed files with 1550 additions and 75 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:traccar_client/bridge/location_bridge.dart';
|
||||
import 'package:traccar_client/preferences.dart';
|
||||
import 'package:traccar_client/settings_screen.dart';
|
||||
import 'package:traccar_client/status_screen.dart';
|
||||
|
||||
|
|
@ -34,7 +33,9 @@ class _MainScreenState extends State<MainScreen> {
|
|||
? '${(location['speed'] * 3.6).toStringAsFixed(0)} km/h'
|
||||
: '--';
|
||||
_lastTime = location['timestamp'] != null
|
||||
? _formatTime(DateTime.fromMillisecondsSinceEpoch(location['timestamp']))
|
||||
? _formatTime(
|
||||
DateTime.fromMillisecondsSinceEpoch(location['timestamp']),
|
||||
)
|
||||
: '--';
|
||||
});
|
||||
}
|
||||
|
|
@ -59,10 +60,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Traccar Client'),
|
||||
centerTitle: true,
|
||||
),
|
||||
appBar: AppBar(title: const Text('Traccar Client'), centerTitle: true),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
|
|
@ -117,10 +115,12 @@ class _MainScreenState extends State<MainScreen> {
|
|||
Widget _buildTrackingToggle() {
|
||||
return SwitchListTile(
|
||||
title: Text(_isTracking ? 'Tracking: ON' : 'Tracking: OFF'),
|
||||
subtitle: Text(_isTracking ? 'Location updates active' : 'Tap to start tracking'),
|
||||
subtitle: Text(
|
||||
_isTracking ? 'Location updates active' : 'Tap to start tracking',
|
||||
),
|
||||
value: _isTracking,
|
||||
onChanged: (_) => _toggleTracking(),
|
||||
activeColor: Colors.green,
|
||||
activeTrackColor: Colors.green,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
MaterialPageRoute(builder: (_) => const StatusScreen()),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.logs),
|
||||
icon: const Icon(Icons.history),
|
||||
label: const Text('Status/Logs'),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue