import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart';
import 'package:flutter/material.dart';

class LiveCareLogs extends StatefulWidget {
  List<ErRequestHistoryList> erRequestHistoryList;

  LiveCareLogs({@required this.erRequestHistoryList});

  @override
  _LiveCareLogsState createState() => _LiveCareLogsState();
}

class _LiveCareLogsState extends State<LiveCareLogs> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Container(
        child: ListView.builder(
          scrollDirection: Axis.vertical,
          shrinkWrap: true,
          physics: ScrollPhysics(),
          padding: EdgeInsets.all(0.0),
          itemCount: widget.erRequestHistoryList.length,
          itemBuilder: (context, index) {
            return widget.erRequestHistoryList[index].callStatus < 4
                ? Container()
                :  LiveCareHistoryCard(
                    erRequestHistoryList: widget.erRequestHistoryList[index]);
          },
        ),
      ),
    );
  }
}
