Correção no botão de iniciar corrida
This commit is contained in:
@@ -45,7 +45,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
}
|
||||
|
||||
Future<void> _setupIconsAndTracking() async {
|
||||
// Icons reduced by ~70% as requested
|
||||
_arrowIcon = await _createArrowMarker(Colors.black, Colors.white, 25);
|
||||
await _initTracking();
|
||||
}
|
||||
@@ -105,7 +104,7 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
locationSettings: const LocationSettings(accuracy: LocationAccuracy.bestForNavigation, distanceFilter: 1)
|
||||
).listen((Position position) {
|
||||
final now = DateTime.now();
|
||||
if (_lastUpdate == null || now.difference(_lastUpdate!).inMilliseconds > 1000) {
|
||||
if (_lastUpdate == null || now.difference(_lastUpdate!).inMilliseconds > 2000) {
|
||||
_lastUpdate = now;
|
||||
_updatePosition(LatLng(position.latitude, position.longitude), position.speed);
|
||||
}
|
||||
@@ -149,7 +148,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
void _updateTraveledPolylines() {
|
||||
if (_routePoints.length > 1) {
|
||||
_polylines.clear();
|
||||
// Glow effect for the trail
|
||||
_polylines.add(Polyline(
|
||||
polylineId: const PolylineId('route_glow'),
|
||||
points: List.from(_routePoints),
|
||||
@@ -157,7 +155,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
width: 12,
|
||||
zIndex: 9
|
||||
));
|
||||
// Main trail line
|
||||
_polylines.add(Polyline(
|
||||
polylineId: const PolylineId('route'),
|
||||
points: List.from(_routePoints),
|
||||
@@ -284,8 +281,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
const SizedBox(height: 20),
|
||||
const Text(AppStrings.runFinished, style: TextStyle(color: Colors.white, fontSize: 24, fontWeight: FontWeight.w900, letterSpacing: 1)),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
// Mini Map Container
|
||||
Container(
|
||||
height: 180,
|
||||
decoration: BoxDecoration(
|
||||
@@ -318,13 +313,11 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
|
||||
_buildResultRow(AppStrings.totalDistance, _formatDistance(finalDistance)),
|
||||
const Divider(color: Colors.white10, height: 25),
|
||||
_buildResultRow(AppStrings.totalTime, _formatTime(finalTime)),
|
||||
const Divider(color: Colors.white10, height: 25),
|
||||
_buildResultRow("VELOCIDADE MÁX", "${finalMaxSpeed.toStringAsFixed(1)} ${AppStrings.kmhUnit}"),
|
||||
|
||||
const SizedBox(height: 35),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
@@ -406,7 +399,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
extendBodyBehindAppBar: true,
|
||||
body: Stack(
|
||||
children: [
|
||||
// Background Map Container
|
||||
Center(
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.94,
|
||||
@@ -430,13 +422,11 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
myLocationButtonEnabled: false,
|
||||
compassEnabled: false,
|
||||
mapToolbarEnabled: false,
|
||||
style: null, // You can add custom styling here
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
// Stats Overlay
|
||||
Positioned(
|
||||
top: 115, left: 25, right: 25,
|
||||
child: Container(
|
||||
@@ -460,7 +450,6 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
// Countdown Overlay
|
||||
if (_isCountingDown)
|
||||
Container(
|
||||
color: Colors.black87,
|
||||
@@ -479,7 +468,7 @@ class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: Padding(
|
||||
floatingActionButton: _isCountingDown ? null : Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20.0),
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: _isRunning ? _finishRun : _showStartConfirmation,
|
||||
|
||||
Reference in New Issue
Block a user