Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions Flutter/radial-gauge/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Accessibility in Flutter Radial Gauge widget | Syncfusion
description: Learn here all about the accessibility support in Syncfusion Flutter Radial Gauge (SfRadialGauge) widget and how to customize it.
platform: Flutter
platform: flutter
control: SfRadialGauge
documentation: ug
---
Expand All @@ -14,8 +14,38 @@ documentation: ug
The [`SfRadialGauge`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge-class.html) can be made accessible to screen readers by wrapping it with the flutter [`Semantics`](https://api.flutter.dev/flutter/widgets/Semantics-class.html) widget. This provides meaningful information about the gauge to assistive technologies.

{% tabs %}
{% highlight Dart %}
{% highlight dart %}

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

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Radial Gauge Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
double _value = 50;

@override
Expand All @@ -30,13 +60,14 @@ The [`SfRadialGauge`](https://pub.dev/documentation/syncfusion_flutter_gauges/la
),
);
}
}

{% endhighlight %}
{% endtabs %}

## Sufficient contrast

You can customize the color of the [`SfRadialGauge`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge-class.html) elements using the following APIs for the sufficient contrast.
You can customize the color of the [`SfRadialGauge`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge-class.html) elements using the following APIs for a sufficient contrast.

* [Title](https://help.syncfusion.com/flutter/radial-gauge/radial-gauge-title#text-alignment)
* [Axis labels](https://help.syncfusion.com/flutter/radial-gauge/axes#label-style-customization)
Expand Down
156 changes: 91 additions & 65 deletions Flutter/radial-gauge/animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Animation in Flutter Radial Gauge widget | Syncfusion
description: Learn here all about adding and customizing animation of Syncfusion Flutter Radial Gauge (SfRadialGauge) widget and more.
platform: Flutter
platform: flutter
control: SfRadialGauge
documentation: ug
---
Expand All @@ -11,46 +11,59 @@ documentation: ug

## Initial animation

The radial gauge allows all of its elements to be animated with [`enableLoadingAnimation`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge/enableLoadingAnimation.html) property. The default value for this property is false. The duration of the animation can be controlled by [`animationDuration`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge/animationDuration.html) property of the gauge.
The radial gauge allows all of its elements to be animated with [`enableLoadingAnimation`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge/enableLoadingAnimation.html) property. The default value for this property is false. The duration of the animation can be controlled by the [`animationDuration`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/SfRadialGauge/animationDuration.html) property of the gauge.

{% tabs %}
{% highlight dart %}

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

void main() => runApp(const RadialGaugeDemo());

class RadialGaugeDemo extends StatelessWidget {
const RadialGaugeDemo({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SfRadialGauge(
enableLoadingAnimation: true,
animationDuration: 4500,
axes: <RadialAxis>[
RadialAxis(
minimum: 0,
maximum: 150,
ranges: <GaugeRange>[
GaugeRange(startValue: 0, endValue: 50, color: Colors.green, startWidth: 10, endWidth: 10),
GaugeRange(startValue: 50, endValue: 100, color: Colors.orange, startWidth: 10, endWidth: 10),
GaugeRange(startValue: 100, endValue: 150, color: Colors.red, startWidth: 10, endWidth: 10)
],
pointers: <GaugePointer>[
NeedlePointer(value: 90)
],
annotations: <GaugeAnnotation>[
GaugeAnnotation(
widget: Container(
child: Text('90.0', style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold))
),
angle: 90,
positionFactor: 0.5
)
]
)
]
return MaterialApp(
home: Scaffold(
body: Center(
child: SfRadialGauge(
enableLoadingAnimation: true,
animationDuration: 4500,
axes: <RadialAxis>[
RadialAxis(
minimum: 0,
maximum: 150,
ranges: <GaugeRange>[
GaugeRange(startValue: 0, endValue: 50, color: Colors.green, startWidth: 10, endWidth: 10),
GaugeRange(startValue: 50, endValue: 100, color: Colors.orange, startWidth: 10, endWidth: 10),
GaugeRange(startValue: 100, endValue: 150, color: Colors.red, startWidth: 10, endWidth: 10)
],
pointers: <GaugePointer>[
NeedlePointer(value: 90)
],
annotations: <GaugeAnnotation>[
GaugeAnnotation(
widget: Container(
child: Text('90.0', style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold))
),
angle: 90,
positionFactor: 0.5
)
]
)
]
),
),
),
);
}
}

{% endhighlight %}
{% endtabs %}

![gauge loading animation](images/animation/initial_Animation.gif)

Expand All @@ -66,52 +79,65 @@ The [`enableAnimation`](https://pub.dev/documentation/syncfusion_flutter_gauges/
* `linear`
* `slowMiddle`

The animation type can be changed using the [`animationType`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/GaugePointer/animationType.html) property of pointer. By default, the animation type is linear.
The animation type can be changed using the [`animationType`](https://pub.dev/documentation/syncfusion_flutter_gauges/latest/gauges/GaugePointer/animationType.html) property of pointer. By default, the animation type is `ease`.

{% tabs %}
{% highlight dart %}

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

void main() => runApp(const RadialGaugeDemo());

class RadialGaugeDemo extends StatelessWidget {
const RadialGaugeDemo({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SfRadialGauge(
axes: <RadialAxis>[
RadialAxis(
axisLineStyle: AxisLineStyle(thickness: 30),
showTicks: false,
pointers: <GaugePointer>[
NeedlePointer(
value: 60,
enableAnimation: true,
needleStartWidth: 0,
needleEndWidth: 5,
needleColor: Color(0xFFDADADA),
knobStyle: KnobStyle(
color: Colors.white,
borderColor: Color(0xFFDADADA),
knobRadius: 0.06,
borderWidth: 0.04
return MaterialApp(
home: Scaffold(
body: Center(
child: SfRadialGauge(
axes: <RadialAxis>[
RadialAxis(
axisLineStyle: AxisLineStyle(thickness: 30),
showTicks: false,
pointers: <GaugePointer>[
NeedlePointer(
value: 60,
enableAnimation: true,
needleStartWidth: 0,
needleEndWidth: 5,
needleColor: Color(0xFFDADADA),
knobStyle: KnobStyle(
color: Colors.white,
borderColor: Color(0xFFDADADA),
knobRadius: 0.06,
borderWidth: 0.04
),
tailStyle: TailStyle(
color: Color(0xFFDADADA),
width: 5,
length: 0.15
)
),
tailStyle: TailStyle(
color: Color(0xFFDADADA),
width: 5,
length: 0.15
RangePointer(
value: 60,
width: 30,
enableAnimation: true,
color: Colors.orange
)
),
RangePointer(
value: 60,
width: 30,
enableAnimation: true,
color: Colors.orange
)
]
)
],
)
]
)
],
),
),
),
);
}
}

{% endhighlight %}
{% endtabs %}

![pointer animation](images/animation/animation.gif)
Loading