import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';

import 'lab_result_chart_and_detials.dart';

class FlowChartPage extends StatelessWidget {
  final PatientLabOrders patientLabOrder;
  final String filterName;

  FlowChartPage({this.patientLabOrder, this.filterName});

  @override
  Widget build(BuildContext context) {
    return BaseView<LabsViewModel>(
      onModelReady: (model) => model.getPatientLabOrdersResults(
          patientLabOrder: patientLabOrder, procedure: filterName),
      builder: (context, model, w) => AppScaffold(
        isShowAppBar: true,
        appBarTitle: filterName,
        baseViewModel: model,
        body: SingleChildScrollView(
          child: model. labOrdersResultsList.isNotEmpty
              ? Container(
                  child: LabResultChartAndDetails(
                    name: filterName,
                    labResult: model.labOrdersResultsList,
                  ),
                )
              : Center(
                child: Container(
                    padding: EdgeInsets.only(top: MediaQuery.of(context).size.height *0.42),
                    child: Center(
                      child: Texts('No Data'),
                    ),
                  ),
              ),
        ),
      ),
    );
  }
}
