import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ReportListWidget extends StatelessWidget {
  final List<Reports> reportList;

  ReportListWidget({@required this.reportList});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView.builder(
        itemBuilder: (context, index) => Padding(
          padding: const EdgeInsets.all(8.0),
          child: Container(
            width: double.infinity,margin: EdgeInsets.only(left: 8,right: 8,top: 3),
            decoration: BoxDecoration(
                color: Colors.white,
                border: Border.all(color: Colors.white, width: 2),
                shape: BoxShape.rectangle,
                borderRadius: BorderRadius.all(
                  Radius.circular(8.0),
                )),
            child: Row(
              children: <Widget>[
                Expanded(
                  flex: 1,
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: LargeAvatar(
                      name: reportList[index].doctorName,
                      url: reportList[index].doctorImageURL,
                    ),
                  ),
                ),
                Expanded(
                  flex: 4,
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        SizedBox(height: 12,),
                        Texts(reportList[index].projectName),
                        Texts(reportList[index].clinicDescription),
                        Texts('invoice No: ${reportList[index].invoiceNo}'),
                        SizedBox(height: 12,),

                      ],
                    ),
                  ),
                )
              ],
            ),
          ),
        ),
        itemCount: reportList.length,
      ),
    );
  }
}
