mirrored_repositories/university_app/lib/widgets/homepage/components/components
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class GradeBook extends StatelessWidget {
  final double gpa;

  const GradeBook(this.gpa, {super.key});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10),
      margin: const EdgeInsets.only(left: 10, right: 5),
      constraints: BoxConstraints.expand(
        height: MediaQuery.of(context).size.height * 0.24,
        width: MediaQuery.of(context).size.width * 0.48,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(20),
        color: Colors.yellow,
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: const [
              Text(
                'GradeBook',
                style: TextStyle(
                  fontSize: 18,
                  fontWeight: FontWeight.bold,
                ),
              ),
              Icon(Icons.charging_station),
            ],
          ),
          Expanded(
            // height: MediaQuery.of(context).size.height * 0.17,
            child: SfRadialGauge(
              enableLoadingAnimation: true,
              axes: <RadialAxis>[
                RadialAxis(
                  showLabels: false,
                  showTicks: false,
                  // showLastLabel: true,
                  // showFirstLabel: true,
                  // maximumLabels: 0,
                  minimum: 0.0,
                  maximum: 4.0,
                  canScaleToFit: true,
                  // offsetUnit: GaugeSizeUnit.factor,
                  pointers: <GaugePointer>[
                    // WidgetPointer(
                    //   enableAnimation: true,
                    //   value: 3.55,
                    //   child: Image(image: AssetImage(''))
                    // )
                  ],
                  ranges: <GaugeRange>[
                    GaugeRange(
                      startValue: 0,
                      endValue: gpa,
                      color: Colors.blue,
                    ),
                  ],
                  annotations: <GaugeAnnotation>[
                    GaugeAnnotation(
                      verticalAlignment: GaugeAlignment.center,
                      widget: Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text(
                            '$gpa',
                            style: const TextStyle(
                              fontSize: 20,
                              fontWeight: FontWeight.bold,
                              color: Colors.blue,
                            ),
                          ),
                          const Text(
                            'GPA',
                            style: TextStyle(
                              fontSize: 16,
                              fontWeight: FontWeight.bold,
                              color: Colors.blue,
                            ),
                          ),
                        ],
                      ),
                      angle: 90,
                    ),
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
