diff --git a/README.md b/README.md
index 1eea9ea8..9666887f 100644
--- a/README.md
+++ b/README.md
@@ -38,11 +38,17 @@ This repository contains sample browser project. Each widgets sample will be fou
## Screenshots ##
+### Chart types
-
+
+
+### Axis types
+
+
+### User interactions
@@ -54,4 +60,4 @@ Syncfusion has no liability for any damage or consequence that may arise by the
## About Syncfusion ##
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
-Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/products/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
\ No newline at end of file
+Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/products/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
\ No newline at end of file
diff --git a/lib/model/helper.dart b/lib/model/helper.dart
index 39e0bc9a..8acdd38a 100755
--- a/lib/model/helper.dart
+++ b/lib/model/helper.dart
@@ -109,6 +109,34 @@ import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning
import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning/selection_zooming.dart';
import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning/zooming_with_custom_buttons.dart';
import 'package:flutter_examples/samples/chart/home/radial_gauge.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/default_gauge_view.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/multiple_axis.dart';
+import 'package:flutter_examples/samples/gauge/ranges/range_thickness.dart';
+import 'package:flutter_examples/samples/gauge/ranges/range_dataLabel.dart';
+import 'package:flutter_examples/samples/gauge/pointers/multiple_ranges.dart';
+import 'package:flutter_examples/samples/gauge/showcase/gauge_overview.dart';
+import 'package:flutter_examples/samples/gauge/showcase/clock_sample.dart';
+import 'package:flutter_examples/samples/gauge/showcase/distance_tracker.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_bounceout.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeanimation.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeincirc.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_linearanimation.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_elasticout.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_slowmiddle.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeout.dart';
+import 'package:flutter_examples/samples/gauge/ranges/multiple_ranges.dart';
+import 'package:flutter_examples/samples/gauge/pointers/multiple_needle.dart';
+import 'package:flutter_examples/samples/gauge/pointers/radial_marker.dart';
+import 'package:flutter_examples/samples/gauge/pointers/text_pointer.dart';
+import 'package:flutter_examples/samples/gauge/annotation/image_annotation.dart';
+import 'package:flutter_examples/samples/gauge/annotation/text_annotation.dart';
+import 'package:flutter_examples/samples/gauge/annotation/direction_compass.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/radiallabel_customization.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/tick_customization.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/non_linearlabel.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/custom_labels.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/range_colors.dart';
+import 'package:flutter_examples/samples/gauge/pointer_interaction/radial_pointerdragging.dart';
import 'model.dart';
void onTapControlItem(
@@ -801,6 +829,180 @@ void onTapSampleItem(BuildContext context, SubItemList sample) {
builder: (BuildContext context) => DefaultSelection(sample)));
}
}
+
+
+//......................Radial Gauge...............................//
+ else if (sample.category == 'Showcase') {
+ if (sample.title == 'Clock') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => ClockExample(sample)));
+ } else if (sample.title == 'Temperature Monitor') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => GaugeOverviewExample(sample)));
+ } else if (sample.title == 'Distance Tracker') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ DistanceTrackerExample(sample)));
+ }
+ } else if (sample.category == 'Axis') {
+ if (sample.title == 'Default view') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialGaugeDefault(sample)));
+ } else if (sample.title == 'Multiple axis') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => MultipleAxisExample(sample)));
+ } else if (sample.title == 'Label Customization') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialLabelCustomization(sample)));
+ } else if (sample.title == 'Tick Customization') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialTickCustomization(sample)));
+ } else if (sample.title == 'Custom Scale') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialNonLinearLabel(sample)));
+ } else if (sample.title == 'Custom Labels') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => GaugeCustomLabels(sample)));
+ } else if (sample.title == 'Range colors for axis') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RangeColorForLabels(sample)));
+ }
+ } else if (sample.category == 'Pointers') {
+ if (sample.title == 'Range Pointer') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ MultipleRangePointerExample(sample)));
+ } else if (sample.title == 'Multiple Needle') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ MultipleNeedleExample(sample)));
+ } else if (sample.title == 'Marker Pointer') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialMarkerExample(sample)));
+ } else if (sample.title == 'Text Pointer') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialTextPointer(sample)));
+ }
+ } else if (sample.category == 'Range') {
+ if (sample.title == 'Multiple Ranges') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ MultipleRangesExample(sample)));
+ } else if (sample.title == 'Range Label') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RangeDataLabelExample(sample)));
+ } else if (sample.title == 'Range Thickness') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RangeThicknessExample(sample)));
+ }
+ } else if (sample.category == 'Gauge Annotation') {
+ if (sample.title == 'Temperature Tracker') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialImageAnnotation(sample)));
+ } else if (sample.title == 'Direction Compass') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialCompass(sample)));
+ } else if (sample.title == 'Text Annotation') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialTextAnnotation(sample)));
+ }
+ } else if (sample.category == 'Pointer Interaction') {
+ if (sample.title == 'Pointer Dragging') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialPointerDragging(sample)));
+ }
+ } else if (sample.category == 'Pointer Animation') {
+ if (sample.title == 'Bounce Out') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialBounceOutExample(sample)));
+ } else if (sample.title == 'Ease') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) => RadialEaseExample(sample)));
+ } else if (sample.title == 'EaseInCirc') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialEaseInCircExample(sample)));
+ } else if (sample.title == 'Linear') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialLinearAnimation(sample)));
+ } else if (sample.title == 'ElasticOut') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialElasticOutAnimation(sample)));
+ } else if (sample.title == 'SlowMiddle') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialSlowMiddleAnimation(sample)));
+ } else if (sample.title == 'EaseOutBack') {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (BuildContext context) =>
+ RadialEaseOutAnimation(sample)));
+ }
+ }
}
String getStatus(List model) {
diff --git a/lib/model/model.dart b/lib/model/model.dart
index 260daf78..35b5604b 100755
--- a/lib/model/model.dart
+++ b/lib/model/model.dart
@@ -98,6 +98,34 @@ import 'package:flutter_examples/samples/chart/user_interactions/trackball/chart
import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning/pinch_zooming.dart';
import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning/selection_zooming.dart';
import 'package:flutter_examples/samples/chart/user_interactions/zooming_panning/zooming_with_custom_buttons.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/default_gauge_view.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/multiple_axis.dart';
+import 'package:flutter_examples/samples/gauge/ranges/range_thickness.dart';
+import 'package:flutter_examples/samples/gauge/ranges/range_dataLabel.dart';
+import 'package:flutter_examples/samples/gauge/pointers/multiple_ranges.dart';
+import 'package:flutter_examples/samples/gauge/showcase/gauge_overview.dart';
+import 'package:flutter_examples/samples/gauge/showcase/distance_tracker.dart';
+import 'package:flutter_examples/samples/gauge/showcase/clock_sample.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_bounceout.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeanimation.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeincirc.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_linearanimation.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_elasticout.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_slowmiddle.dart';
+import 'package:flutter_examples/samples/gauge/animation/radial_easeout.dart';
+import 'package:flutter_examples/samples/gauge/ranges/multiple_ranges.dart';
+import 'package:flutter_examples/samples/gauge/pointers/multiple_needle.dart';
+import 'package:flutter_examples/samples/gauge/pointers/radial_marker.dart';
+import 'package:flutter_examples/samples/gauge/pointers/text_pointer.dart';
+import 'package:flutter_examples/samples/gauge/annotation/image_annotation.dart';
+import 'package:flutter_examples/samples/gauge/annotation/text_annotation.dart';
+import 'package:flutter_examples/samples/gauge/annotation/direction_compass.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/radiallabel_customization.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/tick_customization.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/non_linearlabel.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/custom_labels.dart';
+import 'package:flutter_examples/samples/gauge/axis_feature/range_colors.dart';
+import 'package:flutter_examples/samples/gauge/pointer_interaction/radial_pointerdragging.dart';
import 'package:scoped_model/scoped_model.dart';
class SampleList {
@@ -207,7 +235,15 @@ class SampleListModel extends Model {
List pyramidSeriesSubItemList;
List funnelSeriesSubItemList;
-
+ //Radial gauge examples
+ List> radialGaugeSubItemList;
+ List radialAxisSubItemList;
+ List radialPointersSubItemList;
+ List radialRangesSubItemList;
+ List radialAnnotationSubItemList;
+ List radialInteractionSubItemList;
+ List radialAnimationSubItemList;
+ List radialShowCaseSubItemList;
SampleListModel() {
controlList = [];
@@ -981,6 +1017,221 @@ class SampleListModel extends Model {
'New'
));
+ // Radial gauge example
+
+ //Radial gauge examples
+ radialGaugeSubItemList = >[];
+
+ //Radial gauge categories
+ radialAxisSubItemList = [];
+ radialPointersSubItemList= [];
+ radialRangesSubItemList = [];
+ radialAnnotationSubItemList = [];
+ radialInteractionSubItemList= [];
+ radialShowCaseSubItemList = [];
+ radialAnimationSubItemList = [];
+
+ radialShowCaseSubItemList.add(SubItemList(
+ 'Showcase',
+ 'Clock',
+ '',
+ 'images/axes.png',
+ getClockExample(isTileView),
+ ));
+ radialShowCaseSubItemList.add(SubItemList(
+ 'Showcase',
+ 'Temperature Monitor',
+ '',
+ 'images/axes.png',
+ getGaugeOverviewExample(isTileView),
+ ));
+
+ radialShowCaseSubItemList.add(SubItemList(
+ 'Showcase',
+ 'Distance Tracker',
+ '',
+ 'images/axes.png',
+ getDistanceTrackerExample(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Default view',
+ '',
+ 'images/axes.png',
+ getDefaultRadialGauge(isTileView),
+ ));
+
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Multiple axis',
+ '',
+ 'images/axes.png',
+ getMultipleAxisGauge(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Label Customization',
+ '',
+ 'images/axes.png',
+ getRadialLabelCustomization(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Tick Customization',
+ '',
+ 'images/axes.png',
+ getRadialTickCustomization(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Custom Scale',
+ '',
+ 'images/axes.png',
+ getRadialNonLinearLabel(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Custom Labels',
+ '',
+ 'images/axes.png',
+ getGaugeCustomLabels(isTileView),
+ ));
+ radialAxisSubItemList.add(SubItemList(
+ 'Axis',
+ 'Range colors for axis',
+ '',
+ 'images/axes.png',
+ getRangeColorForLabels(isTileView),
+ ));
+ radialPointersSubItemList.add(SubItemList(
+ 'Pointers',
+ 'Range Pointer',
+ '',
+ 'images/axes.png',
+ getMultipleRangePointerExampleGauge(isTileView),
+ ));
+
+ radialPointersSubItemList.add(SubItemList(
+ 'Pointers',
+ 'Multiple Needle',
+ '',
+ 'images/axes.png',
+ getMultipleNeedleExample(isTileView),
+ ));
+ radialPointersSubItemList.add(SubItemList(
+ 'Pointers',
+ 'Marker Pointer',
+ '',
+ 'images/axes.png',
+ getRadialMarkerExample(isTileView),
+ ));
+ radialPointersSubItemList.add(SubItemList(
+ 'Pointers',
+ 'Text Pointer',
+ '',
+ 'images/axes.png',
+ getRadialTextPointer(isTileView),
+ ));
+ radialRangesSubItemList.add(SubItemList(
+ 'Range',
+ 'Multiple Ranges',
+ '',
+ 'images/axes.png',
+ getMultipleRangesExampleGauge(isTileView),
+ ));
+ radialRangesSubItemList.add(SubItemList(
+ 'Range',
+ 'Range Thickness',
+ '',
+ 'images/axes.png',
+ getRangeThicknessExampleGauge(isTileView),
+ ));
+ radialRangesSubItemList.add(SubItemList(
+ 'Range',
+ 'Range Label',
+ '',
+ 'images/axes.png',
+ getRangeDataLabelExample(isTileView),
+ ));
+ radialAnnotationSubItemList.add(SubItemList(
+ 'Gauge Annotation',
+ 'Direction Compass',
+ '',
+ 'images/axes.png',
+ getRadialCompass(isTileView),
+ ));
+ radialAnnotationSubItemList.add(SubItemList(
+ 'Gauge Annotation',
+ 'Text Annotation',
+ '',
+ 'images/axes.png',
+ getRadialTextAnnotation(isTileView),
+ ));
+ radialAnnotationSubItemList.add(SubItemList(
+ 'Gauge Annotation',
+ 'Temperature Tracker',
+ '',
+ 'images/axes.png',
+ getRadialImageAnnotation(isTileView),
+ ));
+ radialInteractionSubItemList.add(SubItemList(
+ 'Pointer Interaction',
+ 'Pointer Dragging',
+ '',
+ 'images/axes.png',
+ getRadialPointerDragging(isTileView),
+ ));
+
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'Bounce Out',
+ '',
+ 'images/axes.png',
+ getRadialBounceOutExample(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'Ease',
+ '',
+ 'images/axes.png',
+ getRadialEaseExample(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'Linear',
+ '',
+ 'images/axes.png',
+ getRadialLinearAnimation(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'EaseInCirc',
+ '',
+ 'images/axes.png',
+ getRadialEaseInCircExample(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'ElasticOut',
+ '',
+ 'images/axes.png',
+ getRadialElasticOutAnimation(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'SlowMiddle',
+ '',
+ 'images/axes.png',
+ getRadialSlowMiddleAnimation(isTileView),
+ ));
+ radialAnimationSubItemList.add(SubItemList(
+ 'Pointer Animation',
+ 'EaseOutBack',
+ '',
+ 'images/axes.png',
+ getRadialEaseOutAnimation(isTileView),
+ ));
+
cartesianSubItemList.add(lineSeriesSubItemList);
cartesianSubItemList.add(columnSeriesSubItemList);
cartesianSubItemList.add(splineSeriesSubItemList);
@@ -1017,6 +1268,22 @@ class SampleListModel extends Model {
dynamicUpdatesSubItemList.add(liveVerticalSubItemList);
dynamicUpdatesSubItemList.add(randomUpdateDataSubItemList);
+ // To add radial gauge categories
+ radialGaugeSubItemList.add(radialShowCaseSubItemList);
+ radialGaugeSubItemList.add(radialAxisSubItemList);
+ radialGaugeSubItemList.add(radialPointersSubItemList);
+ radialGaugeSubItemList.add(radialRangesSubItemList);
+ radialGaugeSubItemList.add(radialAnnotationSubItemList);
+ radialGaugeSubItemList.add(radialInteractionSubItemList);
+ radialGaugeSubItemList.add(radialAnimationSubItemList);
+
+ controlList.add(SampleList(
+ 'Radial Gauge',
+ 'Demos of radial gauges and its feature',
+ 'images/circle_gauge.png',
+ radialGaugeSubItemList,
+ 'New'));
+
controlList.add(SampleList(
'Cartesian Charts',
'Demos of various chart types supported in cartesian axes',
diff --git a/lib/samples/gauge/animation/radial_bounceout.dart b/lib/samples/gauge/animation/radial_bounceout.dart
new file mode 100644
index 00000000..b9f6a0f1
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_bounceout.dart
@@ -0,0 +1,223 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialBounceOutExample extends StatefulWidget {
+ final SubItemList sample;
+ const RadialBounceOutExample(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialBounceOutExampleState createState() => _RadialBounceOutExampleState(sample);
+}
+
+class _RadialBounceOutExampleState extends State {
+ final SubItemList sample;
+ _RadialBounceOutExampleState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialBounceOutExample oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_bounceout.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialBounceOutExample(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialBounceOutExample(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(radiusFactor: 0.98, startAngle: 90,
+ endAngle: 330, minimum: -8, maximum: 12, showAxisLine: false,
+ majorTickStyle: MajorTickStyle(length: 0.15,
+ lengthUnit: GaugeSizeUnit.factor,
+ thickness: 2), labelOffset: 8,
+ axisLabelStyle: GaugeTextStyle(
+ fontFamily: 'Times', fontSize: isTileView ? 10 : 12,
+ fontWeight: FontWeight.w800,
+ fontStyle: FontStyle.italic),
+ minorTicksPerInterval: 9, interval: 2,
+ pointers: [NeedlePointer(value: 0, needleStartWidth: 2, needleEndWidth: 2,
+ needleColor: Color(0xFFF67280), needleLength: 0.8, lengthUnit: GaugeSizeUnit.factor,
+ enableAnimation: true, animationType: AnimationType.bounceOut,
+ animationDuration: 1500,
+ knobStyle: KnobStyle(knobRadius:8, sizeUnit: GaugeSizeUnit.logicalPixel,
+ color: Color(0xFFF67280))
+ )],
+ minorTickStyle: MinorTickStyle(length: 0.08, thickness: 1,
+ lengthUnit: GaugeSizeUnit.factor,
+ color: Color(0xFFC4C4C4)),
+ axisLineStyle:AxisLineStyle(color: Color(0xFFDADADA),
+ thicknessUnit: GaugeSizeUnit.factor,
+ thickness: 0.1)),
+
+ ],
+ );
+}
+
+
+
+
+
diff --git a/lib/samples/gauge/animation/radial_easeanimation.dart b/lib/samples/gauge/animation/radial_easeanimation.dart
new file mode 100644
index 00000000..824cd921
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_easeanimation.dart
@@ -0,0 +1,249 @@
+import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialEaseExample extends StatefulWidget {
+ final SubItemList sample;
+ const RadialEaseExample(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialEaseExampleState createState() => _RadialEaseExampleState(sample);
+}
+
+class _RadialEaseExampleState extends State {
+ final SubItemList sample;
+ _RadialEaseExampleState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialEaseExample oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_easeanimation.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ Timer timer;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ setState((){
+ _interval = MediaQuery.of(context).orientation == Orientation.portrait ? 1 : 2;
+ });
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialEaseExample(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialEaseExample(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 0, endAngle: 360, showLabels: false, showTicks: false,
+ radiusFactor: 0.9, axisLineStyle: AxisLineStyle(
+ thicknessUnit: GaugeSizeUnit.factor,
+ thickness: isTileView ? 0.07 : 0.1)
+ ),
+ RadialAxis(startAngle: 170, endAngle: 170, showTicks: false, labelFormat: '{value}M',
+ showAxisLine: false, radiusFactor: 0.9, minimum: 0, maximum: 15, showLastLabel: false,
+ axisLabelStyle: GaugeTextStyle(fontSize: isTileView ? 10 : 12, fontWeight: FontWeight.w500),
+ labelOffset: 25, interval: isTileView ? 1: _interval,
+ needsRotateLabels: true,
+ annotations: [
+ GaugeAnnotation( positionFactor: 1, axisValue: 0,
+ widget: Container(height: isTileView ? 30 : 45, width:isTileView ? 30 : 45,
+ decoration: new BoxDecoration(
+ image: new DecorationImage(
+ image: ExactAssetImage('images/shotput.png'),
+ fit: BoxFit.fitHeight,
+ ),
+ ))),
+
+ GaugeAnnotation(widget: Container(child: Text('Distance',
+ style: TextStyle( fontSize: 20)),))
+ ],
+ pointers: [
+ RangePointer(value: 11.5, width: 0.1, color: Color(0xFFF67280),
+ enableAnimation: true, sizeUnit: GaugeSizeUnit.factor,
+ animationType: AnimationType.ease,),
+ MarkerPointer(value: 11.5, markerType: MarkerType.image,
+ enableAnimation: true, animationType: AnimationType.ease,
+ imageUrl: 'images/ball.png' , markerHeight: isTileView ? 30 : 40,
+ markerOffset: 4, markerWidth: isTileView ? 30 : 40),
+ ]
+ )
+
+ ],
+ );
+}
+
+double _interval = 1;
+
diff --git a/lib/samples/gauge/animation/radial_easeincirc.dart b/lib/samples/gauge/animation/radial_easeincirc.dart
new file mode 100644
index 00000000..5a226604
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_easeincirc.dart
@@ -0,0 +1,230 @@
+// import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialEaseInCircExample extends StatefulWidget {
+ final SubItemList sample;
+ const RadialEaseInCircExample(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialEaseInCircExampleState createState() => _RadialEaseInCircExampleState(sample);
+}
+
+class _RadialEaseInCircExampleState extends State {
+ final SubItemList sample;
+ _RadialEaseInCircExampleState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialEaseInCircExample oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_easeincirc.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialEaseInCircExample(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialEaseInCircExample(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(showAxisLine: false,
+ ticksPosition: ElementsPosition.outside,
+ labelsPosition: ElementsPosition.outside,
+ interval: 10,
+ axisLabelStyle:GaugeTextStyle( fontSize: 12),
+ majorTickStyle: MajorTickStyle(length: 0.15,
+ lengthUnit: GaugeSizeUnit.factor,
+ thickness: 1,),
+ minorTicksPerInterval: 4,
+ minorTickStyle: MinorTickStyle(length: 0.04,
+ lengthUnit: GaugeSizeUnit.factor,
+ thickness: 1, ),
+ pointers: [RangePointer(width: 15, pointerOffset: 10,
+ value: 45, animationDuration: 1000,
+ animationType: AnimationType.easeInCirc, enableAnimation: true,
+ color: Color(0xFFF8B195))]
+ )
+ ],
+ );
+}
+
+
+
+
+
diff --git a/lib/samples/gauge/animation/radial_easeout.dart b/lib/samples/gauge/animation/radial_easeout.dart
new file mode 100644
index 00000000..a99861bf
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_easeout.dart
@@ -0,0 +1,231 @@
+import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialEaseOutAnimation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialEaseOutAnimation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialEaseOutAnimationState createState() => _RadialEaseOutAnimationState(sample);
+}
+
+class _RadialEaseOutAnimationState extends State {
+ final SubItemList sample;
+ _RadialEaseOutAnimationState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialEaseOutAnimation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_easeout.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ Timer timer;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialEaseOutAnimation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialEaseOutAnimation(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 180, endAngle: 360, showTicks: false,
+ showLabels: false, centerY: 0.6, radiusFactor: 0.8,
+ minimum: 0, maximum: 50,
+ axisLineStyle: AxisLineStyle(
+ thickness: 40),
+ pointers: [
+ RangePointer(enableAnimation: true, animationType: AnimationType.easeOutBack,
+ width: 40, color: Color(0xFF00A8B5), value: 40),
+
+ NeedlePointer(knobStyle: KnobStyle(knobRadius: 5, sizeUnit: GaugeSizeUnit.logicalPixel,
+ color: _easeOutNeedleColor),
+ needleColor: _easeOutNeedleColor, needleEndWidth: 2, needleStartWidth: 2,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleLength: 0.98,
+ value: 40, enableAnimation: true, animationType: AnimationType.easeOutBack)
+ ]
+ )
+ ],
+ );
+}
+
+Color _easeOutNeedleColor = const Color(0xFF555555);
+
+
+
diff --git a/lib/samples/gauge/animation/radial_elasticout.dart b/lib/samples/gauge/animation/radial_elasticout.dart
new file mode 100644
index 00000000..f3b91e50
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_elasticout.dart
@@ -0,0 +1,237 @@
+import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialElasticOutAnimation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialElasticOutAnimation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialElasticOutAnimationState createState() => _RadialElasticOutAnimationState(sample);
+}
+
+class _RadialElasticOutAnimationState extends State {
+ final SubItemList sample;
+ _RadialElasticOutAnimationState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialElasticOutAnimation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_elasticout.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ Timer timer;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialElasticOutAnimation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialElasticOutAnimation(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 180, endAngle: 360, showAxisLine: true, centerY: 0.65,
+ interval: 10, showLabels: false, radiusFactor: 0.9,
+ majorTickStyle: MajorTickStyle(length: 0.1,
+ lengthUnit: GaugeSizeUnit.factor, thickness: 1.5),
+ minorTicksPerInterval: 4,
+ pointers: [RangePointer(value: 70, width: 5,
+ animationDuration: 2000,
+ enableAnimation: true, animationType: AnimationType.elasticOut,
+ color: Color(0xFF00A8B5)),
+ NeedlePointer(value: 70, needleStartWidth: 0,
+ needleColor: Color(0xFF00A8B5),
+ lengthUnit: GaugeSizeUnit.factor,
+ needleLength: 1,
+ enableAnimation: true,
+ animationDuration: 2000, animationType: AnimationType.elasticOut,
+ needleEndWidth: 5,knobStyle: KnobStyle(knobRadius: 0,
+ sizeUnit: GaugeSizeUnit.factor
+ ))
+ ],
+ minorTickStyle: MinorTickStyle(length: 0.04,
+ lengthUnit: GaugeSizeUnit.factor, thickness: 1.5),
+ axisLineStyle: AxisLineStyle(color: Colors.transparent)
+ )
+ ],
+ );
+}
+
+
+
+
+
diff --git a/lib/samples/gauge/animation/radial_linearanimation.dart b/lib/samples/gauge/animation/radial_linearanimation.dart
new file mode 100644
index 00000000..3bf8eeaa
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_linearanimation.dart
@@ -0,0 +1,245 @@
+import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialLinearAnimation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialLinearAnimation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialLinearAnimationState createState() => _RadialLinearAnimationState(sample);
+}
+
+class _RadialLinearAnimationState extends State {
+ final SubItemList sample;
+ _RadialLinearAnimationState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialLinearAnimation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_linearanimation.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ Timer timer;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ setState((){
+ _radius = MediaQuery.of(context).orientation == Orientation.portrait ? 0.05 : 0.07;
+ });
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialLinearAnimation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialLinearAnimation(bool isTileView) {
+ SfRadialGauge _gauge = SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 270, endAngle: 270, showLabels: false,
+ radiusFactor: 0.8,
+ pointers: [MarkerPointer(markerHeight: 20, markerWidth: 20,
+ markerType: MarkerType.triangle, markerOffset: 17, value: 80,
+ enableAnimation: true, animationType: AnimationType.linear,
+ color: _linearMarkerColor),
+ NeedlePointer(knobStyle: KnobStyle(knobRadius: isTileView? 0.065: _radius,
+ color: _linearNeedleColor
+
+ ),
+ needleStartWidth: 0, needleEndWidth: 5, value: 12,
+ enableAnimation: true,animationType: AnimationType.linear,
+ lengthUnit:GaugeSizeUnit.factor,
+ needleLength: 0.8, needleColor: _linearNeedleColor )
+ ],
+ axisLineStyle: AxisLineStyle(
+ thickness: 3), tickOffset: 2,
+ majorTickStyle: MajorTickStyle(thickness: 2,
+ length: 0.02, lengthUnit:GaugeSizeUnit.factor),
+ minorTicksPerInterval: 0
+
+ ),
+ ],
+ );
+
+ return _gauge;
+}
+
+double _radius = 0.05;
+Color _linearNeedleColor = const Color(0xFF355C7D);
+Color _linearMarkerColor = const Color(0xFFF67280);
+
+
+
+
+
diff --git a/lib/samples/gauge/animation/radial_slowmiddle.dart b/lib/samples/gauge/animation/radial_slowmiddle.dart
new file mode 100644
index 00000000..574d764b
--- /dev/null
+++ b/lib/samples/gauge/animation/radial_slowmiddle.dart
@@ -0,0 +1,248 @@
+import 'dart:async';
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialSlowMiddleAnimation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialSlowMiddleAnimation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialSlowMiddleAnimationState createState() => _RadialSlowMiddleAnimationState(sample);
+}
+
+class _RadialSlowMiddleAnimationState extends State {
+ final SubItemList sample;
+ _RadialSlowMiddleAnimationState(this.sample);
+ bool panelOpen;
+
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialSlowMiddleAnimation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/animation/radial_slowmiddle.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ Timer timer;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialSlowMiddleAnimation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialSlowMiddleAnimation(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 270, endAngle: 270, showAxisLine: false,
+ ticksPosition: ElementsPosition.outside,
+ labelsPosition: ElementsPosition.outside, minimum: 0, maximum: 12,
+ interval: 1, needsRotateLabels: true,
+ majorTickStyle: MajorTickStyle(length: 0.15,
+ lengthUnit: GaugeSizeUnit.factor, thickness: 1.5),
+ minorTicksPerInterval: 4, showFirstLabel: false,
+ axisLabelStyle: GaugeTextStyle(fontSize: 12),
+ minorTickStyle: MinorTickStyle(length: 0.07,
+ lengthUnit: GaugeSizeUnit.factor, thickness: 1.5),
+ pointers: [
+ NeedlePointer(needleLength: 0.95, needleStartWidth: 0,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleEndWidth: 5, needleColor: Color(0xFFC06C84),
+ knobStyle: KnobStyle(knobRadius: 0),
+ value: 11, enableAnimation: true, animationType: AnimationType.slowMiddle
+ ),
+ NeedlePointer(needleLength: 0.7, needleStartWidth: 0,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleEndWidth: 5, needleColor: Color(0xFFF67280),
+ value: 2, enableAnimation: true, animationType: AnimationType.slowMiddle,
+ knobStyle: KnobStyle(color: Color(0xFFF67280),
+ sizeUnit: GaugeSizeUnit.logicalPixel,
+ knobRadius: 10),
+ ),
+ NeedlePointer(needleLength: 0.8, needleStartWidth: 1,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleEndWidth: 1, needleColor: _slowMiddleNeedleColor,
+ knobStyle: KnobStyle(knobRadius: 5, sizeUnit: GaugeSizeUnit.logicalPixel,
+ color: _slowMiddleNeedleColor),
+ value: 10.4, enableAnimation: true, animationType: AnimationType.slowMiddle
+ ),
+ ]
+ )
+ ],
+ );
+}
+
+Color _slowMiddleNeedleColor = const Color(0xFF355C7D);
+
+
+
diff --git a/lib/samples/gauge/annotation/direction_compass.dart b/lib/samples/gauge/annotation/direction_compass.dart
new file mode 100644
index 00000000..58279d05
--- /dev/null
+++ b/lib/samples/gauge/annotation/direction_compass.dart
@@ -0,0 +1,255 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialCompass extends StatefulWidget {
+ final SubItemList sample;
+ const RadialCompass(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialCompassState createState() => _RadialCompassState(sample);
+}
+
+class _RadialCompassState extends State {
+ final SubItemList sample;
+ _RadialCompassState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialCompass oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/annotation/direction_compass.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialCompass(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialCompass(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(showAxisLine: false,
+ ticksPosition: ElementsPosition.outside,
+
+ labelsPosition: ElementsPosition.outside,
+ startAngle: 320, endAngle: 320, minorTicksPerInterval: 10,
+ minimum: 0, maximum: 360, showLastLabel: false,
+ interval: 30, labelOffset: 20,
+ majorTickStyle: MajorTickStyle(length: 0.16,
+ lengthUnit: GaugeSizeUnit.factor),
+ minorTickStyle: MinorTickStyle(length: 0.16,
+ lengthUnit: GaugeSizeUnit.factor, thickness: 1),
+ axisLabelStyle: GaugeTextStyle(fontSize: 12),
+ pointers: [MarkerPointer(value: 90,
+ markerType: MarkerType.triangle),
+ NeedlePointer(value: 310, needleLength: 0.5,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleColor: Color(0xFFC4C4C4), needleStartWidth: 1,
+ needleEndWidth: 1, knobStyle: KnobStyle(knobRadius: 0),
+ tailStyle: TailStyle(color: Color(0xFFC4C4C4), width: 1,
+ lengthUnit: GaugeSizeUnit.factor,
+ length: 0.5)),
+ NeedlePointer(value: 221, needleLength: 0.5,
+ lengthUnit:GaugeSizeUnit.factor,
+ needleColor: Color(0xFFC4C4C4), needleStartWidth: 1,
+ needleEndWidth: 1, knobStyle: KnobStyle(knobRadius: 0,
+ sizeUnit: GaugeSizeUnit.factor
+ ),),
+ NeedlePointer(value: 40, needleLength: 0.5,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleColor: Color(0xFFC4C4C4), needleStartWidth: 1,
+ needleEndWidth: 1, knobStyle: KnobStyle(knobRadius: 0),)
+ ],
+ annotations: [GaugeAnnotation(angle: 230, positionFactor: 0.38,
+ widget: Container(child: Text('W',
+ style: TextStyle(
+ fontFamily: 'Times',
+ fontWeight: FontWeight.bold,
+ fontSize: isTileView ? 12 : 18)),)),
+ GaugeAnnotation(angle: 310, positionFactor: 0.38,
+ widget: Container(child: Text('N',
+ style: TextStyle(
+ fontFamily: 'Times',
+ fontWeight: FontWeight.bold,
+ fontSize:isTileView ? 12 : 18)),)),
+ GaugeAnnotation(angle: 129, positionFactor: 0.38,
+ widget: Container(child: Text('S',
+ style: TextStyle(
+ fontFamily: 'Times',
+ fontWeight: FontWeight.bold,
+ fontSize:isTileView ? 12 : 18)),)),
+ GaugeAnnotation(angle: 50, positionFactor: 0.38,
+ widget: Container(child: Text('E',
+ style: TextStyle(
+ fontFamily: 'Times',
+ fontWeight: FontWeight.bold,
+ fontSize: isTileView ? 12 : 18)),))
+ ]
+ )
+ ],
+ );
+}
+
+
+
diff --git a/lib/samples/gauge/annotation/image_annotation.dart b/lib/samples/gauge/annotation/image_annotation.dart
new file mode 100644
index 00000000..a2117ced
--- /dev/null
+++ b/lib/samples/gauge/annotation/image_annotation.dart
@@ -0,0 +1,225 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialImageAnnotation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialImageAnnotation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialImageAnnotationState createState() => _RadialImageAnnotationState(sample);
+}
+
+class _RadialImageAnnotationState extends State {
+ final SubItemList sample;
+ _RadialImageAnnotationState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialImageAnnotation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/annotation/image_annotation.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialImageAnnotation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialImageAnnotation(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis( interval: 10, radiusFactor: 0.95,
+ startAngle: 0, endAngle: 360, showTicks: false,
+ showLabels: false,
+ axisLineStyle: AxisLineStyle(thickness: 20),
+ pointers: [RangePointer(value: 73,
+ width: 20, color: Color(0xFFFFCD60),
+ enableAnimation: true,
+ cornerStyle: CornerStyle.bothCurve)],
+ annotations: [
+ GaugeAnnotation(widget: Column(children: [Container(
+ width: isTileView ? 30.00 : 50.00 ,
+ height: isTileView ? 30.00 : 50.00,
+ decoration: new BoxDecoration(
+ image: new DecorationImage(
+ image: ExactAssetImage('images/sun.png'),
+ fit: BoxFit.fitHeight,
+ ),
+ )),
+ Padding(padding: EdgeInsets.fromLTRB(0, 2, 0, 0),
+ child: Container(child:Text('73°F',
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize:isTileView ? 15.00 : 25)) ,),
+ )
+ ],) , angle: 270, positionFactor: 0.1)
+
+ ]
+ )
+ ],
+ );
+}
+
+
+
diff --git a/lib/samples/gauge/annotation/text_annotation.dart b/lib/samples/gauge/annotation/text_annotation.dart
new file mode 100644
index 00000000..7431d86c
--- /dev/null
+++ b/lib/samples/gauge/annotation/text_annotation.dart
@@ -0,0 +1,225 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialTextAnnotation extends StatefulWidget {
+ final SubItemList sample;
+ const RadialTextAnnotation(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialTextAnnotationState createState() => _RadialTextAnnotationState(sample);
+}
+
+class _RadialTextAnnotationState extends State {
+ final SubItemList sample;
+ _RadialTextAnnotationState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialTextAnnotation oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/annotation/text_annotation.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialTextAnnotation(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialTextAnnotation(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(showTicks: false,
+ showLabels: false,
+ startAngle: 180,
+ endAngle: 180,
+ radiusFactor: 0.9,
+ axisLineStyle: AxisLineStyle(
+ thickness: 30, dashArray: [8, 10]
+ ),
+ ),
+ RadialAxis(showTicks: false,
+ showLabels: false,
+ startAngle: 180,
+ endAngle: 50,
+ radiusFactor: 0.9,
+ annotations: [GaugeAnnotation(
+ angle: 270, positionFactor: 0, verticalAlignment: GaugeAlignment.far,
+
+ widget: Container(child:Text(' 63%',
+
+ style: TextStyle(
+ fontStyle: FontStyle.italic,
+ fontFamily: 'Times',
+ fontWeight: FontWeight.bold,
+ fontSize: isTileView ? 18 : 25))))],
+ axisLineStyle: AxisLineStyle(
+ color: Color(0xFF00A8B5),
+ thickness: 30, dashArray: [8, 10]
+ ))
+ ],
+ );
+}
+
+
+
diff --git a/lib/samples/gauge/axis_feature/custom_labels.dart b/lib/samples/gauge/axis_feature/custom_labels.dart
new file mode 100644
index 00000000..97cd1a31
--- /dev/null
+++ b/lib/samples/gauge/axis_feature/custom_labels.dart
@@ -0,0 +1,262 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class GaugeCustomLabels extends StatefulWidget {
+ final SubItemList sample;
+ const GaugeCustomLabels(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _GaugeCustomLabelsState createState() => _GaugeCustomLabelsState(sample);
+}
+
+class _GaugeCustomLabelsState extends State {
+ final SubItemList sample;
+ _GaugeCustomLabelsState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(GaugeCustomLabels oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/axis_feature/custom_labels.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ setState((){
+ _endWidth = MediaQuery.of(context).orientation == Orientation.portrait ? 18 : 10;
+ if(Theme.of(context).brightness == Brightness.dark){
+ _cutsomLabelNeedleColor = const Color(0xFF888888);
+ }else{
+ _cutsomLabelNeedleColor = const Color(0xFFFCACACA);
+ }
+ });
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getGaugeCustomLabels(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getGaugeCustomLabels(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 270,
+ endAngle: 270, radiusFactor: 0.9,
+ minimum: 0, maximum: 80,
+ axisLineStyle: AxisLineStyle(
+ thicknessUnit: GaugeSizeUnit.factor,
+ thickness: 0.1
+ ),
+ interval: 10, needsRotateLabels: true,
+ axisLabelStyle: GaugeTextStyle(fontSize: 12),
+ minorTicksPerInterval: 0,
+ majorTickStyle: MajorTickStyle(thickness: 1.5,
+ lengthUnit: GaugeSizeUnit.factor,
+ length: 0.07),
+ showLabels: true, onLabelCreated: labelCreated,
+ pointers: [
+ NeedlePointer(value: 70, lengthUnit: GaugeSizeUnit.factor,
+ needleLength: 0.55, needleEndWidth: isTileView ? 10 : _endWidth,
+ needleColor: Color(0xFFF67280), knobStyle: KnobStyle(knobRadius: 0.1,
+ sizeUnit: GaugeSizeUnit.factor,
+ color: Colors.white)),
+
+ NeedlePointer(value: 30, needleLength: 0.55,
+ lengthUnit: GaugeSizeUnit.factor, needleColor: _cutsomLabelNeedleColor,
+ needleEndWidth: isTileView ? 10 : _endWidth,
+ knobStyle:KnobStyle(knobRadius: 0.1,
+ sizeUnit: GaugeSizeUnit.factor,
+ color: Colors.white)
+ )
+ ],
+ )
+ ],
+ );
+}
+
+double _endWidth = 18;
+Color _cutsomLabelNeedleColor = const Color(0xFFFCACACA);
+
+void labelCreated(AxisLabelCreatedArgs args){
+ if(args.text == '80' || args.text == '0'){
+ args.text ='N';
+ }else if(args.text == '10'){
+ args.text ='NE';
+ }else if(args.text == '20'){
+ args.text ='E';
+ }else if(args.text == '30'){
+ args.text ='SE';
+ }else if(args.text == '40'){
+ args.text ='S';
+ }else if(args.text == '50'){
+ args.text ='SW';
+ }else if(args.text == '60'){
+ args.text ='W';
+ }else if(args.text == '70'){
+ args.text ='NW';
+ }
+}
+
+
+
+
+
+
+
diff --git a/lib/samples/gauge/axis_feature/default_gauge_view.dart b/lib/samples/gauge/axis_feature/default_gauge_view.dart
new file mode 100644
index 00000000..663484e8
--- /dev/null
+++ b/lib/samples/gauge/axis_feature/default_gauge_view.dart
@@ -0,0 +1,210 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialGaugeDefault extends StatefulWidget {
+ final SubItemList sample;
+ const RadialGaugeDefault(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialGaugeDefaultState createState() => _RadialGaugeDefaultState(sample);
+}
+
+class _RadialGaugeDefaultState extends State {
+ final SubItemList sample;
+ _RadialGaugeDefaultState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialGaugeDefault oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/axis_feature/default_gauge_view.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getDefaultRadialGauge(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getDefaultRadialGauge(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis( interval: 10, axisLineStyle: AxisLineStyle(thickness: 0.03,
+ thicknessUnit: GaugeSizeUnit.factor,
+ ), showTicks: false,
+ axisLabelStyle: GaugeTextStyle(fontSize: isTileView ? 12 : 14, ), labelOffset: 25,
+ radiusFactor: 0.95,
+ pointers: [NeedlePointer(needleLength: 0.7, value: 70,
+ lengthUnit: GaugeSizeUnit.factor, needleColor: _needleColor,
+ needleStartWidth: 0, needleEndWidth: isTileView ? 3 : 4,
+ knobStyle: KnobStyle( sizeUnit: GaugeSizeUnit.factor,
+ color: _needleColor,
+ knobRadius: 0.05)),
+ ]
+ )
+ ],
+ );
+}
+
+Color _needleColor = const Color(0xFFC06C84);
+
diff --git a/lib/samples/gauge/axis_feature/multiple_axis.dart b/lib/samples/gauge/axis_feature/multiple_axis.dart
new file mode 100644
index 00000000..d96a3b0c
--- /dev/null
+++ b/lib/samples/gauge/axis_feature/multiple_axis.dart
@@ -0,0 +1,246 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class MultipleAxisExample extends StatefulWidget {
+ final SubItemList sample;
+ const MultipleAxisExample(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _MultipleAxisExampleState createState() => _MultipleAxisExampleState(sample);
+}
+
+class _MultipleAxisExampleState extends State {
+ final SubItemList sample;
+ _MultipleAxisExampleState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(MultipleAxisExample oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/axis_feature/multiple_axis.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ setState((){
+ _radius = MediaQuery.of(context).orientation == Orientation.portrait ? 0.6 : 0.5;
+ });
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getMultipleAxisGauge(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getMultipleAxisGauge(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+
+ RadialAxis(minimum: 32 , maximum: 212, interval: 36,
+ radiusFactor: isTileView ? 0.5 :_radius, labelOffset: 15, needsRotateLabels: true,
+ minorTickStyle: MinorTickStyle(color: Color(0xFF00A8B5), thickness: 1.5,
+ lengthUnit: GaugeSizeUnit.factor,
+ length: 0.07),
+ majorTickStyle: MajorTickStyle(color: Color(0xFF00A8B5), thickness: 1.5,
+ lengthUnit: GaugeSizeUnit.factor,
+ length: 0.15),
+ axisLineStyle: AxisLineStyle(color:Color(0xFF00A8B5), thickness: 3, ),
+ axisLabelStyle: GaugeTextStyle(color: Color(0xFF00A8B5), fontSize: 12),
+
+ ),
+ RadialAxis(minimum: 0 , maximum: 100, interval: 10,
+ ticksPosition: ElementsPosition.outside,
+ labelsPosition: ElementsPosition.outside,
+
+ minorTicksPerInterval: 5,
+ radiusFactor: 0.95, labelOffset: 15,
+ minorTickStyle: MinorTickStyle( thickness: 1.5,
+ length: 0.07, lengthUnit: GaugeSizeUnit.factor),
+ majorTickStyle: MinorTickStyle(thickness: 1.5,
+ length: 0.15, lengthUnit: GaugeSizeUnit.factor,),
+ axisLineStyle: AxisLineStyle( thickness: 3, ),
+ axisLabelStyle: GaugeTextStyle(fontSize: 12),
+ annotations: [
+ GaugeAnnotation(angle: 90, positionFactor: 1,
+ widget: Row(children: [Container(child: Text('33°C :', style: TextStyle(fontSize: 12,
+ fontWeight: FontWeight.bold, fontFamily: 'Times'),)),
+ Container(child: Text(' 91.4°F', style: TextStyle(fontSize: 12,
+ color: Color(0xFF00A8B5), fontWeight: FontWeight.bold, fontFamily: 'Times'),))],)
+ )
+ ],
+ pointers: [NeedlePointer(needleLength: 0.68,
+ lengthUnit: GaugeSizeUnit.factor,
+ needleStartWidth: 0, needleEndWidth: 3, value: 33,
+ enableAnimation: true,
+ knobStyle: KnobStyle(knobRadius: 6.5,
+ sizeUnit: GaugeSizeUnit.logicalPixel
+ ),)]
+ ),
+ ]
+ );
+}
+
+double _radius = 0.6;
+
+
+
+
+
diff --git a/lib/samples/gauge/axis_feature/non_linearlabel.dart b/lib/samples/gauge/axis_feature/non_linearlabel.dart
new file mode 100644
index 00000000..99af6050
--- /dev/null
+++ b/lib/samples/gauge/axis_feature/non_linearlabel.dart
@@ -0,0 +1,318 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialNonLinearLabel extends StatefulWidget {
+ final SubItemList sample;
+ const RadialNonLinearLabel (this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialNonLinearLabelState createState() => _RadialNonLinearLabelState(sample);
+}
+
+class _RadialNonLinearLabelState extends State {
+ final SubItemList sample;
+ _RadialNonLinearLabelState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialNonLinearLabel oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/axis_feature/non_linearlabel.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ setState((){
+ _radius = MediaQuery.of(context).orientation == Orientation.portrait ? 0.06 : 0.1;
+ });
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialNonLinearLabel(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialNonLinearLabel(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ CustomAxis(labelOffset: 15,
+ axisLineStyle: AxisLineStyle(
+ thicknessUnit: GaugeSizeUnit.factor,
+ thickness: 0.15
+ ),
+ radiusFactor: 0.9, minimum: 0,
+ showTicks: false, maximum: 150,
+ axisLabelStyle: GaugeTextStyle(
+ fontSize: 12),
+ pointers: [NeedlePointer(enableAnimation: true,
+ animationType: AnimationType.easeOutBack,
+ value: 60,
+ lengthUnit: GaugeSizeUnit.factor, animationDuration: 1300,
+ needleStartWidth: 0, needleEndWidth: isTileView ? 5 : 7, needleLength: 0.8,
+ tailStyle: TailStyle(width: isTileView ? 5 : 7, lengthUnit: GaugeSizeUnit.logicalPixel,
+ length: 23, ),
+ knobStyle: KnobStyle(knobRadius: isTileView ? 0.07 : _radius,
+ sizeUnit: GaugeSizeUnit.factor,),
+ ), RangePointer(value: 60, width: 0.15,
+ sizeUnit: GaugeSizeUnit.factor,
+ color: _pointerColor, animationDuration: 1300,
+ animationType: AnimationType.easeOutBack,
+ enableAnimation: true)]
+ )
+ ],
+ );
+}
+
+Color _pointerColor = const Color(0xFF494CA2);
+double _radius = 0.06;
+
+class CustomAxis extends RadialAxis{
+ CustomAxis({
+ double radiusFactor = 1,
+ double centerX = 0.5,
+ List pointers,
+ GaugeTextStyle axisLabelStyle,
+ AxisLineStyle axisLineStyle,
+ double minimum,
+ double maximum,
+ bool showTicks,
+ double labelOffset,}) :super(
+ pointers: pointers ?? [],
+ minimum: minimum ,
+ maximum: maximum ,
+ showTicks: showTicks ?? true,
+ labelOffset: labelOffset ?? 20,
+ axisLabelStyle: axisLabelStyle ?? GaugeTextStyle(color: Colors.black,
+ fontSize: 15.0,
+ fontFamily: 'Segoe UI',
+ fontStyle: FontStyle.normal,
+ fontWeight: FontWeight.normal),
+ axisLineStyle: axisLineStyle ?? AxisLineStyle(
+ color: Colors.grey,
+ thickness: 10,),
+ radiusFactor: radiusFactor,
+ );
+
+ @override
+ List generateVisibleLabels(){
+ final List _visibleLabels = [];
+ for (num i = 0; i < 9; i++) {
+ double _value = _calculateLabelValue(i);
+ final CircularAxisLabel label =
+ CircularAxisLabel(axisLabelStyle, _value.toInt().toString(), i, false);
+ label.value = _value;
+ _visibleLabels.add(label);
+ }
+
+ return _visibleLabels;
+ }
+
+ @override
+ double valueToFactor(double value)
+ {
+ if(value >= 0 && value <=2){
+ return (value * 0.125)/2;
+ }else if(value > 2 && value <=5){
+ return (((value - 2) * 0.125)/(5 - 2)) + (1 * 0.125);
+ }else if(value > 5 && value <=10){
+ return (((value - 5) * 0.125)/(10 - 5)) + (2 * 0.125);
+ }else if(value > 10 && value <=20){
+ return (((value - 10) * 0.125)/(20 - 10)) + (3 * 0.125);
+ }else if(value > 20 && value <=30){
+ return (((value - 20) * 0.125)/(30 - 20)) + (4 * 0.125);
+ }else if(value > 30 && value <=50){
+ return (((value - 30) * 0.125)/(50 - 30)) + (5 * 0.125);
+ }else if(value > 50 && value <=100){
+ return (((value - 50) * 0.125)/(100 - 50)) + (6 * 0.125);
+ }else if(value > 100 && value <=150){
+ return (((value - 100) * 0.125)/(150 - 100)) + (7 * 0.125);
+ }else{
+ return 1;
+ }
+ }
+
+
+ /// To return the label value based on interval
+ double _calculateLabelValue(num value){
+ if(value == 0){
+ return 0;
+ }else if(value == 1){
+ return 2;
+ }else if(value == 2){
+ return 5;
+ }else if(value == 3){
+ return 10;
+ }else if(value == 4){
+ return 20;
+ }else if(value == 5){
+ return 30;
+ }else if(value == 6){
+ return 50;
+ }else if(value == 7){
+ return 100;
+ }else{
+ return 150;
+ }
+ }
+
+}
+
+
+
diff --git a/lib/samples/gauge/axis_feature/radiallabel_customization.dart b/lib/samples/gauge/axis_feature/radiallabel_customization.dart
new file mode 100644
index 00000000..9545d76c
--- /dev/null
+++ b/lib/samples/gauge/axis_feature/radiallabel_customization.dart
@@ -0,0 +1,224 @@
+import 'package:syncfusion_flutter_gauges/gauges.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_examples/model/model.dart';
+import 'package:flutter_examples/widgets/flutter_backdrop.dart';
+import 'package:scoped_model/scoped_model.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class RadialLabelCustomization extends StatefulWidget {
+ final SubItemList sample;
+ const RadialLabelCustomization(this.sample, {Key key}) : super(key: key);
+
+ @override
+ _RadialLabelCustomizationState createState() => _RadialLabelCustomizationState(sample);
+}
+
+class _RadialLabelCustomizationState extends State {
+ final SubItemList sample;
+ _RadialLabelCustomizationState(this.sample);
+ bool panelOpen;
+ final frontPanelVisible = ValueNotifier(true);
+
+ @override
+ void initState() {
+ panelOpen = frontPanelVisible.value;
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ super.initState();
+ }
+
+ void _subscribeToValueNotifier() => panelOpen = frontPanelVisible.value;
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ void didUpdateWidget(RadialLabelCustomization oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ frontPanelVisible.removeListener(_subscribeToValueNotifier);
+ frontPanelVisible.addListener(_subscribeToValueNotifier);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ builder: (context, _, model) => SafeArea(
+ child: Backdrop(
+ needCloseButton: false,
+ panelVisible: frontPanelVisible,
+ sampleListModel: model,
+ frontPanelOpenPercentage: 0.28,
+ toggleFrontLayer: false,
+ appBarAnimatedLeadingMenuIcon: AnimatedIcons.close_menu,
+ appBarActions: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ height: 40,
+ width: 40,
+ child: IconButton(
+ icon: Image.asset(model.codeViewerIcon,
+ color: Colors.white),
+ onPressed: () {
+ launch(
+ 'https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/gauge/axis_feature/radiallabel_customization.dart');
+ },
+ ),
+ ),
+ ),
+ ],
+ appBarTitle: AnimatedSwitcher(
+ duration: Duration(milliseconds: 1000),
+ child: Text(sample.title.toString())),
+ backLayer: BackPanel(sample),
+ frontLayer: FrontPanel(sample),
+ sideDrawer: null,
+ headerClosingHeight: 350,
+ titleVisibleOnPanelClosed: true,
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(12), bottom: Radius.circular(0)),
+ ),
+ ));
+ }
+}
+
+class FrontPanel extends StatefulWidget {
+ final SubItemList subItemList;
+ FrontPanel(this.subItemList);
+
+ @override
+ _FrontPanelState createState() => _FrontPanelState(this.subItemList);
+}
+
+class _FrontPanelState extends State {
+ final SubItemList sample;
+ _FrontPanelState(this.sample);
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Scaffold(
+ backgroundColor: model.cardThemeColor,
+ body: Padding(
+ padding: const EdgeInsets.fromLTRB(5, 0, 5, 50),
+ child: Container(child: getRadialLabelCustomization(false)),
+ ));
+ });
+ }
+}
+
+class BackPanel extends StatefulWidget {
+ final SubItemList sample;
+
+ BackPanel(this.sample);
+
+ @override
+ _BackPanelState createState() => _BackPanelState(sample);
+}
+
+class _BackPanelState extends State {
+ final SubItemList sample;
+ GlobalKey _globalKey = GlobalKey();
+ _BackPanelState(this.sample);
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
+ super.initState();
+ }
+
+ _afterLayout(_) {
+ _getSizesAndPosition();
+ }
+
+ _getSizesAndPosition() {
+ final RenderBox renderBoxRed = _globalKey.currentContext.findRenderObject();
+ final size = renderBoxRed.size;
+ final position = renderBoxRed.localToGlobal(Offset.zero);
+ double appbarHeight = 60;
+ BackdropState.frontPanelHeight =
+ position.dy + (size.height - appbarHeight) + 20;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return ScopedModelDescendant(
+ rebuildOnChange: true,
+ builder: (context, _, model) {
+ return Container(
+ color: model.backgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ sample.title,
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 28.0,
+ color: Colors.white,
+ letterSpacing: 0.53),
+ ),
+ Padding(
+ key: _globalKey,
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
+ child: Text(
+ sample.description,
+ style: const TextStyle(
+ fontWeight: FontWeight.normal,
+ fontSize: 15.0,
+ color: Colors.white,
+ letterSpacing: 0.3,
+ height: 1.5),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
+
+SfRadialGauge getRadialLabelCustomization(bool isTileView) {
+ return SfRadialGauge(
+ axes: [
+ RadialAxis(startAngle: 180, endAngle: 360,
+ centerY: 0.7, interval: 10, radiusFactor: 0.95,
+ labelFormat: '{value}%',
+ labelsPosition: ElementsPosition.outside,
+ ticksPosition: ElementsPosition.inside,
+ labelOffset: 15,
+ minorTickStyle: MinorTickStyle(length: 0.05,
+ lengthUnit: GaugeSizeUnit.factor,
+ thickness: 1.5),
+ majorTickStyle: MajorTickStyle(length: 0.1,
+ lengthUnit: GaugeSizeUnit.factor,
+ thickness: 1.5),
+ minorTicksPerInterval: 5,
+ pointers: