import 'package:flutter/material.dart';
import 'package:flyinsono/lab/pages/lab_project/controller.dart';
import 'package:flyinsono/lab/pages/lab_project/widgets/project_member_item.dart';
import 'package:get/get.dart';

class LookProjectMemberDialog extends GetView<LabProjectController> {
  const LookProjectMemberDialog({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 450,
      child: ListView(
        children: [
          Container(
            alignment: controller.selectMemberModelList.length < 5
                ? Alignment.centerLeft
                : Alignment.center,
            padding: EdgeInsets.only(
              left: controller.selectMemberModelList.length < 5 ? 16 : 0,
            ),
            child: GetBuilder<LabProjectController>(
                id: LabProjectController.projectMember,
                builder: (context) {
                  return Wrap(
                    children: controller.selectMemberModelList
                        .map(
                          (e) => ProjectMemberItem(
                            member: e,
                            onChangeSelectMember: (MemberModel member) {
                              // controller.onChangeMember(member);
                            },
                            isSelected: false,
                          ),
                        )
                        .toList(),
                  );
                }),
          ),
        ],
      ),
    );
  }
}
