import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/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;
  final PatiantInformtion patient;
  FlowChartPage({this.patientLabOrder, this.filterName, this.patient});

  @override
  Widget build(BuildContext context) {
    return BaseView<LabsViewModel>(
      onModelReady: (model) => model.getPatientLabOrdersResults(
          patientLabOrder: patientLabOrder, procedure: filterName,patient: patient),
      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,
                  ),
                )
              : Container(
                  child: Center(
                    child: Texts('no Data'),
                  ),
                ),
        ),
      ),
    );
  }
}
