GeekyAnts / GeekyAnts/GaugesFlutter

Changing start/end of gauges does not cause re-render

Open
#249 1 comment 0 reactions 1 assignee Claimed by @Afroz-Shaikh View on GitHub
bug has reproducible steps
Dominant language
Dart
Stars
78
Forks
24
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Changing start/end of a gauge does not cause a re-render, but changing a Pointer value does. I filed this under bug report as I would expect this to be out of the box behavior, but it can also suffice as a feature request.

**To Reproduce**
See reproducible code.

**Expected behavior**
When the start or end values are changed, the gauge is expected to respect these values and re-render.

**Screenshots**
N/A

**Desktop (please complete the following information):**
- OS: Windows 10 22H2
- Browser: N/A, tested on Flutter Desktop
- Version: N/A

**Additional context**
Reproducible code:
```dart
import 'package:flutter/material.dart';
import 'package:geekyants_flutter_gauges/geekyants_flutter_gauges.dart';

void main() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
home: LinearGaugeExample(),
),
);
}

///
/// The following code is a Simple Example of [LinearGauge] Widget.
/// You can customize the [LinearGauge] Widget as per your need.
///
class LinearGaugeExample extends StatefulWidget {
const LinearGaugeExample({Key? key}) : super(key: key);

@override
State createState() => _LinearGaugeExampleState();
}

class _LinearGaugeExampleState extends State {
double startVal = 0.0;

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: [
LinearGauge(
start: startVal,
gaugeOrientation: GaugeOrientation.horizontal,
enableGaugeAnimation: true,
rulers: RulerStyle(
rulerPosition: RulerPosition.bottom,
),
pointers: const [
Pointer(
value: 50,
shape: PointerShape.circle,
),
],
),
TextButton(
onPressed: () {
setState(() {
if (startVal == 0.0) {
startVal = 5.0;
} else {
startVal = 0.0;
}
});
},
child: const Text('Toggle Start'))
],
),
),
);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.