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';

import 'package:flutter/painting.dart';

class CarbsResult extends StatelessWidget {
  double pCal;
  double cCal;
  double fCal;
  double pCalGram;
  double cCalGram;
  double fCalGram;
  double pCalMeal;
  double cCalMeal;
  double fCalMeal;

  CarbsResult(
      {this.pCal,
      this.cCal,
      this.fCal,
      this.pCalGram,
      this.cCalGram,
      this.fCalGram,
      this.fCalMeal,
      this.cCalMeal,
      this.pCalMeal});
  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowAppBar: true,
      appBarTitle: 'Carb Protein Fat',
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Padding(
            padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0),
            child: Table(
              border: TableBorder(
                verticalInside: BorderSide(width: 1, color: Colors.black54),
                bottom: BorderSide(width: 1, color: Colors.black54),
                left: BorderSide(width: 1, color: Colors.black54),
                right: BorderSide(width: 1, color: Colors.black54),
                top: BorderSide(width: 1, color: Colors.black54),
              ),
              children: [
                TableRow(
                    decoration: BoxDecoration(
                      color: Colors.white,
                    ),
                    children: [
                      TableCell(
                        child: Center(
                          child: Texts('Description'),
                        ),
                      ),
                      TableCell(
                        child: Center(
                          child: Texts('Protein'),
                        ),
                      ),
                      TableCell(
                        child: Center(
                          child: Texts(
                            'Carbohydrate',
                          ),
                        ),
                      ),
                      TableCell(
                        child: Center(
                          child: Texts('Fat'),
                        ),
                      ),
                    ]),
                TableRow(children: [
                  Padding(
                    padding: EdgeInsets.all(8.0),
                    child: TableCell(
                      child: Center(
                        child: Texts('Calories\n Per Day'),
                      ),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(pCal.ceil().toString() + '  Cals'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(cCal.ceil().toString() + '  Cals'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(fCal.ceil().toString() + '  Cals'),
                    ),
                  ),
                ]),
                TableRow(children: [
                  Padding(
                    padding: EdgeInsets.all(8.0),
                    child: TableCell(
                      child: Center(
                        child: Texts('Grams Per\n    Day'),
                      ),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(pCalGram.ceil().toString() + ' gr'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(cCalGram.ceil().toString() + ' gr'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(fCalGram.ceil().toString() + ' gr'),
                    ),
                  ),
                ]),
                TableRow(children: [
                  Padding(
                    padding: EdgeInsets.all(8.0),
                    child: TableCell(
                      child: Center(
                        child: Texts('Grams Per\n    Meal'),
                      ),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(pCalMeal.ceil().toString() + ' gr'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(cCalMeal.ceil().toString() + ' gr'),
                    ),
                  ),
                  TableCell(
                    child: Center(
                      child: Texts(fCalMeal.ceil().toString() + ' gr'),
                    ),
                  ),
                ]),
              ],
            ),
          ),
          Container(
            width: 350,
            child: Button(
              label: 'See List Of Doctors',
              onTap: () {
                Navigator.push(
                  context,
                  FadePage(page: DoctorList()),
                );
              },
            ),
          ),
        ],
      ),

      // Texts(pCal.ceil().toString()),
      // Texts(cCal.ceil().toString()),
      // Texts(fCal.ceil().toString()),
      // Texts(pCalGram.ceil().toString()),
      // Texts(cCalGram.ceil().toString()),
      // Texts(fCalGram.ceil().toString()),
      // Texts(pCalMeal.ceil().toString()),
      // Texts(cCalMeal.ceil().toString()),
      // Texts(fCalMeal.ceil().toString()),
    );
  }
}
