KonectarEvents/lib/contacts_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart

293 lines
11 KiB
Dart
Raw Normal View History

2024-10-08 12:01:59 +00:00
// import 'package:konectar_events/custom_widget/text.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_Certificate_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_aff_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_awards_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_education_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_email_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_event_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_location_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_pno_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_training_k2.dart';
// import 'package:konectar_events/storage_hive/email_data/email_model_hive.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_awards_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_education_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_email_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_location_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_training_k2.dart';
import 'package:flutter/material.dart';
class bsheetk2 extends StatefulWidget {
bsheetk2(this.selectedLocation, {super.key});
final selectedLocation;
@override
State<bsheetk2> createState() => _bsheetk2State();
}
class _bsheetk2State extends State<bsheetk2> {
@override
Widget build(BuildContext context) {
return DraggableScrollableSheet(
expand: false,
builder: (BuildContext context, ScrollController scrollController) {
return Container(
width: MediaQuery.of(context).size.width,
//color: Color.fromARGB(255, 246, 248, 252),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(0)),
child: Column(
children: [
Expanded(
child: ListView.builder(
controller: scrollController,
itemCount: 1,
itemBuilder: (BuildContext context, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
getPostalCodeText(widget.selectedLocation),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Text1(
// title: (widget.selectedLocation is Data)
// ? "PostalCode \n${widget.selectedLocation.postalCode}"
// : (widget.selectedLocation is DataPhno)
// ? "phoneTypeName \n${(widget.selectedLocation as DataPhno).phoneTypeName}"
// : (widget.selectedLocation is EmailData)
// ? "PhoneNo1 \n${(widget.selectedLocation as EmailData).emailTypeName}"
// : ""),
// ),
],
);
}),
),
],
),
);
},
);
}
getPostalCodeText(location) {
if (location is Data) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Address \n${location.address1}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "PostalCode \n${location.postalCode}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(
title: "Organization Name \n${location.organizationName}"),
),
],
);
} else if (location is DataPhno) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Phone Type \n${location.phoneTypeName}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Phone Number \n${location.number}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(
title: "Organization Name \n${location.organizationName}"),
),
],
);
} else if (location is EmailData) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Email Type \n${location.emailTypeName}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Email \n${location.email}"),
),
],
);
} else if (location is TrainingList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Institution \n${location.organizationId}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Degree \n${location.degree}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Specialty \n${location.specialty}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "StartDate \n${location.startDate}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "EndDate \n${location.endDate}"),
),
],
);
} else if (location is EducationList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Institution \n${location.organizationId}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Degree \n${location.degree}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Specialty \n${location.specialty}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "StartDate \n${location.startDate}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "EndDate \n${location.endDate}"),
),
],
);
} else if (location is AwardsList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Name \n${location.name}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Start Date \n${location.startDate}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "End Date \n${location.endDate}"),
),
],
);
} else if (location is CertificateList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Name \n${location.organizationId}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Specialty \n${location.specialty}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Start Date \n${location.startDate}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "End Date \n${location.endDate}"),
),
],
);
} else if (location is AffList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Title \n${location.title}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Role \n${location.role}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Start Year \n${location.startYear}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "End Year \n${location.endYear}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Start Year \n${location.startYear}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(
title: "Organization Name \n${location.kolOrganizationName}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(
title: "Organization Type \n${location.kolOrganizationType}"),
),
],
);
} else if (location is EventList) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Name \n${location.name}"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text1(title: "Notes \n${location.notes}"),
),
],
);
}
}
}