import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';

class CalorieResultPage extends StatelessWidget {
  final double calorie;

  CalorieResultPage({this.calorie});

  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowDecPage: false,
      appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calculators}",
      isShowAppBar: true,
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Center(
            child: CircularPercentIndicator(
              radius: 220.0,
              lineWidth: 20.0,
              percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500),
              center: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    calorie.toStringAsFixed(1),
                    style: TextStyle(
                      fontSize: 18.0,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  SizedBox(
                    height: 5.0,
                  ),
                  Texts('Calories'),
                ],
              ),
              progressColor: Color(0xff3C3939),
              backgroundColor: Colors.white,
            ),
          ),
          Container(
            child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
          ),
          Container(
            width: 350,
            child: Button(
              label: 'See List Of Doctors',
              onTap: () {
                Navigator.push(
                  context,
                  FadePage(page: DoctorList()),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
