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 'dart:math';

class IdealBodyResult extends StatelessWidget {
  final double idealBodyWeight;
  final double minRange;
  final double mixRange;
  final double overWeightBy;
  final String textResult;

  IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult});
  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowAppBar: true,
      appBarTitle: 'Ideal Body Weight',
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Texts(
            'Ideal weight range is',
            fontSize: 23.0,
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              Row(
                children: [
                  Texts(
                    minRange.toStringAsFixed(1),
                    fontSize: 30.0,
                  ),
                  Padding(
                    padding: EdgeInsets.only(top: 8.0, left: 4.0),
                    child: Text(
                      'Kg',
                      style: TextStyle(color: Colors.red),
                    ),
                  ),
                ],
              ),
              Icon(
                Icons.arrow_forward,
                color: Colors.red,
                size: 55.0,
              ),
              Row(
                children: [
                  Texts(
                    mixRange.toStringAsFixed(1),
                    fontSize: 30.0,
                  ),
                  Padding(
                    padding: EdgeInsets.only(top: 8.0, left: 4.0),
                    child: Text(
                      'Kg',
                      style: TextStyle(color: Colors.red),
                    ),
                  ),
                ],
              ),
            ],
          ),
          overWeightBy >= 0 && overWeightBy <= 10
              ? Column(
                  children: [
                    Texts(
                      'Congratulations! The current weight is\n perfect and considered healthy',
                      fontSize: 20.0,
                    ),
                  ],
                )
              : overWeightBy > 10 && overWeightBy < 17
                  ? Column(
                      children: [
                        Texts('This means that the weight is a little bit more than ideal weight by'),
                        Texts(overWeightBy.toStringAsFixed(1)),
                        Texts(
                            'May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
                      ],
                    )
                  : overWeightBy >= 18
                      ? Container(
                          height: 250.0,
                          width: 350,
                          child: Column(
                            children: [
                              Texts(
                                'Means that you suffer from excessive\n obesity by',
                              ),
                              SizedBox(
                                height: 55.0,
                              ),
                              Texts(
                                overWeightBy.toStringAsFixed(1),
                                fontSize: 40.0,
                              ),
                              SizedBox(
                                height: 25.0,
                              ),
                              Texts(
                                  'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
                            ],
                          ),
                        )
                      : overWeightBy < -18
                          ? Column(
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Padding(
                                  padding: const EdgeInsets.all(8.0),
                                  child: Texts(
                                    'Under Weight',
                                    fontSize: 18.0,
                                  ),
                                ),
                                SizedBox(
                                  height: 55.0,
                                ),
                                Texts(
                                  overWeightBy.toStringAsFixed(1),
                                  fontSize: 20.0,
                                ),
                              ],
                            )
                          : Container(
                              height: 250.0,
                              width: 350.0,
                              child: Column(
                                children: [
                                  Texts(
                                    'under wheight',
                                    fontSize: 20.0,
                                  ),
                                  SizedBox(
                                    height: 55.0,
                                  ),
                                  Texts(
                                    overWeightBy.toStringAsFixed(1),
                                    fontSize: 20.0,
                                  ),
                                  SizedBox(
                                    height: 25.0,
                                  ),
                                  Texts(
                                      'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
                                ],
                              ),
                            ),
          Container(
            width: 350,
            child: Button(
              label: 'See List Of Doctors',
              onTap: () {
                Navigator.push(
                  context,
                  FadePage(page: DoctorList()),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
