-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #239 from Afroz-Shaikh/fix-transform
[FEAT]: Interactivity for Needle & Shape Pointer
- Loading branch information
Showing
274 changed files
with
1,296 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,85 @@ | ||
import 'package:example/valuebar_position.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:geekyants_flutter_gauges/geekyants_flutter_gauges.dart'; | ||
|
||
void main() { | ||
runApp( | ||
const MaterialApp( | ||
debugShowCheckedModeBanner: false, | ||
home: MyValueBarPosition(), | ||
home: RadialGaugeExample(), | ||
), | ||
); | ||
} | ||
|
||
class MyGaugeExample extends StatefulWidget { | ||
const MyGaugeExample({Key? key}) : super(key: key); | ||
/// | ||
/// 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<MyGaugeExample> createState() => _MyGaugeExampleState(); | ||
State<LinearGaugeExample> createState() => _LinearGaugeExampleState(); | ||
} | ||
|
||
class _MyGaugeExampleState extends State<MyGaugeExample> { | ||
double value = 50; | ||
bool inverseRulers = false; | ||
|
||
class _LinearGaugeExampleState extends State<LinearGaugeExample> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
ElevatedButton( | ||
onPressed: () { | ||
inverseRulers = !inverseRulers; | ||
setState(() {}); | ||
}, | ||
child: const Text("Inverse Rulers")), | ||
Container( | ||
color: Colors.pink.withOpacity(0.1), | ||
child: LinearGauge( | ||
gaugeOrientation: GaugeOrientation.horizontal, | ||
valueBar: [ | ||
ValueBar( | ||
value: value, | ||
offset: 20, | ||
position: ValueBarPosition.top, | ||
) | ||
], | ||
enableGaugeAnimation: true, | ||
rulers: RulerStyle( | ||
rulerPosition: RulerPosition.bottom, | ||
inverseRulers: inverseRulers, | ||
showLabel: inverseRulers, | ||
), | ||
), | ||
child: LinearGauge( | ||
gaugeOrientation: GaugeOrientation.horizontal, | ||
enableGaugeAnimation: true, | ||
rulers: RulerStyle( | ||
rulerPosition: RulerPosition.bottom, | ||
), | ||
pointers: const [ | ||
Pointer( | ||
value: 50, | ||
shape: PointerShape.circle, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
/// | ||
/// The following code is a Simple Example of [RadialGauge] Widget. | ||
/// You can customize the [RadialGauge] Widget as per your need. | ||
/// | ||
class RadialGaugeExample extends StatefulWidget { | ||
const RadialGaugeExample({super.key}); | ||
|
||
@override | ||
State<RadialGaugeExample> createState() => _RadialGaugeExampleState(); | ||
} | ||
|
||
class _RadialGaugeExampleState extends State<RadialGaugeExample> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Scaffold( | ||
backgroundColor: Colors.white, | ||
body: RadialGauge( | ||
track: RadialTrack( | ||
color: Colors.grey, | ||
start: 0, | ||
end: 100, | ||
trackStyle: TrackStyle( | ||
showLastLabel: false, | ||
secondaryRulerColor: Colors.grey, | ||
secondaryRulerPerInterval: 3)), | ||
needlePointer: [ | ||
NeedlePointer( | ||
value: 30, | ||
color: Colors.red, | ||
tailColor: Colors.black, | ||
tailRadius: 0, | ||
needleStyle: NeedleStyle.flatNeedle, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.