Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(color: Colors.blue, width: 2),
- ),
- child: SfRadialGauge(
- enableLoadingAnimation: false,
- axes: [
- ...List.generate(vendor.items.length, (index) {
- final el = vendor.items[index];
- final pointer = RangePointer(
- value: el.endValue - el.startValue + 1,
- color: el.color,
- cornerStyle: CornerStyle.bothCurve,
- width: 10,
- enableAnimation: false,
- );
- double sAngle = (el.startValue - vendor.bad.min) / ((vendor.buren.max - vendor.bad.min) + 40) * 180;
- double eAngle = pointer.value / ((vendor.buren.max - vendor.bad.min) + 40) * 180;
- return RadialAxis(
- axisLineStyle: const AxisLineStyle(cornerStyle: CornerStyle.endCurve),
- radiusFactor: 0.75,
- showAxisLine: false,
- showTicks: false,
- showLabels: false,
- startAngle: 180 + sAngle,
- endAngle: 180 + sAngle + eAngle,
- minimum: 0,
- maximum: pointer.value,
- showLastLabel: true,
- pointers: [pointer],
- );
- }).toList(),
- RadialAxis(
- axisLineStyle: const AxisLineStyle(cornerStyle: CornerStyle.endCurve),
- radiusFactor: 0.75,
- showAxisLine: false,
- showTicks: false,
- showLabels: false,
- startAngle: 180,
- endAngle: 360,
- minimum: vendor.bad.min,
- maximum: vendor.buren.max + 40,
- showLastLabel: true,
- pointers: [
- MarkerPointer(
- // value: provider.visibility ? point : 0,
- value: vendor.formattedPoint,
- markerType: MarkerType.circle,
- color: provider.visibility ? (vendor.scoreItem?.color != null ? Colors.white : Colors.transparent) : Colors.transparent,
- // borderColor: kTheme.primaryColor.withOpacity(0.6),
- borderColor: provider.visibility ? vendor.scoreItem?.color ?? Colors.transparent : Colors.transparent,
- borderWidth: 5,
- markerHeight: 18,
- markerWidth: 18,
- enableAnimation: true,
- ),
- ],
- annotations: [
- const GaugeAnnotation(
- widget: Padding(
- padding: EdgeInsets.only(top: 30),
- child: Text(
- '300',
- style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
- ),
- ),
- angle: 180,
- positionFactor: 1,
- ),
- const GaugeAnnotation(
- widget: Padding(
- padding: EdgeInsets.only(top: 30),
- child: Text(
- '999',
- style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
- ),
- ),
- angle: 360,
- positionFactor: 1,
- ),
- GaugeAnnotation(
- angle: 90,
- positionFactor: 0.0,
- verticalAlignment: GaugeAlignment.far,
- widget: Transform.translate(
- offset: const Offset(0, -10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Column(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Text(
- provider.visibility ? '${initialPoint.toInt()}' : '***',
- style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Color(0xff24272C)),
- ),
- const SizedBox(height: 8),
- Text(
- provider.visibility ? (vendor.scoreItem?.text ?? "") : "***",
- style: const TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- ],
- )
- ],
- ),
- ),
Advertisement
Add Comment
Please, Sign In to add comment