
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';

import 'Lab_Result_details_wideget.dart';
import 'LineChartCurved.dart';


class LabResultChartAndDetails extends StatelessWidget {
  LabResultChartAndDetails({
    Key key,
    @required this.labResult,
    @required this.name,
  }) : super(key: key);

  final List<LabOrderResult> labResult;
  final String name;


  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(10.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(
            margin: EdgeInsets.symmetric(horizontal: 8),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(12)
            ),
            child: LineChartCurved(title: name,labResult:labResult,),
          ),
          Container(
            margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
            padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(12)
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                AppText(
                  "Graph Details",
                  fontSize: SizeConfig.textMultiplier * 2.1,
                  fontWeight: FontWeight.bold,
                  fontFamily: 'Poppins',
                ),
                SizedBox(height: 8,),
                LabResultDetailsWidget(
                  labResult: labResult.reversed.toList(),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

}
