import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class AvailableAppointmentsPage extends StatelessWidget {
  final List<AppoitmentAllHistoryResultList> appointmentsAllHistoryList;

  const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowAppBar: true,
      appBarTitle: 'Available Appointments',
      body: SingleChildScrollView(
        child: Container(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Texts('Available Appointments'),
              SizedBox(
                height: 12,
              ),
              ...List.generate(
                appointmentsAllHistoryList.length,
                (index) => InkWell(
                  onTap: (){
                    Navigator.pop(context, appointmentsAllHistoryList[index]);
                  },
                  child: AppointmentCard(appointment: appointmentsAllHistoryList[index],),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}


