Skip to content

The maximum value is not visible #2362

Open
@oganesik

Description

@oganesik

Bug description

The maximum value is not visible

Steps to reproduce

The maximum value is not visible on my screen

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

/// Speedometer widget using Syncfusion Flutter Gauges
class Speedometer extends StatelessWidget {
  /// Current speed value in km/h
  final double speed;

  /// Maximum speed for the gauge
  final double maxSpeed;

  const Speedometer({super.key, required this.speed, this.maxSpeed = 240});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: SfRadialGauge(
          enableLoadingAnimation: true,
          animationDuration: 4500,
          axes: <RadialAxis>[
            RadialAxis(
              minimum: 0,
              maximum: maxSpeed,
              showTicks: true,
              showLabels: true,
              interval: maxSpeed / 8,
              startAngle: 150,
              endAngle: 30,
              ranges: <GaugeRange>[
                GaugeRange(
                  startValue: 0,
                  endValue: maxSpeed * 0.33,
                  color: Colors.green,
                ),
                GaugeRange(
                  startValue: maxSpeed * 0.33,
                  endValue: maxSpeed * 0.66,
                  color: Colors.orange,
                ),
                GaugeRange(
                  startValue: maxSpeed * 0.66,
                  endValue: maxSpeed,
                  color: Colors.red,
                ),
              ],
              pointers: <GaugePointer>[
                NeedlePointer(
                  enableAnimation: true,
                  animationType: AnimationType.linear,
                  value: speed.clamp(0, maxSpeed),
                  needleStartWidth: 1,
                  needleEndWidth: 6,
                  knobStyle: KnobStyle(color: Colors.black),
                  // регулируем длину «иглы»
                  needleColor: Colors.black,
                ),
              ],
              annotations: <GaugeAnnotation>[
                GaugeAnnotation(
                  widget: Text(
                    '${speed.toStringAsFixed(0)} km/h',
                    style: Theme.of(context).textTheme.titleMedium,
                  ),
                  angle: 90,
                  positionFactor: 0.6,
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Image

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Android

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.29.3, on Microsoft Windows [Version 10.0.19044.5247], locale ru-RU)
[√] Windows Version (Њ ©Єа®б®дв Windows 10 IoT Љ®аЇ®а вЁў­ п LTSC 64-а §ап¤­ п, 21H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.2)
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK
[√] Android Studio (version 2024.3.2)
[√] VS Code (version 1.100.2)
[√] Connected device (5 available)
[√] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gaugesGauges componentopenOpen

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions