import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/other_information/non_acedimic_recognition.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
import 'package:unit2/widgets/add_leading.dart';
import 'package:unit2/widgets/empty_data.dart';

class NonAcademicRecognitionScreen extends StatelessWidget {
  final List<NonAcademicRecognition> nonAcademicRecognitions;
  const NonAcademicRecognitionScreen({super.key, required this.nonAcademicRecognitions});

  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      appBar: AppBar(title: const Text(nonAcademicRecTitle), centerTitle: true, backgroundColor: primary,actions: [AddLeading(onPressed: (){})],),
      body: nonAcademicRecognitions.isNotEmpty?ListView.builder(
         padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
        itemCount: nonAcademicRecognitions.length,
        itemBuilder: (BuildContext context, int index){
          String award = nonAcademicRecognitions[index].title!;
          String presenter = nonAcademicRecognitions[index].presenter!.name!;
          return Column(
            children: [
              Container(
                width: screenWidth,
                             decoration: box1(),
              padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
              child: Row(
                children: [
                  Expanded(child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                            crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                    Text(award,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
                  const Divider(),
                    Text(presenter),
                  ],)),

                                    IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
                ],
              ),
              ),
              const SizedBox(height: 5,),
            ],
          );
      }): const EmptyData(message: "You don't have any Non Academic Recognition added. Please click + to add"),
    );
  }
}