import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.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 BmrResultPage extends StatelessWidget {
  final double bmrResult;
  final double calories;
  BmrResultPage({this.bmrResult, this.calories});
  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowAppBar: true,
      isShowDecPage: false,
      appBarTitle: 'BMR Calculator',
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Center(
            child: CircularPercentIndicator(
              radius: 220.0,
              lineWidth: 20.0,
              percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500),
              center: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    bmrResult.toStringAsFixed(1),
                    style: TextStyle(
                      fontSize: 18.0,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  SizedBox(
                    height: 5.0,
                  ),
                  Text(
                    'Calories/Day',
                    style: TextStyle(
                      fontSize: 16.0,
                      fontWeight: FontWeight.w600,
                    ),
                  ),
                ],
              ),
              progressColor: Color(0xff3C3939),
            ),
          ),
          Container(
            height: 120,
            width: 280.0,
            child: Texts(
                'This means the body will burn ( ${bmrResult.toStringAsFixed(1)} ) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is ( ${calories.toStringAsFixed(1)} ) calories, to maintain the current weight.'),
          ),
          Container(
            width: 350,
            child: Button(
                label: 'See List Of Doctors',
                onTap: () {
                  Navigator.push(
                    context,
                    FadePage(page: DoctorList()),
                  );
                }),
          ),
        ],
      ),
    );
  }
}
