diff --git a/.metadata b/.metadata index bf1f529..ef08f7a 100644 --- a/.metadata +++ b/.metadata @@ -15,7 +15,7 @@ migration: - platform: root create_revision: 300451adae589accbece3490f4396f10bdf15e6e base_revision: 300451adae589accbece3490f4396f10bdf15e6e - - platform: web + - platform: android create_revision: 300451adae589accbece3490f4396f10bdf15e6e base_revision: 300451adae589accbece3490f4396f10bdf15e6e diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c3ef145..35871f2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:name="${applicationName}" android:usesCleartextTraffic="true" - android:icon="@mipmap/launcher_icon"> + android:icon="@mipmap/konectar1"> ( -// isScrollControlled: true, -// // context and builder are -// // required properties in this widget -// context: context, -// builder: (BuildContext context) { -// // we set up a container inside which -// // we create center column and display text - -// // Returning SizedBox instead of a Container -// return Container( -// width: double.infinity, -// child: Wrap( -// // mainAxisSize: MainAxisSize.max, -// children: [ -// Expanded( -// child: SingleChildScrollView( -// child: Column( -// //mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), -// Text('GeeksforGeeks'), - -// // ListView( -// // children: [ -// // ...List.generate( -// // 10, -// // (index) => Text('GeeksforGeeks'), -// // ) -// // ], -// // ) -// ], -// ), -// ), -// ), -// ], -// ), -// ); -// }, -// ); -// }, -// ), -// ); -// } -// } -// import 'package:flutter/material.dart'; - -// // Define your number of items -// const int numberOfItems = 5; // Replace with the desired number - -// class MyCarousel extends StatelessWidget { -// @override -// Widget build(BuildContext context) { -// return Scaffold( -// body: ExpandableCarousel( -// options: CarouselOptions( -// showIndicator: false, -// slideIndicator: CircularWaveSlideIndicator( -// alignment: Alignment.bottomCenter, -// currentIndicatorColor: Colors.blue, // Replace with your color -// indicatorBackgroundColor: Colors.grey, -// ), -// autoPlay: true, -// autoPlayInterval: const Duration(seconds: 2), -// ), -// items: List.generate(numberOfItems, (index) { -// return Builder( -// builder: (BuildContext context) { -// return Center( -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(10), -// ), -// child: Container( -// decoration: BoxDecoration( -// color: Colors.blueAccent, // Replace with your gradient or color -// borderRadius: BorderRadius.circular(10), -// ), -// child: Padding( -// padding: EdgeInsets.all(10.0), -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Text( -// index == 0 -// ? "Top Event Topics" -// : index == 1 -// ? "Top Publication Topics" -// : index == 2 -// ? "Top Products Discussed" -// : index == 3 -// ? "Drugs Prescribed" -// : "Condition Treated", -// style: TextStyle( -// fontSize: 16.0, -// fontWeight: FontWeight.bold, -// color: Colors.white, -// ), -// ), -// const SizedBox(height: 10.0), -// // Example content, you can replace this with your dynamic data -// Row( -// children: [ -// Container( -// decoration: BoxDecoration( -// color: Colors.grey[800], // Replace with your color -// borderRadius: BorderRadius.circular(10), -// ), -// child: Padding( -// padding: const EdgeInsets.all(5.0), -// child: Row( -// children: [ -// Icon( -// Icons.circle, -// color: Colors.white, -// size: 13.0, -// ), -// SizedBox(width: 5.0), -// Text( -// "Item $index", -// style: TextStyle( -// fontSize: 14.0, -// color: Colors.white, -// ), -// ), -// SizedBox(width: 5.0), -// Container( -// decoration: BoxDecoration( -// color: Colors.black, // Replace with your color -// borderRadius: BorderRadius.circular(5), -// ), -// child: Padding( -// padding: const EdgeInsets.all(1.0), -// child: Text( -// "(378)", -// style: TextStyle( -// fontSize: 14.0, -// color: Colors.white, -// ), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// ], -// ), -// ), -// ), -// ), -// ), -// ); -// }, -// ); -// }).toList(), -// ), -// ); -// } -// } - diff --git a/lib/contacts_module/constants.dart b/lib/contacts_module/constants.dart index e4d24b4..16504c2 100644 --- a/lib/contacts_module/constants.dart +++ b/lib/contacts_module/constants.dart @@ -4,24 +4,25 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class Constants { - static Color k2color = Color.fromARGB(255, 0, 71, 132); - static Color k2color1 = Color.fromARGB(255, 0, 71, 132); + static const Color k2color = Color.fromARGB(255, 0, 71, 132); + static const Color k2color1 = Color.fromARGB(255, 0, 71, 132); + static const Color profilecard = Color.fromARGB(255, 4, 104, 198); + static const Color btmcard = Color.fromARGB(2255, 251, 242, 242); static Color cardtext = Colors.transparent; - static Color cardtextdark = Colors.transparent; static const Color bgcolor = Color(0xFFF2F3F8); - static Color bgcolor2 = const Color.fromARGB(255, 0, 112, 184); + static const Color bgwhitecolor = Colors.white; - static Color k2color11 = Colors.white; + static Color bgcolor2 = const Color.fromARGB(255, 0, 112, 184); static final Future response = rootBundle.loadString('assets/section.json'); static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184); - static const url = "http://192.168.2.143:8000/api"; + static const url = "http://192.168.2.170:8000/api"; - // static const url = "http://192.168.21.50:8000/api"; + // static const url = "http://127.0.0.1:8000/api"; //static const url = 'http://192.168.2.143:8085/api';http://127.0.0.1:8001 //static const url = 'http://192.168.153.50:8082/api';192.168.21.50:8000 diff --git a/lib/contacts_module/custom_widget/card_expansiontile.dart b/lib/contacts_module/custom_widget/card_expansiontile.dart new file mode 100644 index 0000000..429f2dd --- /dev/null +++ b/lib/contacts_module/custom_widget/card_expansiontile.dart @@ -0,0 +1,1183 @@ +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/icontext_widget.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/edu_model_hive.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/widgets.dart'; + +class CardCustomExpansionTile extends StatefulWidget { + final String title; + final List? itemList; + final String buttonText; + final String field1; + final String field2; + bool? noexpand; + final VoidCallback? onButtonPressed; // Add this parameter for button callback + + final Function(T)? onItemSelected; + + CardCustomExpansionTile({ + Key? key, + required this.title, + this.itemList, + required this.buttonText, + this.onItemSelected, + required this.field1, + required this.field2, + this.noexpand, + this.onButtonPressed, // Initialize it + }) : super(key: key); + + @override + _CustomExpansionTileState createState() => _CustomExpansionTileState(); +} + +class _CustomExpansionTileState extends State> { + bool _isExpanded = false; + + List keys = []; + + @override + void initState() { + super.initState(); + // Initialize keys for each item in the list + keys = List.generate(widget.itemList!.length, (index) => GlobalKey()); + } + + @override + Widget build(BuildContext context) { + print("Chekingg_Field_one: ${widget.field1}"); + + return ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Container( + child: Card( + margin: EdgeInsets.all(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.bgwhitecolor, + child: ExpansionTile( + backgroundColor: Constants.bgwhitecolor, + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black, + ), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text1( + title: widget.title, + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 16.0, + ), + const SizedBox(width: 8.0), + Text1( + title: "(${widget.itemList!.length})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 16.0, + ), + ], + ), + children: [ + Visibility( + visible: widget.noexpand ?? + true, // Ensure that it's not null, default to true + child: Container( + // height: widget.noexpand ?? false + // ? 200.0 + // : 0, // Restrict height to avoid overflow + + height: widget.noexpand ?? false + // ? widget.itemList!.length * 40.0 + ? getDynamicHeight() + : 0, + + child: ListView.builder( + itemCount: widget.itemList!.take(2).length, + itemBuilder: (context, index) { + var data = widget.itemList![index]; + print("Dattattta_is: $data"); + + return Container( + key: keys[index], + constraints: BoxConstraints( + minWidth: MediaQuery.of(context).size.width, + ), + color: Colors.white, + child: Container( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + children: [displaylocationData(data)], + ), + ), + )); + }), + ), + ), + Visibility( + visible: widget.noexpand!, + child: Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: widget.onButtonPressed, + child: Text( + widget.buttonText, + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } + + getdatacel1(T location) { + if (location is Data) { + return location.address1 != null + ? Text1(title: "${location.address1}") + : SizedBox(); + } else if (location is DataPhno) { + return Text1(title: "${location.phoneTypeName}"); + } else if (location is EmailData) { + return Text1(title: "${location.emailTypeName}"); + } else if (location is TrainingList) { + return Text1(title: "${location.organizationId}"); + } else if (location is EducationList) { + return Text1(title: "${location.organizationId}"); + } else if (location is AwardsList) { + return Text1(title: "${location.name}"); + } else if (location is CertificateList) { + return Text1(title: "${location.organizationId}"); + } else if (location is AffList) { + return Text1(title: "${location.title}"); + } else if (location is EventList) { + return Text1(title: "${location.name}"); + } + } + + getdatacel2(T location) { + if (location is Data) { + return location.postalCode != null + ? Text1(title: "${location.postalCode}") + : SizedBox.shrink(); + // return Text1(title: "${location.postalCode}"); + } else if (location is DataPhno) { + return Text1(title: "${location.number}"); + } else if (location is EmailData) { + return Text1(title: "${location.email}"); + } else if (location is TrainingList) { + return Text1(title: "${location.degree}"); + } else if (location is EducationList) { + return Text1(title: "${location.degree}"); + } else if (location is AwardsList) { + return Text1(title: "${location.startDate} ${location.endDate}"); + } else if (location is CertificateList) { + return Text1(title: "${location.specialty}"); + } else if (location is AffList) { + return Text1(title: "${location.role}"); + } else if (location is EventList) { + return Text1(title: "${location.notes}"); + } + } + + getdatacel3(T location) { + if (location is Data) { + return Text1(title: "${location.countryName}"); + + // return Text1(title: "${location.postalCode}"); + } else if (location is DataPhno) { + return Text1(title: "${location.number}"); + } else if (location is EmailData) { + return Text1(title: "${location.email}"); + } else if (location is TrainingList) { + return Text1(title: "${location.degree}"); + } else if (location is EducationList) { + return Text1(title: "${location.degree}"); + } else if (location is AwardsList) { + return Text1(title: "${location.startDate} ${location.endDate}"); + } else if (location is CertificateList) { + return Text1(title: "${location.specialty}"); + } else if (location is AffList) { + return Text1(title: "${location.role}"); + } else if (location is EventList) { + return Text1(title: "${location.notes}"); + } + } + + getdatacel4(T location) { + if (location is Data) { + return Text1(title: "${location.stateName}"); + + // return Text1(title: "${location.postalCode}"); + } else if (location is DataPhno) { + return Text1(title: "${location.number}"); + } else if (location is EmailData) { + return Text1(title: "${location.email}"); + } else if (location is TrainingList) { + return Text1(title: "${location.degree}"); + } else if (location is EducationList) { + return Text1(title: "${location.degree}"); + } else if (location is AwardsList) { + return Text1(title: "${location.startDate} ${location.endDate}"); + } else if (location is CertificateList) { + return Text1(title: "${location.specialty}"); + } else if (location is AffList) { + return Text1(title: "${location.role}"); + } else if (location is EventList) { + return Text1(title: "${location.notes}"); + } + } + + getdatacel5(T location) { + if (location is Data) { + return location.organizationName != null + // ignore: dead_code + ? Text1( + title: "${location.organizationName}", + txtfont: 20.0, + ) + : Text1( + title: "Aissel", + txtfont: 20.0, + ); + } else if (location is DataPhno) { + return Text1(title: "${location.phoneTypeName}"); + } else if (location is EmailData) { + return Text1(title: "${location.emailTypeName}"); + } else if (location is TrainingList) { + return Text1(title: "${location.organizationId}"); + } else if (location is EducationList) { + return Text1(title: "${location.organizationId}"); + } else if (location is AwardsList) { + return Text1(title: "${location.name}"); + } else if (location is CertificateList) { + return Text1(title: "${location.organizationId}"); + } else if (location is AffList) { + return Text1(title: "${location.title}"); + } else if (location is EventList) { + return Text1(title: "${location.name}"); + } + } + + Widget _buildAddressText(Data data) { + List addressParts = []; + + if (data.address1 != null) + addressParts.add(Text1(title: data.address1! + ", ")); + if (data.cityName != null) + addressParts.add(Text1(title: data.cityName! + ", ")); + if (data.stateName != null) + addressParts.add(Text1(title: data.stateName! + ", ")); + if (data.countryName != null) + addressParts.add(Text1(title: data.countryName! + ", ")); + if (data.postalCode != null) + addressParts.add(Text1(title: data.postalCode!)); + + return Row( + children: addressParts, + ); + } + + Widget _buildPhoneText(DataPhno data) { + List phoneParts = []; + + if (data.phoneTypeName != null) + phoneParts.add(Text1(title: data.phoneTypeName! + ", ")); + + if (data.number != null) + phoneParts.add(Text1(title: data.number!.toString() + ", ")); + + if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + phoneParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: phoneParts, + ); + } + + Widget _buildEmailText(EmailData data) { + List emailParts = []; + + if (data.email != null) emailParts.add(Text1(title: data.email! + ", ")); + + if (data.emailTypeName != null) + emailParts.add(Text1(title: data.emailTypeName!.toString() + ", ")); + + // if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + // emailParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: emailParts, + ); + } + + Widget _buildTrainingText(TrainingList data) { + List emailParts = []; + + if (data.specialty != null) + emailParts.add(Text1(title: data.specialty! + ", ")); + + if (data.degree != null) + emailParts.add(Text1(title: data.degree!.toString() + ", ")); + + // if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + // emailParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: emailParts, + ); + } + + Widget _buildEducationText(EducationList data) { + List emailParts = []; + + if (data.specialty != null) + emailParts.add(Text1(title: data.specialty! + ", ")); + + if (data.degree != null) + emailParts.add(Text1(title: data.degree!.toString() + ", ")); + + // if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + // emailParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: emailParts, + ); + } + + Widget _buildAwardsText(AwardsList data) { + List emailParts = []; + + if (data.name != null) emailParts.add(Text1(title: data.name! + ", ")); + + if (data.url != null) + emailParts.add(Text1(title: data.url!.toString() + ", ")); + + // if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + // emailParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: emailParts, + ); + } + + Widget _buildCertificateText(CertificateList data) { + List emailParts = []; + + if (data.specialty != null) + emailParts.add(Text1(title: data.specialty! + ", ")); + + if (data.url != null) + emailParts.add(Text1(title: data.url!.toString() + ", ")); + + // if (data.formattedIsPrimary != null) if (data.formattedIsPrimary == "No") + // emailParts.add(Text1(title: "Not a primarry No" + ", ")); + + return Row( + children: emailParts, + ); + } + + Widget displaylocationData(T data) { + if (data is Data) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + //icon: Icons.business, + text: data.organizationName ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.location_pin, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildAddressText(data), + ], + ), + ], + ); + } else if (data is DataPhno) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + // icon: Icons.business, + text: data.organizationName ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildPhoneText(data), + ], + ), + ], + ); + } else if (data is EmailData) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + // icon: Icons.business, + text: data.emailTypeName ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildEmailText(data), + ], + ), + ], + ); + } else if (data is TrainingList) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + // icon: Icons.business, + text: data.specialty ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildTrainingText(data), + ], + ), + ], + ); + } else if (data is EducationList) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + // icon: Icons.business, + text: data.specialty ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildEducationText(data), + ], + ), + ], + ); + } else if (data is AwardsList) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + // icon: Icons.business, + text: data.name ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildAwardsText(data), + ], + ), + ], + ); + } else if (data is CertificateList) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + //icon: Icons.business, + text: data.specialty ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // Icon( + // Icons.call, + // size: 20.0, + // color: Constants.k2color, + // ), + SizedBox(width: 8.0), + _buildCertificateText(data), + ], + ), + ], + ); + } + return SizedBox.shrink(); // Fallback in case data is not matched + } + + // displaylocationData(T data) { + // if (data is Data) { + // return Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Align( + // alignment: Alignment.centerLeft, + // child: Row( + // children: [ + // Icon( + // Icons.business, // Replace with any icon you want + // size: 20.0, // Adjust the size of the icon + // color: Constants + // .k2color, // Change the color of the icon if needed + // ), + // SizedBox( + // width: 8.0), // Add some spacing between the icon and text + // Text( + // data.organizationName ?? "Aissel", // Your text widget + // style: TextStyle( + // fontSize: 16.0, // Your font size + // ), + // ), + // ], + // ), + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Icon( + // Icons.location_pin, // Replace with any icon you want + // size: 20.0, // Adjust the size of the icon + // color: + // Constants.k2color, // Change the color of the icon if needed + // ), + // SizedBox(width: 8.0), + // data.address1 != null + // ? Text1(title: data.address1! + ", ") + // : SizedBox.shrink(), + // data.cityName != null + // ? Text1(title: data.cityName! + ", ") + // : SizedBox.shrink(), + // data.stateName != null + // ? Text1(title: data.stateName! + ", ") + // : SizedBox.shrink(), + // data.countryName != null + // ? Text1(title: data.countryName! + ", ") + // : SizedBox.shrink(), + // data.postalCode != null + // ? Text1(title: data.postalCode!) + // : SizedBox.shrink(), + // ], + // ), + // ], + // ); + // } else if (data is DataPhno) { + // return Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Align( + // alignment: Alignment.centerLeft, + // child: Row( + // children: [ + // Icon( + // Icons.business, // Replace with any icon you want + // size: 20.0, // Adjust the size of the icon + // color: Constants + // .k2color, // Change the color of the icon if needed + // ), + // SizedBox(width: 8.0), + // Text1( + // title: data.organizationName ?? "Aissel", + // txtfont: 16.0, + // ), + // ], + // )), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Icon( + // Icons.call, // Replace with any icon you want + // size: 20.0, // Adjust the size of the icon + // color: + // Constants.k2color, // Change the color of the icon if needed + // ), + // SizedBox(width: 8.0), + // data.phoneTypeName != null + // ? Text1(title: data.phoneTypeName! + ", ") + // : SizedBox.shrink(), + // data.formattedIsPrimary != null + // ? Text1(title: data.formattedIsPrimary!.toString() + ", ") + // : SizedBox.shrink(), + // data.number != null + // ? Text1(title: data.number!.toString() + ", ") + // : SizedBox.shrink(), + // ], + // ), + // ], + // ); + // } + // } + + double getDynamicHeight() { + double totalHeight = 0.0; + + // Measure the height of each item after rendering + for (int i = 0; i < widget.itemList!.length; i++) { + final RenderBox? renderBox = + keys[i].currentContext?.findRenderObject() as RenderBox?; + if (renderBox != null) { + totalHeight += renderBox.size.height; + } + } + + return totalHeight; + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// import 'package:discover_module/contacts_module/constants.dart'; +// import 'package:discover_module/contacts_module/custom_widget/text.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/rendering.dart'; +// import 'package:flutter/widgets.dart'; + +// class CardCustomExpansionTile extends StatefulWidget { +// final String title; +// final List? itemList; +// final String buttonText; +// final String field1; +// final String field2; +// bool? noexpand; +// final VoidCallback? onButtonPressed; // Add this parameter for button callback + +// final Function(T) onItemSelected; + +// CardCustomExpansionTile({ +// Key? key, +// required this.title, +// this.itemList, +// required this.buttonText, +// required this.onItemSelected, +// required this.field1, +// required this.field2, +// this.noexpand, +// this.onButtonPressed, // Initialize it +// }) : super(key: key); + +// @override +// _CustomExpansionTileState createState() => _CustomExpansionTileState(); +// } + +// class _CustomExpansionTileState extends State> { +// bool _isExpanded = false; + +// List keys = []; + +// @override +// void initState() { +// super.initState(); +// // Initialize keys for each item in the list +// keys = List.generate(widget.itemList!.length, (index) => GlobalKey()); +// } + +// @override +// Widget build(BuildContext context) { +// print("Chekingg_Field_one: ${widget.field1}"); + +// return ListTileTheme( +// dense: true, +// child: Padding( +// padding: const EdgeInsets.symmetric(horizontal: 8.0), +// child: Container( +// child: Card( +// margin: EdgeInsets.all(1.0), +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(0.0), +// ), +// color: Constants.k2color11, +// child: ExpansionTile( +// backgroundColor: Constants.k2color11, +// initiallyExpanded: false, +// maintainState: true, +// onExpansionChanged: (bool expanded) { +// setState(() { +// _isExpanded = expanded; +// }); +// }, +// trailing: Icon( +// _isExpanded +// ? Icons.keyboard_arrow_up +// : Icons.keyboard_arrow_down, +// color: Colors.black, +// ), +// title: Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Text1( +// title: widget.title, +// txtcolor: Colors.black, +// fontweight: FontWeight.normal, +// txtfont: 16.0, +// ), +// const SizedBox(width: 8.0), +// Text1( +// title: "(${widget.itemList!.length})", +// txtcolor: Colors.black, +// fontweight: FontWeight.normal, +// txtfont: 16.0, +// ), +// ], +// ), +// children: [ +// Visibility( +// visible: widget.noexpand ?? +// true, // Ensure that it's not null, default to true +// child: Container( +// // height: widget.noexpand ?? false +// // ? 200.0 +// // : 0, // Restrict height to avoid overflow + +// height: widget.noexpand ?? false +// // ? widget.itemList!.length * 40.0 +// ? getDynamicHeight() +// : 0, + +// child: ListView.builder( +// itemCount: widget.itemList!.take(2).length, +// itemBuilder: (context, index) { +// var data = widget.itemList![index]; +// print("Dattattta_is: $data"); + +// return Container( +// key: keys[index], +// constraints: BoxConstraints( +// minWidth: MediaQuery.of(context).size.width, +// ), +// color: Colors.white, +// child: Container( +// color: Colors.white, +// child: Padding( +// padding: const EdgeInsets.all(12.0), +// child: Column( +// children: [displaylocationData(data)], +// ), +// ), +// )); +// }), +// ), +// ), +// Visibility( +// visible: widget.noexpand!, +// child: Container( +// color: Colors.white, +// child: Align( +// alignment: Alignment.center, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: OutlinedButton( +// onPressed: widget.onButtonPressed, +// child: Text( +// widget.buttonText, +// style: TextStyle(color: Constants.k2color), +// ), +// style: OutlinedButton.styleFrom( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(12), +// ), +// ), +// ), +// ), +// ), +// ), +// ), +// ], +// ), +// ), +// ), +// ), +// ); +// } + +// getdatacel1(T location) { +// if (location is Data) { +// return location.address1 != null +// ? Text1(title: "${location.address1}") +// : SizedBox(); +// } else if (location is DataPhno) { +// return Text1(title: "${location.phoneTypeName}"); +// } else if (location is EmailData) { +// return Text1(title: "${location.emailTypeName}"); +// } else if (location is TrainingList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is EducationList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is AwardsList) { +// return Text1(title: "${location.name}"); +// } else if (location is CertificateList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is AffList) { +// return Text1(title: "${location.title}"); +// } else if (location is EventList) { +// return Text1(title: "${location.name}"); +// } +// } + +// getdatacel2(T location) { +// if (location is Data) { +// return location.postalCode != null +// ? Text1(title: "${location.postalCode}") +// : SizedBox.shrink(); +// // return Text1(title: "${location.postalCode}"); +// } else if (location is DataPhno) { +// return Text1(title: "${location.number}"); +// } else if (location is EmailData) { +// return Text1(title: "${location.email}"); +// } else if (location is TrainingList) { +// return Text1(title: "${location.degree}"); +// } else if (location is EducationList) { +// return Text1(title: "${location.degree}"); +// } else if (location is AwardsList) { +// return Text1(title: "${location.startDate} ${location.endDate}"); +// } else if (location is CertificateList) { +// return Text1(title: "${location.specialty}"); +// } else if (location is AffList) { +// return Text1(title: "${location.role}"); +// } else if (location is EventList) { +// return Text1(title: "${location.notes}"); +// } +// } + +// getdatacel3(T location) { +// if (location is Data) { +// return Text1(title: "${location.countryName}"); + +// // return Text1(title: "${location.postalCode}"); +// } else if (location is DataPhno) { +// return Text1(title: "${location.number}"); +// } else if (location is EmailData) { +// return Text1(title: "${location.email}"); +// } else if (location is TrainingList) { +// return Text1(title: "${location.degree}"); +// } else if (location is EducationList) { +// return Text1(title: "${location.degree}"); +// } else if (location is AwardsList) { +// return Text1(title: "${location.startDate} ${location.endDate}"); +// } else if (location is CertificateList) { +// return Text1(title: "${location.specialty}"); +// } else if (location is AffList) { +// return Text1(title: "${location.role}"); +// } else if (location is EventList) { +// return Text1(title: "${location.notes}"); +// } +// } + +// getdatacel4(T location) { +// if (location is Data) { +// return Text1(title: "${location.stateName}"); + +// // return Text1(title: "${location.postalCode}"); +// } else if (location is DataPhno) { +// return Text1(title: "${location.number}"); +// } else if (location is EmailData) { +// return Text1(title: "${location.email}"); +// } else if (location is TrainingList) { +// return Text1(title: "${location.degree}"); +// } else if (location is EducationList) { +// return Text1(title: "${location.degree}"); +// } else if (location is AwardsList) { +// return Text1(title: "${location.startDate} ${location.endDate}"); +// } else if (location is CertificateList) { +// return Text1(title: "${location.specialty}"); +// } else if (location is AffList) { +// return Text1(title: "${location.role}"); +// } else if (location is EventList) { +// return Text1(title: "${location.notes}"); +// } +// } + +// getdatacel5(T location) { +// if (location is Data) { +// return location.organizationName != null +// // ignore: dead_code +// ? Text1( +// title: "${location.organizationName}", +// txtfont: 20.0, +// ) +// : Text1( +// title: "Aissel", +// txtfont: 20.0, +// ); +// } else if (location is DataPhno) { +// return Text1(title: "${location.phoneTypeName}"); +// } else if (location is EmailData) { +// return Text1(title: "${location.emailTypeName}"); +// } else if (location is TrainingList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is EducationList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is AwardsList) { +// return Text1(title: "${location.name}"); +// } else if (location is CertificateList) { +// return Text1(title: "${location.organizationId}"); +// } else if (location is AffList) { +// return Text1(title: "${location.title}"); +// } else if (location is EventList) { +// return Text1(title: "${location.name}"); +// } +// } + +// displaylocationData(T data) { +// if (data is Data) { +// return Column( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Align( +// alignment: Alignment.centerLeft, +// child: Row( +// children: [ +// Icon( +// Icons.business, // Replace with any icon you want +// size: 20.0, // Adjust the size of the icon +// color: Constants +// .k2color, // Change the color of the icon if needed +// ), +// SizedBox( +// width: 8.0), // Add some spacing between the icon and text +// Text( +// data.organizationName ?? "Aissel", // Your text widget +// style: TextStyle( +// fontSize: 16.0, // Your font size +// ), +// ), +// ], +// ), +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Icon( +// Icons.location_pin, // Replace with any icon you want +// size: 20.0, // Adjust the size of the icon +// color: +// Constants.k2color, // Change the color of the icon if needed +// ), +// SizedBox(width: 8.0), +// data.address1 != null +// ? Text1(title: data.address1! + ", ") +// : SizedBox.shrink(), +// data.cityName != null +// ? Text1(title: data.cityName! + ", ") +// : SizedBox.shrink(), +// data.stateName != null +// ? Text1(title: data.stateName! + ", ") +// : SizedBox.shrink(), +// data.countryName != null +// ? Text1(title: data.countryName! + ", ") +// : SizedBox.shrink(), +// data.postalCode != null +// ? Text1(title: data.postalCode!) +// : SizedBox.shrink(), +// ], +// ), +// ], +// ); +// } else if (data is DataPhno) { +// return Column( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Align( +// alignment: Alignment.centerLeft, +// child: Row( +// children: [ +// Icon( +// Icons.business, // Replace with any icon you want +// size: 20.0, // Adjust the size of the icon +// color: Constants +// .k2color, // Change the color of the icon if needed +// ), +// SizedBox(width: 8.0), +// Text1( +// title: data.organizationName ?? "Aissel", +// txtfont: 16.0, +// ), +// ], +// )), +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Icon( +// Icons.call, // Replace with any icon you want +// size: 20.0, // Adjust the size of the icon +// color: +// Constants.k2color, // Change the color of the icon if needed +// ), +// SizedBox(width: 8.0), +// data.phoneTypeName != null +// ? Text1(title: data.phoneTypeName! + ", ") +// : SizedBox.shrink(), +// data.formattedIsPrimary != null +// ? Text1(title: data.formattedIsPrimary!.toString() + ", ") +// : SizedBox.shrink(), +// data.number != null +// ? Text1(title: data.number!.toString() + ", ") +// : SizedBox.shrink(), +// ], +// ), +// ], +// ); +// } +// } + +// double getDynamicHeight() { +// double totalHeight = 0.0; + +// // Measure the height of each item after rendering +// for (int i = 0; i < widget.itemList!.length; i++) { +// final RenderBox? renderBox = +// keys[i].currentContext?.findRenderObject() as RenderBox?; +// if (renderBox != null) { +// totalHeight += renderBox.size.height; +// } +// } + +// return totalHeight; +// } +// } diff --git a/lib/contacts_module/custom_widget/clickable_row.dart b/lib/contacts_module/custom_widget/clickable_row.dart new file mode 100644 index 0000000..339b734 --- /dev/null +++ b/lib/contacts_module/custom_widget/clickable_row.dart @@ -0,0 +1,42 @@ +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ClickRow extends StatefulWidget { + final IconData? icon; + final String? text; + final VoidCallback? onTap; + const ClickRow({super.key, this.icon, this.text, this.onTap}); + + @override + State createState() => _ClickRowState(); +} + +class _ClickRowState extends State { + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(left: 15.0), + child: InkWell( + onTap: widget.onTap, + child: Row( + children: [ + Icon( + size: 16, + widget.icon, + color: Colors.white, + ), + const SizedBox(width: 3.0), + Expanded( + child: Text1( + title: widget.text!, + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 14.0), + ), + ], + ), + ), + ); + } +} diff --git a/lib/contacts_module/custom_widget/custiom_profilepic.dart b/lib/contacts_module/custom_widget/custiom_profilepic.dart new file mode 100644 index 0000000..1f43ca0 --- /dev/null +++ b/lib/contacts_module/custom_widget/custiom_profilepic.dart @@ -0,0 +1,38 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_profile_picture/flutter_profile_picture.dart'; + +class CustomProfile extends StatelessWidget { + final String? imgstring; + final double? radius; + final double? fontsize; + final String? name; + const CustomProfile( + {super.key, this.imgstring, this.fontsize, this.radius, this.name}); + + @override + Widget build(BuildContext context) { + return imgstring == "" + ? ProfilePicture( + name: name ?? "", + radius: radius!, + fontsize: fontsize!, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(radius!), + child: CachedNetworkImage( + imageUrl: imgstring!, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_appbar.dart b/lib/contacts_module/custom_widget/custom_appbar.dart new file mode 100644 index 0000000..02fc091 --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_appbar.dart @@ -0,0 +1,24 @@ +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:flutter/material.dart'; + +class CustomAppbar extends StatefulWidget { + final String title; + const CustomAppbar({super.key, required this.title}); + + @override + State createState() => _CustomAppbarState(); +} + +class _CustomAppbarState extends State { + @override + Widget build(BuildContext context) { + return AppBar( + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios_new), + onPressed: () => Navigator.of(context).pop(false), + ), + title: Text1(title: widget.title), + actions: [], + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_bottomdailog.dart b/lib/contacts_module/custom_widget/custom_bottomdailog.dart new file mode 100644 index 0000000..ba5602f --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_bottomdailog.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; + +class CustomLongPressContainer extends StatelessWidget { + final bool? switchValue; + final List? selectedIndices; + final List? selectedRemoveIndices; + final void Function()? onAddToContacts; + final void Function()? onRemoveFromContacts; + final void Function()? onDownload; + final void Function()? onCancel; + final void Function()? onSaveOffline; + + CustomLongPressContainer({ + this.switchValue, + this.selectedIndices, + this.selectedRemoveIndices, + this.onAddToContacts, + this.onRemoveFromContacts, + this.onDownload, + this.onCancel, + this.onSaveOffline, + }); + + @override + Widget build(BuildContext context) { + return Container( + color: Colors.grey[200], // Example color, you can change it + width: MediaQuery.of(context).size.width, + height: 220.0, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Add to Contacts Section + switchValue! + ? GestureDetector( + onTap: onRemoveFromContacts, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.remove, + color: Colors.green, + ), + ), + Text( + 'Remove from My Contacts', + style: TextStyle(color: Colors.black), + ), + ], + ), + ) + : GestureDetector( + onTap: onAddToContacts, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.add, + color: Colors.green, + ), + ), + Text( + 'Add to My Contacts', + style: TextStyle(color: Colors.black), + ), + ], + ), + ), + + // Download Section + GestureDetector( + onTap: onDownload, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.download, + color: Colors.blue, + ), + ), + Text( + 'Download', + style: TextStyle(color: Colors.black), + ), + ], + ), + ), + + // Cancel Section + GestureDetector( + onTap: onCancel, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.close, + color: Colors.red, + ), + ), + Text( + 'Cancel', + style: TextStyle(color: Colors.black), + ), + ], + ), + ), + + // Save Offline Section (Only if switchValue is false) + Visibility( + visible: !switchValue!, + child: GestureDetector( + onTap: onSaveOffline, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.save, + color: Colors.deepOrange, + ), + ), + Padding( + padding: EdgeInsets.only(top: 5.0), + child: Text( + 'Save Offline', + style: TextStyle(color: Colors.black), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_card.dart b/lib/contacts_module/custom_widget/custom_card.dart new file mode 100644 index 0000000..536e101 --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_card.dart @@ -0,0 +1,34 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class CustomCard extends StatefulWidget { + final double? elevation; + final Color? color; + final Color? tintcolor; + final Widget? child; + + final double? bradius; + const CustomCard( + {super.key, + this.elevation, + this.color, + this.bradius, + this.tintcolor, + this.child}); + + @override + State createState() => _CustomCardState(); +} + +class _CustomCardState extends State { + @override + Widget build(BuildContext context) { + return Card( + elevation: widget.elevation!, + color: widget.color, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.bradius!)), + child: widget.child, + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_expansiontile.dart b/lib/contacts_module/custom_widget/custom_expansiontile.dart index 7b2cd26..7efdefb 100644 --- a/lib/contacts_module/custom_widget/custom_expansiontile.dart +++ b/lib/contacts_module/custom_widget/custom_expansiontile.dart @@ -10,24 +10,29 @@ import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_loc import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; class CustomExpansionTile extends StatefulWidget { final String title; - final List itemList; + final List? itemList; final String buttonText; final String field1; final String field2; + bool? noexpand; + final VoidCallback? onButtonPressed; // Add this parameter for button callback final Function(T) onItemSelected; - const CustomExpansionTile({ + CustomExpansionTile({ Key? key, required this.title, - required this.itemList, + this.itemList, required this.buttonText, required this.onItemSelected, required this.field1, required this.field2, + this.noexpand, + this.onButtonPressed, // Initialize it }) : super(key: key); @override @@ -37,6 +42,8 @@ class CustomExpansionTile extends StatefulWidget { class _CustomExpansionTileState extends State> { bool _isExpanded = false; + //var noexpand; + @override Widget build(BuildContext context) { print("Chekingg_Field_one: ${widget.field1}"); @@ -51,9 +58,9 @@ class _CustomExpansionTileState extends State> { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, onExpansionChanged: (bool expanded) { @@ -78,7 +85,7 @@ class _CustomExpansionTileState extends State> { ), const SizedBox(width: 8.0), Text1( - title: "(${widget.itemList.length})", + title: "(${widget.itemList!.length})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0, @@ -86,72 +93,76 @@ class _CustomExpansionTileState extends State> { ], ), children: [ - Scrollbar( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Container( - constraints: BoxConstraints( - minWidth: MediaQuery.of(context).size.width, - ), - color: Colors.white, - child: DataTable( - showCheckboxColumn: false, - columns: [ - DataColumn( - label: Expanded( - child: Text( - widget.field1 ?? 'Item', - style: TextStyle(fontWeight: FontWeight.w600), - softWrap: true, + Visibility( + visible: widget.noexpand!, + child: Scrollbar( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + constraints: BoxConstraints( + minWidth: MediaQuery.of(context).size.width, + ), + color: Colors.white, + child: DataTable( + showCheckboxColumn: false, + columns: [ + DataColumn( + label: Expanded( + child: Text( + widget.field1 ?? 'Item', + style: TextStyle(fontWeight: FontWeight.w600), + softWrap: true, + ), ), ), - ), - DataColumn( - label: Expanded( - child: Text( - widget.field2 ?? 'Details', - style: TextStyle(fontWeight: FontWeight.w600), + DataColumn( + label: Expanded( + child: Text( + widget.field2 ?? 'Details', + style: TextStyle(fontWeight: FontWeight.w600), + ), ), ), - ), - ], - rows: List.generate(widget.itemList.take(2).length, - (index) { - final item = widget.itemList[index]; + ], + rows: List.generate(widget.itemList!.take(2).length, + (index) { + final item = widget.itemList![index]; - return DataRow( - onSelectChanged: (value) { - widget.onItemSelected(widget.itemList[index]); - }, - cells: [ - DataCell(getdatacel1(item)), - DataCell( - getdatacel2(item), - ), - ], - ); - }), + return DataRow( + onSelectChanged: (value) { + widget.onItemSelected(widget.itemList![index]); + }, + cells: [ + DataCell(getdatacel1(item)), + DataCell( + getdatacel2(item), + ), + ], + ); + }), + ), ), ), ), ), - Container( - color: Colors.white, - child: Align( - alignment: Alignment.center, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: OutlinedButton( - onPressed: () { - // Handle the button action here - }, - child: Text( - widget.buttonText, - style: TextStyle(color: Constants.k2color), - ), - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + Visibility( + visible: widget.noexpand!, + child: Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: widget.onButtonPressed, + child: Text( + widget.buttonText, + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), ), ), ), diff --git a/lib/contacts_module/custom_widget/custom_floatingbutton.dart b/lib/contacts_module/custom_widget/custom_floatingbutton.dart new file mode 100644 index 0000000..a3e758d --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_floatingbutton.dart @@ -0,0 +1,78 @@ +import 'package:discover_module/contacts_module/ui_screen/newformlist.dart'; +import 'package:flutter/material.dart'; + +class CustomFloatingBtn extends StatefulWidget { + final double? height; + final double? width; + final Color? color; + final double? borderWidth; + final double? borderRadius; + final IconData? icon; + final Color? iconColor; + final double? iconsize; + final VoidCallbackAction? ontap; + + const CustomFloatingBtn( + {super.key, + this.height, + this.width, + this.color, + this.borderRadius, + this.borderWidth, + this.ontap, + this.icon, + this.iconColor, + this.iconsize}); + + @override + State createState() => _CustomFloatingBtnState(); +} + +class _CustomFloatingBtnState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.width, + height: widget.height, + decoration: BoxDecoration( + border: Border.all( + color: widget.color!, // Outer border color + width: 1.8, + ), + borderRadius: + BorderRadius.circular(widget.borderRadius!), // Rounded border + boxShadow: [ + BoxShadow( + color: widget.color!.withOpacity(0.2), // Shadow color with opacity + blurRadius: 5, // Shadow blur radius + spreadRadius: 2, // Spread of the shadow + offset: Offset(2, 2), // Shadow offset + ), + ], + ), + child: FloatingActionButton( + // shape: CircleBorder(), + shape: RoundedRectangleBorder( + side: BorderSide(width: 7, color: widget.iconColor!), + borderRadius: BorderRadius.circular(widget.borderRadius!)), + + onPressed: () async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => FormList())); + }, + foregroundColor: widget.iconColor, + backgroundColor: widget.color, + child: Text( + String.fromCharCode(widget.icon!.codePoint), + style: TextStyle( + color: widget.iconColor, + inherit: false, + fontSize: widget.iconsize, + fontWeight: FontWeight.w800, + fontFamily: Icons.space_dashboard_outlined.fontFamily, + ), + ), + ), + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_sizedbox.dart b/lib/contacts_module/custom_widget/custom_sizedbox.dart new file mode 100644 index 0000000..dacea1c --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_sizedbox.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; + +class CustomSizedBox extends StatelessWidget { + final double? height; + final double? width; + + const CustomSizedBox({this.height, this.width}); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: height, + width: width, + ); + } +} diff --git a/lib/contacts_module/custom_widget/custom_switch.dart b/lib/contacts_module/custom_widget/custom_switch.dart new file mode 100644 index 0000000..3d978f9 --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_switch.dart @@ -0,0 +1,28 @@ +import 'package:flutter/cupertino.dart'; + +class CustomSwitch extends StatefulWidget { + final Color? activeclor; + final bool? switchvalue; + final ValueChanged? onchanged; + const CustomSwitch( + {super.key, this.activeclor, this.switchvalue, this.onchanged}); + + @override + State createState() => _CustomSwitchState(); +} + +class _CustomSwitchState extends State { + @override + Widget build(BuildContext context) { + return CupertinoSwitch( + activeColor: widget.activeclor, + value: widget.switchvalue!, + onChanged: widget.onchanged + // (value) { + // setState(() { + // _switchValue = value; + // }); + // }, + ); + } +} diff --git a/lib/contacts_module/custom_widget/icontext_widget.dart b/lib/contacts_module/custom_widget/icontext_widget.dart new file mode 100644 index 0000000..48cdd24 --- /dev/null +++ b/lib/contacts_module/custom_widget/icontext_widget.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; + +class IconTextRow extends StatelessWidget { + final IconData? icon; + final String? text; + final double iconSize; + final Color iconColor; + final double fontSize; + + const IconTextRow({ + Key? key, + this.icon, + required this.text, + this.iconSize = 20.0, + this.iconColor = Colors + .blue, // Default color, replace with your Constants.k2color if needed + this.fontSize = 16.0, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + // Icon( + // icon, + // size: iconSize, + // color: iconColor, + // ), + SizedBox(width: 8.0), + Text( + text ?? '', // Show empty string if text is null + style: TextStyle(fontSize: fontSize), + ), + ], + ); + } +} diff --git a/lib/contacts_module/custom_widget/profile_card.dart b/lib/contacts_module/custom_widget/profile_card.dart new file mode 100644 index 0000000..78d468b --- /dev/null +++ b/lib/contacts_module/custom_widget/profile_card.dart @@ -0,0 +1,160 @@ +import 'package:discover_module/contacts_module/custom_widget/clickable_row.dart'; +import 'package:discover_module/contacts_module/custom_widget/custiom_profilepic.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_card.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../constants.dart'; + +class ProfileCard extends StatefulWidget { + final String? name; + final String? spl; + final String? imgurl; + final String? email; + final String? pno; + final String? address; + const ProfileCard( + {super.key, + this.name, + this.spl, + this.imgurl, + this.email, + this.pno, + this.address}); + + @override + State createState() => _ProfileCardState(); +} + +class _ProfileCardState extends State { + @override + Widget build(BuildContext context) { + return CustomCard( + elevation: 6, + color: Constants.profilecard, + bradius: 28, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only( + left: 15.0, right: 15.0, top: 15.0, bottom: 15.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 7, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text1( + title: widget.name ?? " ", + txtcolor: Colors.white, + fontweight: FontWeight.bold, + txtfont: 18.0), + Text1( + title: widget.spl ?? "", + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 14.0), + ], + ), + ), + Flexible( + flex: 3, + child: Container( + child: CustomProfile( + imgstring: widget.imgurl, + fontsize: 12.0, + radius: 32, + name: widget.name, + ), + ), + ), + ], + ), + ), + ClickRow( + icon: Icons.email, + text: widget.email ?? "", + onTap: () async { + await emailSend(widget.email); + }, + ), + SizedBox( + height: 8.0, + ), + ClickRow( + icon: Icons.phone, + text: widget.pno ?? "", + onTap: () async { + await callinfo(widget.pno); + }, + ), + SizedBox( + height: 8.0, + ), + ClickRow( + icon: Icons.location_pin, + text: widget.address ?? + "Icahn School of Medicine at mount sinai, United States 580047", + onTap: _openMapsByAddress, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ); + } +} + +Future _openMapsByAddress() async { + final address = 'Italy'; + final Uri mapsUri = Uri( + scheme: 'https', + host: 'www.google.com', + path: 'maps/search/', + query: address, + ); + + if (!await launchUrl(mapsUri)) { + throw 'Could not launch $mapsUri'; + } +} + +Future emailSend(email) async { + String? encodeQueryParameters(Map params) { + return params.entries + .map((MapEntry entry) => + Uri.encodeComponent(entry.key) + + '=' + + Uri.encodeComponent(entry.value)) + .join('&'); + } + + final Uri emailLaunchUri = Uri( + scheme: 'mailto', + path: email, + query: encodeQueryParameters({ + 'subject': 'Example Subject', + 'body': 'Hello, this is a sample body text.', + }), + ); + + if (await launchUrl(emailLaunchUri)) { + launchUrl(emailLaunchUri); + } else { + throw 'Could not launch $emailLaunchUri'; + } +} + +Future callinfo(pno) async { + final call = Uri.parse('tel:$pno'); + if (await canLaunchUrl(call)) { + launchUrl(call); + } else { + throw 'Could not launch $call'; + } +} diff --git a/lib/contacts_module/custom_widget/text.dart b/lib/contacts_module/custom_widget/text.dart index e74ef75..e70e75f 100644 --- a/lib/contacts_module/custom_widget/text.dart +++ b/lib/contacts_module/custom_widget/text.dart @@ -24,6 +24,7 @@ class _Text1State extends State { return Text( widget.title, softWrap: true, + maxLines: 5, style: TextStyle( color: widget.txtcolor, fontSize: widget.txtfont, diff --git a/lib/contacts_module/hive_fun.dart b/lib/contacts_module/hive_fun.dart index 53a22ff..13a3cf5 100644 --- a/lib/contacts_module/hive_fun.dart +++ b/lib/contacts_module/hive_fun.dart @@ -122,77 +122,8 @@ class HiveFunctions { print("Valueee11Get: $value1"); print("UniqueId111 : ${value["inid"]}"); } - - // print(await _contactbox.getAt(selectedremoveIndic)); - - // int data = selectedremoveIndic; - - // final storeddelData = _contactbox.get(data); - // print("storeddelData_iss: $storeddelData"); - - // if (storeddelData != null) { - // print("I_amNotnull ${storeddelData["id"]}"); - // _contactbox.deleteAt(storeddelData["id"]); - //} - // _hiveBox.delete(dataDel.id); - // _contactbox.deleteAt(selectedremoveIndic); - // final data = _contactbox.keys.map((_contactbox) { - // final value = _contactbox.get(selectedremoveIndic); - - // print("Del_valuee_is: ${value}"); - - // }); } - // void deleteUser(String userId) { - // var _contactbox = Hive.box('contactBox'); - - // // Find the key corresponding to the userId - // for (var key in _contactbox.keys) { - // final value = _contactbox.get(key); - // if (value["id"] == userId) { - // _contactbox.delete(key); - // print("Deleted user with id: $userId"); - // break; // Exit the loop once the item is deleted - // } - // } - // } - - // static void deleteUser(int selectedremoveIndic) { - // print("I_Am: selectedremoveIndic: ${selectedremoveIndic}"); - // // final data = _contactbox.keys.map((key) { - // final value = _contactbox.get(selectedremoveIndic); - - // _contactbox.deleteAt(selectedremoveIndic); - - // // if (value["id"] == selectedremoveIndic) { - // // print("I_Am: selectedremoveIndicnew: ${value["name"]}"); - // // } - // // }); - // } - - // static addno(int selectedRowId) { - // // final box1 = Hive.box("mycontact"); - - // print("SelectedStoredvaluessss: $selectedRowId"); - - // box1.add(selectedRowId); - // } - - // static removeno(int selectedRowId) { - // // final box1 = Hive.box("mycontact"); - - // print("SelectedStoredvaluessss: $selectedRowId"); - - // box1.deleteAt(selectedRowId); - // } - - // static getno() { - // // final box1 = Hive.box("mycontact"); - - // return box1.values; - // } - static storehcpdata(Map data) { apihcpdata.add(data); } @@ -221,24 +152,6 @@ class HiveFunctions { print("Checking_Name_data : ${data}"); - // print("Checking_Name : ${value.contains(text)}"); - // final dataa = value.get(text); - - // return { - // "name": value["name"], - // "org": value["org"], - // "adrr": value["adrr"], - // "phone": value["phone"], - // "Pphone": value["Pphone"], - // "email": value["email"], - // "affno": value["affno"], - // "eveno": value["eveno"], - // "pubno": value["pubno"], - // "trailno": value["trailno"] - // }; - // }).toList(); - - // print("Check_data_is: $data"); return data.toList(); } @@ -299,41 +212,9 @@ class HiveFunctions { print("Checking_Name_data : ${data}"); - // print("Checking_Name : ${value.contains(text)}"); - // final dataa = value.get(text); - - // return { - // "name": value["name"], - // "org": value["org"], - // "adrr": value["adrr"], - // "phone": value["phone"], - // "Pphone": value["Pphone"], - // "email": value["email"], - // "affno": value["affno"], - // "eveno": value["eveno"], - // "pubno": value["pubno"], - // "trailno": value["trailno"] - // }; - // }).toList(); - - // print("Check_data_is: $data"); return data.toList(); } - // static void savemyContact(List selectedIndices, [List displayedHCPList]) async { - // print("Iam selectedd $selectedIndices"); - - // for (int i = 0; i < selectedIndices.length; i++) { - // Map? row = await findRecordById1(selectedIndices[i]); - - // print("StoringgggMyContactneww_isss_isss:Row $row"); - // } - // } - - // Map findRecordById(String selectedIndic) { - // final list = _contactbox.values.toList(); - // } - static Map? findRecordById1(String selectedIndic) { final list = _contactbox.values.toList(); return list @@ -364,7 +245,8 @@ class HiveFunctions { "summarry": row["summarry"], "speciality": row["speciality"], "sub_speciality": row["sub_speciality"], - "img_path": row["img_path"] + "img_path": row["img_path"], + "loc_count": "10", }; print("Inserting_data_is: $data"); diff --git a/lib/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart new file mode 100644 index 0000000..edc7a21 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart @@ -0,0 +1,103 @@ +// To parse this JSON data, do +// +// final fetchNotes = fetchNotesFromJson(jsonString); + +import 'dart:convert'; + +FetchNotes fetchNotesFromJson(String str) => + FetchNotes.fromJson(json.decode(str)); + +String fetchNotesToJson(FetchNotes data) => json.encode(data.toJson()); + +class FetchNotes { + int? code; + String? message; + List? data; + int? lastPage; + int? lastRow; + int? count; + + FetchNotes({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory FetchNotes.fromJson(Map json) => FetchNotes( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => HcpNotes.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.from(data!.map((x) => x.toJson())), + "last_page": lastPage, + "last_row": lastRow, + "count": count, + }; +} + +class HcpNotes { + String? uniqueId; + String? userNote; + dynamic fileName; + dynamic documentUrl; + String? kolUniqueId; + String? createdByUser; + String? updatedByUser; + DateTime? formattedCreatedAt; + DateTime? formattedUpdatedAt; + + HcpNotes({ + this.uniqueId, + this.userNote, + this.fileName, + this.documentUrl, + this.kolUniqueId, + this.createdByUser, + this.updatedByUser, + this.formattedCreatedAt, + this.formattedUpdatedAt, + }); + + factory HcpNotes.fromJson(Map json) => HcpNotes( + uniqueId: json["unique_id"], + userNote: json["user_note"], + fileName: json["file_name"], + documentUrl: json["document_url"], + kolUniqueId: json["kol_unique_id"], + createdByUser: json["created_by_user"], + updatedByUser: json["updated_by_user"], + formattedCreatedAt: json["formatted_created_at"] == null + ? null + : DateTime.parse(json["formatted_created_at"]), + formattedUpdatedAt: json["formatted_updated_at"] == null + ? null + : DateTime.parse(json["formatted_updated_at"]), + ); + + Map toJson() => { + "unique_id": uniqueId, + "user_note": userNote, + "file_name": fileName, + "document_url": documentUrl, + "kol_unique_id": kolUniqueId, + "created_by_user": createdByUser, + "updated_by_user": updatedByUser, + "formatted_created_at": formattedCreatedAt?.toIso8601String(), + "formatted_updated_at": formattedUpdatedAt?.toIso8601String(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart index 845c5ee..c17b478 100644 --- a/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart +++ b/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart @@ -49,8 +49,8 @@ class Data { String? postalCode; String? kolUniqueId; String? formattedIsPrimary; - Null? organizationUniqueId; - Null? organizationName; + String? organizationUniqueId; + String? organizationName; String? countryUniqueId; String? countryName; String? stateUniqueId; diff --git a/lib/contacts_module/provider_class/hcp _provider.dart b/lib/contacts_module/provider_class/hcp _provider.dart index 7863c40..2ca2707 100644 --- a/lib/contacts_module/provider_class/hcp _provider.dart +++ b/lib/contacts_module/provider_class/hcp _provider.dart @@ -9,6 +9,8 @@ class hcpProvider extends ChangeNotifier { List _list = []; + List mulList = []; + List get list => _list; getHCPProvider() async { @@ -29,6 +31,37 @@ class hcpProvider extends ChangeNotifier { // notifyListeners(); // } + // List searchHCP(String query) { + // if (query.isEmpty) { + // return List.from(_list); // Return full list if query is empty + // } else { + // // return _list + // // .where( + // // (hcp) => hcp['name'].toLowerCase().contains(query.toLowerCase())) + // // .toList(); + // print("JsonIssList: $_list"); + // print("queryIssList: $query"); + + // return _list + // .where((hcp) => + // hcp['name'].toLowerCase().contains(query.toLowerCase()) || + // // (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ?? + // // hcp['spl'].toLowerCase().contains(query.toLowerCase())) || + + // hcp['speciality'].toLowerCase().contains(query.toLowerCase()) || + // hcp['addr'].toLowerCase().contains(query.toLowerCase())) + // .toList(); + + // // return _list.where((hcp) { + // // // Perform multiple checks using logical AND (&&) + // // return hcp['name'].toLowerCase().contains(query.toLowerCase()) && + // // hcp['speciality'].toLowerCase().contains(query.toLowerCase()) && + // // hcp['addr'].toLowerCase().contains(query.toLowerCase()); + // // // Add more conditions as needed + // // }).toList(); + // } + // } + List searchHCP(String query) { if (query.isEmpty) { return List.from(_list); // Return full list if query is empty @@ -39,24 +72,26 @@ class hcpProvider extends ChangeNotifier { // .toList(); print("JsonIssList: $_list"); print("queryIssList: $query"); + List selectedValuesList = + query.split(',').map((e) => e.trim()).toList(); - return _list - .where((hcp) => - hcp['name'].toLowerCase().contains(query.toLowerCase()) || - // (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ?? - // hcp['spl'].toLowerCase().contains(query.toLowerCase())) || + return + // _list + // .where((hcp) => + // hcp['name'].toLowerCase().contains(query.toLowerCase()) || + // // (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ?? + // // hcp['spl'].toLowerCase().contains(query.toLowerCase())) || - hcp['speciality'].toLowerCase().contains(query.toLowerCase()) || - hcp['addr'].toLowerCase().contains(query.toLowerCase())) - .toList(); + // hcp['speciality'].toLowerCase().contains(query.toLowerCase()) || + // hcp['addr'].toLowerCase().contains(query.toLowerCase())) + // .toList(); - // return _list.where((hcp) { - // // Perform multiple checks using logical AND (&&) - // return hcp['name'].toLowerCase().contains(query.toLowerCase()) && - // hcp['speciality'].toLowerCase().contains(query.toLowerCase()) && - // hcp['addr'].toLowerCase().contains(query.toLowerCase()); - // // Add more conditions as needed - // }).toList(); + _list.where((hcp) { + // Check if the item matches any of the selected values + return selectedValuesList.any((selected) => + hcp['name'].toLowerCase().contains(selected.toLowerCase())) || + hcp['name'].toLowerCase().contains(query.toLowerCase()); + }).toList(); } } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_add_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_add_provider.dart new file mode 100644 index 0000000..887d514 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_add_provider.dart @@ -0,0 +1,29 @@ +import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; +import 'package:flutter/material.dart'; + +class AddNotesProvider extends ChangeNotifier { + var call_api = CallK2api(); + List result = []; + List get RList => result; + + List deleteresult = []; + List get DelList => deleteresult; + + addnotes(String data, [uniqueId]) async { + final listallnotes = await call_api.addnotesapi(data, uniqueId); + + print("Hiiiiiilistallnotes : ${listallnotes}"); + result = listallnotes; + + notifyListeners(); + } + + deletenotes(uniqueId) async { + final dellistallnotes = await call_api.deletenotesapi(uniqueId); + + print("Hiiiiiilistallnotes : ${dellistallnotes}"); + deleteresult = dellistallnotes; + + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart index 7f30ce6..0c0e484 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart @@ -26,6 +26,8 @@ class AffiliationsProviderk2 extends ChangeNotifier { notifyListeners(); } + bool get hasData => affiliations1.isNotEmpty; + getAllAffiliationsdata() async { print("Affiliations_is: "); final affdata = await affapi.getallaffiliationsdata(); diff --git a/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart index f35468d..470c1c9 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart @@ -14,4 +14,6 @@ class AwardProviderK2 extends ChangeNotifier { awalist = email_result!; notifyListeners(); } + + bool get hasData => awalist.isNotEmpty; } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart index 922a2c5..9356eda 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart @@ -14,4 +14,6 @@ class CertificateProviderK2 extends ChangeNotifier { cerlist = email_result!; notifyListeners(); } + + bool get hasData => cerlist.isNotEmpty; } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart index c6889ca..f3c440c 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart @@ -14,4 +14,6 @@ class EducationProviderK2 extends ChangeNotifier { edulist = email_result!; notifyListeners(); } + + bool get hasData => edulist.isNotEmpty; } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart index 04a5809..56c6b91 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart @@ -1,6 +1,7 @@ import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; import 'package:flutter/cupertino.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; class EmailProviderK2 extends ChangeNotifier { final apicall = CallK2api(); @@ -14,4 +15,11 @@ class EmailProviderK2 extends ChangeNotifier { emaillist = email_result!; notifyListeners(); } + + bool get hasData => emaillist.isNotEmpty; + + storeEmail(row) async { + final emailresult = await apicall.getemaildata(row); + await k2addEmail(emailresult); + } } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart index 8dacf19..5e14ce8 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart @@ -6,6 +6,13 @@ class EventProviderK2 extends ChangeNotifier { final apicall = CallK2api(); List eventlist = []; + List eventlistpagination = []; + + bool _isLoading = false; + bool _hasMore = true; + + int _page = 1; + final int _limit = 10; List get EventsList => eventlist; @@ -13,17 +20,91 @@ class EventProviderK2 extends ChangeNotifier { List get allEventsList => alleventlist; - geteventdata(text) async { - final events = await apicall.geteventsdata(text); + List get eventsListpagination => eventlistpagination; - eventlist = events!; - notifyListeners(); + bool get isLoading => _isLoading; + bool get hasMore => _hasMore; + + geteventdata(text) async { + if (_isLoading || !_hasMore) return; + + try { + final events = await apicall.geteventsdata(text); + + eventlist = events!; + notifyListeners(); + } catch (e) {} } + bool get hasData => eventlist.isNotEmpty; + allgeteventdata() async { final events = await apicall.allgeteventsdata(); alleventlist = events; notifyListeners(); } + + Future geteventsdatawithid() async { + if (_isLoading || !_hasMore) return; + _isLoading = true; + notifyListeners(); + + // + + try { + final events = await apicall.geteventsdatapagelimit(_page, _limit); + if (events!.isEmpty) { + _hasMore = false; + } else { + eventlistpagination.addAll(events); + _page++; + // notifyListeners(); + } + } catch (e) { + } finally { + _isLoading = false; + notifyListeners(); + } + } } + +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; +// import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; +// import 'package:flutter/cupertino.dart'; + +// class EventProviderK2 extends ChangeNotifier { +// final apicall = CallK2api(); + +// List eventlist = []; + +// bool _isLoading = false; +// bool _hasMore = true; + +// int _page = 1; +// final int _limit = 10; + +// List get EventsList => eventlist; + +// List alleventlist = []; + +// List get allEventsList => alleventlist; + +// bool get isLoading => _isLoading; +// bool get hasMore => _hasMore; + +// geteventdata(text) async { + +// final events = await apicall.geteventsdata(text); + +// eventlist = events!; +// notifyListeners(); +// } + +// allgeteventdata() async { +// final events = await apicall.allgeteventsdata(); + +// alleventlist = events; +// notifyListeners(); +// } +// } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart b/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart index d2383e0..3cd06c8 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart @@ -1,4 +1,5 @@ import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; import 'package:flutter/cupertino.dart'; class LocationKolProvider extends ChangeNotifier { @@ -12,5 +13,40 @@ class LocationKolProvider extends ChangeNotifier { final publication_result = await apicall.getlocationsdata(text); loclist = publication_result; notifyListeners(); + + return publication_result; + } + + bool get hasData => loclist.isNotEmpty; + + // Future fetchLocations(int text, int? offline, bool? offlineMode) async { + // // if (_isLoading) return; + + // // _isLoading = true; + // // notifyListeners(); + + // // Your API logic here + + // print("FEcthing_var $text, $offline, $offlineMode"); + + // if (offline == 1) { + // //_locationList = await retrieveidlocations(text); + // } else { + // print("FEcthing_data"); + // final publication_result = await apicall.getlocationsdata(text); + // _locationList = publication_result; + // // Fetch data when online + // // Example: _locationList = await fetchFromAPI(text); + // } + + // _isLoading = false; + // notifyListeners(); + // } + + storeLoc(row) async { + final publicationResult = await apicall.getlocationsdata(row); + print("Getting_data_isss: ${publicationResult}"); + // await addLoc(publicationResult); + await k2addLoc(publicationResult); } } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart index 33ffbc3..f2d2feb 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart @@ -1,5 +1,6 @@ import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; import 'package:flutter/cupertino.dart'; class PhonenoProviderK2 extends ChangeNotifier { @@ -14,4 +15,13 @@ class PhonenoProviderK2 extends ChangeNotifier { phonelist = phone_result; notifyListeners(); } + + bool get hasData => phonelist!.isNotEmpty; + + storePno(row) async { + print("Location_Text"); + final phoneresult = await apicall.getphonedata(row); + print("StorinPnoooooo_is: ${phoneresult}"); + await k2addPno(phoneresult); + } } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart index c4053ae..9c9e4fd 100644 --- a/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart @@ -14,4 +14,6 @@ class TrainigProviderK2 extends ChangeNotifier { tralist = email_result!; notifyListeners(); } + + bool get hasData => tralist.isNotEmpty; } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_viewnotes.dart b/lib/contacts_module/provider_class/k2_provider/kol_viewnotes.dart new file mode 100644 index 0000000..4279d63 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_viewnotes.dart @@ -0,0 +1,60 @@ +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart'; +import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart'; +import 'package:flutter/material.dart'; + +class HcpNotesFecth extends ChangeNotifier { + var call_api = CallK2api(); + + List listnotes = []; + + List get ListNotes => listnotes; + + bool _isLoading = false; + bool _hasMore = true; + + int _page = 1; + final int _limit = 10; + + bool get isLoading => _isLoading; + bool get hasMore => _hasMore; + + // fetchhcpnotes() async { + + // final listallnotes = await call_api.getallnotes(); + + // print("Hiiiiiilistallnotes : ${listallnotes}"); + + // listnotes = listallnotes!; + // notifyListeners(); + // } + + fetchhcpnotes() async { + if (_isLoading || !_hasMore) return; + _isLoading = true; + notifyListeners(); + + try { + // final events = await apicall.geteventsdatapagelimit(_page, _limit); + final listallnotes = await call_api.getallnotes(_page, _limit); + + if (listallnotes!.isEmpty) { + _hasMore = false; + } else { + listnotes.addAll(listallnotes); + _page++; + // notifyListeners(); + } + } catch (e) { + } finally { + _isLoading = false; + notifyListeners(); + } + + // final listallnotes = await call_api.getallnotes(); + + // print("Hiiiiiilistallnotes : ${listallnotes}"); + + // listnotes = listallnotes!; + // notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/profile_storage.dart b/lib/contacts_module/provider_class/k2_provider/profile_storage.dart new file mode 100644 index 0000000..2203dd9 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/profile_storage.dart @@ -0,0 +1,147 @@ +import 'package:discover_module/contacts_module/hive_fun.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/kol_info/curd_kol.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ProfileStorageService { + final BuildContext context; + + ProfileStorageService(this.context); + + offlineProfileK2Store(List selectedIndices, + [List? displayedHCPList]) async { + for (int i = 0; i < selectedIndices.length; i++) { + print('The id id : ${selectedIndices[i]}'); + + Map? row = + findRecordById(displayedHCPList!, selectedIndices[i]); + + print("Storingggg_isss:Row $row"); + + await addKolInfo(row!); + + await storeAffiliations(row["id"].toString()); + await storePublications(row["id"].toString()); + await storeEvents(row["id"].toString()); + await storeTrials(row["id"].toString()); + await storeLocations(row["id"].toString()); + await storePhoneNumbers(row["id"].toString()); + await storeEmails(row["id"].toString()); + await storeEducation(row["id"].toString()); + await storeAwards(row["id"].toString()); + await storeCertificates(row["id"].toString()); + await storePatents(row["id"].toString()); + await storeNIHGrants(row["id"].toString()); + await storeProcedures(row["id"].toString()); + await storeTraining(row["id"].toString()); + await storeSpeakerEvaluations(row["id"].toString()); + } + } + + Future storeAffiliations(String id) async { + await Provider.of(context, listen: false) + .storeAff(id); + } + + Future storePublications(String id) async { + await Provider.of(context, listen: false).storePub(id); + } + + Future storeEvents(String id) async { + await Provider.of(context, listen: false).storeEvent(id); + } + + Future storeTrials(String id) async { + await Provider.of(context, listen: false).storeTrials(id); + } + + Future storeLocations(String id) async { + await Provider.of(context, listen: false).storeLoc(id); + } + + Future storePhoneNumbers(String id) async { + await Provider.of(context, listen: false).storePno(id); + } + + Future storeEmails(String id) async { + await Provider.of(context, listen: false).storeEmail(id); + } + + Future storeEducation(String id) async { + await Provider.of(context, listen: false).storeEdu(id); + } + + Future storeAwards(String id) async { + await Provider.of(context, listen: false).storeAwa(id); + } + + Future storeCertificates(String id) async { + await Provider.of(context, listen: false).storeCer(id); + } + + Future storePatents(String id) async { + await Provider.of(context, listen: false).storePet(id); + } + + Future storeNIHGrants(String id) async { + await Provider.of(context, listen: false).storeNih(id); + } + + Future storeProcedures(String id) async { + await Provider.of(context, listen: false).storePro(id); + } + + Future storeTraining(String id) async { + await Provider.of(context, listen: false) + .storeTraining(id); + } + + Future storeSpeakerEvaluations(String id) async { + await Provider.of(context, listen: false) + .storeSpeaker(id); + } + + Map findRecordById( + List displayedHCPList, String selectedIndic) { + // print( + // "Gettt11111 ${displayedHCPList.firstWhere((element) => element['id'] == int.parse(selectedIndic))}"); + return displayedHCPList + .firstWhere((element) => element['id'] == int.parse(selectedIndic)); + } + + offlineProfileAddContact( + List selectedIndices, List displayedHCPList) async { + for (int i = 0; i < selectedIndices.length; i++) { + print('The id id : ${selectedIndices[i]}'); + + Map? row = + findRecordById(displayedHCPList!, selectedIndices[i]); + + print("Storingggg_isss:Row $row"); + + await HiveFunctions.savemyContact(row); + } + } + + offlineProfileRemoveContact(List _selectedremoveIndices) async { + print("Selected: ${_selectedremoveIndices.length}"); + for (int i = 0; i < _selectedremoveIndices.length; i++) { + await HiveFunctions.deleteUser11(_selectedremoveIndices[i]); + } + } +} diff --git a/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart b/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart index a015398..dc22566 100644 --- a/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart +++ b/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart @@ -8,6 +8,7 @@ import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awa import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; @@ -27,8 +28,6 @@ class CallK2api { print("K2_Urll: $url"); - // final response = await Dio().get(url); - final response = await Dio().post(url, data: {"page": 1, "limit": 100}, options: Options(headers: { @@ -44,19 +43,6 @@ class CallK2api { .toList(); return users; } - - // final jsonresponse = response.data; - - // final jsonresponse211 = response.data["data"]; - - // print("jsonresponse211: ${jsonresponse211}"); - - // final kolresponse = - // jsonresponse211.map((kollist) => Datum.fromJson(kollist)).toList(); - - // print("kolresponse_isss: ${kolresponse}"); - - // return kolresponse; } getsinglehcpdata() async { @@ -65,8 +51,6 @@ class CallK2api { final responsehcp = await Dio().post(url); final jsonresponse1 = responsehcp.data; - // final List Json = json.decode(responsehcp.data); - print("Singlejsondata : ${jsonresponse1}"); return jsonresponse1; } @@ -89,16 +73,6 @@ class CallK2api { return afflist; } - - // print("Gettingdata_isss: ${'''[$affiliationres]'''}"); - - // String arrayText = '''[$affiliationres]'''; - - // final jsonresponse2 = json.decode(arrayText); - - // return jsonresponse2 - // .map((doctor) => Affiliations.fromJson(doctor)) - // .toList(); } getpublicationsdata(id) async { @@ -119,7 +93,7 @@ class CallK2api { var url = '$curl/events/v1/en/fetch'; final events = await Dio().post(url, - data: {"page": 1, "limit": 100}, + data: {"page": 1, "limit": 10}, options: Options(headers: { "Authorization": "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" @@ -130,11 +104,23 @@ class CallK2api { List evelist = dataeve.data!; return evelist; } + } - // String evn = '''[$events]'''; - // final jsonEvent = json.decode(evn); - // print("All_event: $jsonEvent"); - // return jsonEvent.map((doctor) => Events.fromJson(doctor)).toList(); + Future?> geteventsdatawithid(id) async { + var url = '$curl/events/v1/en/fetch'; + + final events = await Dio().post(url, + data: {"page": 1, "limit": 10}, + options: Options(headers: { + "Authorization": + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + if (events.statusCode == 200) { + DataEvent dataeve = DataEvent.fromJson(events.data); + List evelist = dataeve.data!; + return evelist; + } } getallaffiliationsdata() async { @@ -163,7 +149,6 @@ class CallK2api { const url = '$curl/events'; final events = await Dio().get(url); - // final jsonEvent = events.data; final jsonEvent = events.data; print("All_event: $jsonEvent"); @@ -172,17 +157,15 @@ class CallK2api { getalltrials(id) async { print("TrialsssssAPIIIIIIIIII: $id"); - // var url = '$curl/trails/$id'; + var url = '$curl/trails/1'; final trials = await Dio().get(url); String dataa = "[${trials}]"; final jsontrials = jsonDecode(dataa); print("All_trialsss: $jsontrials"); - // return jsontrials; if (jsontrials.isEmpty) { print("notnulllllll: $jsontrials"); - //return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList(); } else { return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList(); } @@ -198,8 +181,6 @@ class CallK2api { } getSpeakerdata() async { - // print("TrialsssssAPIIIIIIIIII: $id"); - // var url = '$curl/trails/$id'; var url = '$curl/speaker/1'; final speaker = await Dio().get(url); @@ -220,33 +201,39 @@ class CallK2api { print("engData_isss: $eng"); return eng; } + // getlocationsdata($id) async { + // var url = '$curl/location/1'; + // final location = await Dio().get(url); + + // print("All_locDataa: ${location.data}"); + + // final List jsonEvent = location.data; // Directly use the data + + // print("All_locDataa123: ${jsonEvent}"); + + // return jsonEvent.map((location) => Loc.fromJson(location)).toList(); + // } getlocationsdata($id) async { - const url = '$curl/contacts/v2/en/kol_location_fetch'; + var url = '$curl/contacts/v2/en/kol_location_fetch'; - // var url = '$curl/location/1'; - - // final location = await Dio().get(url); + // const url = + // 'http://192.168.2.64:8000/api/contacts/v2/en/kol_location_fetch'; final location = await Dio().post(url, data: { - "page": 1, + "page": $id, "limit": 100, "kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1" }, options: Options(headers: { "Authorization": "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + // "Bearer SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" })); - // print("All_locDataaK22: ${location.data}"); - final List jsonEvent = location.data["data"]; // Directly use the data - // print("All_locDataa123: ${jsonEvent}"); - - // return jsonEvent.map((location) => Loc.fromJson(location)).toList(); - if (location.statusCode == 200) { List kolLocation = jsonEvent.map((e) => Data.fromJson(e)).toList(); @@ -256,9 +243,11 @@ class CallK2api { } } - Future?> getphonedata($id) async { + getphonedata($id) async { var url = '$curl/contacts/v2/en/kol_phoneno_fetch'; + //const url = 'http://192.168.2.64:8000/api/contacts/v2/en/kol_phoneno_fetch'; + // final phoneno = await Dio().get(url); final phoneno = await Dio().post(url, data: { @@ -269,33 +258,37 @@ class CallK2api { options: Options(headers: { "Authorization": "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" })); + // if (phoneno.statusCode == 200) { + // final List jsonpno = phoneno.data["data"]; // Directly use the data + // print("All_locDataaphone_pnos: ${jsonpno}"); + // DataaPnoresponse dataPno = DataaPnoresponse.fromJson(phoneno.data); + // List? datalist = dataPno.data; + + // print("All_kol_pnoDataa123: ${datalist}"); + + // return datalist; + // } + + final List jsonEvent = phoneno.data["data"]; // Directly use the data + if (phoneno.statusCode == 200) { - final List jsonpno = phoneno.data["data"]; // Directly use the data - print("All_locDataaphone_pnos: ${jsonpno}"); - DataaPnoresponse dataPno = DataaPnoresponse.fromJson(phoneno.data); - List? datalist = dataPno.data; + List kolPno = + jsonEvent.map((e) => DataPhno.fromJson(e)).toList(); - // List kol_pno = jsonpno.map((e) => pno.PhnoData.fromJson(e)).toList(); + print("All_locDataaK22: ${kolPno}"); - print("All_kol_pnoDataa123: ${datalist}"); - - // List users = (response.data['data'] as List) - // .map((userJson) => Datum.fromJson(userJson)) - // .toList(); - // return users; - - return datalist; + return kolPno; } - // return datalist; - - // return jsonEvent.map((pno) => Phoneno.fromJson(pno)).toList(); } - Future?> getemaildata($id) async { + getemaildata($id) async { var url = '$curl/contacts/v2/en/kol_email_fetch'; + //const url = 'http://192.168.2.64:8000/api/contacts/v2/en/kol_email_fetch'; + final email = await Dio().post(url, data: { "page": 1, @@ -304,6 +297,59 @@ class CallK2api { }, options: Options(headers: { "Authorization": + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" + + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + print("All_locDataaEmaillK22: ${email.data}"); + + final List jsonEvent = email.data["data"]; // Directly use the data + + if (email.statusCode == 200) { + List emailinfo = + jsonEvent.map((e) => EmailData.fromJson(e)).toList(); + + print("All_EmailllllDataaK22: ${emailinfo}"); + + return emailinfo; + } + + // if (email.statusCode == 200) { + // DataEmail email1 = DataEmail.fromJson(email.data); + + // List? emailinfo = email1.data; + + // return emailinfo; + // } + + // final List jsonEvent = phoneno.data["data"]; // Directly use the data + + // if (phoneno.statusCode == 200) { + // List kolPno = + // jsonEvent.map((e) => DataPhno.fromJson(e)).toList(); + + // print("All_locDataaK22: ${kolPno}"); + + // return kolPno; + // } + } + + Future?> oldgetemaildata($id) async { + var url = '$curl/contacts/v2/en/kol_email_fetch'; + + //const url = 'http://192.168.2.64:8000/api/contacts/v2/en/kol_email_fetch'; + + final email = await Dio().post(url, + data: { + "page": 1, + "limit": 100, + "kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1" + }, + options: Options(headers: { + "Authorization": + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" })); @@ -316,12 +362,6 @@ class CallK2api { return emailinfo; } - - // final List jsonEvent = email.data; // Directly use the data - - // print("All_locDataa123: ${jsonEvent}"); - - //return jsonEvent.map((email) => Email.fromJson(email)).toList(); } getpatentdata(id) async { @@ -340,6 +380,8 @@ class CallK2api { Future?> getcerlistdata(id) async { var url = '$curl/contacts/v2/en/kol_certification_fetch'; + // const url = + // 'http://192.168.2.64:8000/api/contacts/v2/en/kol_certification_fetch'; final cer = await Dio().post(url, data: { @@ -349,6 +391,8 @@ class CallK2api { }, options: Options(headers: { "Authorization": + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" })); @@ -360,17 +404,14 @@ class CallK2api { return cerlist; } - - // final List jsonEvent = cer.data; // Directly use the data - - // print("All_locDataa123: ${jsonEvent}"); - - // return jsonEvent.map((certificate) => Cer.fromJson(certificate)).toList(); } Future?> getedulistdata($id) async { var url = '$curl/contacts/v2/en/kol_education_fetch'; + // const url = + // 'http://192.168.2.64:8000/api/contacts/v2/en/kol_education_fetch'; + final edu = await Dio().post(url, data: { "page": 1, @@ -379,6 +420,8 @@ class CallK2api { }, options: Options(headers: { "Authorization": + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" })); @@ -391,12 +434,6 @@ class CallK2api { return edulist; } - - // final List jsonEvent = edu.data; // Directly use the data - - // print("All_locDataa123: ${jsonEvent}"); - - // return jsonEvent.map((edu) => Edu.fromJson(edu)).toList(); } Future?> getawarddata(id) async { @@ -420,20 +457,12 @@ class CallK2api { List awalist = awardss.data!; return awalist; } - - // // String loc = "{$location}"; - // // final jsonEvent = json.decode(loc); - // // print("All_loc: $jsonEvent"); - - // final List jsonEvent = awa.data; // Directly use the data - - // print("All_locDataa123: ${jsonEvent}"); - - // return jsonEvent.map((awards) => Awa.fromJson(awards)).toList(); } Future?> gettrainingdata(id) async { var url = '$curl/contacts/v2/en/kol_training_fetch'; + // const url = + // 'http://192.168.2.64:8000/api/contacts/v2/en/kol_training_fetch'; final training = await Dio().post(url, data: { @@ -444,6 +473,7 @@ class CallK2api { options: Options(headers: { "Authorization": "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + // "Bearer 244|SIIjhONRRt8jyYqEIKb4PZYfEmKCnuSKrTU4Sdhse5c936ae" })); print("All_locDataa:Training: ${training.data}"); @@ -454,16 +484,6 @@ class CallK2api { return traininglist; } - - // // String loc = "{$location}"; - // // final jsonEvent = json.decode(loc); - // // print("All_loc: $jsonEvent"); - - // final List jsonEvent = training.data; // Directly use the data - - // print("All_locDataa123: ${jsonEvent}"); - - // return jsonEvent.map((awards) => Traning.fromJson(awards)).toList(); } getnihdata(id) async { @@ -493,4 +513,124 @@ class CallK2api { return jsonEvent.map((awards) => Pro.fromJson(awards)).toList(); } + + // geteventsdatapagelimit(int page, int limit) {} + + Future?> geteventsdatapagelimit(int page, int limit) async { + var url = '$curl/events/v1/en/fetch'; + + final events = await Dio().post(url, + data: {"page": page, "limit": limit}, + options: Options(headers: { + "Authorization": + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + if (events.statusCode == 200) { + DataEvent dataeve = DataEvent.fromJson(events.data); + List evelist = dataeve.data!; + return evelist; + } + return null; + } + + Future?> getallnotes(int page, int limit) async { + var url = '$curl/contacts/v2/en/kol_note_fetch'; + final allnotes = await Dio().post(url, + data: { + "page": page, + "limit": limit, + "kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1" + }, + options: Options(headers: { + "Authorization": + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + if (allnotes.statusCode == 200) { + FetchNotes notes = FetchNotes.fromJson(allnotes.data); + + List noteslist = notes.data!; + + print("GetAllNotesss: $noteslist"); + return noteslist; + } + return null; + } + + addnotesapi(String data, [uniqueId]) async { + try { + var url = '$curl/contacts/v2/en/kol_note_upsert'; + + Map requestData = { + "note": data, + "kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1" + }; + + // If `id` is provided, add it to the request data for update + if (uniqueId != null && uniqueId.isNotEmpty) { + requestData["id"] = uniqueId; + } + + print("I_amRequesting_Daataa_issss: $requestData"); + final allnotes = await Dio().post(url, + data: requestData, + + // { + // "note": data, + // "kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1" + // // "id": "adc0724ea70c51ff2bf01bfd37b43f09" + // }, + options: Options(headers: { + "Authorization": + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + if (allnotes.statusCode == 200) { + // String response = "[${allnotes.data}]"; + // print("RREESSPPOONNSSEE: ${allnotes.data}"); + + // List jsonList = jsonDecode(response); + // return jsonList; + + List> jsonList = [allnotes.data]; + return jsonList; + + // FetchNotes notes = FetchNotes.fromJson(allnotes.data); + + // List noteslist = notes.data!; + + // print("GetAllNotesss: $noteslist"); + // return noteslist; + } else { + return allnotes.data; + } + } catch (e) { + print("Error occurred: $e"); + } + } + + deletenotesapi(uniqueId) async { + var url = '$curl/contacts/v2/en/kol_note_delete'; + final allnotes = await Dio().post(url, + data: {"id": uniqueId}, + options: Options(headers: { + "Authorization": + "Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd" + })); + + if (allnotes.statusCode == 200) { + // FetchNotes notes = FetchNotes.fromJson(allnotes.data); + + // List noteslist = notes.data!; + + // print("GetAllNotesss: $noteslist"); + // return noteslist; + + List> jsonList = [allnotes.data]; + print("DELETE_List_isss: ${jsonList}"); + return jsonList; + } + return null; + } } diff --git a/lib/contacts_module/service.dart/service.dart b/lib/contacts_module/service.dart/service.dart index bc6bf22..90e0fe7 100644 --- a/lib/contacts_module/service.dart/service.dart +++ b/lib/contacts_module/service.dart/service.dart @@ -30,46 +30,10 @@ class Callapi { final jsonresponse = response.data; - // final apihcpdata = Hive.box("hcpdata"); -// if (apihcpdata.isEmpty) { - // print("alldata_is: , ${jsonresponse} ${jsonresponse.length}"); - // for (int i = 0; i < jsonresponse.length; i++) { - // print("hcp:data_is: , ${jsonresponse[i]['email']}"); - - // // HiveFunctions.storehcpdata({ - // // "id": jsonresponse[i]['id'], - // // "name": jsonresponse[i]['name'], - // // "email": jsonresponse[i]['email'], - // // "summarry": jsonresponse[i]['summarry'], - // // "addr": jsonresponse[i]['addr'], - // // "license_no": jsonresponse[i]['license_no'], - // // "p_suffix": jsonresponse[i]['p_suffix'], - // // "speciality": jsonresponse[i]['speciality'], - // // "sub_speciality": jsonresponse[i]['sub_speciality'], - // // "phone_no": jsonresponse[i]['phone_no'], - // // "rank": jsonresponse[i]['rank'], - // // "score": jsonresponse[i]['score'], - // // "events_count": jsonresponse[i]['events_count'], - // // "affiliations_count": jsonresponse[i]['affiliations_count'], - // // "publications_count": jsonresponse[i]['publications_count'], - // // "img_path": jsonresponse[i]["img_path"], - // // }); - // } - // } - return jsonresponse; - - // print("OfflineJsonnnn"); - // final String response = await rootBundle.loadString('assets/contact.json'); - // final data = await json.decode(response); - // print("Data_isss: $data"); - // return data; } getsinglehcpdata() async { - // const url = 'http://127.0.0.1:8000/api/users/1'; - // const url = 'http://192.168.2.143:8082/api/users/1'; - // const url = 'http://192.168.172.50:8081/api/users/1'; const url = '$curl/users/1'; final responsehcp = await Dio().post(url); @@ -81,50 +45,10 @@ class Callapi { return jsonresponse1; } -// getaffiliationsdata(id) async { -// print("Affiliation_iddd: ${id}"); -// var url = '$curl/affiliations/$id'; - -// // final affiliationres = await Dio().get(url); -// // final jsonresponse2 = affiliationres.data.take(2).toList(); - -// final affiliationres = await Dio().get(url); - -// print("Gettingdata_isss: ${'''[$affiliationres]'''}"); - -// String arrayText = '''[$affiliationres]'''; - -// final jsonresponse2 = json.decode(arrayText); - -// print("Gettingdata_jsonresponse2isss: ${jsonresponse2}"); - -// return jsonresponse2; -// ////////////////////////////////offline////////////////////////// -// // final String response = await Constants.response; - -// // final Affiliation = await json.decode(response); -// // ///////////////////////////////////////////////////// -// // final List> filteredData = Affiliation['Affiliations'] -// // .where((item) => item['user_id'] == id) -// // .cast>() -// // .toList(); -// // print("filteredDatafilteredDatafilteredData: ${filteredData}"); - -// // // Print filtered data - -// // final List affiliations = Affiliation['Affiliations']; - -// // print("Data_isss: $affiliations"); -// // return filteredData; -// } - getaffiliationsdata(id) async { print("Affiliation_iddd: ${id}"); var url = '$curl/affiliations/$id'; - // final affiliationres = await Dio().get(url); - // final jsonresponse2 = affiliationres.data.take(2).toList(); - final affiliationres = await Dio().get(url); print("Gettingdata_isss: ${'''[$affiliationres]'''}"); @@ -136,97 +60,34 @@ class Callapi { return jsonresponse2 .map((doctor) => Affiliations.fromJson(doctor)) .toList(); - - // print("Gettingdata_jsonresponse2isss: ${jsonresponse2}"); - - // return jsonresponse2; } getpublicationsdata(id) async { print("getpublicationsdata_iddd: ${id}"); - // const url = '$curl/publications'; - - // final affiliationres = await Dio().get(url); - // final jsonresponse2 = affiliationres.data.take(2).toList(); - - // return jsonresponse2; var url = '$curl/publications/$id'; final publicationres = await Dio().get(url); String arrayText = '''[$publicationres]'''; - //print("Gettingdata_isss: ${affiliationres}"); - - // final jsonresponse2 = affiliationres.data; final jsonresponse2 = json.decode(arrayText); return jsonresponse2 .map((doctor) => Publications.fromJson(doctor)) .toList(); - //return jsonresponse2; - ////////////////////////////////offline////////////////////////// - - // final String response = await Constants.response; - - // final Publications = await json.decode(response); - // final List publication = Publications['Publications']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Publications['Publications'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("filteredDatafilteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - - // print("publicationData_isss: $publication"); - // return filteredData; } geteventsdata(id) async { var url = '$curl/events/$id'; final events = await Dio().get(url); - // // final jsonEvent = events.data; - // final jsonEvent = events.data; - // print("All_event: $jsonEvent"); - // final jsonEvent1 = events.data.take(2).toList(); - - // print("only few : $jsonEvent1"); - - // return jsonEvent1; - - // final jsonEvent = events.data; String evn = '''[$events]'''; final jsonEvent = json.decode(evn); print("All_event: $jsonEvent"); return jsonEvent.map((doctor) => Events.fromJson(doctor)).toList(); - //return jsonEvent; - - ////////////////////////////////offline////////////////////////// - - // final String response = await Constants.response; - - // final Events = await json.decode(response); - // final List event = Events['Events']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Events['Events'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("filteredDatafilteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("eventData_isss: $event"); - // return filteredData; } getallaffiliationsdata() async { - // const url = 'http://192.168.2.143:8082/api/affiliations'; - //const url = 'http://192.168.172.50:8081/api/affiliations'; const url = '$curl/affiliations/'; final events = await Dio().get(url); @@ -238,12 +99,9 @@ class Callapi { } getallpublicationsdata() async { - // const url = 'http://192.168.2.143:8082/api/publications'; - //const url = 'http://192.168.172.50:8081/api/publications'; const url = '$curl/publications'; final events = await Dio().get(url); - // final jsonEvent = events.data; final jsonEvent = events.data; print("All_event: $jsonEvent"); @@ -251,8 +109,6 @@ class Callapi { } allgeteventsdata() async { - //const url = 'http://192.168.2.143:8082/api/events'; - //const url = 'http://192.168.172.50:8081/api/events'; const url = '$curl/events'; final events = await Dio().get(url); @@ -264,14 +120,6 @@ class Callapi { } getalltrials(id) async { - // print("TrialsssssAPIIIIIIIIII: $id"); - // const url = '$curl/trails'; - - // final trials = await Dio().get(url); - // final jsontrials = trials.data; - // print("All_trialsss: $jsontrials"); - // return jsontrials; - print("TrialsssssAPIIIIIIIIII: $id"); // var url = '$curl/trails/$id'; var url = '$curl/trails/1'; @@ -287,31 +135,9 @@ class Callapi { } else { return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList(); } - ////////////////////////////////offline////////////////////////// - - // final String response = await Constants.response; - - // final Trials = await json.decode(response); - // final List trials = Trials['Trials']; - // ///////////////////////////////////////////////////// - // final List> filteredData = Trials['Trials'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("TrialsssssAPIIIIIIIIIIilteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - - // print("trialsData_isss: $trials"); - // return filteredData; } getallMedicalInsightdata() async { - // const url = 'http://127.0.0.1:8000/api/users'; - // const url = 'http://192.168.2.143:8082/api/users'; - // const url = 'http://192.168.172.50:8082/api/users'; - // const url = 'http://192.168.172.50:8081/api/users'; - const url = '$curl/medicalinsight'; final response = await Dio().get(url); @@ -320,50 +146,19 @@ class Callapi { return jsonresponse; } - // getSpeakerdata() async { - // // const url = '$curl/speaker'; - - // // final response = await Dio().get(url); - - // // final jsonresponse = response.data; - - // // return jsonresponse; - - // final String response = await Constants.response; - - // final Speaker = await json.decode(response); - // final List speaker = Speaker['Speaker']; - - // print("speakerData_isss: $speaker"); - // return speaker; - // } - getSpeakerdata() async { - // print("TrialsssssAPIIIIIIIIII: $id"); - // var url = '$curl/trails/$id'; var url = '$curl/speaker/1'; final speaker = await Dio().get(url); print("Checkkkkk: Speakerrr: $speaker"); - // final jsonspe = jsonDecode(speaker.data); - // print("All_trialsss: $jsonspe"); - final List jsonspe = speaker.data; // Directly use the data return jsonspe.map((location) => Speaker.fromJson(location)).toList(); } getEngdata() async { - // const url = '$curl/engagement'; - - // final response = await Dio().get(url); - - // final jsonresponse = response.data; - - // return jsonresponse; - // } final String response = await Constants.response; final Engagement = await json.decode(response); @@ -373,23 +168,6 @@ class Callapi { return eng; } - // getlocationsdata(id) async { - // final String response = await Constants.response; - - // final Location = await json.decode(response); - // final List event = Location['Location']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Location['Location'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("LocationfilteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("LocationeventData_isss: $event"); - // return filteredData; - // } getlocationsdata($id) async { var url = '$curl/location/1'; @@ -397,10 +175,6 @@ class Callapi { print("All_locDataa: ${location.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = location.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -408,23 +182,6 @@ class Callapi { return jsonEvent.map((location) => Loc.fromJson(location)).toList(); } - // getphonedata(id) async { - // final String response = await Constants.response; - - // final PhoneNo = await json.decode(response); - // final List event = PhoneNo['Location']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = PhoneNo['PhoneNo'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PhoneNofilteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PhoneNoeventData_isss: $event"); - // return filteredData; - // } getphonedata($id) async { var url = '$curl/pno/1'; @@ -432,10 +189,6 @@ class Callapi { print("All_locDataa: ${phoneno.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = phoneno.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -443,24 +196,6 @@ class Callapi { return jsonEvent.map((pno) => Phoneno.fromJson(pno)).toList(); } - // getemaildata(id) async { - // final String response = await Constants.response; - - // final Email = await json.decode(response); - // final List event = Email['Email']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Email['Email'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("EmaililteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("EmaileventData_isss: $event"); - // return filteredData; - // } - getemaildata($id) async { var url = '$curl/email/1'; @@ -468,10 +203,6 @@ class Callapi { print("All_locDataa: ${email.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = email.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -479,24 +210,6 @@ class Callapi { return jsonEvent.map((email) => Email.fromJson(email)).toList(); } - // getpatentdata(id) async { - // final String response = await Constants.response; - - // final Patent = await json.decode(response); - // final List event = Patent['Patent']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Patent['Patent'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } - getpatentdata(id) async { var url = '$curl/patent/1'; @@ -504,10 +217,6 @@ class Callapi { print("All_locDataa: ${patent.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = patent.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -515,24 +224,6 @@ class Callapi { return jsonEvent.map((email) => Patent.fromJson(email)).toList(); } - // getcerlistdata(id) async { - // final String response = await Constants.response; - - // final Certificate = await json.decode(response); - // final List event = Certificate['Certificate']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Certificate['Certificate'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } - getcerlistdata(id) async { var url = '$curl/cer/1'; @@ -540,33 +231,12 @@ class Callapi { print("All_locDataa: ${cer.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = cer.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); return jsonEvent.map((certificate) => Cer.fromJson(certificate)).toList(); } - // getedulistdata(id) async { - // final String response = await Constants.response; - - // final Education = await json.decode(response); - // final List event = Education['Education']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Education['Education'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } getedulistdata($id) async { var url = '$curl/edu/1'; @@ -575,10 +245,6 @@ class Callapi { print("All_locDataa: ${edu.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = edu.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -586,24 +252,6 @@ class Callapi { return jsonEvent.map((edu) => Edu.fromJson(edu)).toList(); } - // getawarddata(id) async { - // final String response = await Constants.response; - - // final Awards = await json.decode(response); - // final List event = Awards['Awards']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Awards['Awards'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } - getawarddata(id) async { var url = '$curl/awa/1'; @@ -611,10 +259,6 @@ class Callapi { print("All_locDataa: ${awa.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = awa.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -622,24 +266,6 @@ class Callapi { return jsonEvent.map((awards) => Awa.fromJson(awards)).toList(); } - // gettrainingdata(id) async { - // final String response = await Constants.response; - - // final Training = await json.decode(response); - // final List event = Training['Training']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Training['Training'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } - gettrainingdata(id) async { var url = '$curl/training/1'; @@ -647,33 +273,13 @@ class Callapi { print("All_locDataa: ${training.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = training.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); return jsonEvent.map((awards) => Traning.fromJson(awards)).toList(); } - // getnihdata(id) async { - // final String response = await Constants.response; - // final Nih = await json.decode(response); - // final List event = Nih['NIHGrants']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Nih['NIHGrants'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } getnihdata(id) async { var url = '$curl/nih/1'; @@ -681,10 +287,6 @@ class Callapi { print("All_locDataa: ${nih.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = nih.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); @@ -692,24 +294,6 @@ class Callapi { return jsonEvent.map((awards) => Nih.fromJson(awards)).toList(); } - // getprodata(id) async { - // final String response = await Constants.response; - - // final Pro = await json.decode(response); - // final List event = Pro['Procedure']; - - // ///////////////////////////////////////////////////// - // final List> filteredData = Pro['Procedure'] - // .where((item) => item['user_id'] == id) - // .cast>() - // .toList(); - // print("PatenteredDatafilteredData111: ${filteredData}"); - - // // Print filtered data - // print("PatenttData_isss: $event"); - // return filteredData; - // } - getprodata(id) async { var url = '$curl/pro/1'; @@ -717,10 +301,6 @@ class Callapi { print("All_locDataa: ${pro.data}"); - // String loc = "{$location}"; - // final jsonEvent = json.decode(loc); - // print("All_loc: $jsonEvent"); - final List jsonEvent = pro.data; // Directly use the data print("All_locDataa123: ${jsonEvent}"); diff --git a/lib/contacts_module/storage_hive/aff_data/insert_aff.dart b/lib/contacts_module/storage_hive/aff_data/insert_aff.dart index cb24b27..5283223 100644 --- a/lib/contacts_module/storage_hive/aff_data/insert_aff.dart +++ b/lib/contacts_module/storage_hive/aff_data/insert_aff.dart @@ -30,10 +30,29 @@ addAffiliation(List affilist) async { for (var affiliation in affiliations) { print("Storing_Affff: ${affiliation.orgName}"); - await box.put(affiliation.id, affiliation); // Use `put` with id as key + // await box.put(affiliation.id, affiliation); + // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), affiliation); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveAffiliations() async { var box = await Hive.openBox('affiliationshive'); print('Retrive Doctor}'); diff --git a/lib/contacts_module/storage_hive/awa_data/crud_awa.dart b/lib/contacts_module/storage_hive/awa_data/crud_awa.dart index 417477f..21934d8 100644 --- a/lib/contacts_module/storage_hive/awa_data/crud_awa.dart +++ b/lib/contacts_module/storage_hive/awa_data/crud_awa.dart @@ -2,15 +2,8 @@ import 'package:discover_module/contacts_module/storage_hive/awa_data/awa_model_ import 'package:hive_flutter/hive_flutter.dart'; addAwa(List awalist) async { - // static final apihcpdata = Hive.box("hcpdata"); - var box = await Hive.openBox('awahive'); -// - //var box = await Hive.openBox('affiliationshive'); - // print("IamPublication_dataaa: ${publist},${publist.}"); - - // Convert JSON list to List List edus = awalist.map((json) { return Awa( id: json.id, @@ -27,24 +20,29 @@ addAwa(List awalist) async { for (var edu in edus) { print("Storing_Eduactionnsss: ${edu.specialty}"); - await box.put(edu.id, edu); // Use `put` with id as key + // await box.put(edu.id, edu); // Use `put` with id as key + + await box.put(await getNextAutoIncrementValue(), edu); } } -// Future retrievePublications() async { -// var box = await Hive.openBox('pubhive'); -// print('Retrive Doctor}'); - -// List publications = box.values.toList(); -// print('Retrive Doctor publications ${publications}}'); - -// for (var publications in publications) { -// print('Retrive artical_title Name: ${publications.artical_title}'); -// print('journal_name: ${publications.journal_name}'); -// // Access other fields as needed -// } +// await box.put(await getNextAutoIncrementValue(), doctor); // } +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidawa(int id) async { var box = await Hive.openBox('awahive'); diff --git a/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart b/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart index 99b74fa..5c6dd78 100644 --- a/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart +++ b/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart @@ -4,15 +4,8 @@ import 'package:discover_module/contacts_module/storage_hive/awa_data/awa_model_ import 'package:hive_flutter/hive_flutter.dart'; addCer(List cerlist) async { - // static final apihcpdata = Hive.box("hcpdata"); - var box = await Hive.openBox('cerhive'); -// - //var box = await Hive.openBox('affiliationshive'); - // print("IamPublication_dataaa: ${publist},${publist.}"); - - // Convert JSON list to List List cers = cerlist.map((json) { return Awa( id: json.id, @@ -29,24 +22,29 @@ addCer(List cerlist) async { for (var cer in cers) { print("Storing_Eduactionnsss: ${cer.specialty}"); - await box.put(cer.id, cer); // Use `put` with id as key + //await box.put(cer.id, cer); // Use `put` with id as key + + await box.put(await getNextAutoIncrementValue(), cer); } } -// Future retrievePublications() async { -// var box = await Hive.openBox('pubhive'); -// print('Retrive Doctor}'); - -// List publications = box.values.toList(); -// print('Retrive Doctor publications ${publications}}'); - -// for (var publications in publications) { -// print('Retrive artical_title Name: ${publications.artical_title}'); -// print('journal_name: ${publications.journal_name}'); -// // Access other fields as needed -// } +// await box.put(await getNextAutoIncrementValue(), doctor); // } +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidcer(int id) async { var box = await Hive.openBox('cerhive'); diff --git a/lib/contacts_module/storage_hive/edu_data/crud_edu.dart b/lib/contacts_module/storage_hive/edu_data/crud_edu.dart index 3c8dcf6..de8752b 100644 --- a/lib/contacts_module/storage_hive/edu_data/crud_edu.dart +++ b/lib/contacts_module/storage_hive/edu_data/crud_edu.dart @@ -1,19 +1,10 @@ import 'package:discover_module/contacts_module/storage_hive/edu_data/edu_model_hive.dart'; -// import 'package:discover_module/storage_hive/edu_data/edu_model_hive.dart'; -// import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart'; -// import 'package:discover_module/storage_hive/pno_data/pno_model_hive.dart'; + import 'package:hive_flutter/hive_flutter.dart'; addEdu(List edulist) async { - // static final apihcpdata = Hive.box("hcpdata"); - var box = await Hive.openBox('edulhive'); -// - //var box = await Hive.openBox('affiliationshive'); - // print("IamPublication_dataaa: ${publist},${publist.}"); - - // Convert JSON list to List List edus = edulist.map((json) { return Edu( id: json.id, @@ -30,24 +21,29 @@ addEdu(List edulist) async { for (var edu in edus) { print("Storing_Eduactionnsss: ${edu.specialty}"); - await box.put(edu.id, edu); // Use `put` with id as key + // await box.put(edu.id, edu); // Use `put` with id as key + + await box.put(await getNextAutoIncrementValue(), edu); } } -// Future retrievePublications() async { -// var box = await Hive.openBox('pubhive'); -// print('Retrive Doctor}'); - -// List publications = box.values.toList(); -// print('Retrive Doctor publications ${publications}}'); - -// for (var publications in publications) { -// print('Retrive artical_title Name: ${publications.artical_title}'); -// print('journal_name: ${publications.journal_name}'); -// // Access other fields as needed -// } +// await box.put(await getNextAutoIncrementValue(), doctor); // } +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidedus(int id) async { var box = await Hive.openBox('edulhive'); diff --git a/lib/contacts_module/storage_hive/email_data/crud_email.dart b/lib/contacts_module/storage_hive/email_data/crud_email.dart index 6cd7c76..2e722a7 100644 --- a/lib/contacts_module/storage_hive/email_data/crud_email.dart +++ b/lib/contacts_module/storage_hive/email_data/crud_email.dart @@ -27,25 +27,45 @@ addEmail(List emaillist) async { for (var email in emails) { print("Storing_Affff: ${email.emailType}"); - await box.put(email.id, email); // Use `put` with id as key + //await box.put(email.id, email); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), email); } } -// Future retrievePublications() async { -// var box = await Hive.openBox('pubhive'); -// print('Retrive Doctor}'); - -// List publications = box.values.toList(); -// print('Retrive Doctor publications ${publications}}'); - -// for (var publications in publications) { -// print('Retrive artical_title Name: ${publications.artical_title}'); -// print('journal_name: ${publications.journal_name}'); -// // Access other fields as needed -// } +// await box.put(await getNextAutoIncrementValue(), doctor); // } +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidemails(int id) async { + var box = await Hive.openBox('emailhive'); + // print('Retrive Doctor}'); + + // var pnos = box.get(id); + // print('Retrive Doctor locations ${pnos}}'); + + // List dataemail = []; + // if (pnos != null) { + // dataemail.add(pnos); // Add to the list if not null + // } +// return dataemail; + + return box.values.toList(); +} + +oldretrieveidemails(int id) async { var box = await Hive.openBox('emailhive'); print('Retrive Doctor}'); @@ -58,3 +78,24 @@ retrieveidemails(int id) async { } return dataemail; } + +k2addEmail(List emaillist) async { + var box = await Hive.openBox('emailhive'); + + List emails = emaillist.map((json) { + return Email( + id: json.uniqueId, + userId: json.uniqueId, + emailType: json.emailTypeName ?? '', + email: json.email ?? '', + ); + }).toList(); + + print("Publicattionnsss_isss: ${emails}"); + + for (var email in emails) { + print("Storing_Affff: ${email.emailType}"); + //await box.put(email.id, email); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), email); + } +} diff --git a/lib/contacts_module/storage_hive/email_data/email_model_hive.dart b/lib/contacts_module/storage_hive/email_data/email_model_hive.dart index bb51363..3fa56d6 100644 --- a/lib/contacts_module/storage_hive/email_data/email_model_hive.dart +++ b/lib/contacts_module/storage_hive/email_data/email_model_hive.dart @@ -4,10 +4,10 @@ part 'email_model_hive.g.dart'; // This part file will be generated @HiveType(typeId: 38) class Email extends HiveObject { @HiveField(0) - final int id; + final String? id; @HiveField(1) - final int userId; + final String? userId; @HiveField(2) final String? emailType; diff --git a/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart b/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart index 1e697d2..e3a5436 100644 --- a/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart +++ b/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart @@ -17,8 +17,8 @@ class EmailAdapter extends TypeAdapter { for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return Email( - id: fields[0] as int, - userId: fields[1] as int, + id: fields[0] as String?, + userId: fields[1] as String?, emailType: fields[2] as String?, email: fields[3] as String?, ); diff --git a/lib/contacts_module/storage_hive/events_data/crud_event.dart b/lib/contacts_module/storage_hive/events_data/crud_event.dart index e48964d..f0cbb1a 100644 --- a/lib/contacts_module/storage_hive/events_data/crud_event.dart +++ b/lib/contacts_module/storage_hive/events_data/crud_event.dart @@ -43,10 +43,29 @@ addEvent(List publist) async { for (var events in events) { print("Storing_Affff: ${events.event_name}"); - await box.put(events.id, events); // Use `put` with id as key + // await box.put(events.id, events); // Use `put` with id as key + + await box.put(await getNextAutoIncrementValue(), events); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + Future retrieveEventss() async { var box = await Hive.openBox('eventhive'); print('Retrive Doctor}'); diff --git a/lib/contacts_module/storage_hive/kol_info/curd_kol.dart b/lib/contacts_module/storage_hive/kol_info/curd_kol.dart index 4dc6f5f..ac9afe8 100644 --- a/lib/contacts_module/storage_hive/kol_info/curd_kol.dart +++ b/lib/contacts_module/storage_hive/kol_info/curd_kol.dart @@ -27,12 +27,22 @@ addKolInfo(Map kollist) async { print("Checkinggg_thatt : ${doctor}, ${doctor.id}"); - await box.put(doctor.id, doctor); + // await box.put(doctor.id, doctor); + await box.put(await getNextAutoIncrementValue(), doctor); +} - // await box.put(affiliation.id, affiliation); // Use `put` with id as key +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } -// return KolInfo(id : json['id'], name : json['id'], email :json['email'], summarry, addr, license_no, p_suffix, speciality, sub_speciality, phone_no, created_at, updated_at, img_path, country) -// }); + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; } retrievekol() async { diff --git a/lib/contacts_module/storage_hive/loc_data/crud_loc.dart b/lib/contacts_module/storage_hive/loc_data/crud_loc.dart index 466c30f..e50e090 100644 --- a/lib/contacts_module/storage_hive/loc_data/crud_loc.dart +++ b/lib/contacts_module/storage_hive/loc_data/crud_loc.dart @@ -3,6 +3,7 @@ import 'package:discover_module/contacts_module/storage_hive/loc_data/location_m import 'package:hive_flutter/hive_flutter.dart'; addLoc(List loclist) async { + print("Trying to store the data : ${loclist}"); // static final apihcpdata = Hive.box("hcpdata"); var box = await Hive.openBox('lochive'); @@ -14,8 +15,8 @@ addLoc(List loclist) async { // Convert JSON list to List List locations = loclist.map((json) { return Location( - id: json.id, - userId: json.userId, + id: json.id.toString(), + userId: json.userId.toString(), institution: json.institution ?? '', address: json.address ?? '', city: json.city ?? '', @@ -27,11 +28,30 @@ addLoc(List loclist) async { print("Publicattionnsss_isss: ${locations}"); for (var loc in locations) { - print("Storing_Affff: ${loc.institution}"); + print("Storing_Afffflocc: ${loc.institution}"); await box.put(loc.id, loc); // Use `put` with id as key + + //await box.put(await getNextAutoIncrementValue(), loc); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + // Future retrievePublications() async { // var box = await Hive.openBox('pubhive'); // print('Retrive Doctor}'); @@ -48,14 +68,56 @@ addLoc(List loclist) async { retrieveidlocations(int id) async { var box = await Hive.openBox('lochive'); - print('Retrive Doctor}'); + print('Retrive Doctor_Locationss : ${box.get}}'); - var locations = box.get(id); - print('Retrive Doctor locations ${locations}}'); + //var locations = box.get(id); + print('Retrive Doctor locations ${box.values.toList()}'); + //print('Retrive Doctor locations1233 ${locations}}'); + print('Retrive Doctor locationsid ${id}}'); - List dataloc = []; - if (locations != null) { - dataloc.add(locations); // Add to the list if not null - } - return dataloc; + // List dataloc = []; + // if (locations != null) { + // dataloc.add(locations); // Add to the list if not null + // } + // print('dataloc ${dataloc}}'); + + // return dataloc; + + return box.values.toList(); +} + +///////////////////////////////////////K2//////////////////////////////// +/// +k2addLoc(List loclist) async { + print("Trying to store the data : ${loclist}"); + // static final apihcpdata = Hive.box("hcpdata"); + + var box = await Hive.openBox('lochive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List locations = loclist.map((json) { + return Location( + id: json.uniqueId.toString(), + userId: json.uniqueId.toString(), + institution: json.organizationName ?? '', + address: json.address1 ?? '', + city: json.cityName ?? '', + state: json.stateName ?? '', + postalCode: json.postalCode.toString() ?? '', + ); + }).toList(); + + print("Publicattionnsss_isss: ${locations}"); + + for (var loc in locations) { + print("Storing_Locationnnnnnlocc: ${loc.institution}"); + await box.put( + await getNextAutoIncrementValue(), loc); // Use `put` with id as key + + //await box.put(await getNextAutoIncrementValue(), loc); + } } diff --git a/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart b/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart index 666b0cd..40749b2 100644 --- a/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart +++ b/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart @@ -4,10 +4,10 @@ part 'location_model_hive.g.dart'; // This part file will be generated @HiveType(typeId: 36) class Location extends HiveObject { @HiveField(0) - final int id; + final String? id; @HiveField(1) - final int userId; + final String? userId; @HiveField(2) final String? institution; diff --git a/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart b/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart index 9904d8c..075cb9b 100644 --- a/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart +++ b/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart @@ -17,8 +17,8 @@ class LocationAdapter extends TypeAdapter { for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return Location( - id: fields[0] as int, - userId: fields[1] as int, + id: fields[0] as String?, + userId: fields[1] as String?, institution: fields[2] as String?, address: fields[3] as String?, city: fields[4] as String?, diff --git a/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart b/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart index b0cb95a..89abc00 100644 --- a/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart +++ b/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart @@ -35,10 +35,28 @@ addNih(List nihlist) async { for (var nih in nihs) { print("Storing_Eduactionnsss: ${nih.piNames}"); - await box.put(nih.id, nih); // Use `put` with id as key + //await box.put(nih.id, nih); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), nih); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidnih(int id) async { var box = await Hive.openBox('nihhive'); diff --git a/lib/contacts_module/storage_hive/patent_data/crud_patent.dart b/lib/contacts_module/storage_hive/patent_data/crud_patent.dart index fefd723..0dd6b24 100644 --- a/lib/contacts_module/storage_hive/patent_data/crud_patent.dart +++ b/lib/contacts_module/storage_hive/patent_data/crud_patent.dart @@ -20,10 +20,28 @@ addPatent(List cerpat) async { for (var pet in pets) { print("Storing_Eduactionnsss: ${pet.patentTitle}"); - await box.put(pet.id, pet); // Use `put` with id as key + //await box.put(pet.id, pet); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pet); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidpatent(int id) async { var box = await Hive.openBox('pethive'); diff --git a/lib/contacts_module/storage_hive/pno_data/crud_pno.dart b/lib/contacts_module/storage_hive/pno_data/crud_pno.dart index 58831ff..f5d5f81 100644 --- a/lib/contacts_module/storage_hive/pno_data/crud_pno.dart +++ b/lib/contacts_module/storage_hive/pno_data/crud_pno.dart @@ -27,10 +27,28 @@ addPno(List pnolist) async { for (var pno in pnonos) { print("Storing_Affff: ${pno.phoneNumber}"); - await box.put(pno.id, pno); // Use `put` with id as key + // await box.put(pno.id, pno); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pno); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + // Future retrievePublications() async { // var box = await Hive.openBox('pubhive'); // print('Retrive Doctor}'); @@ -49,12 +67,43 @@ retrieveidpnos(int id) async { var box = await Hive.openBox('pnohive'); print('Retrive Doctor}'); - var pnos = box.get(id); - print('Retrive Doctor locations ${pnos}}'); + // var pnos = box.get(id); + // print('Retrive Doctor locations ${pnos}}'); - List datapno = []; - if (pnos != null) { - datapno.add(pnos); // Add to the list if not null - } - return datapno; + // List datapno = []; + // if (pnos != null) { + // datapno.add(pnos); // Add to the list if not null + // } + // return datapno; + + return box.values.toList(); +} + +k2addPno(List pnolist) async { + // static final apihcpdata = Hive.box("hcpdata"); + + var box = await Hive.openBox('pnohive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List pnonos = pnolist.map((json) { + return PhoneNo( + id: json.uniqueId.toString(), + userId: json.uniqueId.toString(), + phoneType: json.phoneTypeName.toString() ?? '', + locations: json.organizationName.toString() ?? '', + phoneNumber: json.number.toString() ?? '', + ); + }).toList(); + + print("Publicattionnsss_isss: ${pnonos}"); + + for (var pno in pnonos) { + print("Storing_Affff: ${pno.phoneNumber}"); + // await box.put(pno.id, pno); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pno); + } } diff --git a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart index 008cd44..66799ef 100644 --- a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart +++ b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart @@ -4,10 +4,10 @@ part 'pno_model_hive.g.dart'; // This part file will be generated @HiveType(typeId: 37) class PhoneNo extends HiveObject { @HiveField(0) - final int id; + final String? id; @HiveField(1) - final int userId; + final String? userId; @HiveField(2) final String? phoneType; diff --git a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart index 05b4c27..d1b4afd 100644 --- a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart +++ b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart @@ -17,8 +17,8 @@ class PhoneNoAdapter extends TypeAdapter { for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return PhoneNo( - id: fields[0] as int, - userId: fields[1] as int, + id: fields[0] as String?, + userId: fields[1] as String?, phoneType: fields[2] as String?, locations: fields[3] as String?, phoneNumber: fields[4] as String?, diff --git a/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart b/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart index e8c5cbc..6ce04d7 100644 --- a/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart +++ b/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart @@ -24,10 +24,29 @@ addPro(List nihlist) async { for (var pro in pros) { print("Storing_Eduactionnsss: ${pro.placeOfService}"); - await box.put(pro.id, pro); // Use `put` with id as key + // await box.put(pro.id, pro); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pro); +// } } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidpro(int id) async { var box = await Hive.openBox('prohive'); diff --git a/lib/contacts_module/storage_hive/pub_data/curd_pub.dart b/lib/contacts_module/storage_hive/pub_data/curd_pub.dart index 3c28b0b..34ffff6 100644 --- a/lib/contacts_module/storage_hive/pub_data/curd_pub.dart +++ b/lib/contacts_module/storage_hive/pub_data/curd_pub.dart @@ -31,10 +31,28 @@ addPublication(List publist) async { for (var pub in publications) { print("Storing_Affff: ${pub.artical_title}"); - await box.put(pub.id, pub); // Use `put` with id as key + //await box.put(pub.id, pub); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pub); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + Future retrievePublications() async { var box = await Hive.openBox('pubhive'); print('Retrive Doctor}'); diff --git a/lib/contacts_module/storage_hive/savefilter/save_filter.dart b/lib/contacts_module/storage_hive/savefilter/save_filter.dart new file mode 100644 index 0000000..3dd2e16 --- /dev/null +++ b/lib/contacts_module/storage_hive/savefilter/save_filter.dart @@ -0,0 +1,138 @@ +import 'package:discover_module/contacts_module/storage_hive/pno_data/pno_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/savefilter/save_filter_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +// AddFilterstoSave(selectedtypevalue, [selectedType]) async { +// print("I_am AddFilters $selectedtypevalue, $selectedType"); +// var box = await Hive.openBox('filtershive'); + +// final filter = savecontactfilter( +// id: await getNextAutoIncrementValue(), +// filerType: selectedType, +// filterValue: selectedtypevalue, +// ); +// print("Inserting_data_is: $filter"); +// print( +// "Inserting_data_is: ${filter.id}, ${filter.filerType}, ${filter.filterValue}"); + +// await box.put(filter.id, filter); +// } + +AddFilterstoSaveListtt(List flist) async { + print("I_am AddFilters11 $flist"); + + var box = await Hive.openBox('filtershive'); + + List pros = flist.map((json) { + return savecontactfilter( + id: 1, + filerType: json['filerType'], + filterValue: json['typeValue'], + ); + }).toList(); + + for (var pro in pros) { + // await box.put(pro.id, pro); + // Use `put` with id as key + + print("Pro_isss: $pro"); + await box.put(await getNextAutoIncrementValue(), pro); + } +} + +AddFilterstoSaveListttnew(List flist) async { + print("I_am AddFilters11 $flist"); + + var box = await Hive.openBox('filtersBox'); + + // // Convert the list of maps to a list of strings (or keep it as maps) + // List> filtersToSave = filters; + + // Store the list in the Hive box + await box.put('filters', flist); + + // var box = await Hive.openBox('filtershive'); + + // await box.put(await getNextAutoIncrementValue(), flist); + + // List pros = flist.map((json) { + // return savecontactfilter( + // id: 1, + // filerType: json['filerType'], + // filterValue: json['typeValue'], + // ); + // }).toList(); + + // for (var pro in pros) { + // // await box.put(pro.id, pro); + // // Use `put` with id as key + + // print("Pro_isss: $pro"); + // await box.put(await getNextAutoIncrementValue(), pro); + // } +} + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + +getAllFilters() async { + var box = await Hive.openBox('filtershive'); + + print( + "GetAllFiltersss: ${box.values.toList()}, ${box.values.toList().length}"); + + return box.values.toList(); +} + +Future> getFiltersFromHive1() async { + var box = await Hive.openBox('filtershive'); + + // Getting all the keys in the box + final keys = box.keys; + + // Mapping the keys to the corresponding values + List filters = keys.map((key) { + return box.get(key); + }).toList(); + + return filters; +} + +Future>> getFiltersFromHive() async { + var box = await Hive.openBox('filtershive'); + + List> filtersList = []; + + // Iterate through the box to get all saved filters + for (var key in box.keys) { + var filter = box.get(key) as savecontactfilter; // Cast to your model + filtersList.add({ + 'filerType': filter.filerType!, + 'typeValue': filter.filterValue!, + }); + } + print("FilterListttt_issss: $filtersList"); + return filtersList; // Return the list of maps +} + +Future>> getFilters() async { + var box = await Hive.openBox('filtersBox'); + + // Get the list from the box + List>? filters = box.get('filters'); + + print("Checking Filters: ${filters}"); + + return filters ?? []; // Return an empty list if none found +} diff --git a/lib/contacts_module/storage_hive/savefilter/save_filter_hive.dart b/lib/contacts_module/storage_hive/savefilter/save_filter_hive.dart new file mode 100644 index 0000000..bdcb08b --- /dev/null +++ b/lib/contacts_module/storage_hive/savefilter/save_filter_hive.dart @@ -0,0 +1,20 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'save_filter_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 48) +class savecontactfilter extends HiveObject { + @HiveField(0) + final int? id; + + @HiveField(1) + final String? filerType; + + @HiveField(2) + final String? filterValue; + + savecontactfilter({ + this.id, + this.filerType, + this.filterValue, + }); +} diff --git a/lib/contacts_module/storage_hive/savefilter/save_filter_hive.g.dart b/lib/contacts_module/storage_hive/savefilter/save_filter_hive.g.dart new file mode 100644 index 0000000..1d76788 --- /dev/null +++ b/lib/contacts_module/storage_hive/savefilter/save_filter_hive.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'save_filter_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class savecontactfilterAdapter extends TypeAdapter { + @override + final int typeId = 48; + + @override + savecontactfilter read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return savecontactfilter( + id: fields[0] as int?, + filerType: fields[1] as String?, + filterValue: fields[2] as String?, + ); + } + + @override + void write(BinaryWriter writer, savecontactfilter obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.filerType) + ..writeByte(2) + ..write(obj.filterValue); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is savecontactfilterAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart b/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart index 0411802..d0679c7 100644 --- a/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart +++ b/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart @@ -22,10 +22,28 @@ addSpeaker(List nihlist) async { for (var pro in pros) { print("Storing_Eduactionnsss: ${pro.evaluatorname}"); - await box.put(pro.id, pro); // Use `put` with id as key + //await box.put(pro.id, pro); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pro); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidspeaker(int id) async { var box = await Hive.openBox('speahive'); diff --git a/lib/contacts_module/storage_hive/traning_data/crud_training.dart b/lib/contacts_module/storage_hive/traning_data/crud_training.dart index 74bb001..7599068 100644 --- a/lib/contacts_module/storage_hive/traning_data/crud_training.dart +++ b/lib/contacts_module/storage_hive/traning_data/crud_training.dart @@ -21,10 +21,28 @@ addtraining(List nihlist) async { for (var pro in trai) { print("Storing_Eduactionnsss: ${pro.institutionName}"); - await box.put(pro.id, pro); // Use `put` with id as key + // await box.put(pro.id, pro); // Use `put` with id as key + await box.put(await getNextAutoIncrementValue(), pro); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + retrieveidtri(int id) async { var box = await Hive.openBox('traininghive'); diff --git a/lib/contacts_module/storage_hive/trials_data/crud_trials.dart b/lib/contacts_module/storage_hive/trials_data/crud_trials.dart index 4f71bf3..974dd3a 100644 --- a/lib/contacts_module/storage_hive/trials_data/crud_trials.dart +++ b/lib/contacts_module/storage_hive/trials_data/crud_trials.dart @@ -1,18 +1,9 @@ -// import 'package:discover_module/storage_hive/events_data/event_model_hive.dart'; -// import 'package:discover_module/storage_hive/trials_data/trial_model_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/trials_data/trial_model_hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; addTrials(List publist) async { - // static final apihcpdata = Hive.box("hcpdata"); - var box = await Hive.openBox('trialshive'); -// - //var box = await Hive.openBox('affiliationshive'); - // print("IamPublication_dataaa: ${publist},${publist.}"); - - // Convert JSON list to List List trials = publist.map((json) { return Trials( id: json.id, @@ -47,10 +38,28 @@ addTrials(List publist) async { for (var trials in trials) { print("Storing_Affff: ${trials.trial_name}"); - await box.put(trials.id, trials); // Use `put` with id as key + // await box.put(trials.id, trials); + await box.put(await getNextAutoIncrementValue(), trials); } } +// await box.put(await getNextAutoIncrementValue(), doctor); +// } + +Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; +} + Future retrieveTrials() async { var box = await Hive.openBox('trialshive'); print('Retrive Doctor}'); @@ -61,7 +70,6 @@ Future retrieveTrials() async { for (var Events in events1) { print('Retrive Trials Name: ${Events.trial_name}'); print('Trials: ${Events.status}'); - // Access other fields as needed } } @@ -74,7 +82,7 @@ retrieveidTrials(int id) async { List datatrials = []; if (trials != null) { - datatrials.add(trials); // Add to the list if not null + datatrials.add(trials); } return datatrials; } diff --git a/lib/contacts_module/ui_screen/activity_tab.dart b/lib/contacts_module/ui_screen/activity_tab.dart index 0c88ad1..71e3bc3 100644 --- a/lib/contacts_module/ui_screen/activity_tab.dart +++ b/lib/contacts_module/ui_screen/activity_tab.dart @@ -1,14 +1,3 @@ -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/custom_widget/text.dart'; -// import 'package:discover_module/provider_class/affiliationsprovider.dart'; -// import 'package:discover_module/provider_class/events_provider.dart'; -// import 'package:discover_module/provider_class/publications_provider.dart'; -// import 'package:discover_module/provider_class/trials_provider.dart'; -// import 'package:discover_module/ui_screen/affiliation_data.dart'; -// import 'package:discover_module/ui_screen/bottom_sheet.dart'; -// import 'package:discover_module/ui_screen/events_data.dart'; -// import 'package:discover_module/ui_screen/publication_data.dart'; -// import 'package:discover_module/ui_screen/trials_show_more.dart'; import 'package:discover_module/contacts_module/constants.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; @@ -125,7 +114,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -136,7 +125,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -278,7 +267,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -289,7 +278,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -440,7 +429,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -449,7 +438,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -596,7 +585,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -605,7 +594,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up diff --git a/lib/contacts_module/ui_screen/affiliation_data.dart b/lib/contacts_module/ui_screen/affiliation_data.dart index abbd3b7..b0ff6af 100644 --- a/lib/contacts_module/ui_screen/affiliation_data.dart +++ b/lib/contacts_module/ui_screen/affiliation_data.dart @@ -106,80 +106,7 @@ class _AffiliationsDataState extends State { // ListTile( // title: Text(hcpaffiliations[index]['org_name'].toString())); - }) - - // Scrollbar(, - // child: SingleChildScrollView( - // scrollDirection: Axis.horizontal, - // child: SingleChildScrollView( - // scrollDirection: Axis.vertical, - // child: Container( - // constraints: - // BoxConstraints(minWidth: MediaQuery.of(context).size.width), - // color: Colors.white, - // child: DataTable( - // showCheckboxColumn: false, - // columns: const [ - // //DataColumn(label: Expanded(child: Text('sl no'))), - // DataColumn( - // label: Expanded( - // child: Text('Organization Name'), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Department', softWrap: true))), - // DataColumn( - // label: Expanded(child: Text('Role', softWrap: true))), - // DataColumn( - // label: Expanded( - // child: Text('Time Frame', softWrap: true))), - // DataColumn( - // label: - // Expanded(child: Text('Org Type', softWrap: true))), - // DataColumn( - // label: - // Expanded(child: Text('Eng Type', softWrap: true))), - // // Add more columns as needed - // ], - // rows: List.generate( - // hcpaffiliations.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print("message11 ${hcpaffiliations[index]}"); - - // bottomshet(hcpaffiliations[index]); - // }, - // cells: [ - // // DataCell(Text(hcpaffiliations[index]['id'].toString(), - // // softWrap: true)), - // DataCell(Text( - // hcpaffiliations[index]['org_name'].toString(), - // softWrap: true)), - // DataCell(Text(hcpaffiliations[index]['dept'].toString(), - // softWrap: true)), - // DataCell(Text(hcpaffiliations[index]['role'].toString(), - // softWrap: true)), - // DataCell(Text( - // hcpaffiliations[index]['time_frame'].toString(), - // softWrap: true)), - // DataCell(Text( - // hcpaffiliations[index]['org_type'].toString(), - // softWrap: true)), - // DataCell(Text( - // hcpaffiliations[index]['emg_type'].toString(), - // softWrap: true)), - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // ) - - ); + })); } void bottomshet(affiliation_data) { @@ -263,62 +190,6 @@ class _AffiliationsDataState extends State { ), ), ), - // Padding( - // padding: const EdgeInsets.only(left: 18.0), - // child: - // GestureDetector( - // onTap: () async { - // final ConfigDataProvider - // configDataProvider = - // ConfigDataProvider(); - // await configDataProvider - // .initConfigUIDataEng(); - - // final provider = - // Provider.of( - // context, - // listen: false); - - // if (getCount( - // provider.intConfigDataList[index] - // .name, - // provider) != - // 0) { - // provider.savedList - // .where((element) => - // element.form == - // provider - // .intConfigDataList[index] - // .name) - // .toList(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: - // (BuildContext context) => - // SavedFormListScreen( - // formname: provider - // .intConfigDataList[ - // index] - // .name, - // ))); - // } - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => - // // const InteractionListScreen())); - // }, - // child: Text( - // affiliation_data['org_name'], - // softWrap: true, - // maxLines: 4, - // style: TextStyle( - // fontSize: 18.0, - // color: Colors.grey[700]), - // ), - // ), - // ) ], ), SizedBox( diff --git a/lib/contacts_module/ui_screen/bottom_sheet.dart b/lib/contacts_module/ui_screen/bottom_sheet.dart index 40ad098..34f1d69 100644 --- a/lib/contacts_module/ui_screen/bottom_sheet.dart +++ b/lib/contacts_module/ui_screen/bottom_sheet.dart @@ -627,11 +627,6 @@ class _MyWidgetState extends State { .name, ))); } - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // const InteractionListScreen())); }, child: Text( "View Engagement Form", @@ -902,498 +897,3 @@ class _MyWidgetState extends State { return provider.savedList.where((element) => element.form == form).length; } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:flutter/widgets.dart'; -// import 'package:provider/provider.dart'; - -// class bsheet extends StatefulWidget { -// const bsheet(this.publicationdata, {super.key}); -// final publicationdata; - -// @override -// State createState() => _MyWidgetState(); -// } - -// class _MyWidgetState extends State { -// String? field1, field2, field3, field4, field5, field6, field7; -// String? subfield2, subfield3, subfield4, subfield5, subfield6, subfield7; -// bool? f2, f3, f4, f5, f6, f7; -// bool engbtn = false; -// @override -// void initState() { -// // TODO: implement initState -// super.initState(); -// print("data-isssbottomshett: ${widget.publicationdata}"); -// if (widget.publicationdata['artical_title'] != null) { -// setState(() { -// field1 = widget.publicationdata['artical_title']; - -// subfield2 = "Journal Name"; -// field2 = widget.publicationdata['journal_name']; -// f2 = true; - -// subfield3 = "Date"; -// field3 = widget.publicationdata['date']; -// f3 = true; - -// subfield4 = "Author"; -// field4 = widget.publicationdata['author']; -// f4 = true; - -// subfield5 = ""; -// field5 = " "; -// f5 = false; - -// subfield6 = ""; -// field6 = " "; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); - -// //print("isssbottomshett123: ${widget.publicationdata['event_name']}"); -// } else if (widget.publicationdata['event_name'] != null) { -// setState(() { -// field1 = widget.publicationdata['event_name']; - -// subfield2 = "Session Type"; -// field2 = widget.publicationdata['session_type']; -// f2 = true; - -// subfield3 = "Topic"; -// field3 = widget.publicationdata['topic']; -// f3 = true; - -// subfield4 = "Role"; -// field4 = widget.publicationdata['role']; -// f4 = true; - -// subfield5 = ""; -// field5 = " "; -// f5 = false; - -// subfield6 = ""; -// field6 = " "; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['trial_name'] != null) { -// setState(() { -// field1 = widget.publicationdata['trial_name']; - -// subfield2 = "Status"; -// field2 = widget.publicationdata['status']; -// f2 = true; - -// subfield3 = "Sponsors"; -// field3 = widget.publicationdata['sponsors']; -// f3 = true; - -// subfield4 = "Condtion"; -// field4 = widget.publicationdata['condition']; -// f4 = true; - -// subfield5 = "Intervention"; -// field5 = widget.publicationdata['intervention']; -// f5 = true; - -// subfield6 = "Phase"; -// field6 = widget.publicationdata['phase']; -// f6 = true; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['programtopic'] != null) { -// setState(() { -// field1 = widget.publicationdata['programtopic']; - -// subfield2 = "Speaker Name"; -// field2 = widget.publicationdata['speakername']; -// f2 = true; - -// subfield3 = "Role"; -// field3 = widget.publicationdata['role']; -// f3 = true; - -// subfield4 = "Evalutor Name"; -// field4 = widget.publicationdata['evaluatorname']; -// f4 = true; - -// subfield5 = "Date"; -// field5 = widget.publicationdata['programdate']; -// f5 = true; - -// subfield6 = ""; -// field6 = ""; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['hcpname'] != null) { -// setState(() { -// field1 = widget.publicationdata['hcpname']; - -// subfield2 = "Main Therapeutic Area"; -// field2 = widget.publicationdata['main thereutic area']; -// f2 = true; - -// subfield3 = "Relationship with Chiesi"; -// field3 = widget.publicationdata['relationship with chiesi']; -// f3 = true; - -// subfield4 = "Level of Engagement"; -// field4 = widget.publicationdata['level of engagement']; -// f4 = true; - -// subfield5 = "Date"; -// field5 = widget.publicationdata['date']; -// f5 = true; - -// subfield6 = "Plan of Action"; -// field6 = widget.publicationdata['plan of action']; -// f6 = true; - -// subfield7 = "Recorded By"; -// field7 = widget.publicationdata['recorded by']; -// f7 = true; - -// engbtn = true; -// }); -// } -// // print("data-isssbottomshett: ${widget.publicationdata['artical_title']}"); -// } - -// @override -// Widget build(BuildContext context) { -// return DraggableScrollableSheet( -// expand: false, -// // initialChildSize: -// // 0.7, -// // maxChildSize: -// // 1, -// // minChildSize: -// // 0.5, -// 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: [ -// SizedBox( -// height: 18.0, -// ), -// Row( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Expanded( -// child: Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field1!, -// softWrap: true, -// style: TextStyle( -// fontSize: 16.0, color: Colors.black), -// ), -// ), -// ) -// ], -// ), -// SizedBox( -// height: 0.0, -// ), -// Visibility( -// visible: engbtn, -// child: Row( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: FittedBox( -// fit: BoxFit.fill, -// child: GestureDetector( -// onTap: () async { -// final ConfigDataProvider -// configDataProvider = -// ConfigDataProvider(); -// await configDataProvider -// .initConfigUIDataEng(); - -// final provider = -// Provider.of( -// context, -// listen: false); - -// if (getCount( -// provider -// .intConfigDataList[index] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[index] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: -// (BuildContext context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// index] -// .name, -// ))); -// } -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (context) => -// // const InteractionListScreen())); -// }, -// child: Text( -// "View Engagement Form", -// style: TextStyle( -// fontSize: 14.0, -// color: Colors.grey[700]), -// ), -// ), -// ), -// ) -// ], -// ), -// ), -// SizedBox( -// height: 18.0, -// ), -// Divider(), -// SizedBox( -// height: 8.0, -// ), -// Visibility( -// visible: f2!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// subfield2!, -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field2!, -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// Visibility( -// visible: f3!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// subfield3!, -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field3!, -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// Visibility( -// visible: f4!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// subfield4!, -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field4!, -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// Visibility( -// visible: f5!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// "Oraganization Type", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// "fff", -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// Visibility( -// visible: f6!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// subfield6!, -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field6!, -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// Visibility( -// visible: f7!, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// subfield7!, -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// field7!, -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ), -// ], -// ); -// }), -// ), -// ], -// ), -// ); -// }, -// ); -// } - -// Future getCount(String form, InteractionProvider provider) async { -// await provider.getRecords(); - -// return provider.savedList.where((element) => element.form == form).length; -// } -// } diff --git a/lib/contacts_module/ui_screen/bottomsheet_dynamicheight.dart b/lib/contacts_module/ui_screen/bottomsheet_dynamicheight.dart deleted file mode 100644 index ee48bd9..0000000 --- a/lib/contacts_module/ui_screen/bottomsheet_dynamicheight.dart +++ /dev/null @@ -1,215 +0,0 @@ -// import 'package:flutter/cupertino.dart'; - -// class bsheetDynamicheight extends StatefulWidget { -// const bsheetDynamicheight(this.publicationdata, {super.key}); -// final publicationdata; -// @override -// State createState() => _bsheetDynamicheightState(); -// } - -// class _bsheetDynamicheightState extends State { -// String? field1, field2, field3, field4, field5, field6, field7; -// String? subfield2, subfield3, subfield4, subfield5, subfield6, subfield7; -// bool? f2, f3, f4, f5, f6, f7; -// bool engbtn = false; -// @override -// void initState() { -// // TODO: implement initState -// super.initState(); -// print("data-isssbottomshett: ${widget.publicationdata}"); -// if (widget.publicationdata['artical_title'] != null) { -// setState(() { -// field1 = widget.publicationdata['artical_title']; - -// subfield2 = "Journal Name"; -// field2 = widget.publicationdata['journal_name']; -// f2 = true; - -// subfield3 = "Date"; -// field3 = widget.publicationdata['date']; -// f3 = true; - -// subfield4 = "Author"; -// field4 = widget.publicationdata['author']; -// f4 = true; - -// subfield5 = ""; -// field5 = " "; -// f5 = false; - -// subfield6 = ""; -// field6 = " "; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); - -// //print("isssbottomshett123: ${widget.publicationdata['event_name']}"); -// } else if (widget.publicationdata['event_name'] != null) { -// setState(() { -// field1 = widget.publicationdata['event_name']; - -// subfield2 = "Session Type"; -// field2 = widget.publicationdata['session_type']; -// f2 = true; - -// subfield3 = "Topic"; -// field3 = widget.publicationdata['topic']; -// f3 = true; - -// subfield4 = "Role"; -// field4 = widget.publicationdata['role']; -// f4 = true; - -// subfield5 = ""; -// field5 = " "; -// f5 = false; - -// subfield6 = ""; -// field6 = " "; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['trial_name'] != null) { -// setState(() { -// field1 = widget.publicationdata['trial_name']; - -// subfield2 = "Status"; -// field2 = widget.publicationdata['status']; -// f2 = true; - -// subfield3 = "Sponsors"; -// field3 = widget.publicationdata['sponsors']; -// f3 = true; - -// subfield4 = "Condtion"; -// field4 = widget.publicationdata['condition']; -// f4 = true; - -// subfield5 = "Intervention"; -// field5 = widget.publicationdata['intervention']; -// f5 = true; - -// subfield6 = "Phase"; -// field6 = widget.publicationdata['phase']; -// f6 = true; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['programtopic'] != null) { -// setState(() { -// field1 = widget.publicationdata['programtopic']; - -// subfield2 = "Speaker Name"; -// field2 = widget.publicationdata['speakername']; -// f2 = true; - -// subfield3 = "Role"; -// field3 = widget.publicationdata['role']; -// f3 = true; - -// subfield4 = "Evalutor Name"; -// field4 = widget.publicationdata['evaluatorname']; -// f4 = true; - -// subfield5 = "Date"; -// field5 = widget.publicationdata['programdate']; -// f5 = true; - -// subfield6 = ""; -// field6 = ""; -// f6 = false; - -// subfield7 = ""; -// field7 = " "; -// f7 = false; -// }); -// } else if (widget.publicationdata['hcpname'] != null) { -// setState(() { -// field1 = widget.publicationdata['hcpname']; - -// subfield2 = "Main Therapeutic Area"; -// field2 = widget.publicationdata['main thereutic area']; -// f2 = true; - -// subfield3 = "Relationship with Chiesi"; -// field3 = widget.publicationdata['relationship with chiesi']; -// f3 = true; - -// subfield4 = "Level of Engagement"; -// field4 = widget.publicationdata['level of engagement']; -// f4 = true; - -// subfield5 = "Date"; -// field5 = widget.publicationdata['date']; -// f5 = true; - -// subfield6 = "Plan of Action"; -// field6 = widget.publicationdata['plan of action']; -// f6 = true; - -// subfield7 = "Recorded By"; -// field7 = widget.publicationdata['recorded by']; -// f7 = true; - -// engbtn = true; -// }); -// } -// // print("data-isssbottomshett: ${widget.publicationdata['artical_title']}"); -// } - -// @override -// Widget build(BuildContext context) { -// return Container( -// child: showModalBottomSheet( -// isScrollControlled: true, -// // context and builder are -// // required properties in this widget -// context: context, -// builder: (BuildContext context) { -// // we set up a container inside which -// // we create center column and display text - -// // Returning SizedBox instead of a Container -// return Container( -// width: double.infinity, -// child: Wrap( -// // mainAxisSize: MainAxisSize.max, -// children: [ -// Expanded( -// child: SingleChildScrollView( -// child: Column( -// //mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// // Text( -// // 'GeeksforGeeks'), -// // Text( -// // 'GeeksforGeeks'), - -// // ListView( -// // children: [ -// ...List.generate( -// 20, -// (index) => Text('GeeksforGeeks $index'), -// ) -// ], -// // ) -// // ], -// ), -// ), -// ), -// ], -// ), -// ); -// }, -// ), -// ); -// } -// } diff --git a/lib/contacts_module/ui_screen/chart.dart b/lib/contacts_module/ui_screen/chart.dart deleted file mode 100644 index b5cdd35..0000000 --- a/lib/contacts_module/ui_screen/chart.dart +++ /dev/null @@ -1,251 +0,0 @@ -// import 'package:flutter/material.dart'; -// import 'package:charts_flutter/flutter.dart' as charts; - -// class Chart extends StatefulWidget { -// const Chart({super.key}); - -// @override -// State createState() => _ChartState(); -// } - -// class _ChartState extends State { -// @override -// Widget build(BuildContext context) { -// return Center( -// child: Container( -// height: 200, -// child: _buildChart(), -// ), -// ); -// } -// } - -// Widget _buildChart() { -// final data = [ -// LinearSales("Jan", [50, 100]), -// LinearSales("Feb", [75, 25]), -// LinearSales("Mar", [50, 0]), -// LinearSales("Apr", [25, 85]), -// LinearSales("May", [10, 20]), -// ]; -// final chart = charts.BarChart( -// [ -// charts.Series( -// id: 'Sales', -// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, -// domainFn: (LinearSales sales, _) => sales.month, -// // measureFn: (LinearSales sales, _) => sales.sales, -// measureFn: (LinearSales sales, _) => -// sales.sales.reduce((value, element) => value + element), - -// // measureFn: (LinearSales sales, _) { -// // sales.month; -// // sales.affliations; -// // }, -// data: data, -// ), -// ], -// animate: true, -// ); -// return chart; -// } - -// class LinearSales { -// final String month; -// final List sales; // List of values for the y-axis - -// // final int sales; -// // final int affliations; -// // LinearSales(this.month, this.sales, this.affliations); -// LinearSales(this.month, this.sales); -// } - -import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; - -class Chart extends StatefulWidget { - const Chart({super.key}); - - @override - State createState() => _ChartState(); -} - -class _ChartState extends State { - @override - Widget build(BuildContext context) { - return Center( - child: Container( - height: 200, - child: _buildChart(), - ), - ); - } -} - -Widget _buildChart() { - final data = [ - LinearSales("Jan12weas", [50, 100]), - LinearSales("Febghfctgfc", [75, 35]), - LinearSales("Mardfdxfdx", [50, 20]), - LinearSales("Apr", [25, 85]), - LinearSales("May", [10, 50]), - LinearSales("May1", [10, 50]), - ]; - - final chart = charts.BarChart( - [ - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, - domainFn: (LinearSales sales, _) => sales.month, - measureFn: (LinearSales sales, _) => - sales.sales.reduce((value, element) => value + element), - data: data, - fillColorFn: (LinearSales sales, _) { - print("Salesss"); - print(sales.sales.length); - if (sales.sales.length == 2) { - print("hii"); - - print(sales.sales.indexOf( - sales.sales.reduce((value, element) => value + element)) == - 1); - print(sales.sales.indexOf( - sales.sales.reduce((value, element) => value + element))); - //print(sales.sales.indexOf(2)); - - // final maxIndex = sales.sales.indexOf(sales.sales - // .reduce((value, element) => value > element ? value : element)); - // return sales.sales[0] == 50 - // ? charts.MaterialPalette.red.shadeDefault.lighter - // : charts.MaterialPalette.green.shadeDefault.lighter; - - final totalSales = - sales.sales.reduce((value, element) => value + element); - - print("totalSales $totalSales"); - print(sales.sales[0]); - - int index = data.indexOf(sales); - print("totalSales $index"); - - return totalSales == sales.sales[0] - ? charts.MaterialPalette.red.shadeDefault - : charts.MaterialPalette.green.shadeDefault; - } else { - // If there are more than two values, assign color based on the total sales - final totalSales = - sales.sales.reduce((value, element) => value + element); - return totalSales == sales.sales[0] - ? charts.MaterialPalette.red.shadeDefault.lighter - : charts.MaterialPalette.green.shadeDefault.lighter; - } - }, - ), - ], - animate: true, - ); - - return SizedBox( - height: 300, // Adjust the height as needed - child: chart, - ); -} - -class LinearSales { - final String month; - final List sales; - - LinearSales(this.month, this.sales); -} - -// Widget _buildChart() { -// final data = [ -// LinearSales("Jan", [50, 100]), -// LinearSales("Feb", [75, 35]), -// LinearSales("Mar", [50, 20]), -// LinearSales("Apr", [25, 85]), -// LinearSales("May", [10, 50]), -// ]; - -// final chart = charts.BarChart( -// [ -// charts.Series( -// id: 'Sales', -// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, -// domainFn: (LinearSales sales, _) => sales.month, -// measureFn: (LinearSales sales, _) => -// sales.sales.reduce((value, element) => value + element), -// data: data, -// fillColorFn: (LinearSales sales, _) { -// final totalSales = -// sales.sales.reduce((value, element) => value + element); -// print("Salessss: "); -// print(sales.sales[0]); -// if (sales.sales.length > 1) { -// return totalSales == sales.sales[0] -// ? charts.MaterialPalette.red.shadeDefault.lighter -// : charts.MaterialPalette.red.shadeDefault.lighter; -// } else { -// return totalSales == sales.sales[0] -// ? charts.MaterialPalette.red.shadeDefault.lighter -// : charts.MaterialPalette.green.shadeDefault.lighter; -// } -// }, -// ), -// ], -// animate: true, -// ); - -// return SizedBox( -// height: 300, // Adjust the height as needed -// child: chart, -// ); -// } - -// class LinearSales { -// final String month; -// final List sales; - -// LinearSales(this.month, this.sales); -// } - -// Widget _buildChart() { -// final data = [ -// LinearSales("Jan", [50, 100]), -// LinearSales("Feb", [75, 35]), -// LinearSales("Mar", [50, 20]), -// LinearSales("Apr", [25, 85]), -// LinearSales("May", [10, 50]), -// ]; -// final chart = charts.BarChart( -// [ -// charts.Series( -// id: 'Sales', -// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, -// domainFn: (LinearSales sales, _) => sales.month, -// // measureFn: (LinearSales sales, _) => sales.sales, -// measureFn: (LinearSales sales, _) => -// sales.sales.reduce((value, element) => value + element), - -// // measureFn: (LinearSales sales, _) { -// // sales.month; -// // sales.affliations; -// // }, -// data: data, -// ), -// ], -// animate: true, -// ); -// return chart; -// } - -// class LinearSales { -// final String month; -// final List sales; // List of values for the y-axis - -// // final int sales; -// // final int affliations; -// // LinearSales(this.month, this.sales, this.affliations); -// LinearSales(this.month, this.sales); -// } diff --git a/lib/contacts_module/ui_screen/contact_filters.dart b/lib/contacts_module/ui_screen/contact_filters.dart index 89ff661..5c05de2 100644 --- a/lib/contacts_module/ui_screen/contact_filters.dart +++ b/lib/contacts_module/ui_screen/contact_filters.dart @@ -4,10 +4,12 @@ // import 'package:discover_module/provider_class/hcp%20_provider.dart'; // import 'package:discover_module/ui_screen/new_contacts.dart'; // import 'package:discover_module/ui_screen/saved_profiles/saved_contact.dart'; + import 'package:discover_module/contacts_module/constants.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; import 'package:discover_module/contacts_module/hive_fun.dart'; import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/savefilter/save_filter.dart'; import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_contact.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; @@ -16,8 +18,12 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class FilterDrawer extends StatefulWidget { - FilterDrawer(this.switchValue, this.searchController); + FilterDrawer(this.switchValue, this.searchController, + {required this.onValueChanged, required this.onValueMultiChanged}); bool switchValue; + final Function(String) onValueChanged; + final Function(String) onValueMultiChanged; + TextEditingController searchController = TextEditingController(); @override State createState() => _FilterDrawerState(); @@ -37,220 +43,420 @@ class _FilterDrawerState extends State { 'Event', ]; + var selectedtypevalue; + + List filtersdata = []; + + // List savefiltersdata = []; + List> savefiltersdata = []; + + List> filtersdataarray = []; + + List multidatalist = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + + getFilterss(); + } + + Future getFilterss() async { + // var filters = await getAllFilters(); + var filters = await getFilters(); + + print("Filterdataaaa_iss: $filters, ${filters.length}"); + + setState(() { + // filtersdataarray.clear(); + filtersdata = filters; + }); + } + + Future getFilterss123(List> savefiltersdata) async { + print("filtersdataarray_isss: ${filtersdataarray}"); + // if (filtersdataarray.isNotEmpty) { + // filtersdataarray.clear(); + // } + setState(() { + // filtersdataarray.clear(); + filtersdataarray = savefiltersdata; + }); + } + @override Widget build(BuildContext context) { final dropdownProvider = Provider.of(context); // Adjust to your provider return Drawer( - child: ValueListenableBuilder>( - valueListenable: ddlist, - builder: (context, value, child) { - return ListView( - children: [ - // DrawerHeader removed - ListTile( - title: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Icon( - Icons.sort, - size: 30.0, - ), - const Text( - "Filters", - style: TextStyle( - fontSize: 18.0, fontWeight: FontWeight.bold), - ), - GestureDetector( - onTap: () { - Navigator.pop(context); - // print("hiii"); - }, - child: const Icon(Icons.cancel)) - ], + child: Column( + children: [ + Flexible( + flex: 2, + child: ValueListenableBuilder>( + valueListenable: ddlist, + builder: (context, value, child) { + return ListView( + children: [ + // DrawerHeader removed + ListTile( + title: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Icon( + Icons.sort, + size: 30.0, + ), + const Text( + "Filters", + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.bold), + ), + GestureDetector( + onTap: () { + Navigator.pop(context); + // print("hiii"); + }, + child: const Icon(Icons.cancel)) + ], + ), ), ), - ), - ListTile( - title: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - OutlinedButton( - onPressed: () { - setState(() {}); - }, - child: Text( - 'Reset Filter', - style: TextStyle(color: Constants.k2color), - ), - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + setState(() {}); + }, + child: Text( + 'Reset Filter', + style: TextStyle(color: Constants.k2color), ), - ), - ), - ], - ), - ), - - ListTile( - title: DropdownButtonHideUnderline( - child: DropdownButtonFormField2( - hint: Text("Select the Type"), - decoration: InputDecoration( - // Add Horizontal padding using menuItemStyleData.padding so it matches - // the menu padding when button's width is not specified. - isDense: true, - contentPadding: - const EdgeInsets.symmetric(vertical: 9), - - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - ), - // Add more decoration.. - ), - isExpanded: true, - value: selectedType, - items: items.map((String item) { - return DropdownMenuItem( - value: item, - child: Text(item), - ); - }).toList(), - onChanged: (String? newValue) { - setState(() { - selectedType = newValue; - optionsData(); - }); - }, - buttonStyleData: const ButtonStyleData( - padding: EdgeInsets.symmetric(horizontal: 16), - height: 50, - width: 200, - ), - dropdownStyleData: DropdownStyleData( - maxHeight: 200, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14), - ), - ), - menuItemStyleData: const MenuItemStyleData( - height: 40, - ), - dropdownSearchData: DropdownSearchData( - searchController: textEditingController, - searchInnerWidgetHeight: 50, - searchInnerWidget: Container( - height: 50, - // padding: const EdgeInsets.only( - // top: 8, - // bottom: 4, - // right: 8, - // left: 8, - // ), - child: TextFormField( - expands: true, - maxLines: null, - controller: textEditingController, - decoration: InputDecoration( - isDense: true, - contentPadding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 18, - ), - hintText: 'Search for an item...', - hintStyle: const TextStyle(fontSize: 12), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10.0), - ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), ), ), ), - searchMatchFn: (item, searchValue) { - final itemString = - item.value.toString().toLowerCase(); - final searchString = searchValue.toLowerCase(); - return itemString.contains(searchString); - }, - ), - onMenuStateChange: (isOpen) { - if (!isOpen) { - textEditingController.clear(); - } - }, - iconStyleData: IconStyleData( - icon: Icon(Icons.arrow_drop_down), - iconSize: 20, - ), + ], ), ), - ), - ListTile( - title: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.black), - borderRadius: BorderRadius.circular(10)), - child: Padding( - padding: const EdgeInsets.all(3.5), - child: DropDownField( - hintText: 'Select an option', - items: value, - onValueChanged: (newValue) { - // setState(() { - selectedValue = newValue; - searchController.text = selectedValue; + ListTile( + title: DropdownButtonHideUnderline( + child: DropdownButtonFormField2( + hint: Text("Select the Type"), + decoration: InputDecoration( + // Add Horizontal padding using menuItemStyleData.padding so it matches + // the menu padding when button's width is not specified. + isDense: true, + contentPadding: + const EdgeInsets.symmetric(vertical: 9), - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Contacts1()), - ).then((value) => setState(() {})); - // }); + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + // Add more decoration.. + ), + isExpanded: true, + value: selectedType, + items: items.map((String item) { + return DropdownMenuItem( + value: item, + child: Text(item), + ); + }).toList(), + onChanged: (String? newValue) { + setState(() { + selectedType = newValue; + optionsData(selectedType); + }); }, - value: selectedValue, - ), - ), - ), - ), - - ListTile( - title: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - OutlinedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const SavedContacts1())); - print("refresh done 111"); - // }) - }, - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + buttonStyleData: const ButtonStyleData( + padding: EdgeInsets.symmetric(horizontal: 16), + height: 50, + width: 200, + ), + dropdownStyleData: DropdownStyleData( + maxHeight: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14), ), ), - child: Text1( - title: 'Saved Profiles123', - txtcolor: Constants.k2color, + menuItemStyleData: const MenuItemStyleData( + height: 40, + ), + dropdownSearchData: DropdownSearchData( + searchController: textEditingController, + searchInnerWidgetHeight: 50, + searchInnerWidget: Container( + height: 50, + child: TextFormField( + expands: true, + maxLines: null, + controller: textEditingController, + decoration: InputDecoration( + isDense: true, + contentPadding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 18, + ), + hintText: 'Search for an item...', + hintStyle: const TextStyle(fontSize: 12), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + ), + ), + ), + searchMatchFn: (item, searchValue) { + final itemString = + item.value.toString().toLowerCase(); + final searchString = searchValue.toLowerCase(); + return itemString.contains(searchString); + }, + ), + onMenuStateChange: (isOpen) { + if (!isOpen) { + textEditingController.clear(); + } + }, + iconStyleData: IconStyleData( + icon: Icon(Icons.arrow_drop_down), + iconSize: 20, ), ), - ], + ), ), + ListTile( + title: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10)), + child: Padding( + padding: const EdgeInsets.all(3.5), + child: DropDownField( + hintText: 'Select an option', + items: value, + onValueChanged: (newValue) async { + widget.onValueChanged(newValue); + + setState(() { + selectedtypevalue = newValue; + }); + + // await AddFilterstoSave( + // selectedtypevalue, selectedType); + // getFilterss(); + + print( + "checkingFilterss: ${newValue}, ${selectedType}"); + // Navigator.pop(context); // Close the drawers + + SaveFilter(newValue, selectedType); + }, + value: selectedValue, + ), + ), + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + // getAllFilters(); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const SavedContacts1())); + print("refresh done 111"); + // }) + }, + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text1( + title: 'Saved Profiles123', + txtcolor: Constants.k2color, + ), + ), + ], + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () async { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // const SavedContacts1())); + print("refresh done 111"); + print( + "NewValueee: $selectedtypevalue $selectedType"); + + // savefiltersdata.add(selectedtypevalue,selectedType); + savefiltersdata.add({ + 'filerType': selectedType!, + 'typeValue': selectedtypevalue + }); + + print("savefiltersdata_isss: ${savefiltersdata}"); + + getFilterss123(savefiltersdata); + + // await AddFilterstoSave( + // selectedtypevalue, selectedType); + // getFilterss(); + }, + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text1( + title: 'Save Filters', + txtcolor: Constants.k2color, + ), + ), + ], + ), + ), + ], + ); + }), + ), + Expanded( + child: ListView.builder( + itemCount: filtersdataarray.length, + itemBuilder: (context, index) { + var data = filtersdataarray[index]; + + print("Checkinh12344: $data"); + + return GestureDetector( + onTap: () { + print("clicked_array_isss: ${filtersdataarray}"); + // print("clicked_array_isss: ${filtersdataarray["typeValue"]}"); + + for (var data in filtersdataarray) { + print("Clickedddd_daataa_issss: ${data["typeValue"]}"); + + multidatalist.add(data["typeValue"]); + } + + print("AfterLoop: ${multidatalist}"); + + String namesString = multidatalist.join(', '); + + print("pooja : ${namesString}"); + ///////////////////////////////////// + + widget.onValueMultiChanged(namesString); + + // setState(() { + // selectedtypevalue = filtersdataarray; + // }); + }, + child: Column( + children: [ + Text1( + title: + "${data["filerType"]!} : ${data["typeValue"]!}"), + ], ), - ], - ); - })); + ); + }), + ), + // ListTile( + // title: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // OutlinedButton( + // onPressed: () async { + // // await AddFilterstoSave(selectedtypevalue, selectedType); + + // // await AddFilterstoSave(selectedtypevalue, selectedType); + + // print("lengthhhh: ${filtersdataarray.length}"); + + // // for (int i = 0; i < filtersdataarray.length; i++) { + // // print( + // // "filtersdataarray: ${filtersdataarray[i]["typeValue"]}"); + + // await AddFilterstoSaveListttnew(filtersdataarray); + // // } + // // await AddFilterstoSaveList(filtersdataarray); + + // getFilterss(); + + // // setState(() { + + // // }); + + // // }) + // }, + // style: OutlinedButton.styleFrom( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(12), + // ), + // ), + // child: Text1( + // title: 'New Save Filters', + // txtcolor: Constants.k2color, + // ), + // ), + // ], + // ), + // ), + // Expanded( + // child: ListView.builder( + // itemCount: filtersdata.length, + // itemBuilder: (context, index) { + // var data = filtersdata[index]; + + // print("Filterssss_dataa_issss1233Hiiiii"); + + // print("Filterssss_dataa_issss1233: ${data})}"); + + // return GestureDetector( + // onTap: () { + // print("Clicked_the_data $index"); + // }, + // child: Column( + // children: [ + // Text1(title: data.toString()), + + // // Text1(title: data.filerType), + // // Text1(title: data.typeValue), + // ], + // ), + // ); + // }), + // ) + ], + )); } - optionsData() async { + optionsData(String? selectedType) async { print("hiiiiiiiii"); if (selectedType == "Profile Type") { print("PPPP11"); @@ -311,4 +517,447 @@ class _FilterDrawerState extends State { ddlist.value = offlinenamelist; } } + + SaveFilter(newValue, String? selectedType) { + print("NewValueee: $newValue $selectedType"); + + return Padding( + padding: const EdgeInsets.all(8.0), + child: ListTile(title: Text("hiii")), + ); + } } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// // import 'package:discover_module/constants.dart'; +// // import 'package:discover_module/custom_widget/text.dart'; +// // import 'package:discover_module/hive_fun.dart'; +// // import 'package:discover_module/provider_class/hcp%20_provider.dart'; +// // import 'package:discover_module/ui_screen/new_contacts.dart'; +// // import 'package:discover_module/ui_screen/saved_profiles/saved_contact.dart'; +// import 'package:discover_module/contacts_module/constants.dart'; +// import 'package:discover_module/contacts_module/custom_widget/text.dart'; +// import 'package:discover_module/contacts_module/hive_fun.dart'; +// import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +// import 'package:discover_module/contacts_module/storage_hive/savefilter/save_filter.dart'; +// import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; +// import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_contact.dart'; +// import 'package:dropdown_button2/dropdown_button2.dart'; +// import 'package:dropdownfield2/dropdownfield2.dart'; +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; + +// class FilterDrawer extends StatefulWidget { +// FilterDrawer(this.switchValue, this.searchController, +// {required this.onValueChanged}); +// bool switchValue; +// final Function(String) onValueChanged; + +// TextEditingController searchController = TextEditingController(); +// @override +// State createState() => _FilterDrawerState(); +// } + +// class _FilterDrawerState extends State { +// var items = [ +// 'Profile Type', +// 'HCP Name', +// 'Speciality', +// 'Country', +// 'Region', +// 'State', +// 'City', +// 'List', +// 'Organization', +// 'Event', +// ]; + +// var selectedtypevalue; + +// List filtersdata = []; + +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); + +// getFilterss(); +// } + +// Future getFilterss() async { +// var filters = await getAllFilters(); +// print("Filterdataaaa_iss: $filters, ${filters.length}"); + +// setState(() { +// filtersdata = filters; +// }); +// } + +// @override +// Widget build(BuildContext context) { +// final dropdownProvider = +// Provider.of(context); // Adjust to your provider + +// return Drawer( +// child: Column( +// children: [ +// Expanded( +// child: ValueListenableBuilder>( +// valueListenable: ddlist, +// builder: (context, value, child) { +// return ListView( +// children: [ +// // DrawerHeader removed +// ListTile( +// title: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// const Icon( +// Icons.sort, +// size: 30.0, +// ), +// const Text( +// "Filters", +// style: TextStyle( +// fontSize: 18.0, fontWeight: FontWeight.bold), +// ), +// GestureDetector( +// onTap: () { +// Navigator.pop(context); +// // print("hiii"); +// }, +// child: const Icon(Icons.cancel)) +// ], +// ), +// ), +// ), + +// ListTile( +// title: Row( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// OutlinedButton( +// onPressed: () { +// setState(() {}); +// }, +// child: Text( +// 'Reset Filter', +// style: TextStyle(color: Constants.k2color), +// ), +// style: OutlinedButton.styleFrom( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(12), +// ), +// ), +// ), +// ], +// ), +// ), + +// ListTile( +// title: DropdownButtonHideUnderline( +// child: DropdownButtonFormField2( +// hint: Text("Select the Type"), +// decoration: InputDecoration( +// // Add Horizontal padding using menuItemStyleData.padding so it matches +// // the menu padding when button's width is not specified. +// isDense: true, +// contentPadding: +// const EdgeInsets.symmetric(vertical: 9), + +// border: OutlineInputBorder( +// borderRadius: BorderRadius.circular(10.0), +// ), +// // Add more decoration.. +// ), +// isExpanded: true, +// value: selectedType, +// items: items.map((String item) { +// return DropdownMenuItem( +// value: item, +// child: Text(item), +// ); +// }).toList(), +// onChanged: (String? newValue) { +// setState(() { +// selectedType = newValue; +// optionsData(selectedType); +// }); +// }, +// buttonStyleData: const ButtonStyleData( +// padding: EdgeInsets.symmetric(horizontal: 16), +// height: 50, +// width: 200, +// ), +// dropdownStyleData: DropdownStyleData( +// maxHeight: 200, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(14), +// ), +// ), +// menuItemStyleData: const MenuItemStyleData( +// height: 40, +// ), +// dropdownSearchData: DropdownSearchData( +// searchController: textEditingController, +// searchInnerWidgetHeight: 50, +// searchInnerWidget: Container( +// height: 50, +// child: TextFormField( +// expands: true, +// maxLines: null, +// controller: textEditingController, +// decoration: InputDecoration( +// isDense: true, +// contentPadding: const EdgeInsets.symmetric( +// horizontal: 10, +// vertical: 18, +// ), +// hintText: 'Search for an item...', +// hintStyle: const TextStyle(fontSize: 12), +// border: OutlineInputBorder( +// borderRadius: BorderRadius.circular(10.0), +// ), +// ), +// ), +// ), +// searchMatchFn: (item, searchValue) { +// final itemString = +// item.value.toString().toLowerCase(); +// final searchString = searchValue.toLowerCase(); +// return itemString.contains(searchString); +// }, +// ), +// onMenuStateChange: (isOpen) { +// if (!isOpen) { +// textEditingController.clear(); +// } +// }, +// iconStyleData: IconStyleData( +// icon: Icon(Icons.arrow_drop_down), +// iconSize: 20, +// ), +// ), +// ), +// ), +// ListTile( +// title: Container( +// decoration: BoxDecoration( +// border: Border.all(color: Colors.black), +// borderRadius: BorderRadius.circular(10)), +// child: Padding( +// padding: const EdgeInsets.all(3.5), +// child: DropDownField( +// hintText: 'Select an option', +// items: value, +// onValueChanged: (newValue) { +// widget.onValueChanged(newValue); + +// setState(() { +// selectedtypevalue = newValue; +// }); + +// print( +// "checkingFilterss: ${newValue}, ${selectedType}"); +// // Navigator.pop(context); // Close the drawers + +// SaveFilter(newValue, selectedType); +// }, +// value: selectedValue, +// ), +// ), +// ), +// ), + +// ListTile( +// title: Row( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// OutlinedButton( +// onPressed: () { +// // getAllFilters(); + +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => +// const SavedContacts1())); +// print("refresh done 111"); +// // }) +// }, +// style: OutlinedButton.styleFrom( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(12), +// ), +// ), +// child: Text1( +// title: 'Saved Profiles123', +// txtcolor: Constants.k2color, +// ), +// ), +// ], +// ), +// ), + +// ListTile( +// title: Row( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// OutlinedButton( +// onPressed: () async { +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (context) => +// // const SavedContacts1())); +// print("refresh done 111"); +// print( +// "NewValueee: $selectedtypevalue $selectedType"); + +// await AddFilterstoSave( +// selectedtypevalue, selectedType); +// getFilterss(); + +// // setState(() { + +// // }); + +// // }) +// }, +// style: OutlinedButton.styleFrom( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(12), +// ), +// ), +// child: Text1( +// title: 'Save Filters', +// txtcolor: Constants.k2color, +// ), +// ), +// ], +// ), +// ), +// ], +// ); +// }), +// ), +// Expanded( +// child: ListView.builder( +// itemCount: filtersdata.length, +// itemBuilder: (context, index) { +// var data = filtersdata[index]; + +// print("Filterssss_dataa_issss: $data"); + +// return Column( +// children: [ +// Text1(title: data.filerType), +// Text1(title: data.filterValue), +// ], +// ); +// }), +// ) +// ], +// )); +// } + +// optionsData(String? selectedType) async { +// print("hiiiiiiiii"); +// if (selectedType == "Profile Type") { +// print("PPPP11"); +// setState(() { +// ddlist.value = [ +// "All Profile", +// 'Full Profile', +// 'Basic Profile', +// ]; +// }); +// } else if (selectedType == "HCP Name") { +// print("FilterHcpNameeeNeww"); +// fetchhcpname(selectedType); +// } else if (selectedType == "Speciality") { +// fetchhcpname(selectedType); +// } else if (selectedType == "Country") { +// print("kkk"); +// setState(() { +// ddlist.value = [ +// "United States", +// "United States", +// "United States", +// ]; +// }); +// } else if (selectedType == "State") { +// print("kkk"); +// setState(() { +// ddlist.value = [ +// "Karnataka", +// 'Karnataka', +// 'Karnataka', +// ]; +// }); +// } else if (selectedType == "City") { +// print("kkk"); +// setState(() { +// ddlist.value = [ +// "Hubli", +// 'Hubli', +// 'Hubli', +// ]; +// }); +// } +// } + +// Future fetchhcpname([String? selectedType]) async { +// print("selectedTypeselectedType: ${selectedType}, ${widget.switchValue}"); +// var hcpDataProvider1 = Provider.of(context, listen: false); + +// if (widget.switchValue == false) { +// List namelist = +// await hcpDataProvider1.gethcpNamefilter(selectedType); +// ddlist.value = namelist; +// setState(() {}); +// } else { +// List offlinenamelist = +// await HiveFunctions.getAllhcpdata(selectedType); +// ddlist.value = offlinenamelist; +// } +// } + +// SaveFilter(newValue, String? selectedType) { +// print("NewValueee: $newValue $selectedType"); + +// return Padding( +// padding: const EdgeInsets.all(8.0), +// child: ListTile(title: Text("hiii")), +// ); +// } +// } diff --git a/lib/contacts_module/ui_screen/contacts.dart b/lib/contacts_module/ui_screen/contacts.dart deleted file mode 100644 index 6152596..0000000 --- a/lib/contacts_module/ui_screen/contacts.dart +++ /dev/null @@ -1,518 +0,0 @@ -// // import 'package:discover_module/hive_fun.dart'; -// // import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; - -// // import 'package:discover_module/provider_class/hcp%20_provider.dart'; -// // import 'package:discover_module/ui_screen/profile.dart'; -// // import 'package:discover_module/ui_screen/ranking.dart'; -// // import 'package:flutter/cupertino.dart'; -// // import 'package:flutter/material.dart'; -// // import 'package:flutter/services.dart'; -// // import 'package:flutter/widgets.dart'; -// // import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -// // import 'package:hive_flutter/hive_flutter.dart'; -// // import 'package:provider/provider.dart'; - -// // class Contacts extends StatefulWidget { -// // const Contacts({super.key}); - -// // @override -// // State createState() => _ContactsState(); -// // } - -// // class _ContactsState extends State { -// // // final _contactbox = Hive.box('mycontact'); -// // static final _contactbox = Hive.box("mycontact"); - -// // bool _switchValue = false; - -// // bool isOnline2 = false; - -// // // List alldata = _contactbox.values.toList(); -// // @override -// // void initState() { -// // // TODO: implement initState -// // super.initState(); -// // setupConnectivityListener(); - -// // getcall(); -// // } - -// // NetworkConnectivity networkConnectivity = NetworkConnectivity(); - -// // Future setupConnectivityListener() async { -// // while (true) { -// // bool isOnline = await networkConnectivity.isInternetAvailable(); -// // print('Internetcontact available: $isOnline'); -// // // Perform actions based on connectivity status -// // await Future.delayed(Duration(seconds: 10)); - -// // setState(() { -// // isOnline2 = isOnline; -// // }); // Example: Check every 10 seconds -// // } -// // } - -// // void getcall() async { -// // await Provider.of(context, listen: false).getHCPProvider(); -// // } - -// // @override -// // Widget build(BuildContext context) { -// // SystemChrome.setSystemUIOverlayStyle( -// // SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); -// // print( -// // "newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}"); - -// // print( -// // "Data_newww: ${HiveFunctions.getAllUsers()} ,${HiveFunctions.getAllUsers().length} "); - -// // return SafeArea( -// // child: Scaffold( -// // // appBar: AppBar( -// // // title: const Text('Contacts'), -// // // ), -// // body: Consumer(builder: (context, value, child) { -// // print("todoss: ${value},${value.list.length}"); -// // return Column( -// // children: [ -// // Row( -// // mainAxisAlignment: MainAxisAlignment -// // .center, // Align children to start and end of the row - -// // children: [ -// // Expanded( -// // child: Padding( -// // padding: const EdgeInsets.only(left: 45.0), -// // child: Text( -// // _switchValue ? "My Contacts" : "All Contacts", -// // textAlign: TextAlign.center, -// // style: TextStyle( -// // fontSize: 20.0, -// // fontWeight: FontWeight.w500, -// // fontStyle: FontStyle.normal, -// // color: -// // _switchValue ? Colors.black : Colors.black), -// // ), -// // ), -// // ), -// // // Expanded( -// // Row( -// // // Adjust alignment as needed -// // mainAxisSize: MainAxisSize.min, -// // children: [ -// // _switchValue -// // ? const Text( -// // 'All', -// // style: TextStyle( -// // fontSize: 12, -// // decoration: TextDecoration.lineThrough, -// // decorationThickness: 0.85, -// // ), -// // // TODO: implement dispose -// // ) -// // : const Text('All', -// // style: TextStyle( -// // fontSize: 12, -// // )), -// // CupertinoSwitch( -// // activeColor: Color.fromARGB(255, 0, 71, 132), -// // value: _switchValue, -// // onChanged: (value) { -// // setState(() { -// // print("Switch_value_is : $value"); -// // _switchValue = value; -// // }); -// // }, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(right: 8.0), -// // child: !_switchValue -// // ? const Text( -// // 'My', -// // style: TextStyle( -// // fontSize: 12, -// // decoration: TextDecoration.lineThrough, -// // decorationThickness: 0.85, -// // ), -// // ) -// // : const Text('My', -// // style: TextStyle( -// // fontSize: 12, -// // )), -// // ) -// // ], -// // ), -// // // ), -// // ]), -// // isOnline2 -// // ? Expanded( -// // child: ListView.builder( -// // itemCount: value.list.length, -// // itemBuilder: (BuildContext context, int index) { -// // // var data = HiveFunctions.getAllUsers()[index]; -// // var data = value.list[index]; - -// // print("dataaaa_isss:$data"); - -// // return Column( -// // children: [ -// // ListTile( -// // onTap: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (context) => Profile( -// // text: data, -// // ))); -// // }, -// // // title: Text(_contactbox.values.toString()), -// // leading: ProfilePicture( -// // name: data["name"], -// // radius: 20, -// // fontsize: 12, -// // ), -// // title: Text( -// // data["name"], -// // style: const TextStyle( -// // fontSize: 18.0, -// // fontWeight: FontWeight.bold), -// // ), -// // subtitle: const Text( -// // "Added by Pooja.K", -// // style: TextStyle( -// // fontSize: 14.0, -// // fontWeight: FontWeight.normal), -// // ), -// // ), -// // ], -// // ); -// // }, -// // ), -// // ) -// // : Expanded( -// // child: ListView.builder( -// // itemCount: HiveFunctions.getAllUsers().length, -// // itemBuilder: (BuildContext context, int index) { -// // var data = HiveFunctions.getAllUsers()[index]; - -// // print("dataaaa_isss:$data"); - -// // return Column( -// // children: [ -// // ListTile( -// // onTap: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (context) => Profile( -// // text: data, -// // ))); -// // }, -// // // title: Text(_contactbox.values.toString()), -// // leading: ProfilePicture( -// // name: data["name"], -// // radius: 20, -// // fontsize: 12, -// // ), -// // title: Text( -// // data["name"], -// // style: const TextStyle( -// // fontSize: 18.0, -// // fontWeight: FontWeight.bold), -// // ), -// // subtitle: const Text( -// // "Added by Pooja.K", -// // style: TextStyle( -// // fontSize: 14.0, -// // fontWeight: FontWeight.normal), -// // ), -// // ), -// // ], -// // ); -// // }, -// // ), -// // ), - -// // /////////////////////////////////////////////// -// // // Expanded( -// // // child: ListView.builder( -// // // itemCount: HiveFunctions.getAllUsers().length, -// // // itemBuilder: (BuildContext context, int index) { -// // // var data = HiveFunctions.getAllUsers()[index]; - -// // // print("dataaaa_isss:$data"); - -// // // return Column( -// // // children: [ -// // // ListTile( -// // // onTap: () { -// // // Navigator.push( -// // // context, -// // // MaterialPageRoute( -// // // builder: (context) => Profile( -// // // text: data, -// // // ))); -// // // }, -// // // // title: Text(_contactbox.values.toString()), -// // // leading: ProfilePicture( -// // // name: data["name"], -// // // radius: 20, -// // // fontsize: 12, -// // // ), -// // // title: Text( -// // // data["name"], -// // // style: const TextStyle( -// // // fontSize: 18.0, fontWeight: FontWeight.bold), -// // // ), -// // // subtitle: const Text( -// // // "Added by Pooja.K", -// // // style: TextStyle( -// // // fontSize: 14.0, fontWeight: FontWeight.normal), -// // // ), -// // // ), -// // // ], -// // // ); -// // // }, -// // // ), -// // // ), -// // ], -// // ); -// // }), -// // ), -// // ); -// // } -// // } - -// import 'package:discover_module/provider_class/hcp%20_provider.dart'; -// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -// import 'package:discover_module/ui_screen/new_profile.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -// import 'package:hive_flutter/hive_flutter.dart'; -// import 'package:provider/provider.dart'; -// import 'package:flutter/services.dart'; -// import 'package:discover_module/ui_screen/profile.dart'; - -// class Contacts extends StatefulWidget { -// const Contacts({Key? key}) : super(key: key); - -// @override -// State createState() => _ContactsState(); -// } - -// class _ContactsState extends State { -// final _contactBox = Hive.box("mycontact"); -// bool _switchValue = false; -// bool? isOnline2; - -// @override -// void initState() { -// super.initState(); -// setupConnectivityListener(); -// // getCall(); -// } - -// Future setupConnectivityListener() async { -// while (true) { -// bool isOnline = await NetworkConnectivity().isInternetAvailable(); -// print('Internet contact available: $isOnline'); -// await Future.delayed(Duration(seconds: 2)); -// if (mounted) { -// setState(() { -// isOnline2 = isOnline; -// }); -// } -// if (isOnline2 == true) { -// getCall(); -// } -// } -// } - -// // @override -// // void dispose() { -// // // TODO: implement dispose -// // } -// void getCall() async { -// await Provider.of(context, listen: false).getHCPProvider(); -// } - -// @override -// Widget build(BuildContext context) { -// SystemChrome.setSystemUIOverlayStyle( -// SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); - -// print("internet data_is: $isOnline2"); -// return SafeArea( -// child: Scaffold( -// body: Consumer( -// builder: (context, value, child) { -// return Column( -// children: [ -// Row( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Expanded( -// child: Padding( -// padding: const EdgeInsets.only(left: 45.0), -// child: Text( -// _switchValue ? "My Contacts" : "All Contacts", -// textAlign: TextAlign.center, -// style: TextStyle( -// fontSize: 20.0, -// fontWeight: FontWeight.w500, -// ), -// ), -// ), -// ), -// Row( -// mainAxisSize: MainAxisSize.min, -// children: [ -// _switchValue -// ? const Text( -// 'All', -// style: TextStyle( -// fontSize: 12, -// decoration: TextDecoration.lineThrough, -// decorationThickness: 0.85, -// ), -// ) -// : const Text( -// 'All', -// style: TextStyle( -// fontSize: 12, -// ), -// ), -// CupertinoSwitch( -// activeColor: Color.fromARGB(255, 0, 71, 132), -// value: _switchValue, -// onChanged: (value) { -// setState(() { -// _switchValue = value; -// }); -// }, -// ), -// Padding( -// padding: const EdgeInsets.only(right: 8.0), -// child: !_switchValue -// ? const Text( -// 'My', -// style: TextStyle( -// fontSize: 12, -// decoration: TextDecoration.lineThrough, -// decorationThickness: 0.85, -// ), -// ) -// : const Text( -// 'My', -// style: TextStyle( -// fontSize: 12, -// ), -// ), -// ) -// ], -// ), -// ], -// ), -// if (isOnline2 == true) -// Expanded( -// child: ListView.builder( -// itemCount: value.list.length, -// itemBuilder: (BuildContext context, int index) { -// var data = value.list[index]; -// return ListTile( -// onTap: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (context) => Profile( -// // text: data, -// // ), -// // ), -// // ); - -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => NewProfile(text: data))); -// }, -// leading: data["img_path"] == null -// ? ProfilePicture( -// name: data["name"], -// radius: 20, -// fontsize: 12, -// ) -// : ClipOval( -// child: SizedBox.fromSize( -// size: Size.fromRadius(20), -// child: Image.network(data["img_path"], -// fit: BoxFit.cover), -// ), -// ), -// title: Text( -// data["name"], -// style: TextStyle( -// fontSize: 18.0, -// fontWeight: FontWeight.bold, -// ), -// ), -// subtitle: Text( -// "Added by Pooja.K", -// style: TextStyle( -// fontSize: 14.0, -// fontWeight: FontWeight.normal, -// ), -// ), -// ); -// }, -// ), -// ) -// else -// Expanded( -// child: ListView.builder( -// itemCount: _contactBox.values.length, -// itemBuilder: (BuildContext context, int index) { -// var data = _contactBox.get(index); -// print(":data_is: $data"); -// return ListTile( -// onTap: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => Profile( -// text: data!, -// ), -// ), -// ); -// }, -// leading: ProfilePicture( -// name: data["name"], -// radius: 20, -// fontsize: 12, -// ), -// title: Text( -// data["name"], -// style: TextStyle( -// fontSize: 18.0, -// fontWeight: FontWeight.bold, -// ), -// ), -// subtitle: Text( -// "Added by Pooja.K", -// style: TextStyle( -// fontSize: 14.0, -// fontWeight: FontWeight.normal, -// ), -// ), -// ); -// }, -// ), -// ), -// ], -// ); -// }, -// ), -// ), -// ); -// } -// } diff --git a/lib/contacts_module/ui_screen/discover.dart b/lib/contacts_module/ui_screen/discover.dart deleted file mode 100644 index 1b3fd0e..0000000 --- a/lib/contacts_module/ui_screen/discover.dart +++ /dev/null @@ -1,64 +0,0 @@ -// import 'package:discover_module/ui_screen/ranking.dart'; -// import 'package:discover_module/ui_screen/rising_stars.dart'; -// import 'package:discover_module/ui_screen/trends.dart'; -// import 'package:flutter/material.dart'; - -// class Discover extends StatefulWidget { -// const Discover(this.outerTab, {super.key}); - -// final String outerTab; - -// @override -// State createState() => _DiscoverState(); -// } - -// class _DiscoverState extends State with TickerProviderStateMixin { -// late final TabController _tabController; - -// @override -// void initState() { -// super.initState(); -// _tabController = TabController(length: 3, vsync: this); -// } - -// @override -// void dispose() { -// _tabController.dispose(); -// super.dispose(); -// } - -// @override -// Widget build(BuildContext context) { -// return Column( -// children: [ -// TabBar.secondary( -// controller: _tabController, -// labelStyle: -// const TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold), -// indicatorWeight: 1.0, -// indicatorColor: const Color.fromARGB(255, 0, 71, 135), -// labelPadding: EdgeInsets.all(0.0), -// tabs: const [ -// Tab(text: 'Ranking'), -// // Tab(text: 'Chart'), -// Tab(text: 'Trends'), -// //Tab(text: 'Referral'), -// Tab(text: 'Rising Stars '), -// ], -// ), -// Expanded( -// child: TabBarView( -// controller: _tabController, -// children: [ -// Ranking(), -// // const Chart1(), -// const Trends(), -// //const Referral(), -// const RisingStar(), -// ], -// ), -// ), -// ], -// ); -// } -// } diff --git a/lib/contacts_module/ui_screen/engagementtab.dart b/lib/contacts_module/ui_screen/engagementtab.dart index e00126e..53ba6f6 100644 --- a/lib/contacts_module/ui_screen/engagementtab.dart +++ b/lib/contacts_module/ui_screen/engagementtab.dart @@ -44,13 +44,16 @@ import 'package:discover_module/contacts_module/ui_screen/patent_show_more.dart' import 'package:discover_module/contacts_module/ui_screen/pro_show_more.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; class EngagementTab extends StatefulWidget { - EngagementTab({required this.text, this.offline, Key? key}) : super(key: key); + EngagementTab({required this.text, this.offline, Key? key, this.offlineMode}) + : super(key: key); final int text; int? offline; + bool? offlineMode; @override State createState() => _EngagementTabState(); } @@ -71,6 +74,8 @@ class _EngagementTabState extends State { @override void initState() { // TODO: implement initState + + print("Engagement_offlineModee: ${widget.offlineMode}"); super.initState(); getdata(); } @@ -139,225 +144,6 @@ class _EngagementTabState extends State { return Center( child: ListView( children: [ - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only(left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // // initiallyExpanded: true, - // title: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Medical Insights", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // ], - // ), - // children: [ - // Container( - // width: MediaQuery.of(context).size.width, - - // /// 5, - // color: Colors.white, - // child: Consumer(builder: - // (BuildContext context, value, Widget? child) { - // print("med1 : ${value.med.length}"); - - // if (value.med.length != 0) { - // return ListView.builder( - // physics: const ScrollPhysics(), - // // scrollDirection: Axis.vertical, - // shrinkWrap: true, - // itemCount: value.med.take(2).length, - // itemBuilder: (context, index) { - // item = value.med[index]; - - // print( - // "Item_Medical_insight ${item['Therapeutic Area']}"); - // return Padding( - // padding: const EdgeInsets.all(8.0), - // child: Card( - // margin: EdgeInsets.zero, - - // elevation: 4, - // surfaceTintColor: Colors.white, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.zero, - // ), - - // child: SizedBox( - // width: MediaQuery.sizeOf(context).width, - // child: ListTile( - // dense: true, - // title: Column( - // // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // // Text( - // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - - // RichText( - // text: TextSpan( - // text: '', - // style: DefaultTextStyle.of( - // context) - // .style, - // children: const [ - // TextSpan( - // text: - // 'Acute neurology ', - // style: TextStyle( - // fontWeight: - // FontWeight - // .bold)), - // // TextSpan( - // // text: ' therapeutic area ', - // // style: TextStyle( - // // fontWeight: - // // FontWeight.bold)), - // TextSpan( - // text: - // 'is the therapeutic area of the medical insight for '), - // TextSpan( - // text: - // 'Product A. The age of treatment', - // style: TextStyle( - // fontWeight: - // FontWeight - // .bold)), - // TextSpan( - // text: - // ' is the topic of interest for this source type'), - // TextSpan( - // text: ' publication.', - // style: TextStyle( - // fontWeight: - // FontWeight - // .bold)), - // ], - // ), - // ), - - // const Padding( - // padding: EdgeInsets.all(8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment - // .spaceBetween, - // children: [ - // Row( - // children: [ - // Icon( - // Icons.person, - // size: 20, - // ), - // Text( - // "pooja", - // style: TextStyle( - // fontSize: 14.0), - // ) - // ], - // ), - // Row( - // children: [ - // Icon( - // Icons.calendar_today, - // size: 20, - // ), - // Text( - // "11/11/2022 ", - // style: TextStyle( - // fontSize: 14.0), - // ) - // ], - // ) - // ], - // ), - // ), - // ], - // ), - // ), - // ), - // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), - // ), - // ); - // }); - // } else { - // return Container( - // color: Colors.white, - // width: MediaQuery.of(context).size.width, - // child: Column( - // children: [ - // Text("No records"), - // ], - // ), - // ); - // } - // }), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // const MedicalInsight1())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle(color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - ListTileTheme( dense: true, child: Padding( @@ -368,7 +154,7 @@ class _EngagementTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -377,7 +163,7 @@ class _EngagementTabState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -585,168 +371,186 @@ class _EngagementTabState extends State { ), speakerlistt.length != 0 - ? ListTileTheme( - dense: true, - child: Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Card( - margin: EdgeInsets.all(1.0), - // elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0.0), - ), - color: Constants.k2color11, - child: ExpansionTile( - initiallyExpanded: false, - maintainState: true, - onExpansionChanged: (bool expanded) { - setState(() { - _isExpanded = expanded; - }); - }, - backgroundColor: Constants.k2color11, - trailing: Icon( - _isExpanded - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.black), - // backgroundColor: Colors.white, - // collapsedBackgroundColor: Color(0xFF2b9af3), - title: Row( - mainAxisAlignment: MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Speaker Evalution", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - const SizedBox( - width: 8.0, - ), - Text1( - title: "(${speakerlistt.length.toString()})", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - ], - ), - children: [ - Scrollbar( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Container( - constraints: BoxConstraints( - minWidth: - MediaQuery.of(context).size.width), - color: Colors.white, - child: DataTable( - showCheckboxColumn: false, - columns: const [ - DataColumn( - label: Expanded( - child: Text( - 'Program Topic', - style: TextStyle( - fontWeight: FontWeight.w600), - ), - )), - DataColumn( - label: Expanded( - child: Text('Speaker Name', - style: TextStyle( - fontWeight: - FontWeight.w600)))), - ], - rows: List.generate( - speakerlistt.take(2).length, - (index) => DataRow( - onSelectChanged: (value) { - // =======> Use onSelectChanged for tab - print( - "message ${speakerlistt[index]}"); - - // bsheet( - // publication_data[ - // index]); - showModalBottomSheet( - useRootNavigator: true, - isScrollControlled: false, - enableDrag: true, - useSafeArea: true, - constraints: const BoxConstraints( - maxWidth: double.infinity, - ), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.vertical( - top: Radius.circular(0), - ), - ), - clipBehavior: - Clip.antiAliasWithSaveLayer, - context: context, - builder: (context) { - return bsheet( - speakerlistt[index]); - }, - ); - }, - color: MaterialStateProperty - .resolveWith( - (Set states) { - if (index.isEven) { - return Colors.grey.withOpacity(0.1); - } - return null; - }), - cells: [ - DataCell(Text( - speakerlistt[index] - .programtopic - .toString(), - softWrap: true)), - DataCell(Text( - speakerlistt[index] - .speakername - .toString(), - softWrap: true)), - ], - ), - ), - ), + ? GestureDetector( + onTap: () { + // Do nothing to prevent expansion + }, + child: ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.bgwhitecolor, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.bgwhitecolor, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text1( + title: "Speaker Evalution", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, ), - ), + Text1( + title: + "(${speakerlistt.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], ), - Container( - color: Colors.white, - child: Align( - alignment: Alignment.center, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: OutlinedButton( - onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // AffiliationsData())); - }, - child: Text( - 'Show More', - style: - TextStyle(color: Constants.k2color), - ), - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + children: [ + Visibility( + visible: widget.offlineMode == null + ? true + : widget.offlineMode!, + child: Scrollbar( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + constraints: BoxConstraints( + minWidth: MediaQuery.of(context) + .size + .width), + color: Colors.white, + child: DataTable( + showCheckboxColumn: false, + columns: const [ + DataColumn( + label: Expanded( + child: Text( + 'Program Topic', + style: TextStyle( + fontWeight: FontWeight.w600), + ), + )), + DataColumn( + label: Expanded( + child: Text('Speaker Name', + style: TextStyle( + fontWeight: FontWeight + .w600)))), + ], + rows: List.generate( + speakerlistt.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print( + "message ${speakerlistt[index]}"); + + // bsheet( + // publication_data[ + // index]); + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: + const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet( + speakerlistt[index]); + }, + ); + }, + color: MaterialStateProperty + .resolveWith( + (Set + states) { + if (index.isEven) { + return Colors.grey + .withOpacity(0.1); + } + return null; + }), + cells: [ + DataCell(Text( + speakerlistt[index] + .programtopic + .toString(), + softWrap: true)), + DataCell(Text( + speakerlistt[index] + .speakername + .toString(), + softWrap: true)), + ], + ), + ), ), ), ), ), ), - ) - ]), + Visibility( + visible: widget.offlineMode == null + ? true + : widget.offlineMode!, + child: Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (_) => + // AffiliationsData())); + }, + child: Text( + 'Show More', + style: TextStyle( + color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(12), + ), + ), + ), + ), + ), + ), + ) + ]), + ), ), ), ) @@ -763,7 +567,7 @@ class _EngagementTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -774,7 +578,7 @@ class _EngagementTabState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -916,7 +720,7 @@ class _EngagementTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -927,7 +731,7 @@ class _EngagementTabState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -1069,7 +873,7 @@ class _EngagementTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -1080,7 +884,7 @@ class _EngagementTabState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up diff --git a/lib/contacts_module/ui_screen/hcp_notes/view_notes.dart b/lib/contacts_module/ui_screen/hcp_notes/view_notes.dart new file mode 100644 index 0000000..f6b7afc --- /dev/null +++ b/lib/contacts_module/ui_screen/hcp_notes/view_notes.dart @@ -0,0 +1,314 @@ +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/model_class/awards_model.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_add_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_viewnotes.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:provider/provider.dart'; + +class ViewNotes extends StatefulWidget { + const ViewNotes({super.key}); + + @override + State createState() => _ViewNotesState(); +} + +class _ViewNotesState extends State { +// late FetchNotes; + + List notess = []; + + var _isLoading = false; + + // var events; + + late HcpNotesFecth fetchNotesProviderK2; + + TextEditingController updatenoteController = TextEditingController(); + @override + void initState() { + // TODO: implement initState + super.initState(); + //fetchhcpnotes(); + + fetchNotesProviderK2 = HcpNotesFecth(); + } + + // Future fetchhcpnotes() async { + // print("Hiiiiii"); + // var notesprovider = Provider.of(context, listen: false); + + // await notesprovider.fetchhcpnotes(); + + // var getnotes = notesprovider.ListNotes; + + // setState(() { + // notess = getnotes; + // }); + // } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Notes'), + ), + body: ChangeNotifierProvider( + create: (context) => fetchNotesProviderK2..fetchhcpnotes(), + child: Consumer(builder: (context, hcpnotes, child) { + return NotificationListener( + onNotification: (ScrollNotification scrollinfo) { + if (scrollinfo.metrics.pixels == + scrollinfo.metrics.maxScrollExtent && + !fetchNotesProviderK2.isLoading) { + hcpnotes.fetchhcpnotes(); + } + return false; + }, + child: ListView.builder( + itemCount: + hcpnotes.ListNotes.length + (hcpnotes.hasMore ? 1 : 0), + // +(events.hasMore ? 1 : 0), + itemBuilder: (context, index) { + if (index == hcpnotes.ListNotes.length) { + return const Center(child: CircularProgressIndicator()); + } + var data = hcpnotes.ListNotes[index]; + // print("I_amCheckingggggg12345: ${data.name}"); + return ListTile( + title: Text1(title: "Note : " + data.userNote), + subtitle: + Text1(title: "Created by : " + data.createdByUser), + trailing: Wrap( + spacing: -16, + children: [ + IconButton( + icon: const Icon(Icons.edit), + onPressed: () { + print("Clickedd: ${data.userNote}"); + //updatenoteController.text = data.userNote; + + showDialog( + context: context, + builder: (_) { + return updatedata(data); + // return Alert( + // data: "Added ", + // onPressed: () { + // noteController.clear(); + // Navigator.of(context).pop(); + // }, + // ); + }); + }, + ), + IconButton( + icon: const Icon( + Icons.delete, + //color: Colors.redAccent, + ), + onPressed: () { + showDialog( + context: context, + builder: (_) { + //return updatedata(data); + return AlertDialog( + // title: Text1( + // title: "Alert", + // txtfont: 22.0, + // ), + content: Text1( + title: data.userNote, + txtfont: 18.0, + ), + actions: [ + TextButton( + onPressed: () {}, + child: Text("Cancel")), + TextButton( + onPressed: () async { + Navigator.of(context).pop(); + var addnoteprovider = Provider + .of( + context, + listen: false); + await addnoteprovider + .deletenotes(data.uniqueId); + + showDialog( + context: context, + builder: (_) { + return Alert( + data: "Deleted ", + onPressed: () { + //noteController.clear(); + Navigator.of(context) + .pop(); + }, + ); + }); + }, + child: Text("Delete")) + ], + ); + }); + }, + ), + ], + ), + ); + })); + }), + )); + } + + updatedata(data) { + return AlertDialog( + title: Text1( + title: "Alert", + txtfont: 22.0, + ), + content: TextField( + controller: updatenoteController..text = data.userNote, + //controller: TextEditingController()..text = data, + + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + ), + hintText: 'Write your note here', + contentPadding: EdgeInsets.all(16.0), + ), + maxLines: null, // Allows the TextField to expand vertically + ), + actions: [ + TextButton( + onPressed: () async { + print("Iam OKKK ${updatenoteController.text}"); + print("Iam OKKK ${data.uniqueId}"); + var addnoteprovider = + Provider.of(context, listen: false); + await addnoteprovider.addnotes( + updatenoteController.text, data.uniqueId); + + showDialog( + context: context, + builder: (_) { + return Alert( + data: "Updated ", + onPressed: () async { + // noteController.clear(); + // Refresh the notes list + setState(() {}); + + Navigator.of(context).pop(); + }, + ); + }); + }, + child: Text("Ok")), + TextButton( + onPressed: () { + print("Iam Cancel"); + Navigator.pop(context); + }, + child: Text("Cancel")) + ], + ); + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// import 'package:discover_module/contacts_module/model_class/awards_model.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_viewnotes.dart'; +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; + +// class ViewNotes extends StatefulWidget { +// const ViewNotes({super.key}); + +// @override +// State createState() => _ViewNotesState(); +// } + +// class _ViewNotesState extends State { +// // late FetchNotes; + +// List notess = []; + +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); +// fetchhcpnotes(); +// } + +// Future fetchhcpnotes() async { +// print("Hiiiiii"); +// var notesprovider = Provider.of(context, listen: false); + +// await notesprovider.fetchhcpnotes(); + +// var getnotes = notesprovider.ListNotes; + +// setState(() { +// notess = getnotes; +// }); +// } + +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar( +// title: Text('Notes'), +// ), +// body: ListView.builder( +// itemCount: notess.length, +// itemBuilder: (context, index) { +// var data = notess[index]; + +// return Text(data.userNote); +// })); +// } +// } diff --git a/lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart b/lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart index ba8a199..3880027 100644 --- a/lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart +++ b/lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart @@ -6,10 +6,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; class NetworkConnectivity { - // Future isInternetAvailable() async { - // var connectivityResult = await (Connectivity().checkConnectivity()); - // return connectivityResult != ConnectivityResult.none; - // } Future isInternetAvailable() async { var connectivityResult = await Connectivity().checkConnectivity(); if (connectivityResult == ConnectivityResult.none) { @@ -28,13 +24,7 @@ class NetworkConnectivity { //} } } - // final result = await Dio().get('www.google.com'); - // if (result.statusCode == 200) { - // // if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { - // return true; - // //} - // } return false; } on SocketException catch (_) { return false; diff --git a/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart b/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart index d8c7500..e652f00 100644 --- a/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart +++ b/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart @@ -1320,16 +1320,6 @@ class _InteractionScreenState extends State { //); } - // String fieldsValidation(InteractionProvider provider) { - // List secList = provider.sectionList - // .where((element) => element.validation!.isRequired = true) - // .toList(); - // if (secList.any((element) => element.selectedValue!.isEmpty)) { - // return 'Fields cannot be empty'; - // } - // return ''; - // } - String textFieldsValidation(InteractionProvider provider) { return ''; } diff --git a/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart b/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart index 93a2954..1a27bf7 100644 --- a/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart +++ b/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart @@ -2,11 +2,7 @@ import 'package:discover_module/contacts_module/ui_screen/interactionform/intera import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/new_dynamicform.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/view_forms_list.dart'; -// import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; -// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart b/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart index c67a33b..023f6ec 100644 --- a/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart +++ b/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart @@ -1,955 +1,3 @@ -// import 'dart:convert'; -// // import 'dart:html'; - -// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; -// import 'package:discover_module/ui_screen/interactionform/util.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:hive_flutter/hive_flutter.dart'; - -// import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; - -// import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; - -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; - -// class InteractionProvider extends ChangeNotifier { -// List interactionReponseList = []; -// // List sectionList = []; -// List sectionList = []; -// late Location locationList; -// List textEditingControllerList = []; -// List multipletextEditingControllerList = []; -// int textfieldIndex = 0; - -// List checkboxlist = []; - -// String radioValue = ''; -// bool checkboxValue = false; - -// //List data = []; -// List newList = []; -// String sectionName = ''; -// late String selectedCity = 'Selected City', selectedState = 'Selected State'; - -// String? selectedValue; -// List selectedItems = []; -// InputClass? selectedObj; -// List savedList = []; -// List intConfigDataList = []; -// String? intId, intName; -// final HiveDataRepository _hiveprovider = HiveDataRepository( -// Hive.box('InteractionConfigDataBox')); - -// late bool _isLoading; - -// get isLoading => _isLoading; - -// initConfigData() async { -// _hiveprovider.openHiveBox(); -// intConfigDataList = _hiveprovider.getAllDataFromHive(); -// notifyListeners(); -// } - -// Future getRecords() async { -// var box = Hive.box('InteractionDataBox'); - -// if (!box.isOpen) { -// box = await Hive.openBox('InteractionDataBox'); -// } - -// savedList = box.values.toList(); -// print("savedListt: $savedList"); -// notifyListeners(); -// } - -// init(int index) async { -// await initConfigData(); -// InteractionConfigData interactionConfigData = intConfigDataList[index]; -// intId = intConfigDataList[index].id; -// intName = intConfigDataList[index].name; - -// radioValue = ''; -// print("data $intConfigDataList"); - -// await fetchData(interactionConfigData.widgets); -// notifyListeners(); -// } - -// initSavedForm(SaveInteraction saveInteractiondata) { -// interactionReponseList = saveInteractiondata.save -// .map((e) => FormFieldData( -// multipleList: e.multipleList == null -// ? [] -// : e.multipleList! -// .map((mobj) => SectionList( -// depid: mobj.depid, -// id: mobj.id, -// inputList: mobj.inputList, -// isRequired: mobj.isRequired, -// name: mobj.name, -// param: mobj.param, -// selectedValue: mobj.selectedValue, -// fileName: mobj.fileName, -// extension: mobj.extension, -// widget: mobj.widget, -// controller: mobj.controller, -// gid: mobj.gid, -// input: mobj.input, -// selectedId: mobj.selectedId, -// value: mobj.value)) -// .toList(), -// sectionList: e.sectionList -// .map((obj) => SectionList( -// depid: obj.depid, -// id: obj.id, -// inputList: obj.inputList, -// isRequired: obj.isRequired, -// name: obj.name, -// param: obj.param, -// fileName: obj.fileName, -// extension: obj.extension, -// selectedValue: obj.selectedValue, -// widget: obj.widget, -// controller: obj.controller, -// gid: obj.gid, -// input: obj.input, -// selectedId: obj.selectedId, -// value: obj.value, -// )) -// .toList(), -// sectionName: e.sectionName, -// multiple: e.multiple)) -// .toList(); - -// textEditingControllerList.clear(); - -// for (var item in interactionReponseList) { -// sectionList = item.sectionList; -// for (var sectionItem in item.sectionList) { -// if (sectionItem.widget == InteractionWidget.TEXT) { -// var textEditingController = TextEditingController(); - -// textEditingControllerList.add(textEditingController); -// sectionItem.controller = textEditingControllerList.last; -// } -// if (sectionItem.widget == InteractionWidget.DROPDOWN || -// sectionItem.widget == InteractionWidget.AUTOCOMPLETE || -// sectionItem.widget == InteractionWidget.MULTISELECT) { -// List list = sectionItem.inputList!; -// sectionItem.value = list[0].id; -// print("value : ${list.first} "); -// } -// } -// } -// print(interactionReponseList); -// print("check textcontrollers ${textEditingControllerList.length}"); -// } - -// String getDataValue(String widgetId, String id) { -// print("issue *************"); -// if (id != "") { -// List list = []; -// String value = ' '; - -// for (FormFieldData obj1 in interactionReponseList) { -// // List list = -// for (SectionList obj in obj1.sectionList) { -// if (obj.id == widgetId) { -// list = obj.inputList!; -// } -// } -// } - -// if (list.isNotEmpty) { -// int index = list.indexWhere((element) => element.id.toString() == id); - -// if (index != -1) { -// value = list[index].name; -// } -// } - -// return value; -// } else { -// return " "; -// } -// } - -// // TODO: Search for widget with depid and check if selected is not null and by selected id get the data of current widget - -// List getData2(SectionList sectionItem) { -// print("SEctionItemmmmm: $selectedValue"); -// List list = []; -// // if (sectionItem.inputList != null) { -// list = sectionItem.inputList!; -// if (sectionItem.depid != "") { -// // print("check depid : ${sectionItem.depid}"); -// int i = 0; -// for (var obj in interactionReponseList) { -// i = obj.sectionList -// .indexWhere((element) => element.id == sectionItem.depid); -// // print("check depid index: $i"); -// if (i != -1) { -// //print("check depid value: ${obj.sectionList[i].value}"); -// if (obj.sectionList[i].value != null) { -// if (list -// .where((element) => element.pid == obj.sectionList[i].value) -// .isNotEmpty) { -// list = list -// .where((element) => element.pid == obj.sectionList[i].value) -// .toList(); - -// sectionItem.selectedObject = list[0]; -// } else { -// // InputClass obj = InputClass( -// // id: "obj.sectionList[i].value", -// // name: "Select ${sectionItem.name}"); -// list = []; -// // list.add(obj); -// sectionItem.selectedObject = null; -// } -// } else { -// // int index = obj.sectionList -// // .indexWhere((element) => element.id == sectionItem.id); - -// // list = obj.sectionList[index].inputList; -// } -// } -// } - -// // int index = data[i].data.indexWhere((element) => element.) -// } -// // } -// return list; -// } - -// setDropDownValue(String value, SectionList sectionItem, bool multiple) { -// int i = 0; -// print("selected $value"); -// for (var obj in interactionReponseList) { -// if (multiple && obj.multipleList != null) { -// i = obj.multipleList! -// .indexWhere((element) => element.id == sectionItem.id); -// if (i != -1) { -// obj.multipleList![i].value = value; -// obj.multipleList![i].selectedValue!.add(value); -// } -// } else { -// i = obj.sectionList -// .indexWhere((element) => element.id == sectionItem.id); -// if (i != -1) { -// obj.sectionList[i].value = value; -// obj.sectionList[i].selectedValue!.add(value); -// } -// } -// } -// notifyListeners(); -// } - -// // setTextValue(String value, SectionList sectionItem, bool multiple) { -// // print("Text_val = $value, $sectionItem, $multiple"); -// // int i = 0; -// // for (var obj in interactionReponseList) { -// // if (multiple && obj.multipleList != null) { -// // i = obj.multipleList! -// // .indexWhere((element) => element.id == sectionItem.id); -// // if (i != -1) { -// // obj.multipleList![i].value = value; -// // obj.multipleList![i].selectedValue!.add(value); -// // } -// // } else { -// // i = obj.sectionList -// // .indexWhere((element) => element.id == sectionItem.id); -// // if (i != -1) { -// // obj.sectionList[i].value = value; -// // obj.sectionList[i].selectedValue!.add(value); -// // } -// // } -// // } -// // notifyListeners(); -// // } - -// setTextValue(String value, SectionList sectionItem, bool multiple) { -// int i = 0; -// for (var obj in interactionReponseList) { -// if (multiple && obj.multipleList != null) { -// i = obj.multipleList!.indexWhere((element) => -// element.id == sectionItem.id && element.gid == sectionItem.gid); -// if (i != -1) { -// obj.multipleList![i].value = value; -// obj.multipleList![i].selectedValue!.add(value); -// } -// } else { -// i = obj.sectionList -// .indexWhere((element) => element.id == sectionItem.id); -// if (i != -1) { -// obj.sectionList[i].value = value; -// obj.sectionList[i].selectedValue!.add(value); -// } -// } -// } -// notifyListeners(); -// } - -// setAutoCompleteValue(String value, SectionList sectionItem, bool multiple) { -// int i = 0; -// for (var obj in interactionReponseList) { -// if (multiple && obj.multipleList != null) { -// i = obj.multipleList! -// .indexWhere((element) => element.id == sectionItem.id); -// if (i != -1) { -// obj.multipleList![i].value = value; -// obj.multipleList![i].selectedValue!.add(value); -// } -// } else { -// i = obj.sectionList -// .indexWhere((element) => element.id == sectionItem.id); -// if (i != -1) { -// obj.sectionList[i].value = value; -// obj.sectionList[i].selectedValue!.add(value); -// } -// } -// } -// notifyListeners(); -// } - -// Future fetchData(InteractionResultData interactionResultData) async { -// InteractionResultData interactionConfig = interactionResultData; - -// print("itemCategoryModel Item = + ${interactionConfig.result}"); -// // } -// interactionReponseList = interactionConfig.result; -// print("check stored: $interactionReponseList"); - -// textEditingControllerList.clear(); - -// for (var item in interactionReponseList) { -// sectionList = item.sectionList; -// for (var sectionItem in item.sectionList) { -// sectionItem.selectedValue = []; -// if (sectionItem.widget == InteractionWidget.TEXT) { -// var textEditingController = TextEditingController(); - -// textEditingControllerList.add(textEditingController); -// sectionItem.controller = textEditingControllerList.last; -// } -// if (sectionItem.widget == InteractionWidget.DROPDOWN || -// sectionItem.widget == InteractionWidget.AUTOCOMPLETE || -// sectionItem.widget == InteractionWidget.MULTISELECT) { -// // int index = data -// // .indexWhere((element) => element.widgetId == sectionItem.id); -// // List list = data[index].data; -// List list = sectionItem.inputList!; -// sectionItem.value = list[0].id; -// if (sectionItem.widget == InteractionWidget.MULTISELECT) { -// sectionItem.selectedValue!.add(list[0].name); -// } else { -// sectionItem.selectedValue!.add(list[0].id); -// } - -// sectionItem.selectedObject = list[0]; -// print("value : ${list.first} "); -// } else if (sectionItem.widget == InteractionWidget.CHECKBOX) { -// List list = sectionItem.inputList!; -// if (list.isNotEmpty) { -// for (var element in sectionItem.inputList!) { -// element.ischecked = false; -// } -// } -// // sectionItem.value = list[0].id; -// // sectionItem.selectedValue!.add(list[0].id); -// } -// } -// } -// print(interactionReponseList); -// print("check textcontrollers ${textEditingControllerList.length}"); -// notifyListeners(); - -// return "success"; -// } - -// resetAllWidgetsData() { -// textEditingControllerList.clear(); - -// for (var item in interactionReponseList) { -// item.multipleList = []; -// sectionList = item.sectionList; -// for (var sectionItem in item.sectionList) { -// sectionItem.selectedValue = []; -// // sectionItem.value = ''; -// // sectionItem.selectedObject = InputClass(id: '', name: ''); -// if (sectionItem.widget == InteractionWidget.TEXT) { -// var textEditingController = TextEditingController(); - -// textEditingControllerList.add(textEditingController); -// sectionItem.controller = textEditingControllerList.last; -// } -// if (item.sectionName != "Other") { -// if (sectionItem.widget == InteractionWidget.DROPDOWN || -// sectionItem.widget == InteractionWidget.AUTOCOMPLETE || -// sectionItem.widget == InteractionWidget.MULTISELECT) { -// // int index = data -// // .indexWhere((element) => element.widgetId == sectionItem.id); -// print("Selected widget : ${sectionItem.id}"); -// List list = sectionItem.inputList!; -// sectionItem.value = list[0].id; -// sectionItem.selectedObject = list[0]; -// print("value : ${list.first.name} "); -// } -// } -// } -// } -// print(interactionReponseList); -// print("check textcontrollers ${textEditingControllerList.length}"); -// notifyListeners(); -// } - -// setRadioValue(SectionList sectionItem) { -// List list = (sectionItem.input as List) -// .map((itemWord) => InputClass.fromJson(itemWord)) -// .toList(); -// radioValue = list[0].name; - -// notifyListeners(); -// } - -// setcheckBoxValue(SectionList sectionItem, String sectionName, bool newValue, -// String id, bool multiple) { -// int index = -// sectionItem.inputList!.indexWhere((element) => element.id == id); -// sectionItem.inputList![index].ischecked = newValue; -// // sectionItem.selectedValue.add(data[i].data[index].id); -// int index2 = 0; -// for (var obj in interactionReponseList) { -// if (multiple && obj.multipleList != null) { -// index2 = obj.multipleList! -// .indexWhere((element) => element.id == sectionItem.id); -// if (index2 != -1) { -// obj.multipleList![index2].value = sectionItem.inputList![index].id; -// obj.multipleList![index2].selectedValue! -// .add(sectionItem.inputList![index].id); -// } -// } else { -// index2 = obj.sectionList -// .indexWhere((element) => element.id == sectionItem.id); -// if (index2 != -1) { -// obj.sectionList[index2].value = sectionItem.inputList![index].id; -// obj.sectionList[index2].selectedValue! -// .add(sectionItem.inputList![index].id); -// } -// } -// } -// notifyListeners(); -// } - -// // getSectionItem(String sectionName) { -// // print("sectionName_issss : $sectionName"); -// // newList = []; -// // List addList = []; -// // int index = interactionReponseList -// // .indexWhere((element) => element.sectionName == sectionName); - -// // print("addList_isss: $addList"); - -// // addList = interactionReponseList[index] -// // .sectionList -// // .map((e) => SectionList( -// // depid: e.depid, -// // id: e.id, -// // inputList: e.inputList, -// // isRequired: e.isRequired, -// // name: e.name, -// // param: e.param, -// // selectedValue: [], -// // widget: e.widget, -// // controller: e.controller, -// // gid: e.gid, -// // input: e.input, -// // selectedId: e.selectedId, -// // value: e.value)) -// // .toList(); -// // SectionList delItem = SectionList( -// // name: "delete", -// // param: "deletebtn", -// // id: "deletebtn", -// // selectedValue: [], -// // depid: "", -// // widget: InteractionWidget.BUTTON, -// // inputList: [], -// // isRequired: true); - -// // addList.add(delItem); - -// // // if (interactionReponseList[index].multipleList!.isEmpty) { -// // // newList = addList; -// // // } else { -// // if (interactionReponseList[index].multipleList == null) { -// // interactionReponseList[index].multipleList = addList; -// // print("iff: $addList"); -// // } else { -// // // interactionReponseList[index].multipleList = -// // // // interactionReponseList[index].multipleList! + addList; -// // // interactionReponseList[index].multipleList! + addList; - -// // interactionReponseList[index].multipleList = -// // interactionReponseList[index].multipleList! + addList; - -// // print("iffelse: $addList"); -// // } - -// // newList = interactionReponseList[index].multipleList!; - -// // print("newList_iss: $newList"); - -// // // newList = newList + addList; -// // // } -// // if (interactionReponseList[index].multipleList != null) { -// // for (SectionList obj in interactionReponseList[index].multipleList!) { -// // obj.gid = obj.gid ?? interactionReponseList[index].multipleList!.length; -// // if (obj.widget == InteractionWidget.TEXT) { -// // print("objectt"); -// // var textEditingController = TextEditingController(); - -// // multipletextEditingControllerList.add(textEditingController); -// // obj.controller = multipletextEditingControllerList.last; -// // } -// // // newList.add(obj); -// // } -// // } - -// // print( -// // "check length : ${interactionReponseList[index].multipleList!.length}"); -// // notifyListeners(); -// // } - -// getSectionItem(String sectionName) { -// newList = []; -// List addList = []; -// int index = interactionReponseList -// .indexWhere((element) => element.sectionName == sectionName); -// var textEditingController = TextEditingController(); -// addList = interactionReponseList[index] -// .sectionList -// .map((e) => SectionList( -// depid: e.depid, -// id: e.id, -// inputList: e.inputList, -// isRequired: e.isRequired, -// name: e.name, -// param: e.param, -// selectedValue: [], -// widget: e.widget, -// controller: e.controller, -// gid: e.gid, -// input: e.input, -// selectedId: e.selectedId, -// value: e.value)) -// .toList(); -// SectionList delItem = SectionList( -// name: "delete", -// param: "deletebtn", -// id: "deletebtn", -// selectedValue: [], -// depid: "", -// widget: InteractionWidget.BUTTON, -// inputList: [], -// isRequired: true); - -// addList.add(delItem); - -// for (SectionList obj in addList) { -// //obj.gid = obj.gid ?? addList.length; -// if (obj.widget == InteractionWidget.TEXT) { -// var textEditingController = TextEditingController(); - -// multipletextEditingControllerList.add(textEditingController); -// obj.controller = multipletextEditingControllerList.last; -// } -// // newList.add(obj); -// } - -// // if (interactionReponseList[index].multipleList!.isEmpty) { -// // newList = addList; -// // } else { -// if (interactionReponseList[index].multipleList == null) { -// interactionReponseList[index].multipleList = addList; -// } else { -// interactionReponseList[index].multipleList = -// interactionReponseList[index].multipleList! + addList; -// } - -// newList = interactionReponseList[index].multipleList!; -// // newList = newList + addList; -// // } -// if (interactionReponseList[index].multipleList != null) { -// for (SectionList obj in interactionReponseList[index].multipleList!) { -// obj.gid = obj.gid ?? interactionReponseList[index].multipleList!.length; -// // if (obj.widget == InteractionWidget.TEXT) { -// // var textEditingController = TextEditingController(); - -// // multipletextEditingControllerList.add(textEditingController); -// // obj.controller = multipletextEditingControllerList.last; -// // } -// //newList.add(obj); -// } -// } - -// print( -// "check length : ${interactionReponseList[index].multipleList!.length}"); -// notifyListeners(); -// } - -// deleteMultipleRows( -// int gid, SectionList sectionItem, String selectedSectionName) { -// int index = interactionReponseList -// .indexWhere((element) => element.sectionName == selectedSectionName); - -// print("controllerssssss : ${multipletextEditingControllerList.length}"); -// interactionReponseList[index] -// .multipleList! -// .removeWhere((item) => item.gid == gid); - -// notifyListeners(); -// } - -// bool validateMultipleRows() { -// for (var obj in interactionReponseList) { -// if (obj.multipleList != null) { -// for (var mulobj in obj.multipleList!) { -// if (mulobj.widget == InteractionWidget.TEXT) { -// if (mulobj.controller!.text.isEmpty) { -// return true; -// } -// } -// } -// } -// } -// return false; -// } - -// // bool validateTextFields() { -// // for (var obj in interactionReponseList) { -// // print("validateForm_is: ${obj.sectionList}"); -// // for (var mulobj in obj.sectionList) { -// // print("mulobj_is: ${mulobj}"); -// // print("mulobj_is: ${mulobj.widget}"); -// // print("mulobj_is: ${mulobj.isRequired}"); - -// // if (mulobj.widget == InteractionWidget.TEXT) { -// // if (mulobj.controller!.text.isEmpty) { -// // return true; -// // } -// // } -// // } -// // } -// // return false; -// // } - -// bool validateTextFields() { -// print("Validation_is : ${interactionReponseList.isEmpty}"); -// for (var obj in interactionReponseList) { -// print("validateForm_is: ${obj.sectionList}"); -// for (var mulobj in obj.sectionList) { -// print("mulobj_is: ${mulobj}"); -// print("mulobj_is: ${mulobj.widget}"); -// print("mulobj_is: ${mulobj.validation!.isRequired}"); - -// // if (mulobj.widget == InteractionWidget.TEXT) { -// // if (mulobj.controller!.text.isEmpty) { -// // print("I_amTextWidget"); -// // return false; -// // } -// // } - -// if (mulobj.validation!.isRequired == true) { -// if (mulobj.widget == InteractionWidget.TEXT) { -// if (mulobj.controller!.text.isEmpty) { -// print("Text_isEmpty"); -// //return false; -// } -// } else if (mulobj.widget == InteractionWidget.AUTOCOMPLETE) { -// if (mulobj.selectedId == null) { -// print("Auto_isEmpty"); -// //return false; -// } -// } else if (mulobj.widget == InteractionWidget.DROPDOWN) { -// if (mulobj.selectedId == null) { -// print("Dropdown_isEmpty"); -// //return false; -// } -// } else if (mulobj.widget == InteractionWidget.values) { -// if (mulobj.selectedId == null) { -// print("Dropdown_isEmpty"); -// //return false; -// } -// } -// // showDialog(context: context, builder: (_){ - -// // return AboutDialog() -// // }); -// } -// } -// return false; -// } -// return false; -// } - -// Future saveJsonObject(BuildContext context, String form, -// {bool isEdit = false}) async { -// print("form_data: $form"); -// List resultData = interactionReponseList -// .map((e) => FormFieldData( -// multipleList: e.multipleList == null -// ? [] -// : e.multipleList! -// .map((mobj) => SectionList( -// depid: mobj.depid, -// id: mobj.id, -// inputList: mobj.inputList, -// isRequired: mobj.isRequired, -// name: mobj.name, -// param: mobj.param, -// selectedValue: mobj.selectedValue, -// extension: mobj.extension, -// fileName: mobj.fileName, -// widget: mobj.widget, -// // controller: mobj.controller, -// gid: mobj.gid, -// input: mobj.input, -// selectedId: mobj.selectedId, -// value: mobj.value)) -// .toList(), -// sectionList: e.sectionList -// .map((obj) => SectionList( -// depid: obj.depid, -// id: obj.id, -// inputList: obj.inputList, -// isRequired: obj.isRequired, -// name: obj.name, -// param: obj.param, -// selectedValue: obj.selectedValue, -// widget: obj.widget, -// controller: obj.controller, -// gid: obj.gid, -// input: obj.input, -// extension: obj.extension, -// fileName: obj.fileName, -// selectedId: obj.selectedId, -// value: obj.value)) -// .toList(), -// sectionName: e.sectionName, -// multiple: e.multiple)) -// .toList(); - -// String generateId = '${intId}R${await getNextAutoIncrementValue()}'; - -// print("Result_data_is: ${FormFieldData}"); - -// if (validateSectionList(resultData)) { -// _isLoading = true; -// notifyListeners(); -// final data = SaveInteraction( -// save: resultData, -// id: generateId, -// updatedTime: DateTime.now().toString(), -// form: form, -// intId: intId ?? "id", -// intName: intName ?? "name"); -// var box = Hive.box('InteractionDataBox'); - -// if (!box.isOpen) { -// box = await Hive.openBox('InteractionDataBox'); -// } - -// print("Data_Result_is: ${data}"); - -// // // if (validateJson1(data.save.first)) { -// await box.put(await getNextAutoIncrementValue(), data); -// } else { -// _isLoading = false; -// notifyListeners(); - -// // Handle validation error -// print("JSON data is not valid according to the schema."); -// } -// // box.close(); -// await getRecords(); -// return generateId; -// } - -// List getModifiedList(List sectionList) { -// List newSectionList = []; -// for (var obj in sectionList) { -// if (obj.id != 'deletebtn') { -// if (obj.input == 'chooseFile') { -// MultipleSectionList newobj = MultipleSectionList( -// id: obj.id, -// selectedValue: obj.selectedValue!, -// extension: obj.extension!, -// fileName: obj.fileName!, -// ); - -// newSectionList.add(newobj); -// } else { -// MultipleSectionList newobj = MultipleSectionList( -// id: obj.id, -// selectedValue: obj.selectedValue!, -// ); -// newSectionList.add(newobj); -// } -// } -// } -// return newSectionList; -// } - -// List> getMultipleSectionList( -// List sectionList, List multipleList) { -// List> list = []; -// List> listing = []; -// List secList = getModifiedList(sectionList); -// List multipleList0 = getModifiedList(multipleList); -// list.add(secList); -// listing.add(secList); -// // List listing = []; -// if (multipleList.isNotEmpty) { -// final releaseDateMap = multipleList.groupBy((m) => m.gid); -// print("see map : $releaseDateMap"); - -// if (releaseDateMap.isNotEmpty) { -// listing = []; -// List> mulList = -// releaseDateMap.values.toList(growable: true); -// for (var item in mulList) { -// listing.add(getModifiedList(item)); -// } -// listing.add(secList); -// list = [...listing]; - -// //}); -// } -// } -// return list; -// } - -// SaveInteractionFormJson formJson(SaveInteraction saveInteraction) { -// List saveList = []; -// for (var obj in saveInteraction.save) { -// Save saveobj = Save( -// sectionName: obj.sectionName, -// multipleSectionList: -// getMultipleSectionList(obj.sectionList, obj.multipleList!)); -// saveList.add(saveobj); -// } - -// SaveInteractionFormJson saveInteractionFormJson = SaveInteractionFormJson( -// interactionForm1: saveInteraction.form!, -// intId: saveInteraction.id, -// intName: saveInteraction.intName, -// save: saveList); -// return saveInteractionFormJson; -// } - -// bool validateJson1(FormFieldData data) { -// print("Checking_data1 ${data.sectionName}"); - -// print("Checking_data1 ${data.sectionList}"); -// return false; -// } - -// bool validateSectionList(List resultData) { -// for (var formData in resultData) { -// for (var section in formData.sectionList) { -// print("Section_isssss: $section"); -// print("Section_isssss: ${section.isRequired}"); -// print("Section_isssss: ${section.widget}"); - -// if (section.widget == InteractionWidget.TEXT) { -// if (section.controller!.text.isEmpty) { -// debugPrint("Iam text and empty"); -// notifyListeners(); - -// return false; -// } -// } else if (section.widget == InteractionWidget.AUTOCOMPLETE) { -// if (section.selectedValue!.isEmpty) { -// debugPrint("Iam AUTOCOMPLETE and empty"); -// notifyListeners(); - -// return false; -// } -// } else if (section.widget == InteractionWidget.DROPDOWN) { -// if (section.selectedValue!.isEmpty) { -// debugPrint("Iam dropdown and empty"); -// notifyListeners(); - -// return false; -// } -// } else if (section.widget == InteractionWidget.CHECKBOX) { -// if (section.selectedValue!.isEmpty) { -// debugPrint("Iam CHECKBOX and empty"); -// notifyListeners(); - -// return false; -// } -// } -// } -// // print("Multilist"); -// // for (var msection in formData.multipleList!) { -// // print("Multilist Enter"); - -// // print("Multilist Enterwidget: ${msection.widget}"); - -// // if (msection.widget == InteractionWidget.TEXT) { -// // if (msection.controller!.text.isEmpty) { -// // debugPrint("Iam text and empty"); -// // notifyListeners(); - -// // return false; -// // } -// // } else if (msection.widget == InteractionWidget.AUTOCOMPLETE) { -// // if (msection.selectedValue!.isEmpty) { -// // debugPrint("Iam AUTOCOMPLETE and empty"); -// // notifyListeners(); - -// // return false; -// // } -// // } else if (msection.widget == InteractionWidget.DROPDOWN) { -// // if (msection.selectedValue!.isEmpty) { -// // debugPrint("Iam dropdown and empty"); -// // notifyListeners(); - -// // return false; -// // } -// // } else if (msection.widget == InteractionWidget.CHECKBOX) { -// // if (msection.selectedValue!.isEmpty) { -// // debugPrint("Iam CHECKBOX and empty"); -// // notifyListeners(); - -// // return false; -// // } -// // } -// // } -// } -// notifyListeners(); - -// return true; -// } - -// String? validateId(String? value) { -// if (value == null || value.isEmpty) { -// print("D is required"); -// return 'ID is required'; -// } -// // Add more validation rules if needed -// return null; -// } -// } - -import 'dart:convert'; -// import 'dart:html'; - import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; @@ -957,19 +5,10 @@ import 'package:discover_module/contacts_module/ui_screen/interactionform/model/ import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; -// import 'package:discover_module/ui_screen/interactionform/util.dart'; + import 'package:flutter/cupertino.dart'; import 'package:hive_flutter/hive_flutter.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; - -// import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; - -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; - class InteractionProvider extends ChangeNotifier { List interactionReponseList = []; // List sectionList = []; @@ -1583,26 +622,6 @@ class InteractionProvider extends ChangeNotifier { } await getRecords(); return generateId; - - // final data = SaveInteraction( - // save: resultData, - // id: generateId, - // updatedTime: DateTime.now().toString(), - // form: form, - // intId: intId ?? "id", - // intName: intName ?? "name"); - // var box = Hive.box('InteractionDataBox'); - - // if (!box.isOpen) { - // box = await Hive.openBox('InteractionDataBox'); - // } - - // await box.put(await getNextAutoIncrementValue(), data); - // // box.close(); - // await getRecords(); - // return generateId; - // await MockApiCall().postFormData(data); - // await prov.addOfflineData(data); } List getModifiedList(List sectionList) { diff --git a/lib/contacts_module/ui_screen/interactionform/mockapi.dart b/lib/contacts_module/ui_screen/interactionform/mockapi.dart index d373baf..4cad201 100644 --- a/lib/contacts_module/ui_screen/interactionform/mockapi.dart +++ b/lib/contacts_module/ui_screen/interactionform/mockapi.dart @@ -773,103 +773,6 @@ class MockApiCall { } ], }, - // { - // "sectionName": "HCP", - // "multiple": true, - // "sectionList": [ - // { - // "name": "name", - // "id": "field_0_2", - // "depid": "pooja", - // "widget": "text", - // "input": "text1", - // "validation": {"isRequired": true} - // }, - // { - // "name": "Role", - // "id": "field_0_1", - // "depid": "", - // "widget": "dropdown", - // "input": "checkbox", - // "validation": {"isRequired": true}, - // "inputList": [ - // {"id": "1", "name": "Option 1"}, - // {"id": "2", "name": "Option 2"}, - // {"id": "3", "name": "Option 3"}, - // {"id": "4", "name": "Option 4"}, - // {"id": "5", "name": "Option 5"}, - // {"id": "6", "name": "Option 6"}, - // {"id": "7", "name": "Option 7"} - // ] - // }, - // { - // "name": "Attended", - // "id": "field_0_1", - // "depid": "", - // "widget": "dropdown", - // "input": "checkbox", - // "validation": {"isRequired": true}, - // "inputList": [ - // {"id": "1", "name": "Option 1"}, - // {"id": "2", "name": "Option 2"}, - // {"id": "3", "name": "Option 3"}, - // {"id": "4", "name": "Option 4"}, - // {"id": "5", "name": "Option 5"}, - // {"id": "6", "name": "Option 6"}, - // {"id": "7", "name": "Option 7"} - // ] - // }, - // { - // "name": "Honorarium", - // "id": "field_0_2", - // "depid": "", - // "widget": "text", - // "input": "date", - // "validation": {"isRequired": true} - // }, - // { - // "name": "created by", - // "id": "field_0_2", - // "depid": "poojatk", - // "widget": "text", - // "input": "text1", - // "validation": {"isRequired": true} - // }, - // { - // "name": "created on", - // "id": "field_0_2", - // "depid": "13/05/2024", - // "widget": "text", - // "input": "text1", - // "validation": {"isRequired": true} - // }, - // // { - // // "name": "field_0_0", - // // "id": "field_0_0", - // // "depid": "", - // // "widget": "checkbox", - // // "input": "radio", - // // "validation": {"isRequired": true}, - // // "inputList": [ - // // {"id": "1", "name": "Option 1"}, - // // {"id": "2", "name": "Option 2"}, - // // {"id": "3", "name": "Option 3"}, - // // {"id": "4", "name": "Option 4"}, - // // {"id": "5", "name": "Option 5"}, - // // {"id": "6", "name": "Option 6"}, - // // {"id": "7", "name": "Option 7"} - // // ] - // // }, - // // { - // // "name": "field_0_2", - // // "id": "field_0_2", - // // "depid": "", - // // "widget": "text", - // // "input": "date", - // // "validation": {"isRequired": true} - // // } - // ], - // }, ] } ] diff --git a/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart index 2e496dc..0276d2f 100644 --- a/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart +++ b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart @@ -1,65 +1,5 @@ -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -// import 'package:hive_flutter/hive_flutter.dart'; -// // import 'package:pwa_ios/model/interaction_data.dart'; - -// part 'interaction_config_data.g.dart'; - -// class UIDataResponse { -// bool success; -// String message; - -// List formFields; - -// UIDataResponse({ -// required this.success, -// required this.message, -// required this.formFields, -// }); - -// factory UIDataResponse.fromJson(Map json) => UIDataResponse( -// success: json["success"], -// message: json["message"], -// formFields: List.from( -// json["data"].map((x) => FormFieldData.fromJson(x))), -// ); - -// Map toJson() => { -// "success": success, -// "message": message, -// "form-fields": List.from(formFields.map((x) => x.toJson())), -// }; - -// @override -// String toString() { -// // TODO: implement toString -// return List.from(formFields.map((x) => x.toJson())).toString(); -// } -// } - -// @HiveType(typeId: 19) -// class InteractionConfigData { -// @HiveField(1) -// InteractionResultData widgets; -// @HiveField(2) -// String id; -// @HiveField(3) -// String name; - -// InteractionConfigData({ -// required this.widgets, -// required this.id, -// required this.name, -// }); - -// Map toJson() => {"widgets": widgets}; -// } - -//pooja - -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; -// import 'package:pwa_ios/model/interaction_data.dart'; part 'engagement_interaction.g.dart'; diff --git a/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart b/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart index 97f012b..cc22fe7 100644 --- a/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart +++ b/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart @@ -1970,2169 +1970,3 @@ class _InteractionScreen1State extends State { )); } } - - - - - - - - - - - - - - - - - - - - - -// import 'dart:convert'; -// import 'dart:io'; - -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/ui_screen/add_event/add_hcp.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/util.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:flutter/rendering.dart'; -// import 'package:flutter/services.dart'; -// import 'package:flutter/widgets.dart'; -// import 'package:intl/intl.dart'; -// import 'package:path_provider/path_provider.dart'; -// import 'package:popover/popover.dart'; -// import 'package:provider/provider.dart'; -// import 'package:dropdown_button2/dropdown_button2.dart'; - -// import 'package:file_picker/file_picker.dart'; -// // import 'package:pwa_ios/widgets/responsive_ext.dart'; -// import 'package:permission_handler/permission_handler.dart'; -// import 'package:path/path.dart' as p; -// //import 'package:carousel_slider/carousel_slider.dart'; -// import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; - -// // import 'package:popover/popover.dart'; - -// class InteractionScreen1 extends StatefulWidget { -// int index; -// String form; -// InteractionScreen1({super.key, required this.index, required this.form}); - -// @override -// State createState() => _InteractionScreen1State(); -// } - -// class _InteractionScreen1State extends State { -// List interactionReponseList = []; -// List sectionList = []; -// List textEditingControllerList = []; -// int textfieldIndex = 0; -// String dropdownvalue = 'Select value'; -// String? fileName; -// final TextEditingController textEditingController = TextEditingController(); - -// bool _isExpanded = false; - -// late int _value; - -// var list; - -// var item1; - -// final GlobalKey _formKey = GlobalKey(); - -// int _currentPage = 0; -// late int _totalPages = -// Provider.of(context, listen: false) -// .interactionReponseList -// .length; -// @override -// void initState() { -// WidgetsBinding.instance.addPostFrameCallback((timeStamp) { -// // if (mytimer!.isActive) { -// // cancelTimer(); -// // } -// init(); -// }); - -// super.initState(); -// } - -// init() async { -// await Provider.of(context, listen: false) -// .init(widget.index); -// setState(() {}); -// } - -// // @override -// // Widget build(BuildContext context) { -// // return Consumer( -// // builder: (BuildContext context, provider, Widget? child) { -// // return GestureDetector( -// // onTap: () { -// // FocusScope.of(context).requestFocus(FocusNode()); -// // }, -// // child: OrientationBuilder(builder: (context, orientation) { -// // return SafeArea( -// // child: Scaffold( -// // //resizeToAvoidBottomInset: false, -// // appBar: AppBar( -// // title: const FittedBox( -// // fit: BoxFit.scaleDown, -// // child: Text( -// // 'Record New Interaction', -// // style: TextStyle( -// // // fontSize: isTablet ? 22 : 14, color: Colors.white -// // // fontSize: 20, -// // color: Colors.white), -// // ), -// // ), -// // // backgroundColor: const Color(0xFF2b9af3), -// // automaticallyImplyLeading: false, -// // actions: [saveActions(provider)], -// // leading: InkWell( -// // onTap: () { -// // Navigator.pop(context); -// // }, -// // child: const Icon( -// // Icons.arrow_back_ios, -// // color: Colors.white, -// // ), -// // ), -// // ), -// // body: Column( -// // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Expanded( -// // child: ListView.builder( -// // itemCount: provider.interactionReponseList.length, -// // cacheExtent: double.parse( -// // provider.interactionReponseList.length.toString()), -// // itemBuilder: (context, index) { -// // var item = provider.interactionReponseList[index]; -// // sectionList = item.sectionList; - -// // return Column( -// // children: [ -// // Card( -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // elevation: 5, -// // color: Constants.k2color, -// // child: ExpansionTile( -// // maintainState: true, -// // backgroundColor: Constants.k2color, -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.white), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // initiallyExpanded: true, -// // title: -// // // Stack( -// // // alignment: AlignmentDirectional.center, -// // // children: [Contact Module Mobile app Filter section api issue Pooja p1 in-progress -// // Text( -// // item.sectionName, -// // style: const TextStyle( -// // color: Colors.white, -// // fontWeight: FontWeight.normal, -// // // fontSize: isTablet ? 18 : 14 -// // ), -// // ), -// // children: [ -// // Container( -// // color: Colors.white, -// // child: Padding( -// // padding: -// // const EdgeInsets.only(top: 8.0), -// // child: Column( -// // mainAxisSize: MainAxisSize.min, -// // crossAxisAlignment: -// // CrossAxisAlignment.center, -// // children: [ -// // GridView.count( -// // physics: -// // const NeverScrollableScrollPhysics(), - -// // crossAxisCount: -// // context.responsive( -// // 1, -// // sm: 1, // small -// // md: isTablet -// // ? 2 -// // : orientation == -// // Orientation -// // .landscape -// // ? 2 -// // : 1, // medium -// // lg: sectionList.length == 1 -// // ? 1 -// // : 3, // large -// // xl: 3, // extra large screen -// // ), - -// // mainAxisSpacing: -// // sectionList.length == 1 || -// // !isTablet -// // ? 1 -// // : 3.5, -// // // mainAxisSpacing: -// // // orientation == Orientation.portrait -// // // ? 1 -// // // : 3, -// // shrinkWrap: true, -// // padding: EdgeInsets.zero, - -// // childAspectRatio: -// // sectionList.length == 1 -// // ? orientation == -// // Orientation -// // .landscape -// // ? 10 -// // : 4.8 -// // : isTablet -// // ? 2.8 -// // : 3.5, - -// // children: List.generate( -// // sectionList.length, -// // (i) { -// // SectionList sectionItem = -// // sectionList[i]; -// // dropdownvalue = -// // sectionItem.widget == -// // InteractionWidget -// // .DROPDOWN -// // ? sectionItem.value ?? -// // "Select" -// // : ' '; -// // List< -// // InputClass> list = sectionItem -// // .widget == -// // InteractionWidget -// // .DROPDOWN || -// // sectionItem.widget == -// // InteractionWidget -// // .AUTOCOMPLETE || -// // sectionItem.widget == -// // InteractionWidget -// // .MULTISELECT -// // ? provider -// // .getData2(sectionItem) -// // : []; -// // provider.checkboxlist = -// // sectionItem.widget == -// // InteractionWidget -// // .CHECKBOX -// // ? provider.getData2( -// // sectionItem) -// // : []; - -// // return Column( -// // //mainAxisSize: MainAxisSize.min, -// // crossAxisAlignment: -// // CrossAxisAlignment -// // .start, -// // children: [ -// // sectionItem.widget == -// // InteractionWidget -// // .BUTTON && -// // sectionItem -// // .input == -// // 'add' -// // ? const SizedBox -// // .shrink() -// // : Padding( -// // padding: -// // const EdgeInsets -// // .only( -// // left: 8.0, -// // right: -// // 8.0), -// // child: FittedBox( -// // fit: BoxFit -// // .scaleDown, -// // child: Text( -// // sectionItem -// // .validation! -// // .isRequired -// // ? '${sectionItem.name}:*' -// // : '${sectionItem.name}:', -// // style: -// // TextStyle( -// // color: Colors -// // .orange -// // .shade800, -// // fontSize: -// // 18.0, -// // // fontSize: isTablet -// // // ? 18 -// // // : 12, -// // ), -// // ), -// // ), -// // ), -// // returnWidget( -// // sectionItem: -// // sectionItem, -// // item: item, -// // provider: provider, -// // list: list, -// // gridIndex: i, -// // listIndex: index, -// // widgetData: -// // sectionItem -// // .widget!, -// // multiple: false), -// // ], -// // ); -// // }, -// // ), -// // ), -// // // SizedBox( -// // // height: isTablet ? 15 : 5, -// // // ), -// // item.multiple -// // ? gridViewWidget( -// // provider, -// // item.sectionName, -// // item.multipleList ?? [], -// // orientation, -// // item, -// // index) -// // : const SizedBox.shrink(), -// // provider.interactionReponseList -// // .length == -// // index - 1 -// // ? saveActions(provider) -// // : const SizedBox.shrink() -// // //const Spacer(), -// // ], -// // ), -// // ), -// // ), -// // ]), -// // ), -// // ], -// // ); -// // }, -// // ), -// // ), -// // // const Spacer(), -// // //saveActions(provider), -// // Align( -// // alignment: Alignment.bottomRight, -// // child: Container( -// // height: 80.0, -// // width: 80.0, - -// // //child: -// // // Text(provider.interactionReponseList.toString()))) -// // child: _offsetPopup(provider.interactionReponseList))) -// // ], -// // ), -// // ), -// // ); -// // }), -// // ); -// // }); -// // } -// final CarouselController _controller = CarouselController(); - -// @override -// Widget build(BuildContext context) { -// return Consumer( -// builder: (BuildContext context, provider, Widget? child) { -// return GestureDetector( -// onTap: () { -// FocusScope.of(context).requestFocus(FocusNode()); -// }, -// child: OrientationBuilder(builder: (context, orientation) { -// return SafeArea( -// child: Scaffold( -// backgroundColor: Colors.white, -// appBar: AppBar( -// title: const FittedBox( -// fit: BoxFit.scaleDown, -// child: Text( -// 'Record New Interaction', -// style: TextStyle(color: Colors.white, fontSize: 18.0), -// ), -// ), -// automaticallyImplyLeading: false, -// //actions: [saveActions(provider)], -// leading: InkWell( -// onTap: () { -// Navigator.pop(context); -// }, -// child: const Icon( -// Icons.arrow_back_ios, -// color: Colors.white, -// ), -// ), -// ), -// body: Column( -// children: [ -// Expanded( -// child: -// // ListView.builder( -// // itemCount: provider.interactionReponseList.length, -// // cacheExtent: double.parse(provider -// // .interactionReponseList.length -// // .toString()), -// // itemBuilder: (context, index) { -// // var item = provider.interactionReponseList[index]; -// // sectionList = item.sectionList; -// // print("Section_ListttPooja: $sectionList"); -// FlutterCarousel( -// options: CarouselOptions( -// onPageChanged: (index, reason) { -// setState(() { -// _currentPage = index; -// }); -// // Example: Perform actions when reaching the last page -// // if (_currentPage == _totalPages - 1) { -// // print('Reached the last page!'); -// // // Add your actions here -// // } -// }, -// controller: _controller, - -// height: MediaQuery.of(context) -// .size -// .height, // Adjust as needed -// // aspectRatio: 16 / 9, // Optional aspect ratio adjustment -// //viewportFraction: 0.9, -// viewportFraction: 1.0, - -// initialPage: 0, -// enableInfiniteScroll: false, -// reverse: false, -// autoPlay: false, -// autoPlayInterval: Duration(seconds: 3), -// autoPlayAnimationDuration: Duration(milliseconds: 800), -// autoPlayCurve: Curves.fastOutSlowIn, -// enlargeCenterPage: false, -// disableCenter: false, -// showIndicator: true, -// scrollDirection: Axis.horizontal, - -// slideIndicator: CircularWaveSlideIndicator( -// alignment: Alignment.bottomCenter, -// currentIndicatorColor: Constants.k2color, -// indicatorBackgroundColor: Colors.grey), -// ), -// items: provider.interactionReponseList.map((item) { -// sectionList = item.sectionList; -// print("Item_sectionListt11: ${item.sectionName}"); - -// print("Item_sectionListt: ${item.sectionList}"); - -// // provider.interactionReponseList[index] -// // .map((item) { -// return ListView( -// children: [ -// ColoredBox( -// color: Colors.white, -// child: -// // ExpansionTile( -// // maintainState: true, -// // // backgroundColor: Constants.k2color, -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.white), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // initiallyExpanded: true, -// // title: -// Padding( -// padding: const EdgeInsets.all(8.0), -// child: Text( -// item.sectionName, -// textAlign: TextAlign.center, -// style: const TextStyle( -// color: Colors.black, -// fontSize: 18.0, - -// fontWeight: FontWeight.bold, -// // fontSize: isTablet ? 18 : 14 -// ), -// ), -// ), -// // children: [], -// // ), -// ), -// Container( -// color: Colors.white, -// child: Column( -// mainAxisSize: MainAxisSize.min, -// children: [ -// ColoredBox( -// color: Colors.white, -// child: Padding( -// padding: const EdgeInsets.only(top: 5.0), -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: -// CrossAxisAlignment.center, -// children: [ -// GridView.count( -// physics: -// const NeverScrollableScrollPhysics(), - -// crossAxisCount: -// context.responsive( -// 1, -// sm: 1, // small -// md: isTablet -// ? 2 -// : orientation == -// Orientation.landscape -// ? 2 -// : 1, // medium -// lg: sectionList.length == 1 -// ? 1 -// : 3, // large -// xl: 3, // extra large screen -// ), - -// // mainAxisSpacing: -// // sectionList.length == 1 || -// // !isTablet -// // ? 1.8 -// // : 3.5, -// mainAxisSpacing: -// sectionList.length == 1 || -// !isTablet -// ? 1.8 -// : 3.5, -// // mainAxisSpacing: -// // orientation == Orientation.portrait -// // ? 1 -// // : 3, -// shrinkWrap: true, -// padding: EdgeInsets.zero, - -// // childAspectRatio: -// // sectionList.length == 1 -// // ? orientation == -// // Orientation.landscape -// // ? 10 -// // : 4.8 -// // : isTablet -// // ? 2.8 -// // : 3.0, - -// // childAspectRatio: -// // sectionList.length == 1 -// // ? orientation == -// // Orientation -// // .landscape -// // ? 10 -// // : 4.8 -// // : isTablet -// // ? 2.8 -// // : 3.5, -// childAspectRatio: -// sectionList.length == 1 -// ? orientation == -// Orientation -// .landscape -// ? 10 -// : 4.8 -// : isTablet -// ? 2.8 -// : 4.5, - -// children: List.generate( -// sectionList.length, -// (i) { -// SectionList sectionItem = -// sectionList[i]; -// dropdownvalue = -// sectionItem.widget == -// InteractionWidget -// .DROPDOWN -// ? sectionItem.value ?? -// "Select" -// : ' '; -// List< -// InputClass> list = sectionItem -// .widget == -// InteractionWidget -// .DROPDOWN || -// sectionItem.widget == -// InteractionWidget -// .AUTOCOMPLETE || -// sectionItem.widget == -// InteractionWidget -// .MULTISELECT -// ? provider -// .getData2(sectionItem) -// : []; -// provider.checkboxlist = -// sectionItem.widget == -// InteractionWidget -// .CHECKBOX -// ? provider.getData2( -// sectionItem) -// : []; - -// return Column( -// mainAxisSize: -// MainAxisSize.min, -// crossAxisAlignment: -// CrossAxisAlignment.start, -// children: [ -// sectionItem.widget == -// InteractionWidget -// .BUTTON && -// sectionItem.input == -// 'add' -// ? const SizedBox -// .shrink() -// : Padding( -// padding: -// const EdgeInsets -// .only( -// left: 8.0, -// right: 8.0), -// child: FittedBox( -// fit: BoxFit -// .scaleDown, -// child: Text( -// sectionItem -// .validation! -// .isRequired -// ? '${sectionItem.name}:*' -// : '${sectionItem.name}:', -// style: -// TextStyle( -// // color: Colors -// // .orange -// // .shade800, -// color: Constants -// .k2color, - -// fontSize: -// 14.0, -// // fontSize: isTablet -// // ? 18 -// // : 12, -// ), -// ), -// ), -// ), -// returnWidget( -// sectionItem: -// sectionItem, -// item: item, -// provider: provider, -// list: list, -// gridIndex: i, -// listIndex: 0, -// widgetData: -// sectionItem.widget!, -// multiple: false), -// ], -// ); -// }, -// ), -// ), -// // SizedBox( -// // height: isTablet ? 15 : 5, -// // ), -// item.multiple -// ? gridViewWidget( -// provider, -// item.sectionName, -// item.multipleList ?? [], -// orientation, -// item, -// 0) -// : const SizedBox.shrink(), -// provider.interactionReponseList -// .length == -// 0 - 1 -// ? saveActions(provider) -// : const SizedBox.shrink(), - -// // Add your actions here - -// //const Spacer(), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// item.multiple -// ? Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.only(bottom: 18.0), -// child: OutlinedButton( -// onPressed: () { -// provider.getSectionItem( -// item.sectionName, -// ); -// }, -// child: Text( -// 'Add More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// : SizedBox.shrink(), -// _currentPage == _totalPages - 1 -// ? Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.only(bottom: 18.0), -// child: OutlinedButton( -// // onPressed: () {}, -// onPressed: () async { -// String record = -// await provider.saveJsonObject( -// context, widget.form); - -// print( -// "Validation_isss: ${provider.isLoading}"); - -// if (provider.isLoading == false) { -// print("Validation_false"); -// showAlertDialog1(context, -// "Please fill all the fields"); -// } else { -// showAlertDialog(context, -// "Form $record Saved Successfully!"); -// print("Validation_True"); -// } -// }, -// child: Text( -// 'Submit', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// : SizedBox.shrink(), -// ], -// ); -// }).toList(), -// ) -// //}), -// ), -// //const SizedBox(height: 16.0), - -// Padding( -// padding: const EdgeInsets.only(bottom: 8.0), -// child: Align( -// alignment: Alignment.bottomCenter, -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Flexible( -// child: OutlinedButton( -// style: OutlinedButton.styleFrom( -// shape: CircleBorder()), -// onPressed: () { -// //if (_currentPageIndex > _totalPages - 1) -// _controller.previousPage(); -// }, -// child: Padding( -// padding: EdgeInsets.all(8.0), -// child: Icon( -// Icons.arrow_back, -// color: Constants.k2color, -// ), -// ), -// ), -// ), -// Flexible( -// child: OutlinedButton( -// style: OutlinedButton.styleFrom( -// shape: CircleBorder()), -// // onPressed: () { -// // _controller.nextPage( -// // duration: Duration(milliseconds: 300), -// // curve: Curves.ease, -// // ); -// // }, -// onPressed: () { -// _controller.nextPage( -// duration: Duration(milliseconds: 300), -// curve: Curves.ease, -// ); -// }, -// child: Padding( -// padding: EdgeInsets.all(8.0), -// child: Icon( -// Icons.arrow_forward, -// color: Constants.k2color, -// ), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// ); -// }), -// ); -// }, -// ); -// } - -// // @override -// // Widget build(BuildContext context) { -// // return Consumer( -// // builder: (BuildContext context, provider, Widget? child) { -// // return GestureDetector( -// // onTap: () { -// // FocusScope.of(context).requestFocus(FocusNode()); -// // }, -// // child: OrientationBuilder(builder: (context, orientation) { -// // return SafeArea( -// // child: Scaffold( -// // appBar: AppBar( -// // title: const FittedBox( -// // fit: BoxFit.scaleDown, -// // child: Text( -// // 'Record New Interaction', -// // style: TextStyle(color: Colors.white), -// // ), -// // ), -// // automaticallyImplyLeading: false, -// // actions: [saveActions(provider)], -// // leading: InkWell( -// // onTap: () { -// // Navigator.pop(context); -// // }, -// // child: const Icon( -// // Icons.arrow_back_ios, -// // color: Colors.white, -// // ), -// // ), -// // ), -// // body: Column( -// // children: [ -// // Expanded( -// // child: CarouselSlider.builder( -// // itemCount: provider.interactionReponseList.length, -// // options: CarouselOptions( -// // height: MediaQuery.of(context) -// // .size -// // .height, // Adjust as needed -// // aspectRatio: -// // 16 / 9, // Optional aspect ratio adjustment -// // viewportFraction: 0.9, -// // initialPage: 0, -// // enableInfiniteScroll: false, -// // reverse: false, -// // autoPlay: false, -// // autoPlayInterval: Duration(seconds: 3), -// // autoPlayAnimationDuration: -// // Duration(milliseconds: 800), -// // autoPlayCurve: Curves.fastOutSlowIn, -// // enlargeCenterPage: true, -// // scrollDirection: Axis.horizontal, -// // ), -// // itemBuilder: -// // (BuildContext context, int index, int realIndex) { -// // var item = provider.interactionReponseList[index]; -// // sectionList = item.sectionList; -// // return Card( -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // elevation: 5, -// // color: Constants.k2color, -// // child: Text("pooja ${index}"), -// // // ExpansionTile( -// // // maintainState: true, -// // // backgroundColor: Constants.k2color, -// // // onExpansionChanged: (bool expanded) { -// // // setState(() { -// // // _isExpanded = expanded; -// // // }); -// // // }, -// // // trailing: Icon( -// // // _isExpanded -// // // ? Icons.keyboard_arrow_up -// // // : Icons.keyboard_arrow_down, -// // // color: Colors.white, -// // // ), -// // // initiallyExpanded: true, -// // // title: Text( -// // // item.sectionName, -// // // style: const TextStyle( -// // // color: Colors.white, -// // // fontWeight: FontWeight.normal, -// // // ), -// // // ), -// // // children: [ -// // // Container( -// // // color: Colors.white, -// // // child: Padding( -// // // padding: const EdgeInsets.only(top: 8.0), -// // // child: Column( -// // // mainAxisSize: MainAxisSize.min, -// // // crossAxisAlignment: -// // // CrossAxisAlignment.center, -// // // children: [ -// // // GridView.count( -// // // physics: -// // // const NeverScrollableScrollPhysics(), -// // // crossAxisCount: -// // // context.responsive( -// // // 1, -// // // sm: 1, // small -// // // md: isTablet -// // // ? 2 -// // // : orientation == -// // // Orientation.landscape -// // // ? 2 -// // // : 1, // medium -// // // lg: sectionList.length == 1 -// // // ? 1 -// // // : 3, // large -// // // xl: 3, // extra large screen -// // // ), -// // // mainAxisSpacing: -// // // sectionList.length == 1 || -// // // !isTablet -// // // ? 1 -// // // : 3.5, -// // // childAspectRatio: -// // // sectionList.length == 1 -// // // ? orientation == -// // // Orientation.landscape -// // // ? 10 -// // // : 4.8 -// // // : isTablet -// // // ? 2.8 -// // // : 3.5, -// // // children: List.generate( -// // // sectionList.length, -// // // (i) { -// // // SectionList sectionItem = -// // // sectionList[i]; -// // // // Your existing code for building widgets inside the GridView -// // // return returnWidget( -// // // sectionItem: sectionItem, -// // // item: item, -// // // provider: provider, -// // // list: list, -// // // gridIndex: i, -// // // listIndex: index, -// // // widgetData: -// // // sectionItem.widget!, -// // // multiple: false); -// // // }, -// // // ), -// // // ), -// // // // Other widgets inside the ExpansionTile's children -// // // ], -// // // ), -// // // ), -// // // ), -// // // ], -// // // ), -// // // ); -// // ); -// // }, -// // ), -// // ), -// // Align( -// // alignment: Alignment.bottomRight, -// // child: Container( -// // height: 80.0, -// // width: 80.0, -// // child: _offsetPopup(provider.interactionReponseList), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ); -// // }), -// // ); -// // }, -// // ); -// // } - -// Widget returnWidget({ -// required SectionList sectionItem, -// required FormFieldData item, -// required InteractionProvider provider, -// required List list, -// required int gridIndex, -// required int listIndex, -// required InteractionWidget widgetData, -// required bool multiple, -// }) { -// switch (widgetData) { -// case InteractionWidget.CHECKBOX: -// return (sectionItem.inputList!.length >= 5) -// ? customMultiselectDropdown( -// sectionItem, provider, sectionItem.inputList!, multiple) -// : buildCheckbox(sectionItem, item.sectionName, provider, multiple); - -// case InteractionWidget.AUTOCOMPLETE: -// return customAutoCompletedropdown( -// sectionItem, provider, list, multiple); - -// case InteractionWidget.MULTISELECT: -// return customMultiselectDropdown(sectionItem, provider, list, multiple); - -// case InteractionWidget.RADIO: -// return (sectionItem.inputList!.length >= 5) -// ? customdropdown( -// sectionItem, provider, sectionItem.inputList!, multiple) -// : buildRadio(sectionItem, provider); - -// case InteractionWidget.LABEL: -// return Text(sectionItem.input!); - -// case InteractionWidget.RANGESLIDER: -// return CustomRangeSlider( -// max: double.parse(sectionItem.max!), -// min: double.parse(sectionItem.min!), -// sliderPos: sectionItem.selectedValue!.isNotEmpty -// ? double.parse(sectionItem.selectedValue!.last.toString()) -// : double.parse(sectionItem.min!), -// onChanged: (val) { -// setState(() { -// sectionItem.selectedValue = []; -// sectionItem.selectedId = val.toString(); -// sectionItem.selectedValue!.add(val.toInt()); -// }); -// }, -// ); - -// case InteractionWidget.BUTTON: -// return sectionItem.input == 'add' -// ? const Offstage( -// offstage: true, -// child: Text("Visible"), -// ) -// : Row( -// children: [ -// CustomButton( -// backgroundColor: const Color.fromARGB(255, 233, 229, 229), -// onPressed: () async { -// sectionItem.selectedValue = []; -// sectionItem.extension = []; -// sectionItem.fileName = []; -// await getEncodedFile(sectionItem); - -// setState(() {}); -// }, -// width: 120, -// height: 40, -// fontsize: 12, -// textColor: Colors.black, -// title: sectionItem.name), -// const SizedBox( -// width: 5, -// ), -// Text( -// sectionItem.selectedValue!.isNotEmpty -// ? sectionItem.selectedValue!.length > 1 -// ? 'Files uploaded' -// : "File Uploaded" -// : 'No file uploaded', -// style: TextStyle( -// color: sectionItem.selectedValue!.isNotEmpty -// ? Colors.green -// : Colors.red), -// ), -// ], -// ); - -// case InteractionWidget.TEXT: -// return sectionItem.input == 'Date' -// ? buildDateWidget(sectionItem) -// : sectionItem.input == "textArea" -// ? Expanded( -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: InteractionTextField( -// // maxchars: int.parse(sectionItem.validation!.chars ?? "0"), -// controller: sectionItem.controller!, -// labelText: sectionItem.name, -// // maxlines: 8, -// //minlines: 4, -// onChanged: (val) { -// sectionItem.selectedValue = []; -// setState(() {}); - -// sectionItem.selectedValue!.add(val); -// }, -// ), -// ), -// ) -// ////Poojaaaaa -// : sectionItem.input == "text1" -// ? Text( -// sectionItem.depid!, -// style: TextStyle( -// fontSize: 18.0, fontWeight: FontWeight.normal), -// ) -// : Expanded( -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: -// // isTablet ? 200 : MediaQuery.of(context).size.width, -// //height: isTablet ? 50 : 40, -// width: MediaQuery.of(context).size.width, -// height: isTablet ? 50 : 40, - -// child: InteractionTextField( -// inputType: sectionItem.input == "number" -// ? TextInputType.number -// : TextInputType.name, -// maxchars: int.parse(sectionItem.chars ?? "0"), -// controller: sectionItem.controller!, -// labelText: sectionItem.name, -// onChanged: (val) { -// sectionItem.selectedValue = []; -// // sectionItem.selectedValue!.clear(); - -// provider.setTextValue( -// val, sectionItem, multiple); -// }, -// ), -// ), -// ), -// ); -// case InteractionWidget.DROPDOWN: -// // return customdropdown(sectionItem, provider, list, multiple); - -// return customAutoCompletedropdown( -// sectionItem, provider, list, multiple); -// } -// } - -// Future requestPermission(Permission permission) async { -// final status = await permission.request(); - -// setState(() { -// print(status); -// // _permissionStatus = status; -// // print(_permissionStatus); -// }); -// } - -// Widget buildDateWidget(SectionList sectionItem) { -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: isTablet ? 200 : MediaQuery.of(context).size.width, -// // height: isTablet ? 50 : 40, -// width: MediaQuery.of(context).size.width, -// child: TextField( -// controller: -// sectionItem.controller, //editing controller of this TextField -// decoration: InputDecoration( -// // border: OutlineInputBorder(), -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(10.0), -// ), -// labelStyle: const TextStyle(fontSize: 16), -// suffixIcon: const Icon(Icons.calendar_today), //icon of text field -// labelText: "Enter Date" //label text of field -// ), -// readOnly: true, //set it true, so that user will not able to edit text -// onTap: () async { -// DateTime? pickedDate = await showDatePicker( -// context: context, -// initialDate: DateTime.now(), -// firstDate: DateTime( -// 2000), //DateTime.now() - not to allow to choose before today. -// lastDate: DateTime(2101)); - -// if (pickedDate != null) { -// print( -// pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 -// String formattedDate = -// DateFormat('yyyy-MM-dd').format(pickedDate); -// print( -// formattedDate); //formatted date output using intl package => 2021-03-16 -// //you can implement different kind of Date Format here according to your requirement - -// setState(() { -// sectionItem.controller!.text = formattedDate; -// sectionItem.selectedValue = []; -// sectionItem.selectedValue! -// .add(formattedDate); //set output date to TextField value. -// }); -// } else { -// print("Date is not selected"); -// } -// }, -// ), -// ), -// ); -// } - -// Widget saveActions(InteractionProvider provider) { -// return Align( -// alignment: Alignment.centerRight, -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceEvenly, -// children: [ -// Padding( -// // padding: const EdgeInsets.all(4.0), -// padding: const EdgeInsets.only(top: 8.0, bottom: 8.0, right: 5.0), - -// child: CustomButton( -// backgroundColor: Colors.red.shade800, -// onPressed: () { -// //showDeleteProfileAlertDialog(context); -// for (var textcontrollers -// in provider.textEditingControllerList) { -// textcontrollers.text = ''; -// } -// }, -// textColor: Colors.white, -// title: "Reset", -// // height: 40, -// // width: isTablet ? 100 : 80, -// height: MediaQuery.of(context).size.height * 0.2, - -// // fontsize: isTablet ? 15 : 10.2, -// fontsize: isTablet ? 16 : 12, -// ), -// ), -// SizedBox( -// //width: isTablet ? 20 : 4, -// width: isTablet ? 20 : 2, -// ), -// Padding( -// // padding: const EdgeInsets.all(8.0), -// padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), - -// child: CustomButton( -// backgroundColor: Colors.green.shade500, -// onPressed: () async { -// String record = -// await provider.saveJsonObject(context, widget.form); - -// print("Validation_isss: ${provider.isLoading}"); - -// if (provider.isLoading == false) { -// print("Validation_false"); -// showAlertDialog1(context, "Please fill all the fields"); -// } else { -// showAlertDialog(context, "Form $record Saved Successfully!"); -// print("Validation_True"); -// } -// }, -// textColor: Colors.white, -// title: "Save", -// // height: 40, -// // width: isTablet ? 100 : 80, -// height: MediaQuery.of(context).size.height * 0.2, - -// // width: MediaQuery.of(context).size.width * 0.1, -// fontsize: isTablet ? 16 : 12, -// ), -// ), -// SizedBox( -// width: isTablet ? 20 : 2, -// ), -// ], -// ), -// ); -// } - -// Widget buildRadio(SectionList sectionItem, InteractionProvider provider) { -// List list = provider.getData2(sectionItem); -// // .map((itemWord) => InputClass.fromJson(itemWord)) -// // .toList(); -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: isTablet ? 250 : MediaQuery.of(context).size.width, -// width: MediaQuery.of(context).size.width, - -// child: Row( -// children: [ -// for (InputClass value in list) -// Row( -// children: [ -// Radio( -// value: value.name, -// activeColor: Colors.black, -// groupValue: provider.radioValue, -// onChanged: (String? value) { -// setState(() { -// print(value); -// provider.radioValue = value!; -// int index = -// list.indexWhere((element) => element.name == value); -// sectionItem.selectedValue!.add(list[index].id); -// }); -// }, -// ), -// Text(value.name), -// ], -// ), -// ], -// ), -// ), -// ); -// } - -// Widget buildCheckbox(SectionList sectionItem, String sectionName, -// InteractionProvider provider, bool multiple) { -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: 250, -// width: MediaQuery.of(context).size.width, - -// child: Row( -// children: [ -// for (var value in provider.checkboxlist) -// Row( -// children: [ -// FittedBox( -// fit: BoxFit.scaleDown, -// child: CheckboxListTile( -// dense: true, -// //contentPadding: const EdgeInsets.symmetric(vertical: 5), -// value: value.ischecked ?? false, -// activeColor: Colors.black, -// checkColor: Colors.white, -// onChanged: (bool? newvalue) { -// value.ischecked = newvalue!; -// provider.setcheckBoxValue(sectionItem, sectionName, -// newvalue, value.id, multiple); -// //setState(() {}); -// }, -// ), -// ), -// Text(value.name), -// ], -// ), -// ], -// ), -// ), -// ); -// } - -// Widget customdropdown(SectionList sectionItem, InteractionProvider provider, -// List list, bool multiple) { -// // sectionItem.value = ''; - -// if (list.isEmpty) { -// list = []; -// InputClass inputClass = -// InputClass(id: "no value", name: "Select ${sectionItem.name}"); -// list.add(inputClass); -// sectionItem.selectedObject = list[0]; -// } -// // InputClass selectedObj = list[0]; -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// width: MediaQuery.of(context).size.width, -// // height: isTablet ? 60 : 40, -// child: DropdownButtonFormField2( -// isExpanded: true, -// decoration: InputDecoration( -// // Add Horizontal padding using menuItemStyleData.padding so it matches -// // the menu padding when button's width is not specified. -// isDense: true, -// contentPadding: const EdgeInsets.symmetric(vertical: 5), -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(10.0), -// ), -// // Add more decoration.. -// ), -// hint: Text( -// 'Select ${sectionItem.name}', -// style: const TextStyle(fontSize: 14), -// ), -// items: list -// .map((item) => DropdownMenuItem( -// value: item, -// child: Text( -// item.name, -// style: const TextStyle( -// fontSize: 14, -// ), -// ), -// )) -// .toList(), -// value: sectionItem.selectedObject ?? list[0], -// // // provider.getDropDownValue(sectionItem.value!, sectionItem, list) -// // sectionItem.value ?? list[0].name, -// validator: (value) { -// if (value == null) { -// return 'Please select ${sectionItem.name}'; -// } -// return null; -// }, -// onChanged: (value) { -// //Do something when selected item is changed. -// sectionItem.selectedObject = value!; -// sectionItem.value = value.id; -// provider.setDropDownValue(value.id, sectionItem, multiple); -// print("selected ${sectionItem.value}"); -// // setState(() {}); -// }, -// onSaved: (value) { -// sectionItem.selectedObject = value!; -// sectionItem.value = value.id; -// provider.setDropDownValue(value.id, sectionItem, multiple); -// // setState(() {}); -// }, -// buttonStyleData: const ButtonStyleData( -// padding: EdgeInsets.only(right: 8), -// ), -// iconStyleData: const IconStyleData( -// icon: Icon( -// Icons.arrow_drop_down, -// color: Colors.black45, -// ), -// iconSize: 24, -// ), -// dropdownStyleData: DropdownStyleData( -// decoration: BoxDecoration( -// borderRadius: BorderRadius.circular(10.0), -// ), -// ), -// menuItemStyleData: const MenuItemStyleData( -// padding: EdgeInsets.symmetric(horizontal: 16), -// ), -// ), -// ), -// ); -// } - -// Widget customAutoCompletedropdown(SectionList sectionItem, -// InteractionProvider provider, List list, bool multiple) { -// list = sectionItem.inputList!; -// print("***Autocomplete list ${list[0].name}"); -// //} -// //InputClass selectedObj = list[0]; -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: isTablet ? 200 : MediaQuery.of(context).size.width, -// // height: isTablet ? 60 : 40, -// width: MediaQuery.of(context).size.width, - -// child: DropdownButtonHideUnderline( -// child: DropdownButtonFormField2( -// isExpanded: true, -// decoration: InputDecoration( -// // Add Horizontal padding using menuItemStyleData.padding so it matches -// // the menu padding when button's width is not specified. -// isDense: true, -// contentPadding: const EdgeInsets.symmetric(vertical: 5), -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(10.0), -// ), -// // Add more decoration.. -// ), -// hint: Text( -// 'Select Item', -// style: TextStyle( -// fontSize: 14, -// color: Theme.of(context).hintColor, -// ), -// ), -// items: list -// .map((item) => DropdownMenuItem( -// value: item, -// child: Text( -// item.name, -// style: const TextStyle( -// fontSize: 14, -// ), -// ), -// )) -// .toList(), -// value: sectionItem.selectedObject, -// onSaved: (value) { -// sectionItem.selectedObject = value!; -// provider.setAutoCompleteValue(value.id, sectionItem, multiple); -// sectionItem.value = value.name; -// }, -// onChanged: (value) { -// // setState(() { -// sectionItem.selectedObject = value!; -// provider.setAutoCompleteValue(value.id, sectionItem, multiple); -// sectionItem.value = value.name; -// // setState(() {}); -// //}); -// }, - -// buttonStyleData: const ButtonStyleData( -// padding: EdgeInsets.symmetric(horizontal: 16), -// height: 40, -// width: 200, -// ), -// dropdownStyleData: const DropdownStyleData( -// maxHeight: 200, -// ), -// menuItemStyleData: const MenuItemStyleData( -// height: 40, -// ), -// dropdownSearchData: DropdownSearchData( -// searchController: textEditingController, -// searchInnerWidgetHeight: 50, -// searchInnerWidget: Container( -// height: 50, -// padding: const EdgeInsets.only( -// top: 8, -// bottom: 4, -// right: 8, -// left: 8, -// ), -// child: TextFormField( -// // expands: true, -// // maxLines: null, -// controller: textEditingController, -// decoration: InputDecoration( -// isDense: true, -// contentPadding: const EdgeInsets.symmetric( -// horizontal: 10, -// vertical: 18, -// ), -// hintText: 'Search for an item...', -// hintStyle: const TextStyle(fontSize: 12), -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(10.0), -// ), -// ), -// ), -// ), -// searchMatchFn: (item, searchValue) { -// return item.value!.name.toString().contains(searchValue); -// }, -// ), -// //This to clear the search value when you close the menu -// onMenuStateChange: (isOpen) { -// if (!isOpen) { -// textEditingController.clear(); -// } -// }, -// ), -// ), -// ), -// ); -// } - -// Widget customMultiselectDropdown(SectionList sectionItem, -// InteractionProvider provider, List list, bool multiple) { -// if (list.isEmpty) { -// list = sectionItem.inputList!; -// } -// InputClass selectedObj = list[0]; - -// return Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: SizedBox( -// // width: isTablet ? 200 : MediaQuery.of(context).size.width, -// // height: isTablet ? 60 : 40, -// width: MediaQuery.of(context).size.width, -// // height: MediaQuery.of(context).size.height, - -// child: DropdownButtonHideUnderline( -// child: DropdownButtonFormField2( -// isExpanded: true, -// decoration: InputDecoration( -// // Add Horizontal padding using menuItemStyleData.padding so it matches -// // the menu padding when button's width is not specified. -// isDense: true, -// contentPadding: const EdgeInsets.symmetric(vertical: 5), -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(10.0), -// ), -// // Add more decoration.. -// ), -// hint: Text( -// 'Select Items', -// style: TextStyle( -// fontSize: 14, -// color: Theme.of(context).hintColor, -// ), -// ), -// items: list.map((item) { -// return DropdownMenuItem( -// value: item, -// //disable default onTap to avoid closing menu when selecting an item -// enabled: false, -// child: StatefulBuilder( -// builder: (context, menuSetState) { -// final isSelected = -// sectionItem.selectedValue!.contains(item.name); -// return InkWell( -// onTap: () { -// isSelected -// ? sectionItem.selectedValue!.remove(item.name) -// : sectionItem.selectedValue!.add(item.name); -// //This rebuilds the StatefulWidget to update the button's text -// setState(() {}); -// //This rebuilds the dropdownMenu Widget to update the check mark -// menuSetState(() {}); -// }, -// child: Container( -// height: double.infinity, -// padding: const EdgeInsets.symmetric(horizontal: 16.0), -// child: Row( -// children: [ -// if (isSelected) -// const Icon(Icons.check_box_outlined) -// else -// const Icon(Icons.check_box_outline_blank), -// const SizedBox(width: 16), -// Expanded( -// child: Text( -// item.name, -// style: const TextStyle( -// fontSize: 14, -// ), -// ), -// ), -// ], -// ), -// ), -// ); -// }, -// ), -// ); -// }).toList(), -// //Use last selected item as the current value so if we've limited menu height, it scroll to last item. -// value: selectedObj, -// // ? null -// // : provider.selectedItems.last, -// onChanged: (value) { -// selectedObj = value!; -// provider.setAutoCompleteValue(value.id, sectionItem, multiple); -// sectionItem.value = value.name; -// }, -// onSaved: (value) { -// selectedObj = value!; -// provider.setAutoCompleteValue(value.id, sectionItem, multiple); -// sectionItem.value = value.name; -// }, -// selectedItemBuilder: (context) { -// return list.map( -// (item) { -// return Container( -// alignment: AlignmentDirectional.center, -// child: Text( -// sectionItem.selectedValue!.join(', '), -// style: const TextStyle( -// fontSize: 14, -// overflow: TextOverflow.ellipsis, -// ), -// maxLines: 1, -// ), -// ); -// }, -// ).toList(); -// }, -// buttonStyleData: const ButtonStyleData( -// padding: EdgeInsets.only(left: 16, right: 8), -// height: 40, -// width: 140, -// ), -// menuItemStyleData: const MenuItemStyleData( -// height: 40, -// padding: EdgeInsets.zero, -// ), -// ), -// ), -// ), -// ); -// } - -// Widget gridViewWidget( -// InteractionProvider provider, -// String sectionName, -// List sectionList, -// Orientation orientation, -// FormFieldData item, -// int listIndex) { -// print("ListInex: $listIndex"); -// print("sectionName: $sectionName"); -// print("sectionName: $sectionName"); - -// print("gridsectionlost_is: $sectionList"); -// print("gridsectionlostleangth_is: ${sectionList.length}"); - -// List pooja = sectionList; - -// print("Pooja_isss: $pooja"); -// print("Pooja_leangth_isss: ${pooja.length}"); - -// ////////////////////////////////////mycode/////////////////////////// - -// List> convertedArray = []; -// print("Provider_leangth: ${item.sectionList.length}"); - -// for (int i = 0; i < pooja.length; i += item.sectionList.length + 1) { -// print("poojaleangth: $pooja"); - -// convertedArray.add(pooja.sublist(i, i + item.sectionList.length + 1)); -// } -// print("ConvertedArray.leangth: $convertedArray"); -// print("ConvertedArray.leangth: ${convertedArray.length}"); - -// return Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// for (var i = 0; i < convertedArray.length; i++) -// DecoratedBox( -// decoration: BoxDecoration( -// // border: Border.all(color: Colors.black), -// // borderRadius: BorderRadius.circular(10.0), -// color: i % 2 == 0 -// ? Color.fromARGB(133, 213, 241, 254) -// : Colors.white, -// ), -// child: GridView.builder( -// physics: const NeverScrollableScrollPhysics(), -// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( -// crossAxisCount: context.responsive( -// 1, -// sm: 1, // small -// md: isTablet -// ? 2 -// : orientation == Orientation.landscape -// ? 2 -// : 1, // medium -// lg: sectionList.length == 1 ? 1 : 3, // large -// xl: 3, // extra large screen -// ), -// mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 1, -// // childAspectRatio: sectionList.length == 1 -// // ? orientation == Orientation.landscape -// // ? 10 -// // : 4.8 -// // : isTablet -// // ? 2.8 -// // : 3.7, -// childAspectRatio: sectionList.length == 1 -// ? orientation == Orientation.landscape -// ? 10 -// : 4.8 -// : isTablet -// ? 2.8 -// : 4.5, -// ), -// shrinkWrap: true, -// padding: EdgeInsets.zero, -// itemCount: convertedArray[i].length, -// itemBuilder: (context, index) { -// SectionList sectionItem = convertedArray[i][index]; -// dropdownvalue = -// sectionItem.widget == InteractionWidget.DROPDOWN -// ? sectionItem.value ?? "Select" -// : ' '; -// List list = sectionItem.widget == -// InteractionWidget.DROPDOWN || -// sectionItem.widget == -// InteractionWidget.AUTOCOMPLETE || -// sectionItem.widget == InteractionWidget.MULTISELECT -// ? provider.getData2(sectionItem) -// : []; -// provider.checkboxlist = -// sectionItem.widget == InteractionWidget.CHECKBOX -// ? provider.getData2(sectionItem) -// : []; -// return Padding( -// padding: const EdgeInsets.only(top: 12.0), -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// // sectionItem.widget == InteractionWidget.BUTTON && -// // sectionItem.input == 'add' || -// // sectionItem.input == 'deletebtn' -// // ? const SizedBox.shrink() -// // : -// Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text( -// sectionItem.validation!.isRequired -// ? "${sectionItem.name}*" -// : sectionItem.name, -// style: TextStyle( -// //color: Colors.orange.shade800, -// color: Constants.k2color, -// fontSize: 14), -// ), -// ), -// ), -// // const SizedBox( -// // height: 15, -// // ), -// sectionItem.widget == InteractionWidget.BUTTON -// ? sectionItem.input == 'chooseFile' -// ? Row( -// children: [ -// CustomButton( -// backgroundColor: const Color.fromARGB( -// 255, 233, 229, 229), -// onPressed: () async { -// sectionItem.selectedValue = []; -// sectionItem.extension = []; -// sectionItem.fileName = []; -// await getEncodedFile(sectionItem); - -// setState(() {}); -// }, -// width: 120, -// height: 40, -// fontsize: 12, -// textColor: Colors.black, -// title: sectionItem.name), -// const SizedBox( -// width: 5, -// ), -// Text( -// sectionItem.selectedValue!.isNotEmpty -// ? sectionItem -// .selectedValue!.isNotEmpty -// ? 'File uploaded' -// : "Files Uploaded" -// : 'No file uploaded', -// style: TextStyle( -// color: sectionItem -// .selectedValue!.isNotEmpty -// ? Colors.green -// : Colors.red), -// ), -// ], -// ) -// : isTablet -// ? IconButton( -// onPressed: () { -// provider.deleteMultipleRows( -// sectionItem.gid!, -// sectionList[i], -// sectionName); - -// setState(() {}); -// }, -// icon: const Icon( -// Icons.cancel, -// size: 30, -// color: Color.fromARGB(255, 8, 39, 92), -// ), -// ) -// : Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: CustomButton( -// backgroundColor: -// const Color.fromARGB( -// 255, 233, 75, 75), -// onPressed: () { -// provider.deleteMultipleRows( -// sectionItem.gid!, -// sectionList[i], -// sectionName); - -// setState(() {}); -// }, -// height: 40, - -// // height: -// // MediaQuery.of(context).size.height * -// // 0.2, -// fontsize: 12, -// textColor: Colors.white, -// title: "Delete"), -// ) -// : returnWidget( -// sectionItem: sectionItem, -// item: item, -// provider: provider, -// list: list, -// gridIndex: i, -// listIndex: listIndex, -// widgetData: sectionItem.widget!, -// multiple: true), -// ], -// ), -// ); -// }), -// ) -// ], -// ); -// //); -// } - -// String fieldsValidation(InteractionProvider provider) { -// List secList = provider.sectionList -// .where((element) => element.validation!.isRequired = true) -// .toList(); -// if (secList.any((element) => element.selectedValue!.isEmpty)) { -// return 'Fields cannot be empty'; -// } -// return ''; -// } - -// String textFieldsValidation(InteractionProvider provider) { -// return ''; -// } - -// _displaySnackBar(String msg) { -// final snackBar = SnackBar( -// content: Text( -// msg, -// style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), -// )); -// ScaffoldMessenger.of(context).showSnackBar(snackBar); -// //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); -// } - -// Future getEncodedFile(SectionList sectionItem) async { -// String base64Image = ''; -// var status = Platform.isAndroid -// ? await Permission.manageExternalStorage.status -// : await Permission.storage.status; -// if (status.isGranted) { -// FilePickerResult? result = -// await FilePicker.platform.pickFiles(allowMultiple: true); - -// if (result != null) { -// print(result.files.first.path); -// print(result.files.last.path); -// for (var files in result.files) { -// File file = File(files.path!); -// print("check file path : ${file.path}"); -// fileName = file.path.split('/').last; -// // Get the application folder directory -// Directory? directory = Platform.isAndroid -// ? await getExternalStorageDirectory() //FOR ANDROID -// : await getApplicationDocumentsDirectory(); -// String newPath = ""; //FOR ios -// String convertedDirectoryPath = (directory?.path).toString(); - -// print("see the converted directory path $convertedDirectoryPath"); - -// newPath = "$convertedDirectoryPath/konectar/files"; -// print("new path :$newPath"); -// directory = Directory(newPath); -// if (!await directory.exists()) { -// await directory.create(recursive: true); -// } -// File newFile = await file.copy('${directory.path}/$fileName'); -// print("new path is ${newFile.path}"); -// final extension = p.extension(newFile.path); -// List imageBytes = await newFile.readAsBytes(); -// Uint8List imageUint8List = Uint8List.fromList(imageBytes); -// base64Image = base64Encode(imageUint8List); -// sectionItem.selectedValue!.add(base64Image); -// sectionItem.extension!.add(extension); -// sectionItem.fileName!.add(fileName); -// } -// } -// } else { -// print("not permitted"); -// await requestPermission(Platform.isAndroid -// ? Permission.manageExternalStorage -// : Permission.storage); -// } -// } - -// showAlertDialog(BuildContext context, String record) { -// Widget cancelButton = TextButton( -// child: const Text("Ok"), -// onPressed: () async { -// Navigator.of(context).pop(); -// Navigator.of(context).pop(); -// }, -// ); - -// // set up the AlertDialog -// AlertDialog alert = AlertDialog( -// title: const Text(""), -// content: Text(record), -// actions: [ -// cancelButton, -// ], -// ); - -// // show the dialog -// showDialog( -// context: context, -// builder: (BuildContext context) { -// return alert; -// }, -// ); -// } - -// showAlertDialog1(BuildContext context, String record) { -// Widget cancelButton = TextButton( -// child: const Text("Ok"), -// onPressed: () async { -// Navigator.of(context).pop(); -// }, -// ); - -// // set up the AlertDialog -// AlertDialog alert = AlertDialog( -// title: const Text(""), -// content: Text(record), -// actions: [ -// cancelButton, -// ], -// ); - -// // show the dialog -// showDialog( -// context: context, -// builder: (BuildContext context) { -// return alert; -// }, -// ); -// } - -// Widget _offsetPopup(List interactionReponseList) { -// List trueElements = -// interactionReponseList.where((element) => element.multiple).toList(); -// print("trueElements_iss: $trueElements"); - -// return PopupMenuButton( -// onSelected: (newValue) { -// var provider = -// Provider.of(context, listen: false); -// setState(() { -// _value = newValue; // it gives the value which is selected - -// var item = trueElements[_value]; - -// provider.getSectionItem( -// item.sectionName, -// ); -// }); -// print("Clicked Section111 $_value "); // add this property -// print( -// "interactionReponseList1 ${interactionReponseList} "); // add this property -// }, -// itemBuilder: (context) { -// return List.generate(trueElements.length, (index) { -// var provider = -// Provider.of(context, listen: false); - -// var item = trueElements[index]; - -// print("itemitemitemitem_isss: ${item.multiple}"); - -// return PopupMenuItem( -// value: index, -// child: item.multiple == true -// ? GestureDetector( -// onTap: () { -// print("Clicked Section ${item.sectionName}"); -// // provider.getSectionItem( -// // item.sectionName, -// // ); -// //print("Clicked Section : ${sectionList}") -// setState(() { -// provider.getSectionItem( -// item.sectionName, -// ); -// }); - -// const DecoratedBox( -// decoration: BoxDecoration( -// // border: Border.all(color: Colors.black), -// // borderRadius: BorderRadius.circular(10.0), -// border: Border( -// bottom: -// BorderSide(width: 1.5, color: Colors.black), -// //top: BorderSide(width: 1.5, color: Colors.black), -// ), -// ), -// ); -// }, -// child: item.multiple == true -// ? Text(' ${item.sectionName}') -// : const SizedBox.shrink()) -// : SizedBox.shrink(), -// ); -// }); -// }, -// icon: Container( -// height: double.infinity, -// width: double.infinity, -// decoration: const ShapeDecoration( -// color: Color.fromARGB(255, 8, 39, 92), -// shape: StadiumBorder( -// side: BorderSide(color: Colors.white, width: 2), -// ), -// ), -// child: Icon(Icons.add, color: Colors.white), -// )); -// } -// } - diff --git a/lib/contacts_module/ui_screen/internetcheck.dart b/lib/contacts_module/ui_screen/internetcheck.dart new file mode 100644 index 0000000..fba823f --- /dev/null +++ b/lib/contacts_module/ui_screen/internetcheck.dart @@ -0,0 +1,38 @@ +// import 'package:connectivity_plus/connectivity_plus.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// class checkinter extends StatefulWidget { +// const checkinter({super.key}); + +// @override +// State createState() => _checkinterState(); +// } + +// class _checkinterState extends State { +// @override +// Widget build(BuildContext context) { +// return const Placeholder(); +// } +// } +// final Connectivity _connectivity = Connectivity(); +// get developer => null; + +// Future initConnectivitycheck() async { +// late List result; +// // Platform messages may fail, so we use a try/catch PlatformException. +// try { +// result = await _connectivity.checkConnectivity(); +// } on PlatformException catch (e) { +// developer.log('Couldn\'t check connectivity status', error: e); +// return; +// } + +// // If the widget was removed from the tree while the asynchronous platform +// // message was in flight, we want to discard the reply rather than calling +// // setState to update our non-existent appearance. +// if (!mounted) { +// return Future.value(null); +// } + +// return _updateConnectionStatus(result); +// } diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart index 2cb3f17..8850399 100644 --- a/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart @@ -1,4 +1,3 @@ -// import 'package:discover_module/constants.dart'; import 'package:discover_module/contacts_module/constants.dart'; import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; @@ -11,32 +10,20 @@ import 'package:discover_module/contacts_module/provider_class/trials_provider.d import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; import 'package:discover_module/contacts_module/ui_screen/publication_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/show_morek2/events_showmorek2.dart'; import 'package:discover_module/contacts_module/ui_screen/trials_show_more.dart'; -// import 'package:discover_module/custom_widget/text.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_aff_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_event_k2.dart'; -// import 'package:discover_module/provider_class/affiliationsprovider.dart'; -// import 'package:discover_module/provider_class/events_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_aff_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_event_provider.dart'; -// import 'package:discover_module/provider_class/publications_provider.dart'; -// import 'package:discover_module/provider_class/trials_provider.dart'; -// import 'package:discover_module/ui_screen/affiliation_data.dart'; -// import 'package:discover_module/ui_screen/bottom_sheet.dart'; -// import 'package:discover_module/ui_screen/events_data.dart'; -// import 'package:discover_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart'; -// import 'package:discover_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; -// import 'package:discover_module/ui_screen/publication_data.dart'; -// import 'package:discover_module/ui_screen/trials_show_more.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ActivitiesK2 extends StatefulWidget { //Activities({super.key, required text}); - ActivitiesK2({required this.text, Key? key}) : super(key: key); + ActivitiesK2({required this.text, Key? key, this.offlineMode}) + : super(key: key); final int text; + bool? offlineMode; @override State createState() => _ActivitiesState(); @@ -118,6 +105,7 @@ class _ActivitiesState extends State { buttonText: 'Show More', field1: 'Organization Name', field2: 'TimeFrame', + noexpand: widget.offlineMode == null ? true : false, onItemSelected: (AffList selectedLocation) { List> keyValue = [ { @@ -133,7 +121,17 @@ class _ActivitiesState extends State { modelbsheet(keyValue); }, ) - : Container(), + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Affiliations", + itemList: affiliation_data.cast(), + buttonText: 'Show More', + field1: 'Organization Name', + field2: 'TimeFrame', + noexpand: false, + onItemSelected: (AffList selectedLocation) {}, + ) + : Container(), publication_data.length != 0 ? ListTileTheme( @@ -146,7 +144,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -157,7 +155,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -304,6 +302,7 @@ class _ActivitiesState extends State { buttonText: 'Show More', field1: 'Event Name', field2: 'Role', + noexpand: widget.offlineMode == null ? true : false, onItemSelected: (EventList selectedLocation) { List> keyValue = [ { @@ -315,8 +314,24 @@ class _ActivitiesState extends State { ]; modelbsheet(keyValue); }, + onButtonPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => Events2ShowMore(text: widget.text))); + }, ) - : Container(), + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Events", + itemList: event_data.cast(), + buttonText: 'Show More', + field1: 'Event Name', + field2: 'Role', + noexpand: false, + onItemSelected: (EventList selectedLocation) {}, + ) + : Container(), trial_data.length != 0 ? ListTileTheme( @@ -329,7 +344,7 @@ class _ActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -338,7 +353,7 @@ class _ActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/demoActivityTab.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/demoActivityTab.dart new file mode 100644 index 0000000..3ff8da7 --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/demoActivityTab.dart @@ -0,0 +1,345 @@ +import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_sizedbox.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_aff_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_event_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +import 'package:discover_module/contacts_module/ui_screen/show_morek2/events_showmorek2.dart'; + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ActivitiesK2Demo extends StatefulWidget { + const ActivitiesK2Demo({required this.text, super.key, this.offlineMode}); + + final int text; + final bool? offlineMode; + + @override + State createState() => _ActivitiesState(); +} + +class _ActivitiesState extends State { + bool isDataLoaded = false; + @override + void initState() { + super.initState(); + getaffiliations(); + } + + Future getaffiliations() async { + final affProvider = + Provider.of(context, listen: false); + + final eveProvider = Provider.of(context, listen: false); + + if (!affProvider.hasData) { + await affProvider.getAffiliationsdata(widget.text); + } + + if (mounted) { + if (!eveProvider.hasData) { + await eveProvider.geteventdata(widget.text); + } + } + setState(() { + isDataLoaded = true; // Mark data as loaded + }); + } + + Widget build(BuildContext context) { + final affProvider = + Provider.of(context, listen: false); + + final eveProvider = Provider.of(context, listen: false); + return Center( + child: ListView(children: [ + affProvider.hasData + ? CustomExpansionTile( + title: "Affiliations", + itemList: affProvider.adddta.cast(), + buttonText: 'Show More', + field1: 'Organization Name', + field2: 'TimeFrame', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (AffList selectedLocation) { + List> keyValue = [ + { + "Department": selectedLocation.department, + "Title": selectedLocation.title, + "Start Year": selectedLocation.startYear, + "End Year": selectedLocation.endYear, + "Role": selectedLocation.role, + "Organization Type": selectedLocation.kolOrganizationType, + "Engagement Type": selectedLocation.kolEngagementType, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + eveProvider.hasData + ? CustomExpansionTile( + title: "Events", + itemList: eveProvider.EventsList.cast(), + buttonText: 'Show More', + field1: 'Event Name', + field2: 'Role', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EventList selectedLocation) { + List> keyValue = [ + { + "Name": selectedLocation.name, + "Notes": selectedLocation.notes, + "Partially Released Event": + selectedLocation.partiallyReleasedEvent, + } + ]; + modelbsheet(keyValue); + }, + onButtonPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => Events2ShowMore(text: widget.text))); + }, + ) + : Container(), + ]), + ); + } + + void bottomshet(affiliation_data) { + showModalBottomSheet( + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Colors.white, + color: Color.fromARGB(255, 246, 248, 252), + + 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: [ + const CustomSizedBox(height: 18.0), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Text( + affiliation_data.org_name, + softWrap: true, + maxLines: 4, + style: const TextStyle( + fontSize: 16.0, color: Colors.black), + ), + ), + ), + ], + ), + const CustomSizedBox(height: 18.0), + Divider(), + const CustomSizedBox(height: 18.0), + affiliation_data['dept'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text1( + title: "Department", + txtfont: 13.0, + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['dept'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['role'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text1( + title: "Role", + txtfont: 13.0, + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['role'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['time_frame'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Time Frame".toString(), + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['time_frame'] + .toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['org_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text1( + title: "Oraganization Type", + txtfont: 13.0, + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['emg_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + ], + ); + }, + ), + ), + ], + ), + ); + }, + ); + //); + }, + ); + } + + void modelbsheet(List> keyValue) { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheetk2new(keyValue); + }, + ); + } +} diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart index b92d1ab..61a8e57 100644 --- a/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart @@ -54,9 +54,12 @@ class _bsheetk2State extends State { Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), - child: Text1( - title: - ' $key \n ${data[key]}', // Display key and corresponding value + child: Padding( + padding: const EdgeInsets.only(left: 9.0), + child: Text1( + title: + ' $key \n ${data[key]}', // Display key and corresponding value + ), ), ) // Text1(title: data.keyValue) ], diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart index 363b30a..7328387 100644 --- a/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart @@ -1,4 +1,4 @@ -// import 'package:discover_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/custom_widget/card_expansiontile.dart'; import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; @@ -14,327 +14,445 @@ import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_e import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; -import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; -import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; -import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_Certificate_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_awards_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_education_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_email_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_location_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_pno_k2.dart'; -// import 'package:discover_module/model_class/k2_api_model/kol_training_k2.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_awards_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_certificate_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_education_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_email_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_locationprovider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_pno_provider.dart'; -// import 'package:discover_module/provider_class/k2_provider/kol_training_provider.dart'; -// import 'package:discover_module/storage_hive/awa_data/crud_awa.dart'; -// import 'package:discover_module/storage_hive/cer_hive/crud_cer.dart'; -// import 'package:discover_module/storage_hive/edu_data/crud_edu.dart'; -// import 'package:discover_module/storage_hive/email_data/crud_email.dart'; -// import 'package:discover_module/storage_hive/loc_data/crud_loc.dart'; -// import 'package:discover_module/storage_hive/pno_data/crud_pno.dart'; -// import 'package:discover_module/storage_hive/traning_data/crud_training.dart'; -// import 'package:discover_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +import 'package:discover_module/contacts_module/ui_screen/show_morek2/location_showmorek2.dart'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LocationK2Tab extends StatefulWidget { - // const LocationTab({super.key}); - LocationK2Tab({required this.text, this.offline, Key? key}) : super(key: key); + const LocationK2Tab( + {required this.text, this.offline, super.key, this.offlineMode}); final int text; - int? offline; + final int? offline; + final bool? offlineMode; @override State createState() => _LocationK2TabState(); } class _LocationK2TabState extends State { - List locationList = []; - List pno = []; - List emailid = []; + bool isDataLoaded = false; - List training = []; - List education = []; - List award = []; - List certificate = []; + List locationList = []; + + List phonenolist = []; + + List mailList = []; @override void initState() { - // TODO: implement initState super.initState(); - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getAffiliations(); + WidgetsBinding.instance.addPostFrameCallback((_) { + print("I_aminitstate"); + + if (!isDataLoaded) { + getAffiliations(); + } }); } Future getAffiliations() async { - // ignore: prefer_typing_uninitialized_variables - var loclist, phoneno, emailno1, edu1, awa1, cer1, training1; + final locationProvider = + Provider.of(context, listen: false); - if (widget.offline == 1) { - loclist = await retrieveidlocations(widget.text); - print("Saved_Checkingloclist: $loclist"); - } else { - var location = Provider.of(context, listen: false); - await location.locationinfo(widget.text); - loclist = location.locationlist; + final pnoProvider = Provider.of(context, listen: false); + final emailProvider = Provider.of(context, listen: false); + final trainingProvider = + Provider.of(context, listen: false); + final educationProvider = + Provider.of(context, listen: false); + final awardsProvider = Provider.of(context, listen: false); + final certificateProvider = + Provider.of(context, listen: false); - setState(() { - locationList = loclist; - }); - } - - if (mounted) { - if (widget.offline == 1) { - phoneno = await retrieveidpnos(widget.text); - print("Saved_Checkingloclist: $loclist"); - } else { - var phone = Provider.of(context, listen: false); - await phone.phonek2info(widget.text); - phoneno = phone.phonenolist; + Future _loadData( + bool hasData, + Function fetchDataOffline, + Function fetchDataOnline, + dynamic setStateCallback, + ) async { + if (!hasData) { + if (widget.offline == 1) { + print("Offline mode: ${widget.offline}"); + var data = await fetchDataOffline(widget.text); + print("Retrieved data: $data"); + setState(() => setStateCallback(data)); + } else { + await fetchDataOnline(widget.text); + } } - setState(() { - pno = phoneno; - }); } + // Location data fetch logic if (mounted) { - if (widget.offline == 1) { - emailno1 = await retrieveidemails(widget.text); - print("Saved_CheckingloclistEmailll: $emailno1"); - } else { - var email = Provider.of(context, listen: false); - await email.emailinfo(widget.text); - emailno1 = email.emailkollist; - print("Saved_CheckingloclistEmailll123: $emailno1"); - } - - setState(() { - emailid = emailno1; - }); + await _loadData( + locationProvider.hasData, + retrieveidlocations, + locationProvider.locationinfo, + (data) => locationList = data, + ); } + // Phone number data fetch logic if (mounted) { - if (widget.offline == 1) { - training1 = await retrieveidtri(widget.text); - print("Saved_CheckingloclistEmailll: $emailno1"); - } else { - var trai = Provider.of(context, listen: false); - await trai.traininginfo(widget.text); - training1 = trai.traininglist; - } - - setState(() { - training = training1; - }); + await _loadData( + pnoProvider.hasData, + retrieveidpnos, + pnoProvider.phonek2info, + (data) => phonenolist = data, + ); } + // Email data fetch logic if (mounted) { - if (widget.offline == 1) { - edu1 = await retrieveidedus(widget.text); - print("Saved_CheckingloclistEdu: $edu1"); - } else { - var edu = Provider.of(context, listen: false); - await edu.eduinfo(widget.text); - edu1 = edu.educationlist; - print("Saved_CheckingloclistEdu123: $edu1"); - } - - setState(() { - education = edu1; - }); + await _loadData( + emailProvider.hasData, + retrieveidemails, + emailProvider.emailinfo, + (data) => mailList = data, + ); } + // Training data fetch logic if (mounted) { - if (widget.offline == 1) { - awa1 = await retrieveidawa(widget.text); - print("Saved_CheckingloclistEdu: $edu1"); - } else { - var awa = Provider.of(context, listen: false); - await awa.awainfo(widget.text); - awa1 = awa.awardlist; - } - setState(() { - award = awa1; - }); + await _loadData( + trainingProvider.hasData, + retrieveidtri, + trainingProvider.traininginfo, + (data) => {}, // Handle training data if needed + ); } + // Education data fetch logic if (mounted) { - if (widget.offline == 1) { - cer1 = await retrieveidcer(widget.text); - print("Saved_CheckingloclistEdu: $edu1"); - } else { - var cer = Provider.of(context, listen: false); - await cer.certificateinfo(widget.text); - cer1 = cer.certificatelist; - } - - setState(() { - certificate = cer1; - }); + await _loadData( + educationProvider.hasData, + retrieveidtri, + educationProvider.eduinfo, + (data) => {}, // Handle education data if needed + ); } + + // Awards data fetch logic + if (mounted) { + await _loadData( + awardsProvider.hasData, + retrieveidtri, + awardsProvider.awainfo, + (data) => {}, // Handle awards data if needed + ); + } + + // Certificate data fetch logic + if (mounted) { + await _loadData( + certificateProvider.hasData, + retrieveidtri, + certificateProvider.certificateinfo, + (data) => {}, // Handle certificate data if needed + ); + } + + setState(() { + isDataLoaded = true; // Mark data as loaded + }); } @override Widget build(BuildContext context) { + final locationProvider = Provider.of(context); + + final pnoProvider = Provider.of(context); + final emailProvider = Provider.of(context); + final trainingProvider = + Provider.of(context, listen: false); + + final educationProvider = + Provider.of(context, listen: false); + + final awardsProvider = Provider.of(context, listen: false); + + var certificateProvider = + Provider.of(context, listen: false); + print("LocationProvider_hasdata: ${locationProvider.hasData}"); + + List dataList = locationList.map((location) { + print("Location_dataaaa_issss: ${location.address}"); + return Data(address1: location.address, postalCode: location.city); + }).toList(); + + List dataPnoList = phonenolist.map((location) { + print("Pnooo_dataaaa_issss: ${location.phoneType}"); + return DataPhno( + organizationName: location.phoneType.toString(), + number: int.parse(location.phoneNumber)); + }).toList(); + + List dataEmailList = mailList.map((location) { + // print("Pnooo_dataaaa_issss: ${location.emailType}"); + return EmailData( + email: location.email, emailTypeName: location.emailType); + }).toList(); return Center( - child: ListView(children: [ - locationList.length != 0 - ? CustomExpansionTile( - title: "Locations", - itemList: locationList.cast(), - buttonText: 'Show More', - field1: 'Institutation', - field2: 'Address', - onItemSelected: (Data selectedPhoneNumber) { - List> keyValue = [ - { - "Address": selectedPhoneNumber.address1, - "Postal Code": selectedPhoneNumber.postalCode, - "Primary": selectedPhoneNumber.formattedIsPrimary, - "organization Name": selectedPhoneNumber.organizationName, - "Country Name": selectedPhoneNumber.countryName, - "State Name": selectedPhoneNumber.stateName, - "City Name": selectedPhoneNumber.cityName, - } - ]; + child: ListView( + children: [ + locationProvider.hasData + ? CardCustomExpansionTile( + title: "Locations", + itemList: locationProvider.locationlist.cast(), + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (Data selectedPhoneNumber) { + List> keyValue = [ + { + "Address": selectedPhoneNumber.address1, + "Postal Code": selectedPhoneNumber.postalCode, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": + selectedPhoneNumber.organizationName, + "Country Name": selectedPhoneNumber.countryName, + "State Name": selectedPhoneNumber.stateName, + "City Name": selectedPhoneNumber.cityName, + } + ]; - modelbsheet(keyValue); - }, - ) - : Container(), - pno.length != 0 - ? CustomExpansionTile( - title: "Phone Numbers", - itemList: pno.cast(), - buttonText: 'Show More', - field1: 'Phone Type', - field2: 'Phone No', - onItemSelected: (DataPhno selectedPhoneNumber) { - List> keyValue = [ - { - "Phone Number": selectedPhoneNumber.number, - "Phone Type": selectedPhoneNumber.phoneTypeName, - "Primary": selectedPhoneNumber.formattedIsPrimary, - "organization Name": selectedPhoneNumber.organizationName, - } - ]; + modelbsheet(keyValue); + }, + // onButtonPressed: () { + // print("Show More button clicked"); + // }, + onButtonPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (_) => Lock2ShowMore())); + }, + ) + : + // widget.offlineMode != null + // ? + CustomExpansionTile( + title: "Locations1", + // itemList: locationList.cast(), + itemList: dataList, + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (Data selectedPhoneNumber) {}, + ), - modelbsheet(keyValue); - }, - ) - : Container(), - emailid.length != 0 - ? CustomExpansionTile( - title: "Emails", - itemList: emailid.cast(), - buttonText: 'Show More', - field1: 'Email Type', - field2: 'Email', - onItemSelected: (EmailData selectedPhoneNumber) { - List> keyValue = [ - { - "Email": selectedPhoneNumber.email, - "Email Type": selectedPhoneNumber.emailTypeName, - } - ]; + //: Container(), + pnoProvider.hasData + ? CardCustomExpansionTile( + title: "Phone Numbers", + itemList: pnoProvider.phonenolist.cast(), + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (DataPhno selectedPhoneNumber) { + List> keyValue = [ + { + "Phone Number": selectedPhoneNumber.number, + "Phone Type": selectedPhoneNumber.phoneTypeName, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": + selectedPhoneNumber.organizationName, + } + ]; - modelbsheet(keyValue); - }, - ) - : Container(), - training.length != 0 - ? CustomExpansionTile( - title: "Trainings", - itemList: training.cast(), - buttonText: 'Show More', - field1: 'Education Type', - field2: 'Institution Name', - onItemSelected: (TrainingList selectedPhoneNumber) { - List> keyValue = [ - { - "organization Id": selectedPhoneNumber.organizationId, - "Degree": selectedPhoneNumber.degree, - "Specialty": selectedPhoneNumber.specialty, - "Start Date": selectedPhoneNumber.startDate, - "End Date": selectedPhoneNumber.endDate, - } - ]; - modelbsheet(keyValue); - }, - ) - : Container(), - education.length != 0 - ? CustomExpansionTile( - title: "Education", - itemList: education.cast(), - buttonText: 'Show More', - field1: 'Education Type', - field2: 'Institution Name', - onItemSelected: (EducationList selectedPhoneNumber) { - List> keyValue = [ - { - "organization Id": selectedPhoneNumber.organizationId, - "Degree": selectedPhoneNumber.degree, - "Specialty": selectedPhoneNumber.specialty, - "Start Date": selectedPhoneNumber.startDate, - "End Date": selectedPhoneNumber.endDate, - } - ]; - modelbsheet(keyValue); - }, - ) - : Container(), - award.length != 0 - ? CustomExpansionTile( - title: "Awards", - itemList: award.cast(), - buttonText: 'Show More', - field1: 'Education Type', - field2: 'Institution Name', - onItemSelected: (AwardsList selectedPhoneNumber) { - List> keyValue = [ - { - "Name": selectedPhoneNumber.name, - "Start Date": selectedPhoneNumber.startDate, - "End Date": selectedPhoneNumber.endDate, - } - ]; - modelbsheet(keyValue); - }, - ) - : Container(), - certificate.length != 0 - ? CustomExpansionTile( - title: "Certificates", - itemList: certificate.cast(), - buttonText: 'Show More', - field1: 'Education Type', - field2: 'Institution Name', - onItemSelected: (CertificateList selectedPhoneNumber) { - List> keyValue = [ - { - "Organization Id": selectedPhoneNumber.organizationId, - "specialty": selectedPhoneNumber.specialty, - "Start Date": selectedPhoneNumber.startDate, - "End Date": selectedPhoneNumber.endDate, - } - ]; - modelbsheet(keyValue); - }, - ) - : Container(), - ]), + modelbsheet(keyValue); + }, + onButtonPressed: () { + print("Show More button clicked"); + }, + ) + : + // widget.offlineMode != null + // ? + CustomExpansionTile( + title: "Phone Numbers", + // itemList: pnoProvider.phonenolist.cast(), + itemList: dataPnoList, + + buttonText: 'Show More', + field1: 'Phone Type', + field2: 'Phone No', + noexpand: widget.offlineMode == null ? true : false, + //noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (DataPhno selectedPhoneNumber) {}, + ), + + // : Container(), + emailProvider.hasData + ? CardCustomExpansionTile( + title: "Emails", + itemList: emailProvider.emailkollist.cast(), + buttonText: 'Show More', + field1: 'Email Type', + field2: 'Email', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EmailData selectedPhoneNumber) { + List> keyValue = [ + { + "Email": selectedPhoneNumber.email, + "Email Type": selectedPhoneNumber.emailTypeName, + } + ]; + + modelbsheet(keyValue); + }, + onButtonPressed: () { + print("Show More button clicked"); + }, + ) + : CustomExpansionTile( + title: "Emails", + //itemList: emailProvider.emailkollist.cast(), + itemList: dataEmailList, + + buttonText: 'Show More', + field1: 'Email Type', + field2: 'Email', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EmailData selectedPhoneNumber) {}, + ), + // : Container(), + trainingProvider.hasData + ? CardCustomExpansionTile( + title: "Trainings", + itemList: trainingProvider.traininglist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (TrainingList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Trainings", + // itemList: trainingProvider.traininglist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (TrainingList selectedPhoneNumber) {}, + ) + : Container(), + educationProvider.hasData + ? CardCustomExpansionTile( + title: "Education", + itemList: + educationProvider.educationlist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EducationList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Education", + // itemList: trainingProvider.traininglist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (EducationList selectedPhoneNumber) {}, + ) + : Container(), + awardsProvider.hasData + ? CardCustomExpansionTile( + title: "Awards", + itemList: awardsProvider.awardlist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (AwardsList selectedPhoneNumber) { + List> keyValue = [ + { + "Name": selectedPhoneNumber.name, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Awards", + // itemList: trainingProvider.traininglist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (AwardsList selectedPhoneNumber) {}, + ) + : Container(), + certificateProvider.hasData + ? CardCustomExpansionTile( + title: "Certificates", + itemList: certificateProvider.cerlist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (CertificateList selectedPhoneNumber) { + List> keyValue = [ + { + "Organization Id": selectedPhoneNumber.organizationId, + "specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Awards", + // itemList: trainingProvider.traininglist.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (CertificateList selectedPhoneNumber) {}, + ) + : Container(), + ], + ), ); } diff --git a/lib/contacts_module/ui_screen/location_tab.dart b/lib/contacts_module/ui_screen/location_tab.dart index fe1abbf..2d5a09a 100644 --- a/lib/contacts_module/ui_screen/location_tab.dart +++ b/lib/contacts_module/ui_screen/location_tab.dart @@ -188,9 +188,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -341,9 +341,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -492,9 +492,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -645,9 +645,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -799,9 +799,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -948,9 +948,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, @@ -1102,9 +1102,9 @@ class _LocationTabState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, diff --git a/lib/contacts_module/ui_screen/new_contacts.dart b/lib/contacts_module/ui_screen/new_contacts.dart index b6fe292..daa372c 100644 --- a/lib/contacts_module/ui_screen/new_contacts.dart +++ b/lib/contacts_module/ui_screen/new_contacts.dart @@ -1,61 +1,25 @@ import 'dart:async'; - -import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/custiom_profilepic.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_bottomdailog.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_sizedbox.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_switch.dart'; +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; import 'package:discover_module/contacts_module/hive_fun.dart'; -import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; -import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; -import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; -import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; -import 'package:discover_module/contacts_module/storage_hive/kol_info/curd_kol.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/profile_storage.dart'; import 'package:discover_module/contacts_module/ui_screen/contact_filters.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; import 'package:discover_module/contacts_module/ui_screen/new_new_profile.dart'; -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/custom_widget/text.dart'; -// import 'package:discover_module/hive_fun.dart'; -// import 'package:discover_module/provider_class/affiliationsprovider.dart'; -// import 'package:discover_module/provider_class/award_provider.dart'; -// import 'package:discover_module/provider_class/certificate_provider.dart'; -// import 'package:discover_module/provider_class/educationprovider.dart'; -// import 'package:discover_module/provider_class/email_provider.dart'; -// import 'package:discover_module/provider_class/events_provider.dart'; -// import 'package:discover_module/provider_class/hcp%20_provider.dart'; -// import 'package:discover_module/provider_class/location_provider.dart'; -// import 'package:discover_module/provider_class/nih_provider.dart'; -// import 'package:discover_module/provider_class/patent_provider.dart'; -// import 'package:discover_module/provider_class/phoneno_provider.dart'; -// import 'package:discover_module/provider_class/procedureprovider.dart'; -// import 'package:discover_module/provider_class/publications_provider.dart'; -// import 'package:discover_module/provider_class/speaker_provider.dart'; -// import 'package:discover_module/provider_class/training_provider.dart'; -// import 'package:discover_module/provider_class/trials_provider.dart'; -// import 'package:discover_module/storage_hive/kol_info/curd_kol.dart'; -// import 'package:discover_module/ui_screen/contact_filters.dart'; -// import 'package:discover_module/ui_screen/interactionform/util.dart'; -// import 'package:discover_module/ui_screen/new_new_profile.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_profile_picture/flutter_profile_picture.dart'; final ValueNotifier> ddlist = ValueNotifier>([]); String selectedValue = ''; + String? selectedType; final TextEditingController searchController = TextEditingController(); @@ -86,7 +50,6 @@ class _Contacts1State extends State { bool longpressmy = false; late List hcpdataList; - // ignore: prefer_typing_uninitialized_variables var hcpDataProvider1; @@ -94,6 +57,10 @@ class _Contacts1State extends State { final Connectivity _connectivity = Connectivity(); late StreamSubscription> _connectivitySubscription; + bool offMode = false; + + List> filterList = []; + get developer => null; @override @@ -105,6 +72,7 @@ class _Contacts1State extends State { _connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus); + hcpList(); }); } @@ -118,13 +86,36 @@ class _Contacts1State extends State { hcpdataList = hcplist; } + void _onSwitchChanged(bool value) { + setState(() { + _switchValue = value; // Update the switch value + }); + print("Switch value: $_switchValue"); // Optional: Log the switch value + } + @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle( - SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); + const SystemUiOverlayStyle(statusBarColor: Constants.k2color)); + + void updateSelectedValue(String newValue) { + setState(() { + selectedValue = newValue; + searchController.text = selectedValue; + }); + } + + void updatemultivalue(String newValue) { + print("FilterdList_isss: ${newValue}"); + setState(() { + selectedValue = newValue; + searchController.text = selectedValue; + }); + } return SafeArea( child: Scaffold( + backgroundColor: Constants.bgwhitecolor, key: _scaffoldKey, // Assign the key to the Scaffold appBar: AppBar( @@ -138,9 +129,14 @@ class _Contacts1State extends State { child: TextField( controller: searchController, onChanged: (value) { - setState(() {}); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + selectedValue = value; + searchController.text = selectedValue; + }); + }); }, - decoration: InputDecoration( + decoration: const InputDecoration( fillColor: Constants.k2color, contentPadding: EdgeInsets.symmetric(vertical: 9.0), border: OutlineInputBorder(), @@ -166,11 +162,10 @@ class _Contacts1State extends State { icon: Icon(isSearchClickd ? Icons.close : Icons.search)) ], ), - endDrawer: FilterDrawer(_switchValue, searchController), + endDrawer: FilterDrawer(_switchValue, searchController, + onValueChanged: updateSelectedValue, + onValueMultiChanged: updatemultivalue), - // Drawer( - // child: listdata(), - // ), body: Consumer( builder: (context, hcpProvider, child) { print("_selectedValueConsumerConsumer_isss: $selectedValue"); @@ -189,81 +184,16 @@ class _Contacts1State extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Wrap( - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 2.0), - child: CupertinoSwitch( - activeColor: Color.fromARGB(255, 0, 71, 132), - value: _switchValue, - onChanged: (value) { - setState(() { - _switchValue = value; - }); - }, - ), - ), - Padding( - padding: - const EdgeInsets.only(right: 8.0, top: 9.0), - child: !_switchValue - ? Text1( - title: 'My Contacts', - txtfont: 15, - txtcolor: Colors.grey, - ) - : Text1( - title: 'My Contacts', - txtfont: 15, - txtcolor: Colors.grey, - )) - ], - ), - Padding( - padding: const EdgeInsets.only(right: 8.0), - child: Row( - children: [ - GestureDetector( - onTap: () { - print("SearchVon: ${searchController.text}"); - - setState(() { - selectedValue = ''; - }); - }, - child: Text1(title: 'My Filters'), - // child: Text1( - // title: _connectionStatus[0].toString(), - // ) - ), - IconButton( - onPressed: () async { - _scaffoldKey.currentState?.openEndDrawer(); - }, - icon: const Icon( - Icons.sort, - size: 30, - )), - ], - ), - ) - ], + _offlineBanner(), + headerRow(), + const CustomSizedBox( + height: 5.0, ), - const SizedBox( - height: 5, - ), - // !_switchValue - // ? hcpContactlistview(displayedHCPList) - // : hcpContactlistview(myContactHCPList), - // contactsBottomdailog() !_switchValue ? _connectionStatus[0] .toString() .contains("ConnectivityResult.none") - ? hcpContactlistview(myContactHCPList) + ? hcpContactlistview(myContactHCPList, offMode) : hcpContactlistview(displayedHCPList) : hcpContactlistview(myContactHCPList), contactsBottomdailog() @@ -275,40 +205,6 @@ class _Contacts1State extends State { ); } - Future _showMyDialog(String data) async { - return showDialog( - context: context, - barrierDismissible: false, // user must tap button! - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Successfully'), - content: SingleChildScrollView( - child: ListBody( - children: [ - // Text('This is a demo alert dialog.'), - Text(data), - ], - ), - ), - actions: [ - TextButton( - child: const Text('Ok'), - onPressed: () { - Navigator.of(context).pop(); - setState(() { - _selectedIndices.clear(); - _selectedremoveIndices.clear(); - longpress = false; - longpressmy = false; - }); - }, - ), - ], - ); - }, - ); - } - Map findRecordById( List displayedHCPList, String selectedIndic) { // print( @@ -317,7 +213,7 @@ class _Contacts1State extends State { .firstWhere((element) => element['id'] == int.parse(selectedIndic)); } - hcpContactlistview(List HCPList) { + hcpContactlistview(List HCPList, [offMode]) { return Expanded( child: ListView.builder( itemCount: HCPList.length, @@ -327,138 +223,116 @@ class _Contacts1State extends State { print("CheckinggggImage_path: ${data['img_path']}"); return Column( - children: [ - ListTile( - onLongPress: () { - print("LongPresss"); - setState(() { - longpress = true; - }); - }, - onTap: () async { - print("Check_data11 = ${data}"); + mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.end, - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => NewProfile1(text: data), - ), - ); - }, - leading: data["img_path"] == "" - ? ProfilePicture( - name: data["First Name"], - radius: 30, - fontsize: 12, - ) - : ClipOval( - child: SizedBox.fromSize( - size: const Size.fromRadius(30), - child: CachedNetworkImage( - imageUrl: data["img_path"], - imageBuilder: (context, imageProvider) => Container( - decoration: BoxDecoration( - image: DecorationImage( - image: imageProvider, - fit: BoxFit.fill, - ), - ), + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: ListTile( + onLongPress: () { + print("LongPresss"); + setState(() { + longpress = true; + }); + }, + onTap: () async { + print("Check_data11 = ${offMode}"); + + offMode != null + ? Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + NewProfile1(text: data, offlinemode: offMode), + ), + ) + : Navigator.push( + context, + MaterialPageRoute( + builder: (context) => NewProfile1(text: data), + ), + ); + }, + leading: CustomProfile( + imgstring: data["img_path"], + fontsize: 12.0, + radius: 30, + name: data["First Name"], + ), + trailing: Visibility( + visible: longpress, + child: !_switchValue + ? Checkbox( + value: _selectedIndices + .contains(data["id"].toString()), + onChanged: (value) { + setState(() { + if (value!) { + print("Datata_issss_iddd: ${data["id"]}"); + _selectedIndices.add(data["id"].toString()); + } else { + _selectedIndices + .remove(data["id"].toString()); + } + print("id_total123: ${_selectedIndices}"); + }); + }) + : Checkbox( + value: _selectedremoveIndices.contains(data["id"]), + onChanged: (value) { + setState(() { + if (value!) { + _selectedremoveIndices.add(data["id"]); + } else { + _selectedremoveIndices.remove(data["id"]); + } + print("id_total: ${_selectedremoveIndices}"); + }); + }), + ), + title: Text1( + title: "Dr. " + data['name'], + fontweight: FontWeight.bold, + txtfont: isTablet ? 22 : 15, + ), + subtitle: Column( + children: [ + Row( + children: [ + Expanded( + child: Text1( + title: data["speciality"] ?? data['spl'], + fontweight: FontWeight.normal, + txtcolor: Colors.black, + txtfont: isTablet ? 20 : 13, ), ), - ), + ], ), - trailing: Visibility( - visible: longpress, - child: !_switchValue - ? Checkbox( - value: - _selectedIndices.contains(data["id"].toString()), - onChanged: (value) { - setState(() { - if (value!) { - print("Datata_issss_iddd: ${data["id"]}"); - _selectedIndices.add(data["id"].toString()); - } else { - _selectedIndices.remove(data["id"].toString()); - } - print("id_total123: ${_selectedIndices}"); - }); - }) - : Checkbox( - value: _selectedremoveIndices.contains(data["id"]), - onChanged: (value) { - setState(() { - if (value!) { - _selectedremoveIndices.add(data["id"]); - } else { - _selectedremoveIndices.remove(data["id"]); - } - print("id_total: ${_selectedremoveIndices}"); - }); - }), - ), - title: Text1( - title: data['name'], - fontweight: FontWeight.bold, - txtfont: isTablet ? 22 : 16, - ), - subtitle: Column( - children: [ - Row( - children: [ - Expanded( - child: Text1( - title: data["speciality"] ?? data['spl'], - fontweight: FontWeight.normal, - txtfont: isTablet ? 20 : 14, + const CustomSizedBox( + height: 10.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text1( + title: "Added by Pooja k on 01/07/2023", + fontweight: FontWeight.normal, + txtfont: 12, + ), ), - ), - ], - ), - Row( - children: [ - Text1( - title: data["State"] ?? '', - fontweight: FontWeight.normal, - txtfont: 14, - ), - SizedBox( - width: 3.0, - ), - Expanded( - child: Text1( - title: data["Country"] ?? '', - fontweight: FontWeight.normal, - txtfont: 14, - ), - ), - ], - ), - ], - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.only(left: 10.0), - child: Text1( - title: "Added by Pooja k", - fontweight: FontWeight.normal, - txtfont: 14, - ), + ], + ), + ], ), - Padding( - padding: EdgeInsets.only(right: 10.0), - child: Text1( - title: "Added on 01/07/2023", - fontweight: FontWeight.normal, - txtfont: 14, - ), - ) - ], + ), + ), + const Padding( + padding: EdgeInsets.only(left: 20.0, right: 20.0), + child: Divider(), ), - Divider(), ], ); }, @@ -466,217 +340,19 @@ class _Contacts1State extends State { ); } - Future offlineProfileStore(List selectedIndices) async { - for (int i = 0; i < selectedIndices.length; i++) { - print('The id id : ${selectedIndices[i]}'); - - Map? row = - findRecordById(displayedHCPList, selectedIndices[i]); - - print("Storingggg_isss:Row $row"); - - await addKolInfo(row); - - await Provider.of(context, listen: false) - .storeAff(row["id"]); - - await Provider.of(context, listen: false) - .storePub(row["id"]); - - await Provider.of(context, listen: false) - .storeEvent(row["id"]); - - await Provider.of(context, listen: false) - .storeTrials(row["id"]); - - await Provider.of(context, listen: false) - .storeLoc(row["id"]); - - await Provider.of(context, listen: false) - .storePno(row["id"]); - - await Provider.of(context, listen: false) - .storeEmail(row["id"]); - - await Provider.of(context, listen: false) - .storeEdu(row["id"]); - - await Provider.of(context, listen: false) - .storeAwa(row["id"]); - - await Provider.of(context, listen: false) - .storeCer(row["id"]); - - await Provider.of(context, listen: false) - .storePet(row["id"]); - - await Provider.of(context, listen: false) - .storeNih(row["id"]); - - await Provider.of(context, listen: false) - .storePro(row["id"]); - - await Provider.of(context, listen: false) - .storeTraining(row["id"]); - - await Provider.of(context, listen: false) - .storeSpeaker(row["id"]); - } - } - contactsBottomdailog() { return Align( alignment: Alignment.bottomCenter, child: longpress - ? Container( - color: const Color.fromARGB(255, 251, 242, 242), - width: MediaQuery.of(context).size.width, - height: 200.0, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - !_switchValue - ? GestureDetector( - onTap: () async { - print("Selected: ${_selectedIndices}"); - print("Selected: ${_selectedIndices.length}"); - - for (int i = 0; i < _selectedIndices.length; i++) { - Map? row = findRecordById( - displayedHCPList, _selectedIndices[i]); - print("StoringgggMyContact_isss_isss:Row $row"); - - await HiveFunctions.savemyContact(row); - } - - _showMyDialog( - "Selected contact has been added to my contacts "); - }, - child: Row( - children: [ - const Padding( - padding: EdgeInsets.all(15.0), - child: Icon( - Icons.add, - color: Colors.green, - ), - ), - Text1( - title: 'Add to My Contacts', - txtcolor: Colors.black, - txtfont: 14.0), - ], - ), - ) - : GestureDetector( - onTap: () async { - print( - "SelectedRemoveee: ${_selectedremoveIndices}"); - print("Selected: ${_selectedremoveIndices.length}"); - for (int i = 0; - i < _selectedremoveIndices.length; - i++) { - await HiveFunctions.deleteUser11( - _selectedremoveIndices[i]); - } - - setState(() {}); - - _showMyDialog("selected contact has been removed"); - }, - child: const Row( - children: [ - Padding( - padding: EdgeInsets.all(15.0), - child: Icon( - Icons.remove, - color: Colors.green, - ), - ), - Text( - 'Remove from My Contacts', - style: TextStyle(color: Colors.black), - ), - ], - ), - ), - Row( - children: [ - const Padding( - padding: EdgeInsets.all(15.0), - child: Icon( - Icons.download, - color: Colors.blue, - ), - ), - GestureDetector( - onTap: () {}, - child: Text1( - title: 'Download', - txtcolor: Colors.black, - ), - ), - ], - ), - GestureDetector( - onTap: () { - setState(() { - longpress = false; - _selectedIndices.clear(); - _selectedremoveIndices.clear(); - }); - }, - child: Row( - children: [ - const Padding( - padding: EdgeInsets.all(15.0), - child: Icon( - Icons.close, - color: Colors.red, - ), - ), - Text1( - title: 'Cancel', - txtcolor: Colors.black, - ), - ], - ), - ), - Visibility( - visible: !_switchValue ? true : false, - child: Expanded( - child: GestureDetector( - onTap: () async { - print("Selected: ${_selectedIndices}"); - offlineProfileStore(_selectedIndices); - _showMyDialog( - "selected contact has been added to offline"); - - setState(() {}); - }, - child: const Row( - children: [ - Padding( - padding: EdgeInsets.all(15.0), - child: Icon( - Icons.save, - color: Colors.deepOrange, - ), - ), - Padding( - padding: EdgeInsets.only(top: 15.0), - child: Text( - 'Save Offline', - style: TextStyle(color: Colors.black), - ), - ), - ], - ), - ), - ), - ), - ], - ), + ? CustomLongPressContainer( + switchValue: _switchValue, + selectedIndices: _selectedIndices, + selectedRemoveIndices: _selectedremoveIndices, + onAddToContacts: _onAddToContacts, + onRemoveFromContacts: _onRemoveFromContacts, + onDownload: _onDownload, + onCancel: _onCancel, + onSaveOffline: _onSaveOffline, ) : Container(), ); @@ -692,9 +368,6 @@ class _Contacts1State extends State { return; } - // If the widget was removed from the tree while the asynchronous platform - // message was in flight, we want to discard the reply rather than calling - // setState to update our non-existent appearance. if (!mounted) { return Future.value(null); } @@ -705,8 +378,160 @@ class _Contacts1State extends State { Future _updateConnectionStatus(List result) async { setState(() { _connectionStatus = result; + + if (_connectionStatus[0].toString().contains("ConnectivityResult.none")) { + offMode = true; // Set to true when offline + } else { + offMode = false; // Set to false when online + } }); // ignore: avoid_print print('Connectivity changed: $_connectionStatus'); } + + headerRow() { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Wrap( + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 2.0), + child: CustomSwitch( + activeclor: Constants.k2color, + switchvalue: _switchValue, + onchanged: _onSwitchChanged, + ), + ), + Padding( + padding: const EdgeInsets.only(right: 8.0, top: 9.0), + child: Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: !_switchValue ? Colors.grey : Colors.black, + )) + ], + ), + Row( + children: [ + GestureDetector( + onTap: () { + print("SearchVon: ${selectedType}"); + + setState(() { + selectedValue = ''; + selectedType = null; + }); + }, + child: Text1(title: 'My Filters'), + ), + IconButton( + onPressed: () async { + _scaffoldKey.currentState?.openEndDrawer(); + }, + icon: const Icon( + Icons.sort, + size: 30, + )), + ], + ) + ], + ); + } + + Future _onAddToContacts() async { + print("Selected: ${_selectedIndices}"); + print("Selected: ${_selectedIndices.length}"); + + ProfileStorageService profileStorageService = + ProfileStorageService(context); + + await profileStorageService.offlineProfileAddContact( + _selectedIndices, displayedHCPList); + + displayAlert("Added"); + } + + Future _onRemoveFromContacts() async { + ProfileStorageService profileStorageService = + ProfileStorageService(context); + + await profileStorageService + .offlineProfileRemoveContact(_selectedremoveIndices); + + displayAlert("selected contact has been removed"); + } + + void _onDownload() { + // Handle download + print("Download action triggered"); + } + + void _onCancel() { + setState(() { + longpress = false; + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + }); + } + + Future _onSaveOffline() async { + // Handle save offline + print("Save offline triggered"); + + print("Selected: ${_selectedIndices}"); + + ProfileStorageService profileStorageService = + ProfileStorageService(context); + + await profileStorageService.offlineProfileK2Store( + _selectedIndices, displayedHCPList); + + displayAlert("selected contact has been added to offline"); + + setState(() {}); + } + + displayAlert(String data) { + return showDialog( + context: context, + builder: (_) { + return Alert( + data: data, + onPressed: () { + Navigator.of(context).pop(); + setState(() { + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + longpress = false; + longpressmy = false; + }); + }, + ); + }); + } + + Widget _offlineBanner() { + return offMode + ? Container( + color: Colors.red, // Set the color of the banner + padding: EdgeInsets.symmetric(vertical: 8.0), + child: const Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.signal_wifi_off, + color: Colors.white, + size: 20, + ), + SizedBox(width: 8.0), + Text( + 'You are offline', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ], + ), + ) + : SizedBox.shrink(); // Empty widget if online + } } diff --git a/lib/contacts_module/ui_screen/new_new_profile.dart b/lib/contacts_module/ui_screen/new_new_profile.dart index 3a3efbc..636d6de 100644 --- a/lib/contacts_module/ui_screen/new_new_profile.dart +++ b/lib/contacts_module/ui_screen/new_new_profile.dart @@ -1,25 +1,24 @@ -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/custom_widget/text.dart'; -// import 'package:discover_module/ui_screen/engagementtab.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// import 'package:discover_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart'; -// import 'package:discover_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart'; -// import 'package:discover_module/ui_screen/newformlist.dart'; import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_appbar.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_floatingbutton.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_sizedbox.dart'; +import 'package:discover_module/contacts_module/custom_widget/profile_card.dart'; +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_add_provider.dart'; import 'package:discover_module/contacts_module/ui_screen/engagementtab.dart'; +import 'package:discover_module/contacts_module/ui_screen/hcp_notes/view_notes.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/demoActivityTab.dart'; import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart'; -import 'package:discover_module/contacts_module/ui_screen/newformlist.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; +import 'package:provider/provider.dart'; class NewProfile1 extends StatefulWidget { - const NewProfile1({Key? key, required this.text}) : super(key: key); + const NewProfile1({super.key, required this.text, this.offlinemode}); final Map text; + final bool? offlinemode; @override State createState() => _NewProfileState(); @@ -31,19 +30,23 @@ class _NewProfileState extends State bool _isExpanded = false; - var item; - - TextEditingController firstNameController = TextEditingController(); - final ScrollController _scrollController = ScrollController(); late final TabController _tabController; + TextEditingController noteController = TextEditingController(); + + final List gradients = [ + const Color.fromARGB(255, 246, 245, 251), + const Color.fromARGB(255, 245, 249, 249), + const Color.fromARGB(255, 255, 244, 244), + const Color.fromARGB(255, 246, 245, 251), + const Color.fromARGB(255, 245, 249, 249), + ]; + @override void initState() { super.initState(); - print("pooja123"); - //init(); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { _tabController = TabController(length: 3, vsync: this); }); @@ -63,197 +66,752 @@ class _NewProfileState extends State child: headerview(context), ), ); - // }); } Widget headerview(BuildContext context) { return SafeArea( - child: Scaffold( - backgroundColor: Constants.bgcolor, - body: Stack( - children: [ - Container( - // color: Colors.blue, - child: Column( - children: [ - getAppBarUI(), - Expanded( - child: NestedScrollView( - controller: _scrollController, - headerSliverBuilder: - (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverList( - delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { - return Column( - children: [ - buildCardView( - context, - ) - ], - ); - }, childCount: 1), - ), - SliverPersistentHeader( - pinned: true, - floating: true, - delegate: ContestTabHeader( - Container( - //color: Constants.bgcolor2, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Constants.tabbgColor, - Constants.k2color, - ]), - ), - child: TabBar( - indicatorColor: Colors.white, - labelColor: Colors - .white, // Color of the selected tab text - - unselectedLabelColor: Colors.black, - // unselectedLabelColor: - // Color.fromARGB(255, 163, 159, 159), - tabs: [ - // Tab(text: "Sentiment"), - Tab( - child: Text1( - title: "Details", - txtfont: 15.0, - ), - ), - Tab( - child: Text1( - title: "Activities", - txtfont: 15.0, - ), - ), - Tab( - child: Text1( - title: "Engagements", - txtfont: 15.0, - ), + child: Scaffold( + backgroundColor: Constants.bgwhitecolor, + body: Stack( + children: [ + Column( + children: [ + const CustomAppbar(title: "Contacts"), + Expanded( + child: NestedScrollView( + controller: _scrollController, + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverList( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) { + return Column( + children: [ + buildCardView( + context, ), + const CustomSizedBox(height: 15.0), + profilesummarydata(), + const CustomSizedBox(height: 10.0), + _buidTopCards(), + const CustomSizedBox(height: 10.0), + hcpNotes(), + const CustomSizedBox(height: 10.0), ], + ); + }, childCount: 1), + ), + SliverPersistentHeader( + pinned: true, + floating: true, + delegate: ContestTabHeader( + Padding( + padding: const EdgeInsets.only( + left: 8.0, right: 8.0), + child: Container( + color: Constants.profilecard, + child: TabBar( + indicatorColor: Colors.white, + labelColor: Colors + .white, // Color of the selected tab text + + unselectedLabelColor: Constants.k2color, + + tabs: [ + Tab( + child: Text1( + title: "Details", + txtfont: 15.0, + ), + ), + Tab( + child: Text1( + title: "Activities", + txtfont: 15.0, + ), + ), + Tab( + child: Text1( + title: "Engagements", + txtfont: 15.0, + ), + ), + ], + ), + ), ), ), - ), - ) - ]; - }, - body: TabBarView( - //controller: _tabController, - children: [ - // LocationTab(text: widget.text["id"]), + ) + ]; + }, + body: TabBarView( + //controller: _tabController, + children: [ + // LocationTab(text: widget.text["id"]), - LocationK2Tab(text: widget.text["id"]), + LocationK2Tab( + text: widget.text["id"], + offlineMode: widget.offlinemode), - // Activities(text: widget.text["id"]), - ActivitiesK2(text: widget.text["id"]), + ActivitiesK2Demo( + text: widget.text["id"], + offlineMode: widget.offlinemode), + // ActivitiesK2( + // text: widget.text["id"], + // offlineMode: widget.offlinemode), - EngagementTab(text: widget.text["id"]), - ], + EngagementTab( + text: widget.text["id"], + offlineMode: widget.offlinemode), + ], + ), ), - ), - ) - ], - ), + ) + ], + ), + ], ), - ], - ), - floatingActionButton: Visibility( - visible: true, - child: FloatingActionButton( - onPressed: () async { - Navigator.push( - context, MaterialPageRoute(builder: (context) => FormList())); - }, - foregroundColor: Colors.white, - backgroundColor: const Color.fromARGB(255, 0, 71, 132), - child: new Icon(Icons.add), - ), - ), - ), - ); + floatingActionButton: const CustomFloatingBtn( + height: 70.0, + width: 70.0, + color: Color.fromARGB(255, 3, 131, 243), + borderRadius: 100, + icon: Icons.add, + iconColor: Constants.bgwhitecolor, + iconsize: 33))); } buildCardView(BuildContext context) { MediaQuery.of(context).size.height * 0.35; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - Container( - width: - MediaQuery.of(context).size.width, // Adjust width as needed - height: 110, // Adjust height as needed - decoration: BoxDecoration(color: Constants.k2color), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text1( - title: widget.text!["name"], - txtcolor: Colors.white, - fontweight: FontWeight.normal, - txtfont: 20.0), - Text1( - title: widget.text!["speciality"], - txtcolor: Colors.white, - fontweight: FontWeight.normal, - txtfont: 14.0), - ], - ), - ), - Positioned( - bottom: -45, - child: Container( - child: widget.text["img_path"] == "" - ? ProfilePicture( - name: widget.text!["name"], - radius: 48, - fontsize: 21, - ) - : ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(48), - child: CachedNetworkImage( - imageUrl: widget.text!["img_path"], - imageBuilder: (context, imageProvider) => Container( - decoration: BoxDecoration( - image: DecorationImage( - image: imageProvider, - fit: BoxFit.fill, + return Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ProfileCard( + name: "Dr ${widget.text["name"]}", + spl: widget.text["speciality"], + imgurl: widget.text["img_path"], + pno: widget.text["phone_no"].toString(), + email: widget.text["email"], + address: widget.text["Country"], + ), + ], + // ), + ), + ); + } + + _buidTopCards() { + return ExpandableCarousel( + options: CarouselOptions( + showIndicator: false, + slideIndicator: CircularWaveSlideIndicator( + currentIndicatorColor: Constants.k2color1, + indicatorBackgroundColor: Colors.grey, + ), + autoPlay: true, + autoPlayInterval: const Duration(seconds: 2), + // enlargeCenterPage: false, // Enlarge the current page (optional) + //aspectRatio: 16 / 9, + viewportFraction: 0.8, + ), + items: [1, 2, 3, 4, 5].asMap().entries.map((entry) { + int index = entry.key; + + return Builder( + builder: (BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Card( + // elevation: 6, + margin: EdgeInsets.all(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + child: Container( + // width: MediaQuery.sizeOf(context).width / 1.5, + decoration: BoxDecoration( + color: + gradients[index % gradients.length], // Apply gradient + borderRadius: BorderRadius.circular(20), + ), + child: Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + index == 0 + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Top Event Topics", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: + Color.fromARGB(255, 64, 53, 114)), + ), + const CustomSizedBox(height: 10.0), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(10), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text( + "Angina Pectoris", + style: TextStyle( + color: Color.fromARGB( + 255, 64, 53, 114)), + ), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text("Coronary Artery Disease", + style: TextStyle( + color: Color.fromARGB( + 255, 64, 53, 114)), + softWrap: true), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text( + "Hypertension", + style: TextStyle( + color: Color.fromARGB( + 255, 64, 53, 114)), + ), + ], + ), + ), + ), + ], + ), + ], ), - ), - ), - ), - ), - ), + ) + : index == 1 + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Top Publication Topics", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: Color.fromARGB( + 255, 71, 150, 150)), + textAlign: TextAlign.left, + ), + const CustomSizedBox(height: 10.0), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(10), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text( + "Angina Pectoris", + style: TextStyle( + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + ), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text( + "Coronary Artery Disease", + style: TextStyle( + color: + Color.fromARGB( + 255, + 71, + 150, + 150)), + softWrap: true), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only(left: 10.0), + child: Row( + children: [ + Text( + "Hypertension", + style: TextStyle( + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ) + : index == 2 + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Top Products Topics", + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: Color.fromARGB( + 255, 255, 86, 72)), + ), + const CustomSizedBox(height: 10.0), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular( + 10), + ), + child: const Padding( + padding: EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Angina Pectoris", + style: TextStyle( + color: Color + .fromARGB( + 255, + 255, + 86, + 72)), + ), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular( + 5), + ), + child: const Padding( + padding: EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Coronary Artery Disease", + style: TextStyle( + color: Color + .fromARGB( + 255, + 255, + 86, + 72)), + softWrap: true), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Constants.cardtext, + borderRadius: + BorderRadius.circular( + 5), + ), + child: const Padding( + padding: EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Hypertension", + style: TextStyle( + color: Color + .fromARGB( + 255, + 255, + 86, + 72)), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ) + : index == 3 + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Drugs Prescribed", + style: TextStyle( + fontSize: 16.0, + fontWeight: + FontWeight.bold, + color: Color.fromARGB( + 255, 64, 53, 114)), + ), + const CustomSizedBox( + height: 10.0), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: + Constants.cardtext, + borderRadius: + BorderRadius + .circular(10), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Angina Pectoris", + style: TextStyle( + color: Color + .fromARGB( + 255, + 64, + 53, + 114)), + ), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: + Constants.cardtext, + borderRadius: + BorderRadius + .circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Coronary Artery Disease", + style: TextStyle( + color: Color + .fromARGB( + 255, + 64, + 53, + 114)), + softWrap: true), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: BoxDecoration( + color: + Constants.cardtext, + borderRadius: + BorderRadius + .circular(5), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Hypertension", + style: TextStyle( + color: Color + .fromARGB( + 255, + 64, + 53, + 114)), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ) + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + "Condition Treated", + style: TextStyle( + fontSize: 16.0, + fontWeight: + FontWeight.bold, + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + ), + const CustomSizedBox( + height: 10.0), + Row( + children: [ + Container( + decoration: + BoxDecoration( + color: Constants + .cardtext, + borderRadius: + BorderRadius + .circular( + 10), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Angina Pectoris", + style: TextStyle( + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + ), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: + BoxDecoration( + color: Constants + .cardtext, + borderRadius: + BorderRadius + .circular( + 5), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Coronary Artery Disease", + style: TextStyle( + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + softWrap: + true), + ], + ), + ), + ), + ], + ), + Row( + children: [ + Container( + decoration: + BoxDecoration( + color: Constants + .cardtext, + borderRadius: + BorderRadius + .circular( + 5), + ), + child: const Padding( + padding: + EdgeInsets.only( + left: 10.0), + child: Row( + children: [ + Text( + "Hypertension", + style: TextStyle( + color: Color.fromARGB( + 255, + 71, + 150, + 150)), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), ), - ) - ], - ), - SizedBox( - height: 55.0, - ), - - _ProfileInfoRow(text: widget.text["id"]), - - locandpnoinfo(), - - const SizedBox( - height: 5.0, - ), + ); + }, + ); + }).toList(), + ); + } + profilesummarydata() { + return Column( + children: [ Align( alignment: Alignment.centerLeft, child: Padding( @@ -265,9 +823,7 @@ class _NewProfileState extends State txtfont: 18.0), ), ), - const SizedBox( - height: 5.0, - ), + const CustomSizedBox(height: 5.0), Align( alignment: Alignment.centerLeft, child: Padding( @@ -279,558 +835,124 @@ class _NewProfileState extends State txtfont: 14.0), ), ), + ], + ); + } - SizedBox( - height: 10.0, - ), - - ListTileTheme( - dense: true, - child: Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Card( - margin: EdgeInsets.all(1.0), - // elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0.0), + hcpNotes() { + return ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.bgwhitecolor, + child: ExpansionTile( + // collapsedBackgroundColor: Color(0xFF2b9af3), + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.bgwhitecolor, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Notes", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const CustomSizedBox(width: 8.0), + Text1( + title: "(0)", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], ), - color: Constants.k2color11, - child: ExpansionTile( - // collapsedBackgroundColor: Color(0xFF2b9af3), - onExpansionChanged: (bool expanded) { - setState(() { - _isExpanded = expanded; - }); - }, - backgroundColor: Constants.k2color11, - trailing: Icon( - _isExpanded - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.black), - title: Row( - mainAxisAlignment: MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( children: [ - Text1( - title: "Notes", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - const SizedBox( - width: 8.0, - ), - Text1( - title: "(0)", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - ], - ), - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: TextField( - decoration: InputDecoration( - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.0), - ), - hintText: 'Write your note here', - contentPadding: EdgeInsets.all(16.0), - ), - maxLines: - null, // Allows the TextField to expand vertically - ), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: OutlinedButton( + OutlinedButton( onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => PublicationsData())); + Navigator.push(context, + MaterialPageRoute(builder: (_) => ViewNotes())); }, - child: Text( - 'Save', - style: TextStyle(color: Constants.k2color), - ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), + child: Text1( + title: 'View Notes', + txtcolor: Constants.k2color, + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + controller: noteController, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + ), + hintText: 'Write your note here', + contentPadding: EdgeInsets.all(16.0), + ), + maxLines: null, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () async { + var addnoteprovider = + Provider.of(context, listen: false); + await addnoteprovider.addnotes(noteController.text); + showDialog( + context: context, + builder: (_) { + return Alert( + data: "Added ", + onPressed: () { + noteController.clear(); + Navigator.of(context).pop(); + }, + ); + }); + }, + child: Text( + 'Save', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), ), ), - ]), - ), - ), - ), // adds spacing between the text and image - - SizedBox( - height: 10.0, - ), - ], - // ), - ); - } - - void bottomshet(affiliation_data) { - // print("Aff_index_data: ${affiliation_data}"); - showModalBottomSheet( - // isScrollControlled: - // true, - - context: context, - - useRootNavigator: true, - isScrollControlled: false, - enableDrag: true, - useSafeArea: true, - constraints: const BoxConstraints( - maxWidth: double.infinity, - ), - - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(0), - ), - ), - clipBehavior: Clip.antiAliasWithSaveLayer, - // sheetAnimationStyle: _animationStyle, - builder: (BuildContext context) { - return - // makeDismissible( - // child: - DraggableScrollableSheet( - expand: false, - builder: (BuildContext context, ScrollController scrollController) { - return Container( - width: MediaQuery.of(context).size.width, - //color: Colors.white, - color: Color.fromARGB(255, 246, 248, 252), - - 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: [ - SizedBox( - height: 18.0, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Text( - affiliation_data['org_name'], - softWrap: true, - maxLines: 4, - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700]), - ), - ), - ), - ], - ), - const SizedBox( - height: 18.0, - ), - Divider(), - const SizedBox( - height: 8.0, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Padding( - padding: EdgeInsets.only(left: 18.0), - child: Text( - "Department", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['dept'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Padding( - padding: - EdgeInsets.only(left: 18.0, top: 18.0), - child: Text( - "Role", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['role'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 18.0, top: 18.0), - child: Text( - "Time Frame".toString(), - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['time_frame'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Padding( - padding: - EdgeInsets.only(left: 18.0, top: 18.0), - child: Text( - "Oraganization Type", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['org_type'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Padding( - padding: - EdgeInsets.only(left: 18.0, top: 18.0), - child: Text( - "Eng Type", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['emg_type'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - ], - ); - }, - ), - ), - ], - ), - ); - }, - ); - //); - }, - ); - } - - Widget getAppBarUI() { - return Container( - decoration: BoxDecoration( - color: Constants.k2color, - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: const Offset(0, 2), - blurRadius: 8.0), - ], - ), - child: Padding( - padding: EdgeInsets.only(top: 2, left: 8, right: 8), - child: Row( - children: [ - Container( - alignment: Alignment.topLeft, - // width: AppBar().preferredSize.height, - // height: AppBar().preferredSize.height, - child: Material( - color: Colors.transparent, - child: InkWell( - borderRadius: const BorderRadius.all( - Radius.circular(32.0), - ), - onTap: () { - Navigator.pop(context); - }, - child: const Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.arrow_back_ios_new, - size: 18, - color: Colors.white, - ), - SizedBox( - width: 8, - ), - Text( - "Contacts", - style: TextStyle(fontSize: 14.0, color: Colors.white), - ) - ], - ), ), ), - ), - ), - const Expanded( - child: Text( - "", - maxLines: 1, - softWrap: true, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 14, - overflow: TextOverflow.ellipsis, - ), - ), - ), - ], + ]), ), ), - ); + ); // adds spacing between the text and image } - - locandpnoinfo() { - return Column( - children: [ - const SizedBox( - height: 8.0, - ), - _buildClickableRow( - icon: Icons.location_city_sharp, - text: widget.text["addr"] ?? "Azienda Ospedaliera di Padova", - ), - const SizedBox( - height: 8.0, - ), - _buildClickableRow( - icon: Icons.location_pin, - text: widget.text?["Country"] ?? - "Via Giustiniani, 2, Padova, Veneto 35128, Italy", - onTap: _openMapsByAddress, - ), - const SizedBox( - height: 8.0, - ), - _buildClickableRow( - icon: Icons.email, - text: widget.text?["email"], - onTap: () async { - await emailSend(widget.text?["email"]); - }, - ), - SizedBox( - height: 8.0, - ), - _buildClickableRow( - icon: Icons.phone, - text: widget.text!["phone_no"].toString(), - onTap: () async { - await callinfo(widget.text?["phone_no"].toString()); - }, - ), - ], - ); - } - - Future _openMapsByAddress() async { - final address = 'Italy'; - final Uri mapsUri = Uri( - scheme: 'https', - host: 'www.google.com', - path: 'maps/search/', - query: address, - ); - - if (!await launchUrl(mapsUri)) { - throw 'Could not launch $mapsUri'; - } - } - - Future emailSend(email) async { - String? encodeQueryParameters(Map params) { - return params.entries - .map((MapEntry entry) => - Uri.encodeComponent(entry.key) + - '=' + - Uri.encodeComponent(entry.value)) - .join('&'); - } - - final Uri emailLaunchUri = Uri( - scheme: 'mailto', - path: email, - query: encodeQueryParameters({ - 'subject': 'Example Subject', - 'body': 'Hello, this is a sample body text.', - }), - ); - - if (await launchUrl(emailLaunchUri)) { - launchUrl(emailLaunchUri); - } else { - throw 'Could not launch $emailLaunchUri'; - } - } - - Future callinfo(pno) async { - final call = Uri.parse('tel:$pno'); - if (await canLaunchUrl(call)) { - launchUrl(call); - } else { - throw 'Could not launch $call'; - } - } -} - -dispalytext(dispalydata) { - return Text1( - title: dispalydata, - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 14.0); -} - -getIcon(IconData icons) { - return Icon( - icons, - color: Color.fromARGB(255, 0, 71, 132), - ); -} - -Widget _buildClickableRow({ - required IconData icon, - required String text, - VoidCallback? onTap, -}) { - return Padding( - padding: const EdgeInsets.only(left: 8.0), - child: InkWell( - onTap: onTap, - child: Row( - children: [ - getIcon(icon), - const SizedBox(width: 3.0), - Expanded(child: dispalytext(text)), - ], - ), - ), - ); -} - -class _ProfileInfoRow extends StatelessWidget { -// _ProfileInfoRow({Key? key}) : super(key: key); - final int text; - - _ProfileInfoRow({required this.text, Key? key}) : super(key: key); - - final List _items = const [ - ProfileInfoItem("Publication(s)", 688), - ProfileInfoItem("Event(s)", 111), - ProfileInfoItem("Trial(s)", 10), - ]; - - @override - Widget build(BuildContext context) { - return Container( - height: 80, - constraints: const BoxConstraints(maxWidth: 400), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: _items - .map((item) => Expanded( - child: Row( - children: [ - if (_items.indexOf(item) != 0) const VerticalDivider(), - Expanded(child: _singleItem(context, item)), - ], - ))) - .toList(), - ), - ); - } - - Widget _singleItem(BuildContext context, item) => Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - item.value.toString(), - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ), - Text( - item.title, - // style: const TextStyle( - // fontWeight: FontWeight.normal, - // fontSize: 18, - // ), - // style: Theme.of(context).textTheme.caption, - ) - ], - ); -} - -class ProfileInfoItem { - final String title; - final int value; - const ProfileInfoItem(this.title, this.value); } class ContestTabHeader extends SliverPersistentHeaderDelegate { diff --git a/lib/contacts_module/ui_screen/new_new_profile_offline.dart b/lib/contacts_module/ui_screen/new_new_profile_offline.dart deleted file mode 100644 index b70fd6f..0000000 --- a/lib/contacts_module/ui_screen/new_new_profile_offline.dart +++ /dev/null @@ -1,18999 +0,0 @@ -// import 'package:discover_module/check.dart'; -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/custom_widget/text.dart'; -// import 'package:discover_module/provider_class/affiliationsprovider.dart'; -// import 'package:discover_module/provider_class/engagement_provider.dart'; -// import 'package:discover_module/provider_class/events_provider.dart'; -// import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -// import 'package:discover_module/provider_class/publications_provider.dart'; -// import 'package:discover_module/provider_class/speaker_provider.dart'; -// import 'package:discover_module/provider_class/trials_provider.dart'; -// import 'package:discover_module/ui_screen/affiliation_data.dart'; -// import 'package:discover_module/ui_screen/bottom_sheet.dart'; -// import 'package:discover_module/ui_screen/engagementlist.dart'; -// import 'package:discover_module/ui_screen/events_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -// import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; -// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -// import 'package:discover_module/ui_screen/medical_insight.dart'; -// import 'package:discover_module/ui_screen/newformlist.dart'; -// import 'package:discover_module/ui_screen/publication_data.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/foundation.dart'; -// import 'package:flutter/material.dart'; -// import 'package:flutter/rendering.dart'; -// import 'package:flutter/widgets.dart'; -// import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; -// import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -// import 'package:provider/provider.dart'; -// import 'package:url_launcher/url_launcher.dart'; - -// class NewProfileoff extends StatefulWidget { -// const NewProfileoff({Key? key, required this.text}) : super(key: key); -// final Map text; - -// @override -// State createState() => _NewProfileState(); -// } - -// class _NewProfileState extends State -// with TickerProviderStateMixin { -// bool isonline = false; -// List affiliation_data = []; -// List publication_data = []; -// List event_data = []; -// List trial_data = []; -// List medinsightData = []; -// List speaker = []; -// List eng = []; - -// // final PageController _controller = PageController(viewportFraction: 0.8); - -// List viewformData = []; - -// bool _isExpanded = false; - -// var item; - -// TextEditingController firstNameController = TextEditingController(); - -// // final List gradients = [ -// // LinearGradient(colors: [ -// // Colors.red, -// // Colors.orange, -// // ]), -// // LinearGradient(colors: [Colors.green, Colors.yellow]), -// // LinearGradient(colors: [Colors.blue, Colors.purple]), -// // LinearGradient(colors: [Colors.pink, Colors.redAccent]), -// // LinearGradient(colors: [Colors.teal, Colors.blueAccent]), -// // ]; - -// final List gradients = [ -// const Color.fromARGB(255, 23, 162, 184), -// const Color.fromARGB(255, 40, 167, 69), -// const Color.fromARGB(255, 255, 193, 7), -// const Color.fromARGB(255, 220, 53, 69), -// const Color.fromARGB(255, 23, 162, 184), -// ]; -// final ScrollController _scrollController = ScrollController(); -// late final TabController _tabController; - -// static const _tabs = [ -// Tab(text: "Details"), -// Tab(text: "Speakers"), -// Tab(text: "Speakers"), -// ]; -// @override -// void initState() { -// // TODO: implement initState -// super.initState(); -// print("pooja123"); -// _tabController = TabController(length: 3, vsync: this); - -// //init(); -// WidgetsBinding.instance.addPostFrameCallback((timeStamp) { -// getaffiliations(); - -// getuserdetails(); - -// // print("Widget_isssIndex_iss ${widget.text}"); -// // print( -// // "Widget_isssIndex_iss ${widget.text!["id"]},${widget.text!["name"]},${widget.text!["img_path"]}"); -// }); -// } - -// init() async { -// await Provider.of(context, listen: false) -// .initConfigData(); -// final data = -// await Provider.of(context, listen: false); - -// // if(data.g) -// data.getRecords("form-3 demo"); -// // setState(() {}); -// } - -// getaffiliations() async { -// var affiliations = -// Provider.of(context, listen: false); - -// await affiliations.getAffiliationsdata(); -// final affilist = affiliations.adddta; - -// var publication = Provider.of(context, listen: false); - -// await publication.publicatininfo(); -// final publist = publication.publicationlist; - -// var events = Provider.of(context, listen: false); -// await events.geteventdata(); -// final eventlist = events.EventsList; - -// var form = Provider.of(context, listen: false); -// // form.savedList; - -// var trials = Provider.of(context, listen: false); -// await trials.trialsdata(); - -// final trialslist = trials.trialsinfo; - -// var med = Provider.of(context, listen: false); -// await med.medicalinsightdata(); -// final medlist = med.trialsinfo; - -// var speaker11 = -// Provider.of(context, listen: false); - -// await speaker11.getspeakerdata(); - -// final speakerlist = speaker11.speaker; - -// var engtype = Provider.of(context, listen: false); -// await engtype.getengagementdata(); -// final engtypelist = engtype.engagementdata; - -// setState(() { -// affiliation_data = affilist; -// publication_data = publist; -// event_data = eventlist; -// viewformData = form.savedList; -// trial_data = trialslist; -// medinsightData = medlist; -// speaker = speakerlist; -// eng = engtypelist; -// }); - -// print("Affiliations_data_is: $affilist"); -// print("trialslist_data_is: $trialslist"); -// } - -// getuserdetails() async { -// // HiveFunctions.getindexUser(widget.text); - -// NetworkConnectivity networkConnectivity = NetworkConnectivity(); -// bool isonline1 = await networkConnectivity.isInternetAvailable(); - -// setState(() { -// print("Profile_isOnline: $isonline1"); -// isonline = isonline1; -// }); -// } - -// @override -// void dispose() { -// _tabController.dispose(); -// super.dispose(); -// } - -// @override -// Widget build(BuildContext context) { -// // return Consumer( -// // builder: (BuildContext context, provider, Widget? child) { -// return DefaultTabController( -// length: 3, -// child: SafeArea( -// child: headerview(context), -// ), -// ); -// // }); -// } - -// Widget headerview(BuildContext context) { -// return SafeArea( -// child: Scaffold( -// backgroundColor: Constants.bgcolor, -// // appBar: AppBar(), -// body: Stack( -// children: [ -// Container( -// // color: Colors.blue, -// child: Column( -// children: [ -// getAppBarUI(), -// Expanded( -// child: NestedScrollView( -// controller: _scrollController, -// headerSliverBuilder: -// (BuildContext context, bool innerBoxIsScrolled) { -// return [ -// SliverList( -// delegate: SliverChildBuilderDelegate( -// (BuildContext context, int index) { -// return Container( -// //color: Constants.blueColor, -// child: Column( -// children: [ -// buildCardView( -// context, -// ) - -// // getTimeDateUI(), -// ], -// ), -// ); -// }, childCount: 1), -// ), -// SliverPersistentHeader( -// pinned: true, -// floating: true, -// delegate: ContestTabHeader( -// Container( -// color: Constants.bgcolor2, -// child: const TabBar( -// indicatorColor: Colors.white, -// labelColor: Colors -// .white, // Color of the selected tab text - -// unselectedLabelColor: -// Color.fromARGB(255, 163, 159, 159), -// tabs: [ -// // Tab(text: "Sentiment"), -// Tab( -// // text: "Related " -// child: Text( -// 'Activities', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 17.0), -// ), -// ), -// Tab( -// // text: "Activities " -// child: Text( -// 'Details', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 17.0), -// ), -// ), -// Tab( -// //text: "Engagement " - -// child: Text( -// 'Engagement', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 17.0), -// ), -// ), - -// // Tab(icon: Icon(Icons.email)), -// ], -// ), -// ), -// // const TabBar( -// // indicatorSize: TabBarIndicatorSize.label, -// // labelColor: Colors.black, -// // unselectedLabelColor: Colors.grey, -// // tabs: _tabs, -// // ), -// ), -// ) -// ]; -// }, -// body: TabBarView( -// //controller: _tabController, -// children: [ -// ListView(children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Affiliations", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// // width: -// // MediaQuery.of(context) -// // .size -// // .width, -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Organization Name', -// style: TextStyle( -// fontWeight: -// FontWeight.w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Time Frame', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// affiliation_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${affiliation_data[index]}"); - -// bottomshet( -// affiliation_data[ -// index]); -// }, -// color: MaterialStateProperty -// .resolveWith( -// (Set -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// affiliation_data[ -// index] -// ['org_name'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// affiliation_data[ -// index] -// ['time_frame'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// AffiliationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Publications", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// //isAlwaysShown: true, -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Artical Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), - -// DataColumn( -// label: Expanded( -// child: Text('Authors', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), - -// // Add more columns as needed -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Events", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: MediaQuery.of(context) -// .size -// .width, -// ), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Event Name', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)), -// )), - -// DataColumn( -// label: Expanded( -// child: Text('Role', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), - -// // Add more columns as needed -// ], -// rows: List.generate( -// event_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${event_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// event_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// event_data[index] -// ['event_name'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// event_data[index] -// ['role'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EventsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Trials", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Trial Name', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Status', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// trial_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${trial_data[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// trial_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// trial_data[index] -// ['trial_name'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// trial_data[index] -// ['status'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EventsData())); -// }, -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image -// ]), - -// ListView(children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Locations", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: true, -// // useSafeArea: true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: -// // double.infinity, -// // ), -// // shape: -// // const RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular(0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: context, -// // builder: (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); - -// showModalBottomSheet< -// dynamic>( -// isScrollControlled: -// true, -// // context and builder are -// // required properties in this widget -// context: context, -// builder: (BuildContext -// context) { -// // we set up a container inside which -// // we create center column and display text - -// // Returning SizedBox instead of a Container -// return Container( -// width: double -// .infinity, -// child: Wrap( -// // mainAxisSize: MainAxisSize.max, -// children: [ -// Expanded( -// child: -// SingleChildScrollView( -// child: -// Column( -// //mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// // Text( -// // 'GeeksforGeeks'), -// // Text( -// // 'GeeksforGeeks'), - -// // ListView( -// // children: [ -// ...List -// .generate( -// 15, -// (index) => -// Padding( -// padding: const EdgeInsets.all(8.0), -// child: Column( -// children: [ -// Text('Heart Failure'), -// ], -// ), -// ), -// ) -// ], -// // ) -// // ], -// ), -// ), -// ), -// ], -// ), -// ); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Phone Numbers", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('phone Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Location', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Emails", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Email Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Email', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Staff/Assistant", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Location', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), - -// ///elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "State License", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('License No', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('State', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // ], -// ]), -// // -// ListView( -// children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// // initiallyExpanded: true, -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Medical Insight", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Container( -// width: MediaQuery.of(context) -// .size -// .width, - -// /// 5, -// color: Colors.white, -// child: Consumer< -// MediacalInsightProvider>( -// builder: (BuildContext context, -// value, Widget? child) { -// print( -// "med1 : ${value.med.length}"); - -// if (value.med.length != 0) { -// return ListView.builder( -// physics: -// const ScrollPhysics(), -// // scrollDirection: Axis.vertical, -// shrinkWrap: true, -// itemCount: value.med -// .take(2) -// .length, -// itemBuilder: -// (context, index) { -// item = value.med[index]; - -// print( -// "Item_Medical_insight ${item['Therapeutic Area']}"); -// return Padding( -// padding: -// const EdgeInsets -// .all(8.0), -// child: Card( -// margin: -// EdgeInsets.zero, - -// elevation: 4, -// surfaceTintColor: -// Colors.white, -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .zero, -// ), - -// child: SizedBox( -// width: MediaQuery -// .sizeOf( -// context) -// .width, -// child: ListTile( -// dense: true, -// title: Column( -// // crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// // Text( -// // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - -// RichText( -// text: -// TextSpan( -// text: '', -// style: DefaultTextStyle.of( -// context) -// .style, -// children: const [ -// TextSpan( -// text: -// 'Acute neurology ', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// // TextSpan( -// // text: ' therapeutic area ', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.bold)), -// TextSpan( -// text: -// 'is the therapeutic area of the medical insight for '), -// TextSpan( -// text: -// 'Product A. The age of treatment', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// TextSpan( -// text: -// ' is the topic of interest for this source type'), -// TextSpan( -// text: -// ' publication.', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// ], -// ), -// ), - -// const Padding( -// padding: -// EdgeInsets.all( -// 8.0), -// child: Row( -// mainAxisAlignment: -// MainAxisAlignment -// .spaceBetween, -// children: [ -// Row( -// children: [ -// Icon( -// Icons.person, -// size: 20, -// ), -// Text( -// "pooja", -// style: TextStyle(fontSize: 14.0), -// ) -// ], -// ), -// Row( -// children: [ -// Icon( -// Icons.calendar_today, -// size: 20, -// ), -// Text( -// "11/11/2022 ", -// style: TextStyle(fontSize: 14.0), -// ) -// ], -// ) -// ], -// ), -// ), -// ], -// ), -// ), -// ), -// // shape: BorderRadius.only(bottomRight: Radius.circular(50)), -// ), -// ); -// }); -// } else { -// return Container( -// color: Colors.white, -// width: MediaQuery.of(context) -// .size -// .width, -// child: Column( -// children: [ -// Text("No records"), -// ], -// ), -// ); -// } -// }), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// const MedicalInsight1())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// //mainAxisSize: MainAxisSize.min, -// children: [ -// GestureDetector( -// onTap: () async { -// final provider = Provider.of< -// InteractionProvider>( -// context, -// listen: false); -// if (getCount( -// provider -// .intConfigDataList[ -// 0] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[ -// 0] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// 0] -// .name, -// ))); -// } -// }, -// child: Text1( -// title: "Interactions", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ), -// const SizedBox( -// width: 8.0, -// ), -// ], -// ), -// children: [ -// Container( -// height: MediaQuery.of(context) -// .size -// .height / -// 5, -// color: Colors.white, -// child: Consumer< -// ViewInteractionProvider>( -// builder: (BuildContext context, -// provider, Widget? child) { -// print( -// "P_leangth : ${provider.savedList.length}"); - -// if (provider.savedList.length != -// 0) { -// return ListView.builder( -// shrinkWrap: true, -// physics: -// NeverScrollableScrollPhysics(), -// itemCount: provider -// .savedList -// .take(2) -// .length, -// itemBuilder: -// (context, index) { -// print( -// "Indexxxxxx $index"); -// return Column( -// children: [ -// ListTile( -// subtitle: Text( -// 'Updated on ${provider.savedList[index].updatedTime}', -// //style: TextStyle(fontStyle: FontStyle.italic), -// ), -// title: Text( -// provider -// .savedList[ -// index] -// .id, -// ), -// trailing: SizedBox( -// width: 150, -// child: Row( -// children: [ -// IconButton( -// onPressed: -// () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => ViewInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))); -// }, -// icon: -// const Icon( -// Icons -// .info_outline, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// IconButton( -// onPressed: -// () async { -// await provider -// .initConfigData() -// .then({ -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => EditInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))) -// }); -// }, -// icon: -// const Icon( -// Icons -// .edit, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// IconButton( -// onPressed: -// () { -// showDeleteRecordAlertDialog( -// context, -// provider.savedList[index].id, -// provider.savedList[index]); -// }, -// icon: -// const Icon( -// Icons -// .delete, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// ]), -// ), -// onTap: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// ViewInteractionScreen( -// saveInteraction: -// provider.savedList[index], -// ))); -// }, -// ), -// const Divider(), -// ], -// ); -// }); -// } else { -// return Container( -// color: Colors.white, -// width: MediaQuery.of(context) -// .size -// .width, -// child: Column( -// children: [ -// Text("No records"), -// ], -// ), -// ); -// } -// }), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// final provider = Provider -// .of( -// context, -// listen: false); -// if (getCount( -// provider -// .intConfigDataList[ -// 0] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[ -// 0] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// 0] -// .name, -// ))); -// } -// }, -// child: Text('Show More'), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Speaker Evalution", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Program Topic', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Speaker Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// speaker.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${speaker[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// speaker[index]); -// }, -// ); -// }, -// color: MaterialStateProperty -// .resolveWith< -// Color?>((Set< -// MaterialState> -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// speaker[index][ -// 'programtopic'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// speaker[index][ -// 'speakername'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // AffiliationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Engagement", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Main Therapeutic Area', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Date', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// eng.take(2).length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${eng[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// eng[index]); -// }, -// ); -// }, -// color: MaterialStateProperty -// .resolveWith< -// Color?>((Set< -// MaterialState> -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// eng[index][ -// 'main thereutic area'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// eng[index]['date'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EngagementList())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "NIH Grants", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('NIH Center', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Organization Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Procedures", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Program Year', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Procedure', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Patents", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Patent Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Status', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Patient Referrals", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: -// Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Referred By', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Type of Referrals', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: -// (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: double -// .infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index] -// [ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants -// .k2color), -// ), -// style: OutlinedButton -// .styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Training", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Institute Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Degree', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Case", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: -// Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: -// (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: double -// .infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index] -// [ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants -// .k2color), -// ), -// style: OutlinedButton -// .styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image -// ], -// ), - -// // /expandableDetails(), -// // speakersList(provider), -// ], -// ), -// ), -// ) -// ], -// ), -// ), -// ], -// ), -// floatingActionButton: Visibility( -// visible: true, -// child: FloatingActionButton( -// onPressed: () async { -// // final ConfigDataProvider configDataProvider = -// // ConfigDataProvider(); - -// // await configDataProvider.initConfigUIData(); -// Navigator.push( -// context, MaterialPageRoute(builder: (context) => FormList())); -// }, -// foregroundColor: Colors.white, -// backgroundColor: const Color.fromARGB(255, 0, 71, 132), -// child: new Icon(Icons.add), -// ), -// ), -// ), -// ); -// } - -// buildCardView(BuildContext context) { -// MediaQuery.of(context).size.height * 0.35; - -// return Container( -// //color: Colors.yellowAccent, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// mainAxisSize: MainAxisSize.min, -// //mainAxisAlignment: MainAxisAlignment.spaceAround, -// children: [ -// Stack( -// clipBehavior: Clip.none, -// alignment: Alignment.center, -// children: [ -// Container( -// width: -// MediaQuery.of(context).size.width, // Adjust width as needed -// height: 60, // Adjust height as needed -// decoration: BoxDecoration(color: Constants.k2color), -// ), -// Positioned( -// bottom: -45, -// child: Container( -// child: widget.text["img_path"] == null -// ? ProfilePicture( -// name: widget.text!["name"], -// radius: 38, -// fontsize: 21, -// ) -// : ClipOval( -// child: SizedBox.fromSize( -// size: Size.fromRadius(48), // Image radius -// child: Image.network(widget.text!["img_path"], -// fit: BoxFit.fill), -// ), -// ), -// ), -// ) -// ], -// ), -// SizedBox( -// height: 55.0, -// ), -// // Profile photo -// Column( -// children: [ -// Text1( -// title: "Dr " + widget.text!["name"], -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 22.0), -// Text1( -// title: widget.text!["speciality"], -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// SizedBox( -// height: 8.0, -// ), -// Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: -// Row(mainAxisAlignment: MainAxisAlignment.center, children: [ -// const Icon( -// Icons.location_city_sharp, -// color: Color.fromARGB(255, 0, 71, 132), -// ), -// const SizedBox( -// width: 3.0, -// ), -// Expanded( -// child: Text1( -// title: -// //widget.text!["addr"] ?? -// "Florida Hospital Medical Group Inc", -// txtcolor: Colors.black, -// txtfont: 15.0, -// fontweight: FontWeight.normal, -// ), -// // child: RichText( -// // text: TextSpan( -// // text: widget.text!["addr"] ?? -// // "Azienda Ospedaliera di Padova", -// // style: TextStyle( -// // fontSize: 16.0, color: Colors.black), -// // ), -// // ), -// ), -// ]), -// ), -// const SizedBox( -// height: 8.0, -// ), -// Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: Row(children: [ -// const Icon( -// Icons.location_pin, -// color: Color.fromARGB(255, 0, 71, 132), -// ), -// const SizedBox( -// width: 3.0, -// ), -// Expanded( -// // child: Text( -// // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // style: TextStyle( -// // fontWeight: FontWeight.bold, fontSize: 14.0), -// // ), -// child: Text1( -// title: widget.text!["adrr"] ?? -// "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), - -// // child: RichText( -// // text: TextSpan( -// // text: widget.text!["adrr"] ?? -// // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // style: TextStyle( -// // fontSize: 16.0, color: Colors.black), -// // ), -// // ), -// ), -// ]), -// ), -// const SizedBox( -// height: 8.0, -// ), -// Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: GestureDetector( -// onTap: () async { -// print("Emailll"); -// String? encodeQueryParameters(Map params) { -// return params.entries -// .map((MapEntry entry) => -// Uri.encodeComponent(entry.key) + -// '=' + -// Uri.encodeComponent(entry.value)) -// .join('&'); -// } - -// final Uri emailLaunchUri = Uri( -// scheme: 'mailto', -// path: 'example@example.com', -// query: encodeQueryParameters({ -// 'subject': 'Example Subject', -// 'body': 'Hello, this is a sample body text.', -// }), -// ); - -// if (await launchUrl(emailLaunchUri)) { -// launchUrl(emailLaunchUri); -// } else { -// throw 'Could not launch $emailLaunchUri'; -// } -// }, -// child: Row(children: [ -// const Icon( -// Icons.email, -// color: Color.fromARGB(255, 0, 71, 132), -// ), -// const SizedBox( -// width: 3.0, -// ), -// Expanded( -// child: Text1( -// title: widget.text!["email"], -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// ), -// ]), -// ), -// ), -// SizedBox( -// height: 8.0, -// ), -// Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: Row(children: [ -// const Icon( -// Icons.phone, -// color: Color.fromARGB(255, 0, 71, 132), -// ), -// const SizedBox( -// width: 3.0, -// ), -// // Text( -// // "+390498212410 X 12", -// // style: TextStyle( -// // fontWeight: FontWeight.bold, fontSize: 14.0), -// // ), -// Text1( -// title: widget.text!["phone_no"].toString(), -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// ]), -// ), -// const SizedBox( -// height: 8.0, -// ), -// Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: Row(children: [ -// const Icon( -// Icons.call, -// color: Color.fromARGB(255, 0, 71, 132), -// ), -// const SizedBox( -// width: 3.0, -// ), -// Expanded( -// child: Text1( -// title: widget.text!["phone_no"].toString(), -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// ), -// ]), -// ), -// ], -// ), - -// const SizedBox( -// height: 12.0, -// ), -// Align( -// alignment: Alignment.centerLeft, -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: Text1( -// title: "Profile Summarry", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 18.0), -// ), -// ), -// const SizedBox( -// height: 5.0, -// ), -// Align( -// alignment: Alignment.centerLeft, -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0), -// child: Text1( -// title: widget.text!["summarry"] ?? "jhj", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// ), -// ), - -// ExpandableCarousel( -// options: CarouselOptions( -// showIndicator: false, -// slideIndicator: CircularWaveSlideIndicator( -// alignment: Alignment.bottomCenter, -// currentIndicatorColor: Constants.k2color1, -// indicatorBackgroundColor: Colors.grey, -// // padding: EdgeInsets.only(: 10), -// ), -// autoPlay: true, -// autoPlayInterval: const Duration(seconds: 2), -// ), -// // items: [1, 2, 3, 4, 5].map((i) { -// items: [1, 2, 3, 4, 5].asMap().entries.map((entry) { -// int index = entry.key; - -// return Builder( -// builder: (BuildContext context) { -// return Center( -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(10), -// ), -// child: Container( -// decoration: BoxDecoration( -// color: gradients[ -// index % gradients.length], // Apply gradient -// borderRadius: BorderRadius.circular(10), -// ), -// child: Padding( -// padding: EdgeInsets.all(10.0), -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// const Text( -// "Top Event Topics", -// style: TextStyle( -// fontSize: 16.0, -// fontWeight: FontWeight.bold, -// color: Colors.white), -// ), -// const SizedBox( -// height: 10.0, -// ), -// Row( -// children: [ -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtext, -// borderRadius: BorderRadius.circular(10), -// ), -// child: Padding( -// padding: const EdgeInsets.all(5.0), -// child: Row( -// children: [ -// Text( -// "Angina Pectoris", -// style: TextStyle( -// color: Colors.white), -// ), -// SizedBox(width: 5.0), -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtextdark, -// borderRadius: -// BorderRadius.circular(5), -// ), -// child: Padding( -// padding: -// const EdgeInsets.all(1.0), -// child: Text( -// "(378)", -// style: TextStyle( -// color: Colors.white), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// SizedBox(height: 5), -// Row( -// children: [ -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtext, -// borderRadius: BorderRadius.circular(5), -// ), -// child: Padding( -// padding: const EdgeInsets.all(5.0), -// child: Row( -// children: [ -// Text("Coronary Artery Disease", -// style: TextStyle( -// color: Colors.white), -// softWrap: true), -// SizedBox(width: 5.0), -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtextdark, -// borderRadius: -// BorderRadius.circular(5), -// ), -// child: Padding( -// padding: -// const EdgeInsets.all(1.0), -// child: Text( -// "(378)", -// style: TextStyle( -// color: Colors.white), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// SizedBox(height: 5), -// Row( -// children: [ -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtext, -// borderRadius: BorderRadius.circular(5), -// ), -// child: Padding( -// padding: const EdgeInsets.all(5.0), -// child: Row( -// children: [ -// Text( -// "Hypertension", -// style: TextStyle( -// color: Colors.white), -// ), -// SizedBox(width: 5.0), -// Container( -// decoration: BoxDecoration( -// color: Constants.cardtextdark, -// borderRadius: -// BorderRadius.circular(5), -// ), -// child: Padding( -// padding: -// const EdgeInsets.all(1.0), -// child: Text( -// "(378)", -// style: TextStyle( -// color: Colors.white), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// ], -// ), -// ), -// ), -// ), -// ), -// ); -// }, -// ); -// }).toList(), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.symmetric(horizontal: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, // Replace with Constants.k2color11 -// child: ExpansionTile( -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: -// Constants.k2color11, // Replace with Constants.k2color11 -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black, -// ), -// title: Row( -// children: [ -// Text( -// "Sentiment Score", -// style: TextStyle( -// color: Colors.black, -// fontWeight: FontWeight.normal, -// fontSize: 17.0, -// ), -// ), -// const SizedBox(width: 8.0), -// Text( -// "(3)", -// style: TextStyle( -// color: Colors.black, -// fontWeight: FontWeight.normal, -// fontSize: 17.0, -// ), -// ), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: MediaQuery.of(context).size.width, -// ), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Product', -// style: -// TextStyle(fontWeight: FontWeight.w600), -// ), -// ), -// ), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Aissel Engagement', -// style: -// TextStyle(fontWeight: FontWeight.w600), -// ), -// ), -// ), -// // Add more columns as needed -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: false, -// enableDrag: true, -// useSafeArea: true, -// constraints: const BoxConstraints( -// maxWidth: double.infinity, -// ), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.vertical( -// top: Radius.circular(0), -// ), -// ), -// clipBehavior: Clip.antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet(publication_data[index]); -// }, -// ); -// }, -// cells: [ -// DataCell( -// Text( -// publication_data[index] -// ['artical_title'] ?? -// '', -// softWrap: true, -// ), -// ), -// DataCell( -// Text( -// publication_data[index]['author'] ?? '', -// softWrap: true, -// ), -// ), -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => PublicationsData(), -// ), -// ); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Colors -// .blue), // Replace with Constants.k2color -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(12), -// ), -// ), -// ), -// ), -// ), -// ), -// ], -// ), -// ), -// ), -// ), - -// SizedBox( -// height: 10.0, -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Note", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(0)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Padding( -// padding: const EdgeInsets.all(8.0), -// child: TextField( -// decoration: InputDecoration( -// border: OutlineInputBorder( -// borderRadius: BorderRadius.circular(8.0), -// ), -// hintText: 'Write your note here', -// contentPadding: EdgeInsets.all(16.0), -// ), -// maxLines: -// null, // Allows the TextField to expand vertically -// ), -// ), -// Padding( -// padding: const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => PublicationsData())); -// }, -// child: Text( -// 'Save', -// style: TextStyle(color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(12), -// ), -// ), -// ), -// ), -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// SizedBox( -// height: 10.0, -// ), -// ], -// // ), -// ), -// ); -// } - -// Widget expandableDetails() { -// return Container( -// child: ListView( -// children: [ -// Column(children: [ -// SizedBox( -// height: 5, -// ), -// Container( -// // color: Colors.black, -// height: MediaQuery.sizeOf(context).height, -// width: MediaQuery.sizeOf(context).width, -// child: DefaultTabController( -// length: 3, - -// child: Column( -// children: [ -// Container( -// color: Constants.bgcolor2, -// child: const TabBar( -// indicatorColor: Colors.white, -// labelColor: -// Colors.white, // Color of the selected tab text - -// unselectedLabelColor: -// Color.fromARGB(255, 163, 159, 159), -// tabs: [ -// // Tab(text: "Sentiment"), -// Tab( -// // text: "Related " -// child: Text( -// 'Activities', -// style: TextStyle( -// fontWeight: FontWeight.bold, fontSize: 15.0), -// ), -// ), -// Tab( -// // text: "Activities " -// child: Text( -// 'Deatils', -// style: TextStyle( -// fontWeight: FontWeight.bold, fontSize: 15.0), -// ), -// ), -// Tab( -// //text: "Engagement " - -// child: Text( -// 'Engagement', -// softWrap: true, -// style: TextStyle( -// fontWeight: FontWeight.bold, fontSize: 15.0), -// ), -// ), - -// // Tab(icon: Icon(Icons.email)), -// ], -// ), -// ), -// // TabBarView -// Expanded( -// child: TabBarView( -// children: [ -// ListView(children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Locations", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// const RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Phone Numbers", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('phone Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Location', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Emails", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Email Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Email', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Staff/Assistant", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Location', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), - -// ///elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "State License", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('License No', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('State', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'Institution'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['Address'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // ], -// ]), -// ListView(children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Affiliations", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// // width: -// // MediaQuery.of(context) -// // .size -// // .width, -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Organization Name', -// style: TextStyle( -// fontWeight: -// FontWeight.w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Time Frame', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// affiliation_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${affiliation_data[index]}"); - -// bottomshet( -// affiliation_data[ -// index]); -// }, -// color: MaterialStateProperty -// .resolveWith( -// (Set -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// affiliation_data[ -// index] -// ['org_name'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// affiliation_data[ -// index] -// ['time_frame'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// AffiliationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Publications", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// //isAlwaysShown: true, -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Artical Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), - -// DataColumn( -// label: Expanded( -// child: Text('Authors', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), - -// // Add more columns as needed -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Events", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: MediaQuery.of(context) -// .size -// .width, -// ), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Event Name', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)), -// )), - -// DataColumn( -// label: Expanded( -// child: Text('Role', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), - -// // Add more columns as needed -// ], -// rows: List.generate( -// event_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${event_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// event_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// event_data[index] -// ['event_name'] -// .toString(), -// softWrap: true)), - -// DataCell(Text( -// event_data[index] -// ['role'] -// .toString(), -// softWrap: true)), - -// // Add more DataCells as needed -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EventsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Trials", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Trial Name', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Status', -// softWrap: true, -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// trial_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${trial_data[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: -// Radius.circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// trial_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// trial_data[index] -// ['trial_name'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// trial_data[index] -// ['status'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EventsData())); -// }, -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants.k2color), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image -// ]), - -// // -// ListView( -// children: [ -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// // initiallyExpanded: true, -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Medical Insight", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Container( -// width: MediaQuery.of(context) -// .size -// .width, - -// /// 5, -// color: Colors.white, -// child: Consumer< -// MediacalInsightProvider>( -// builder: (BuildContext context, -// value, Widget? child) { -// print( -// "med1 : ${value.med.length}"); - -// if (value.med.length != 0) { -// return ListView.builder( -// physics: -// const ScrollPhysics(), -// // scrollDirection: Axis.vertical, -// shrinkWrap: true, -// itemCount: value.med -// .take(2) -// .length, -// itemBuilder: -// (context, index) { -// item = value.med[index]; - -// print( -// "Item_Medical_insight ${item['Therapeutic Area']}"); -// return Padding( -// padding: -// const EdgeInsets -// .all(8.0), -// child: Card( -// margin: -// EdgeInsets.zero, - -// elevation: 4, -// surfaceTintColor: -// Colors.white, -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .zero, -// ), - -// child: SizedBox( -// width: MediaQuery -// .sizeOf( -// context) -// .width, -// child: ListTile( -// dense: true, -// title: Column( -// // crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// // Text( -// // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - -// RichText( -// text: -// TextSpan( -// text: '', -// style: DefaultTextStyle.of( -// context) -// .style, -// children: const [ -// TextSpan( -// text: -// 'Acute neurology ', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// // TextSpan( -// // text: ' therapeutic area ', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.bold)), -// TextSpan( -// text: -// 'is the therapeutic area of the medical insight for '), -// TextSpan( -// text: -// 'Product A. The age of treatment', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// TextSpan( -// text: -// ' is the topic of interest for this source type'), -// TextSpan( -// text: -// ' publication.', -// style: -// TextStyle(fontWeight: FontWeight.bold)), -// ], -// ), -// ), - -// const Padding( -// padding: -// EdgeInsets.all( -// 8.0), -// child: Row( -// mainAxisAlignment: -// MainAxisAlignment -// .spaceBetween, -// children: [ -// Row( -// children: [ -// Icon( -// Icons.person, -// size: 20, -// ), -// Text( -// "pooja", -// style: TextStyle(fontSize: 14.0), -// ) -// ], -// ), -// Row( -// children: [ -// Icon( -// Icons.calendar_today, -// size: 20, -// ), -// Text( -// "11/11/2022 ", -// style: TextStyle(fontSize: 14.0), -// ) -// ], -// ) -// ], -// ), -// ), -// ], -// ), -// ), -// ), -// // shape: BorderRadius.only(bottomRight: Radius.circular(50)), -// ), -// ); -// }); -// } else { -// return Container( -// color: Colors.white, -// width: MediaQuery.of(context) -// .size -// .width, -// child: Column( -// children: [ -// Text("No records"), -// ], -// ), -// ); -// } -// }), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// const MedicalInsight1())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// //mainAxisSize: MainAxisSize.min, -// children: [ -// GestureDetector( -// onTap: () async { -// final provider = Provider.of< -// InteractionProvider>( -// context, -// listen: false); -// if (getCount( -// provider -// .intConfigDataList[ -// 0] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[ -// 0] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// 0] -// .name, -// ))); -// } -// }, -// child: Text1( -// title: "Interactions", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ), -// const SizedBox( -// width: 8.0, -// ), -// ], -// ), -// children: [ -// Container( -// height: MediaQuery.of(context) -// .size -// .height / -// 5, -// color: Colors.white, -// child: Consumer< -// ViewInteractionProvider>( -// builder: (BuildContext context, -// provider, Widget? child) { -// print( -// "P_leangth : ${provider.savedList.length}"); - -// if (provider.savedList.length != -// 0) { -// return ListView.builder( -// shrinkWrap: true, -// physics: -// NeverScrollableScrollPhysics(), -// itemCount: provider -// .savedList -// .take(2) -// .length, -// itemBuilder: -// (context, index) { -// print( -// "Indexxxxxx $index"); -// return Column( -// children: [ -// ListTile( -// subtitle: Text( -// 'Updated on ${provider.savedList[index].updatedTime}', -// //style: TextStyle(fontStyle: FontStyle.italic), -// ), -// title: Text( -// provider -// .savedList[ -// index] -// .id, -// ), -// trailing: SizedBox( -// width: 150, -// child: Row( -// children: [ -// IconButton( -// onPressed: -// () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => ViewInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))); -// }, -// icon: -// const Icon( -// Icons -// .info_outline, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// IconButton( -// onPressed: -// () async { -// await provider -// .initConfigData() -// .then({ -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => EditInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))) -// }); -// }, -// icon: -// const Icon( -// Icons -// .edit, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// IconButton( -// onPressed: -// () { -// showDeleteRecordAlertDialog( -// context, -// provider.savedList[index].id, -// provider.savedList[index]); -// }, -// icon: -// const Icon( -// Icons -// .delete, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// ]), -// ), -// onTap: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// ViewInteractionScreen( -// saveInteraction: -// provider.savedList[index], -// ))); -// }, -// ), -// const Divider(), -// ], -// ); -// }); -// } else { -// return Container( -// color: Colors.white, -// width: MediaQuery.of(context) -// .size -// .width, -// child: Column( -// children: [ -// Text("No records"), -// ], -// ), -// ); -// } -// }), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// final provider = Provider -// .of( -// context, -// listen: false); -// if (getCount( -// provider -// .intConfigDataList[ -// 0] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[ -// 0] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext -// context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// 0] -// .name, -// ))); -// } -// }, -// child: Text('Show More'), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Speaker Evalution", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(4)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Program Topic', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Speaker Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// speaker.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${speaker[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// speaker[index]); -// }, -// ); -// }, -// color: MaterialStateProperty -// .resolveWith< -// Color?>((Set< -// MaterialState> -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// speaker[index][ -// 'programtopic'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// speaker[index][ -// 'speakername'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // AffiliationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Engagement", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Main Therapeutic Area', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// ), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Date', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// eng.take(2).length, -// (index) => DataRow( -// onSelectChanged: (value) { -// // =======> Use onSelectChanged for tab -// print( -// "message ${eng[index]}"); - -// // bsheet( -// // publication_data[ -// // index]); -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// eng[index]); -// }, -// ); -// }, -// color: MaterialStateProperty -// .resolveWith< -// Color?>((Set< -// MaterialState> -// states) { -// if (index.isEven) { -// return Colors.grey -// .withOpacity(0.1); -// } -// return null; -// }), -// cells: [ -// DataCell(Text( -// eng[index][ -// 'main thereutic area'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// eng[index]['date'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// EngagementList())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "NIH Grants", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('NIH Center', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Organization Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Procedures", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Program Year', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Procedure', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Patents", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Patent Title', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Status', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// //elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Patient Referrals", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 17.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: -// Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Referred By', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Type of Referrals', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: -// (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: double -// .infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index] -// [ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants -// .k2color), -// ), -// style: OutlinedButton -// .styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Training", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text( -// 'Institute Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Degree', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: -// double.infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular(0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index][ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: -// Constants.k2color), -// ), -// style: -// OutlinedButton.styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular( -// 12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image - -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only( -// left: 8.0, right: 8.0), -// child: Container( -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: -// BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// backgroundColor: Constants.k2color11, -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: -// MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Case", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// ], -// ), -// children: [ -// Scrollbar( -// child: SingleChildScrollView( -// scrollDirection: -// Axis.horizontal, -// child: Container( -// constraints: BoxConstraints( -// minWidth: -// MediaQuery.of(context) -// .size -// .width), -// color: Colors.white, -// child: DataTable( -// showCheckboxColumn: false, -// columns: const [ -// DataColumn( -// label: Expanded( -// child: Text('Name', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text( -// 'Type', -// style: TextStyle( -// fontWeight: -// FontWeight -// .w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: -// (value) { -// print( -// "message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: -// true, -// isScrollControlled: -// false, -// enableDrag: true, -// useSafeArea: true, -// constraints: -// const BoxConstraints( -// maxWidth: double -// .infinity, -// ), -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .vertical( -// top: Radius -// .circular( -// 0), -// ), -// ), -// clipBehavior: Clip -// .antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet( -// publication_data[ -// index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[ -// index] -// [ -// 'artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[ -// index] -// ['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: -// const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (_) => -// PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle( -// color: Constants -// .k2color), -// ), -// style: OutlinedButton -// .styleFrom( -// shape: -// RoundedRectangleBorder( -// borderRadius: -// BorderRadius -// .circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), -// ), // adds spacing between the text and image -// ], -// ), -// // Center(child: Icon(Icons.email)), -// ], -// ), -// ), -// // Other widgets below TabBarView -// ], -// ), -// // ), -// ), -// ), -// ]), -// ], -// ), -// ); -// } - -// // Widget build(BuildContext context) { -// // var size = MediaQuery.of(context).size; - -// // /*24 is for notification bar on Android*/ -// // final double itemHeight = (size.height - kToolbarHeight - 24) / 2; -// // final double itemWidth = size.width / 2; -// // return Scaffold( -// // body: SafeArea( -// // child: Container( -// // color: Constants.bgcolor, -// // child: Column( -// // children: [ -// // Expanded( -// // child: ListView( -// // children: [ -// // Column( -// // children: [ -// // Stack( -// // clipBehavior: Clip.none, -// // alignment: Alignment.center, -// // children: [ -// // Container( -// // width: MediaQuery.of(context) -// // .size -// // .width, // Adjust width as needed -// // height: 100, // Adjust height as needed -// // decoration: -// // BoxDecoration(color: Constants.k2color), -// // ), -// // Positioned( -// // bottom: -45, -// // child: Container( -// // child: widget.text["img_path"] == null -// // ? ProfilePicture( -// // name: widget.text!["name"], -// // radius: 38, -// // fontsize: 21, -// // ) -// // : ClipOval( -// // child: SizedBox.fromSize( -// // size: Size.fromRadius( -// // 48), // Image radius -// // child: Image.network( -// // widget.text!["img_path"], -// // fit: BoxFit.fill), -// // ), -// // ), -// // ), -// // ) -// // ], -// // ), -// // SizedBox( -// // height: 55.0, -// // ), -// // // Profile photo -// // Column( -// // children: [ -// // Text1( -// // title: "Dr " + widget.text!["name"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 22.0), -// // Text1( -// // title: widget.text!["speciality"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row( -// // mainAxisAlignment: MainAxisAlignment.center, -// // children: [ -// // const Icon( -// // Icons.location_city_sharp, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: -// // //widget.text!["addr"] ?? -// // "Florida Hospital Medical Group Inc", -// // txtcolor: Colors.black, -// // txtfont: 15.0, -// // fontweight: FontWeight.normal, -// // ), -// // // child: RichText( -// // // text: TextSpan( -// // // text: widget.text!["addr"] ?? -// // // "Azienda Ospedaliera di Padova", -// // // style: TextStyle( -// // // fontSize: 16.0, color: Colors.black), -// // // ), -// // // ), -// // ), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.location_pin, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // // child: Text( -// // // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // // style: TextStyle( -// // // fontWeight: FontWeight.bold, fontSize: 14.0), -// // // ), -// // child: Text1( -// // title: widget.text!["adrr"] ?? -// // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), - -// // // child: RichText( -// // // text: TextSpan( -// // // text: widget.text!["adrr"] ?? -// // // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // // style: TextStyle( -// // // fontSize: 16.0, color: Colors.black), -// // // ), -// // // ), -// // ), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.email, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: widget.text!["email"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ]), -// // ), -// // SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.phone, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // // Text( -// // // "+390498212410 X 12", -// // // style: TextStyle( -// // // fontWeight: FontWeight.bold, fontSize: 14.0), -// // // ), -// // Text1( -// // title: widget.text!["phone_no"].toString(), -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.call, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: -// // widget.text!["phone_no"].toString(), -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ]), -// // ), -// // ], -// // ), - -// // const SizedBox( -// // height: 12.0, -// // ), -// // Align( -// // alignment: Alignment.centerLeft, -// // child: Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Text1( -// // title: "Profile Summarry", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 18.0), -// // ), -// // ), -// // const SizedBox( -// // height: 5.0, -// // ), -// // Align( -// // alignment: Alignment.centerLeft, -// // child: Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Text1( -// // title: widget.text!["summarry"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ), - -// // ExpandableCarousel( -// // options: CarouselOptions( -// // slideIndicator: CircularWaveSlideIndicator( -// // alignment: Alignment.bottomCenter, -// // currentIndicatorColor: Constants.k2color1, -// // indicatorBackgroundColor: Colors.grey, -// // // padding: EdgeInsets.only(: 10), -// // ), -// // autoPlay: true, -// // autoPlayInterval: const Duration(seconds: 2), -// // ), -// // // items: [1, 2, 3, 4, 5].map((i) { -// // items: [1, 2, 3, 4, 5].asMap().entries.map((entry) { -// // int index = entry.key; - -// // return Builder( -// // builder: (BuildContext context) { -// // return Center( -// // child: Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(10), -// // ), -// // child: Container( -// // decoration: BoxDecoration( -// // gradient: gradients[index % -// // gradients -// // .length], // Apply gradient -// // borderRadius: -// // BorderRadius.circular(10), -// // ), -// // child: Padding( -// // padding: EdgeInsets.all(10.0), -// // child: Column( -// // mainAxisSize: MainAxisSize.min, -// // crossAxisAlignment: -// // CrossAxisAlignment.start, -// // children: [ -// // const Text( -// // "Top Event Topics", -// // style: TextStyle( -// // fontSize: 16.0, -// // fontWeight: FontWeight.bold, -// // color: Colors.white), -// // ), -// // const SizedBox( -// // height: 10.0, -// // ), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 10), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text( -// // "Angina Pectoris"), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // SizedBox(height: 5), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text( -// // "Coronary Artery Disease", -// // softWrap: true), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // SizedBox(height: 5), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text("Hypertension"), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ); -// // }, -// // ); -// // }).toList(), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: -// // const EdgeInsets.symmetric(horizontal: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // color: Constants -// // .k2color11, // Replace with Constants.k2color11 -// // child: ExpansionTile( -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: Constants -// // .k2color11, // Replace with Constants.k2color11 -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.black, -// // ), -// // title: Row( -// // children: [ -// // Text( -// // "Sentiment Score", -// // style: TextStyle( -// // color: Colors.black, -// // fontWeight: FontWeight.normal, -// // fontSize: 17.0, -// // ), -// // ), -// // const SizedBox(width: 8.0), -// // Text( -// // "(3)", -// // style: TextStyle( -// // color: Colors.black, -// // fontWeight: FontWeight.normal, -// // fontSize: 17.0, -// // ), -// // ), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of(context).size.width, -// // ), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Product', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600), -// // ), -// // ), -// // ), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Aissel Engagement', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600), -// // ), -// // ), -// // ), -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // publication_data.length, -// // (index) => DataRow( -// // onSelectChanged: (value) { -// // showModalBottomSheet( -// // useRootNavigator: true, -// // isScrollControlled: false, -// // enableDrag: true, -// // useSafeArea: true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double.infinity, -// // ), -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.vertical( -// // top: Radius.circular(0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: context, -// // builder: (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell( -// // Text( -// // publication_data[index] -// // ['artical_title'] ?? -// // '', -// // softWrap: true, -// // ), -// // ), -// // DataCell( -// // Text( -// // publication_data[index] -// // ['author'] ?? -// // '', -// // softWrap: true, -// // ), -// // ), -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData(), -// // ), -// // ); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Colors -// // .blue), // Replace with Constants.k2color -// // ), -// // style: OutlinedButton.styleFrom( -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ), - -// // SizedBox( -// // height: 10.0, -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: -// // const EdgeInsets.only(left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Note", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(0)", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: TextField( -// // decoration: InputDecoration( -// // border: OutlineInputBorder( -// // borderRadius: -// // BorderRadius.circular(8.0), -// // ), -// // hintText: 'Write your note here', -// // contentPadding: EdgeInsets.all(16.0), -// // ), -// // maxLines: -// // null, // Allows the TextField to expand vertically -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Save', -// // style: TextStyle( -// // color: Constants.k2color), -// // ), -// // style: OutlinedButton.styleFrom( -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(12), -// // ), -// // ), -// // ), -// // ), -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // SizedBox( -// // height: 10.0, -// // ), -// // ], -// // ), -// // Container( -// // // color: Colors.black, -// // height: MediaQuery.sizeOf(context).height * 0.7, -// // width: MediaQuery.sizeOf(context).width, -// // child: DefaultTabController( -// // length: 3, - -// // child: Column( -// // children: [ -// // Container( -// // color: Constants.bgcolor2, -// // child: const TabBar( -// // indicatorColor: Colors.white, -// // labelColor: Colors -// // .white, // Color of the selected tab text - -// // unselectedLabelColor: -// // Color.fromARGB(255, 163, 159, 159), -// // tabs: [ -// // // Tab(text: "Sentiment"), -// // Tab( -// // // text: "Related " -// // child: Text( -// // 'Related', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), -// // Tab( -// // // text: "Activities " -// // child: Text( -// // 'Activities', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), -// // Tab( -// // //text: "Engagement " - -// // child: Text( -// // 'Engagement', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), - -// // // Tab(icon: Icon(Icons.email)), -// // ], -// // ), -// // ), -// // // TabBarView -// // Expanded( -// // child: TabBarView( -// // children: [ -// // ListView(children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Locations", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // const RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Phone Numbers", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'phone Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Location', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Emails", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Email Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Email', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Staff/Assistant", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Location', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), - -// // ///elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "State License", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'License No', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'State', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // ], -// // ]), -// // ListView(children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Affiliations", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // // width: -// // // MediaQuery.of(context) -// // // .size -// // // .width, -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Organization Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Time Frame', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // affiliation_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${affiliation_data[index]}"); - -// // bottomshet( -// // affiliation_data[ -// // index]); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // affiliation_data[ -// // index] -// // [ -// // 'org_name'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // affiliation_data[ -// // index] -// // [ -// // 'time_frame'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // AffiliationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Publications", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // //isAlwaysShown: true, -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Artical Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: true), -// // )), - -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Authors', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), - -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[ -// // index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // publication_data[ -// // index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Events", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: -// // BoxConstraints( -// // minWidth: MediaQuery.of( -// // context) -// // .size -// // .width, -// // ), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Event Name', -// // softWrap: true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600)), -// // )), - -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Role', -// // softWrap: -// // true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), - -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // event_data.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${event_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // event_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // event_data[index] -// // [ -// // 'event_name'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // event_data[index] -// // [ -// // 'role'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EventsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Trials", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Trial Name', -// // softWrap: true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600)), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Status', -// // softWrap: -// // true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // trial_data.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${trial_data[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // trial_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // trial_data[index] -// // [ -// // 'trial_name'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // trial_data[index] -// // [ -// // 'status'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EventsData())); -// // }, -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image -// // ]), - -// // // -// // ListView( -// // children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // // initiallyExpanded: true, -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Medical Insight", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Container( -// // width: -// // MediaQuery.of(context) -// // .size -// // .width, - -// // /// 5, -// // color: Colors.white, -// // child: Consumer< -// // MediacalInsightProvider>( -// // builder: (BuildContext -// // context, -// // value, -// // Widget? child) { -// // print( -// // "med1 : ${value.med.length}"); - -// // if (value.med.length != -// // 0) { -// // return ListView.builder( -// // physics: -// // const ScrollPhysics(), -// // // scrollDirection: Axis.vertical, -// // shrinkWrap: true, -// // itemCount: value.med -// // .take(2) -// // .length, -// // itemBuilder: -// // (context, -// // index) { -// // item = value -// // .med[index]; - -// // print( -// // "Item_Medical_insight ${item['Therapeutic Area']}"); -// // return Padding( -// // padding: -// // const EdgeInsets -// // .all( -// // 8.0), -// // child: Card( -// // margin: -// // EdgeInsets -// // .zero, - -// // elevation: 4, -// // surfaceTintColor: -// // Colors -// // .white, -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .zero, -// // ), - -// // child: -// // SizedBox( -// // width: MediaQuery.sizeOf( -// // context) -// // .width, -// // child: -// // ListTile( -// // dense: -// // true, -// // title: -// // Column( -// // // crossAxisAlignment: CrossAxisAlignment.center, -// // children: [ -// // // Text( -// // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - -// // RichText( -// // text: -// // TextSpan( -// // text: '', -// // style: DefaultTextStyle.of(context).style, -// // children: const [ -// // TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), -// // // TextSpan( -// // // text: ' therapeutic area ', -// // // style: TextStyle( -// // // fontWeight: -// // // FontWeight.bold)), -// // TextSpan(text: 'is the therapeutic area of the medical insight for '), -// // TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), -// // TextSpan(text: ' is the topic of interest for this source type'), -// // TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), -// // ], -// // ), -// // ), - -// // const Padding( -// // padding: -// // EdgeInsets.all(8.0), -// // child: -// // Row( -// // mainAxisAlignment: MainAxisAlignment.spaceBetween, -// // children: [ -// // Row( -// // children: [ -// // Icon( -// // Icons.person, -// // size: 20, -// // ), -// // Text( -// // "pooja", -// // style: TextStyle(fontSize: 14.0), -// // ) -// // ], -// // ), -// // Row( -// // children: [ -// // Icon( -// // Icons.calendar_today, -// // size: 20, -// // ), -// // Text( -// // "11/11/2022 ", -// // style: TextStyle(fontSize: 14.0), -// // ) -// // ], -// // ) -// // ], -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), -// // ), -// // ); -// // }); -// // } else { -// // return Container( -// // color: Colors.white, -// // width: MediaQuery.of( -// // context) -// // .size -// // .width, -// // child: Column( -// // children: [ -// // Text( -// // "No records"), -// // ], -// // ), -// // ); -// // } -// // }), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // const MedicalInsight1())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // //mainAxisSize: MainAxisSize.min, -// // children: [ -// // GestureDetector( -// // onTap: () async { -// // final provider = Provider -// // .of( -// // context, -// // listen: false); -// // if (getCount( -// // provider -// // .intConfigDataList[ -// // 0] -// // .name, -// // provider) != -// // 0) { -// // provider.savedList -// // .where((element) => -// // element -// // .form == -// // provider -// // .intConfigDataList[ -// // 0] -// // .name) -// // .toList(); -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext -// // context) => -// // SavedFormListScreen( -// // formname: provider -// // .intConfigDataList[0] -// // .name, -// // ))); -// // } -// // }, -// // child: Text1( -// // title: "Interactions", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ), -// // const SizedBox( -// // width: 8.0, -// // ), -// // ], -// // ), -// // children: [ -// // Container( -// // height: -// // MediaQuery.of(context) -// // .size -// // .height / -// // 5, -// // color: Colors.white, -// // child: Consumer< -// // ViewInteractionProvider>( -// // builder: (BuildContext -// // context, -// // provider, -// // Widget? child) { -// // print( -// // "P_leangth : ${provider.savedList.length}"); - -// // if (provider.savedList -// // .length != -// // 0) { -// // return ListView.builder( -// // shrinkWrap: true, -// // physics: -// // NeverScrollableScrollPhysics(), -// // itemCount: provider -// // .savedList -// // .take(2) -// // .length, -// // itemBuilder: -// // (context, -// // index) { -// // print( -// // "Indexxxxxx $index"); -// // return Column( -// // children: [ -// // ListTile( -// // subtitle: -// // Text( -// // 'Updated on ${provider.savedList[index].updatedTime}', -// // //style: TextStyle(fontStyle: FontStyle.italic), -// // ), -// // title: Text( -// // provider -// // .savedList[ -// // index] -// // .id, -// // ), -// // trailing: -// // SizedBox( -// // width: -// // 150, -// // child: Row( -// // children: [ -// // IconButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => ViewInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))); -// // }, -// // icon: const Icon( -// // Icons.info_outline, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // IconButton( -// // onPressed: () async { -// // await provider.initConfigData().then({ -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => EditInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))) -// // }); -// // }, -// // icon: const Icon( -// // Icons.edit, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // IconButton( -// // onPressed: () { -// // showDeleteRecordAlertDialog(context, provider.savedList[index].id, provider.savedList[index]); -// // }, -// // icon: const Icon( -// // Icons.delete, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // ]), -// // ), -// // onTap: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => ViewInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))); -// // }, -// // ), -// // const Divider(), -// // ], -// // ); -// // }); -// // } else { -// // return Container( -// // color: Colors.white, -// // width: MediaQuery.of( -// // context) -// // .size -// // .width, -// // child: Column( -// // children: [ -// // Text( -// // "No records"), -// // ], -// // ), -// // ); -// // } -// // }), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // final provider = -// // Provider.of< -// // InteractionProvider>( -// // context, -// // listen: -// // false); -// // if (getCount( -// // provider -// // .intConfigDataList[ -// // 0] -// // .name, -// // provider) != -// // 0) { -// // provider.savedList -// // .where((element) => -// // element -// // .form == -// // provider -// // .intConfigDataList[ -// // 0] -// // .name) -// // .toList(); -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext -// // context) => -// // SavedFormListScreen( -// // formname: -// // provider.intConfigDataList[0].name, -// // ))); -// // } -// // }, -// // child: -// // Text('Show More'), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Speaker Evalution", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Program Topic', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Speaker Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // speaker.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${speaker[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // speaker[ -// // index]); -// // }, -// // ); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // speaker[index] -// // [ -// // 'programtopic'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // speaker[index] -// // [ -// // 'speakername'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // // Navigator.push( -// // // context, -// // // MaterialPageRoute( -// // // builder: (_) => -// // // AffiliationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Engagement", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Main Therapeutic Area', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Date', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // eng.take(2).length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${eng[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // eng[index]); -// // }, -// // ); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // eng[index][ -// // 'main thereutic area'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // eng[index][ -// // 'date'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EngagementList())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "NIH Grants", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'NIH Center', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Organization Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Procedures", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Program Year', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Procedure', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Patents", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Patent Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Status', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Patient Referrals", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: -// // Expanded( -// // child: Text( -// // 'Referred By', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type of Referrals', -// // style: -// // TextStyle(fontWeight: FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => -// // DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: -// // double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular(0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: -// // (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: -// // OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Training", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Institute Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Degree', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Case", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: -// // Expanded( -// // child: Text( -// // 'Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type', -// // style: -// // TextStyle(fontWeight: FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => -// // DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: -// // double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular(0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: -// // (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: -// // OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image -// // ], -// // ), -// // // Center(child: Icon(Icons.email)), -// // ], -// // ), -// // ), -// // // Other widgets below TabBarView -// // ], -// // ), -// // // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ], -// // ), -// // ), -// // // ), -// // ), -// // floatingActionButton: Visibility( -// // visible: true, -// // child: FloatingActionButton( -// // onPressed: () async { -// // // final ConfigDataProvider configDataProvider = -// // // ConfigDataProvider(); - -// // // await configDataProvider.initConfigUIData(); -// // Navigator.push( -// // context, MaterialPageRoute(builder: (context) => FormList())); -// // }, -// // foregroundColor: Colors.white, -// // backgroundColor: const Color.fromARGB(255, 0, 71, 132), -// // child: new Icon(Icons.add), -// // ), -// // ), -// // ); -// // } - -// Future getCount(String form, InteractionProvider provider) async { -// await provider.getRecords(); - -// return provider.savedList.where((element) => element.form == form).length; -// } - -// buidCard() { -// Text("Hiii"); -// } - -// showDeleteRecordAlertDialog( -// BuildContext context, String record, SaveInteraction saveInteraction) { -// // set up the buttons -// ViewInteractionProvider provider = -// Provider.of(context, listen: false); -// Widget cancelButton = TextButton( -// child: const Text("YES"), -// onPressed: () async { -// await provider.deleteRecord(saveInteraction).then((value) { -// _displaySnackBar("Deleted sucessfully!"); -// Navigator.of(context).pop(); -// }); -// }, -// ); -// Widget continueButton = TextButton( -// child: const Text("NO"), -// onPressed: () { -// Navigator.of(context).pop(); -// }, -// ); - -// // set up the AlertDialog -// AlertDialog alert = AlertDialog( -// title: const Text(""), -// content: Text("Are you sure you want to delete the record $record ?"), -// actions: [ -// cancelButton, -// continueButton, -// ], -// ); - -// // show the dialog -// showDialog( -// context: context, -// builder: (BuildContext context) { -// return alert; -// }, -// ); -// } - -// _displaySnackBar(String msg) { -// final snackBar = SnackBar( -// content: Text( -// msg, -// style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), -// )); -// ScaffoldMessenger.of(context).showSnackBar(snackBar); -// //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); -// } - -// Widget makeDismissible({required DraggableScrollableSheet child}) { -// return GestureDetector( -// behavior: HitTestBehavior.opaque, -// onTap: () => Navigator.of(context).pop(), -// child: GestureDetector( -// onTap: () {}, -// child: child, -// ), -// ); -// } - -// void bottomshet(affiliation_data) { -// // print("Aff_index_data: ${affiliation_data}"); -// showModalBottomSheet( -// // isScrollControlled: -// // true, - -// context: context, - -// useRootNavigator: true, -// isScrollControlled: false, -// enableDrag: true, -// useSafeArea: true, -// constraints: const BoxConstraints( -// maxWidth: double.infinity, -// ), - -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.vertical( -// top: Radius.circular(0), -// ), -// ), -// clipBehavior: Clip.antiAliasWithSaveLayer, -// // sheetAnimationStyle: _animationStyle, -// builder: (BuildContext context) { -// return -// // makeDismissible( -// // child: -// DraggableScrollableSheet( -// expand: false, -// builder: (BuildContext context, ScrollController scrollController) { -// return Container( -// width: MediaQuery.of(context).size.width, -// //color: Colors.white, -// color: Color.fromARGB(255, 246, 248, 252), - -// // decoration: -// // BoxDecoration(borderRadius: BorderRadius.circular(10)), -// // child: ListView( -// // children: [ - -// // ], -// // ), - -// 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: [ -// // Row( -// // children: [ -// // Text( -// // "Affiliation", -// // style: TextStyle(fontSize: 20.0), -// // ) -// // ], -// // ), -// SizedBox( -// height: 18.0, -// ), -// Row( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: GestureDetector( -// onTap: () async { -// final ConfigDataProvider -// configDataProvider = -// ConfigDataProvider(); -// await configDataProvider -// .initConfigUIDataEng(); - -// final provider = -// Provider.of( -// context, -// listen: false); - -// if (getCount( -// provider.intConfigDataList[index] -// .name, -// provider) != -// 0) { -// provider.savedList -// .where((element) => -// element.form == -// provider -// .intConfigDataList[index] -// .name) -// .toList(); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: -// (BuildContext context) => -// SavedFormListScreen( -// formname: provider -// .intConfigDataList[ -// index] -// .name, -// ))); -// } -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (context) => -// // const InteractionListScreen())); -// }, -// child: Text( -// affiliation_data['org_name'], -// style: TextStyle( -// fontSize: 18.0, -// color: Colors.grey[700]), -// ), -// ), -// ) -// ], -// ), -// SizedBox( -// height: 18.0, -// ), -// Divider(), -// SizedBox( -// height: 8.0, -// ), - -// Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// "Department", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// affiliation_data['dept'], -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// "Role", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// affiliation_data['role'], -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// "Time Frame", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// affiliation_data['time_frame'], -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// "Oraganization Type", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// affiliation_data['org_type'], -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.only( -// left: 18.0, top: 18.0), -// child: Text( -// "Eng Type", -// style: TextStyle(fontSize: 13.0), -// ), -// ), -// Padding( -// padding: const EdgeInsets.only(left: 18.0), -// child: Text( -// affiliation_data['emg_type'], -// style: TextStyle( -// fontSize: 15.0, -// color: Colors.grey[700]), -// ), -// ) -// ], -// ), -// ], -// ); -// }, -// ), -// ), -// ], -// ), -// ); -// }, -// ); -// //); -// }, -// ); -// } - -// Widget _buildPaginationDots() { -// return Container( -// padding: EdgeInsets.symmetric(vertical: 8.0), -// child: Row( -// mainAxisAlignment: MainAxisAlignment.center, -// children: List.generate(10, (index) { -// return Container( -// margin: EdgeInsets.symmetric(horizontal: 4.0), -// width: 8.0, -// height: 8.0, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: 1 == index ? Colors.blue : Colors.grey, -// ), -// ); -// }), -// ), -// ); -// } - -// Widget getAppBarUI() { -// return Container( -// decoration: BoxDecoration( -// color: Constants.k2color, -// boxShadow: [ -// BoxShadow( -// color: Colors.grey.withOpacity(0.2), -// offset: const Offset(0, 2), -// blurRadius: 8.0), -// ], -// ), -// child: Padding( -// padding: EdgeInsets.only(top: 2, left: 8, right: 8), -// child: Row( -// children: [ -// Container( -// alignment: Alignment.topLeft, -// // width: AppBar().preferredSize.height, -// // height: AppBar().preferredSize.height, -// child: Material( -// color: Colors.transparent, -// child: InkWell( -// borderRadius: const BorderRadius.all( -// Radius.circular(32.0), -// ), -// onTap: () { -// Navigator.pop(context); -// }, -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: Icon( -// Icons.arrow_back_ios_new, -// size: 18, -// color: Colors.white, -// ), -// ), -// ), -// ), -// ), -// Expanded( -// child: Text( -// "", -// maxLines: 1, -// softWrap: true, -// style: TextStyle( -// fontWeight: FontWeight.w600, -// fontSize: 14, -// overflow: TextOverflow.ellipsis, -// ), -// ), -// ), -// ], -// ), -// ), -// ); -// } - -// // Future _launchMailApp() async { -// // final Uri emailLaunchUri = Uri( -// // scheme: 'mailto', -// // path: 'example@example.com', -// // query: encodeQueryParameters({ -// // 'subject': 'Example Subject', -// // 'body': 'Hello, this is a sample body text.', -// // }), -// // ); - -// // if (!await launchUrl(emailLaunchUri)) { -// // throw 'Could not launch $emailLaunchUri'; -// // } -// // } - -// // String? encodeQueryParameters(Map params) { -// // return params.entries -// // .map((MapEntry entry) => -// // Uri.encodeComponent(entry.key) + -// // '=' + -// // Uri.encodeComponent(entry.value)) -// // .join('&'); -// // } - -// Widget listViewTopicCard(String title, String content, bool visible) { -// return Visibility( -// visible: visible, -// child: Card( -// child: Container( -// padding: EdgeInsets.all(8.0), -// width: double.maxFinite, -// decoration: BoxDecoration( -// // color: Color.fromARGB(179, 248, 238, 238), -// // color: Colors.white, -// ), -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 14.0), -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Text( -// title, -// style: TextStyle( -// fontSize: 16, -// fontWeight: FontWeight.bold, -// ), -// ), -// Text( -// content, -// style: TextStyle( -// fontSize: 14, -// color: Colors.grey[700], -// ), -// ), -// ], -// ), -// ), -// ), -// ), -// ); -// } -// } - -// class ContestTabHeader extends SliverPersistentHeaderDelegate { -// ContestTabHeader( -// this.searchUI, -// ); -// final Widget searchUI; - -// @override -// Widget build( -// BuildContext context, double shrinkOffset, bool overlapsContent) { -// return Container(color: Colors.white, child: searchUI); -// } - -// @override -// double get maxExtent => 52.0; - -// @override -// double get minExtent => 52.0; - -// @override -// bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { -// return true; -// } -// } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// // import 'package:discover_module/constants.dart'; -// // import 'package:discover_module/custom_widget/text.dart'; -// // import 'package:discover_module/provider_class/affiliationsprovider.dart'; -// // import 'package:discover_module/provider_class/engagement_provider.dart'; -// // import 'package:discover_module/provider_class/events_provider.dart'; -// // import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -// // import 'package:discover_module/provider_class/publications_provider.dart'; -// // import 'package:discover_module/provider_class/speaker_provider.dart'; -// // import 'package:discover_module/provider_class/trials_provider.dart'; -// // import 'package:discover_module/ui_screen/affiliation_data.dart'; -// // import 'package:discover_module/ui_screen/bottom_sheet.dart'; -// // import 'package:discover_module/ui_screen/engagementlist.dart'; -// // import 'package:discover_module/ui_screen/events_data.dart'; -// // import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -// // import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -// // import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart'; -// // import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// // import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// // import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -// // import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; -// // import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -// // import 'package:discover_module/ui_screen/medical_insight.dart'; -// // import 'package:discover_module/ui_screen/newformlist.dart'; -// // import 'package:discover_module/ui_screen/publication_data.dart'; -// // import 'package:flutter/cupertino.dart'; -// // import 'package:flutter/foundation.dart'; -// // import 'package:flutter/material.dart'; -// // import 'package:flutter/rendering.dart'; -// // import 'package:flutter/widgets.dart'; -// // import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; -// // import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -// // import 'package:provider/provider.dart'; - -// // class NewProfile1 extends StatefulWidget { -// // const NewProfile1({Key? key, required this.text}) : super(key: key); -// // final Map text; - -// // @override -// // State createState() => _NewProfileState(); -// // } - -// // class _NewProfileState extends State { -// // bool isonline = false; -// // List affiliation_data = []; -// // List publication_data = []; -// // List event_data = []; -// // List trial_data = []; -// // List medinsightData = []; -// // List speaker = []; -// // List eng = []; - -// // // final PageController _controller = PageController(viewportFraction: 0.8); -// // final ScrollController _scrollController = ScrollController(); - -// // List viewformData = []; - -// // bool _isExpanded = false; - -// // var item; - -// // List widgetList = ['Geeks', 'for', 'Geeks']; - -// // TextEditingController firstNameController = TextEditingController(); - -// // final List gradients = [ -// // LinearGradient(colors: [ -// // Colors.red, -// // Colors.orange, -// // ]), -// // LinearGradient(colors: [Colors.green, Colors.yellow]), -// // LinearGradient(colors: [Colors.blue, Colors.purple]), -// // LinearGradient(colors: [Colors.pink, Colors.redAccent]), -// // LinearGradient(colors: [Colors.teal, Colors.blueAccent]), -// // ]; - -// // @override -// // void initState() { -// // // TODO: implement initState -// // super.initState(); -// // print("pooja123"); -// // //init(); - -// // getaffiliations(); - -// // getuserdetails(); - -// // print("Widget_isssIndex_iss ${widget.text}"); -// // print( -// // "Widget_isssIndex_iss ${widget.text!["id"]},${widget.text!["name"]},${widget.text!["img_path"]}"); -// // } - -// // init() async { -// // await Provider.of(context, listen: false) -// // .initConfigData(); -// // final data = -// // await Provider.of(context, listen: false); - -// // // if(data.g) -// // data.getRecords("form-3 demo"); -// // // setState(() {}); -// // } - -// // getaffiliations() async { -// // var affiliations = -// // Provider.of(context, listen: false); - -// // await affiliations.getAffiliationsdata(); -// // final affilist = affiliations.adddta; - -// // var publication = Provider.of(context, listen: false); - -// // await publication.publicatininfo(); -// // final publist = publication.publicationlist; - -// // var events = Provider.of(context, listen: false); -// // await events.geteventdata(); -// // final eventlist = events.EventsList; - -// // var form = Provider.of(context, listen: false); -// // // form.savedList; - -// // var trials = Provider.of(context, listen: false); -// // await trials.trialsdata(); - -// // final trialslist = trials.trialsinfo; - -// // var med = Provider.of(context, listen: false); -// // await med.medicalinsightdata(); -// // final medlist = med.trialsinfo; - -// // var speaker11 = -// // Provider.of(context, listen: false); - -// // await speaker11.getspeakerdata(); - -// // final speakerlist = speaker11.speaker; - -// // var engtype = Provider.of(context, listen: false); -// // await engtype.getengagementdata(); -// // final engtypelist = engtype.engagementdata; - -// // setState(() { -// // affiliation_data = affilist; -// // publication_data = publist; -// // event_data = eventlist; -// // viewformData = form.savedList; -// // trial_data = trialslist; -// // medinsightData = medlist; -// // speaker = speakerlist; -// // eng = engtypelist; -// // }); - -// // print("Affiliations_data_is: $affilist"); -// // print("trialslist_data_is: $trialslist"); -// // } - -// // getuserdetails() async { -// // // HiveFunctions.getindexUser(widget.text); - -// // NetworkConnectivity networkConnectivity = NetworkConnectivity(); -// // bool isonline1 = await networkConnectivity.isInternetAvailable(); - -// // setState(() { -// // print("Profile_isOnline: $isonline1"); -// // isonline = isonline1; -// // }); -// // } - -// // @override -// // Widget build(BuildContext context) { -// // var size = MediaQuery.of(context).size; - -// // /*24 is for notification bar on Android*/ -// // final double itemHeight = (size.height - kToolbarHeight - 24) / 2; -// // final double itemWidth = size.width / 2; -// // return Scaffold( -// // body: SafeArea( -// // child: Container( -// // color: Constants.bgcolor, -// // child: Column( -// // children: [ -// // Expanded( -// // child: ListView( -// // children: [ -// // Column( -// // children: [ -// // Stack( -// // clipBehavior: Clip.none, -// // alignment: Alignment.center, -// // children: [ -// // Container( -// // width: MediaQuery.of(context) -// // .size -// // .width, // Adjust width as needed -// // height: 100, // Adjust height as needed -// // decoration: -// // BoxDecoration(color: Constants.k2color), -// // ), -// // Positioned( -// // bottom: -45, -// // child: Container( -// // child: widget.text["img_path"] == null -// // ? ProfilePicture( -// // name: widget.text!["name"], -// // radius: 38, -// // fontsize: 21, -// // ) -// // : ClipOval( -// // child: SizedBox.fromSize( -// // size: Size.fromRadius( -// // 48), // Image radius -// // child: Image.network( -// // widget.text!["img_path"], -// // fit: BoxFit.fill), -// // ), -// // ), -// // ), -// // ) -// // ], -// // ), -// // SizedBox( -// // height: 55.0, -// // ), -// // // Profile photo -// // Column( -// // children: [ -// // Text1( -// // title: "Dr " + widget.text!["name"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 22.0), -// // Text1( -// // title: widget.text!["speciality"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row( -// // mainAxisAlignment: MainAxisAlignment.center, -// // children: [ -// // const Icon( -// // Icons.location_city_sharp, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: -// // //widget.text!["addr"] ?? -// // "Florida Hospital Medical Group Inc", -// // txtcolor: Colors.black, -// // txtfont: 15.0, -// // fontweight: FontWeight.normal, -// // ), -// // // child: RichText( -// // // text: TextSpan( -// // // text: widget.text!["addr"] ?? -// // // "Azienda Ospedaliera di Padova", -// // // style: TextStyle( -// // // fontSize: 16.0, color: Colors.black), -// // // ), -// // // ), -// // ), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.location_pin, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // // child: Text( -// // // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // // style: TextStyle( -// // // fontWeight: FontWeight.bold, fontSize: 14.0), -// // // ), -// // child: Text1( -// // title: widget.text!["adrr"] ?? -// // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), - -// // // child: RichText( -// // // text: TextSpan( -// // // text: widget.text!["adrr"] ?? -// // // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", -// // // style: TextStyle( -// // // fontSize: 16.0, color: Colors.black), -// // // ), -// // // ), -// // ), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.email, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: widget.text!["email"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ]), -// // ), -// // SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.phone, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // // Text( -// // // "+390498212410 X 12", -// // // style: TextStyle( -// // // fontWeight: FontWeight.bold, fontSize: 14.0), -// // // ), -// // Text1( -// // title: widget.text!["phone_no"].toString(), -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ]), -// // ), -// // const SizedBox( -// // height: 8.0, -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Row(children: [ -// // const Icon( -// // Icons.call, -// // color: Color.fromARGB(255, 0, 71, 132), -// // ), -// // const SizedBox( -// // width: 3.0, -// // ), -// // Expanded( -// // child: Text1( -// // title: -// // widget.text!["phone_no"].toString(), -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ]), -// // ), -// // ], -// // ), - -// // const SizedBox( -// // height: 12.0, -// // ), -// // Align( -// // alignment: Alignment.centerLeft, -// // child: Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Text1( -// // title: "Profile Summarry", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 18.0), -// // ), -// // ), -// // const SizedBox( -// // height: 5.0, -// // ), -// // Align( -// // alignment: Alignment.centerLeft, -// // child: Padding( -// // padding: const EdgeInsets.only(left: 8.0), -// // child: Text1( -// // title: widget.text!["summarry"], -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 15.0), -// // ), -// // ), - -// // ExpandableCarousel( -// // options: CarouselOptions( -// // slideIndicator: CircularWaveSlideIndicator( -// // alignment: Alignment.bottomCenter, -// // currentIndicatorColor: Constants.k2color1, -// // indicatorBackgroundColor: Colors.grey, -// // // padding: EdgeInsets.only(: 10), -// // ), -// // autoPlay: true, -// // autoPlayInterval: const Duration(seconds: 2), -// // ), -// // // items: [1, 2, 3, 4, 5].map((i) { -// // items: [1, 2, 3, 4, 5].asMap().entries.map((entry) { -// // int index = entry.key; - -// // return Builder( -// // builder: (BuildContext context) { -// // return Center( -// // child: Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(10), -// // ), -// // child: Container( -// // decoration: BoxDecoration( -// // gradient: gradients[index % -// // gradients -// // .length], // Apply gradient -// // borderRadius: -// // BorderRadius.circular(10), -// // ), -// // child: Padding( -// // padding: EdgeInsets.all(10.0), -// // child: Column( -// // mainAxisSize: MainAxisSize.min, -// // crossAxisAlignment: -// // CrossAxisAlignment.start, -// // children: [ -// // const Text( -// // "Top Event Topics", -// // style: TextStyle( -// // fontSize: 16.0, -// // fontWeight: FontWeight.bold, -// // color: Colors.white), -// // ), -// // const SizedBox( -// // height: 10.0, -// // ), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 10), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text( -// // "Angina Pectoris"), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // SizedBox(height: 5), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text( -// // "Coronary Artery Disease", -// // softWrap: true), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // SizedBox(height: 5), -// // Row( -// // children: [ -// // Container( -// // decoration: BoxDecoration( -// // color: Constants.cardtext, -// // borderRadius: -// // BorderRadius.circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 5.0), -// // child: Row( -// // children: [ -// // Text("Hypertension"), -// // SizedBox(width: 5.0), -// // Container( -// // decoration: -// // BoxDecoration( -// // color: Constants -// // .cardtextdark, -// // borderRadius: -// // BorderRadius -// // .circular( -// // 5), -// // ), -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(1.0), -// // child: Text( -// // "(378)", -// // style: TextStyle( -// // color: Colors -// // .black), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ], -// // ), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ); -// // }, -// // ); -// // }).toList(), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: -// // const EdgeInsets.symmetric(horizontal: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // color: Constants -// // .k2color11, // Replace with Constants.k2color11 -// // child: ExpansionTile( -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: Constants -// // .k2color11, // Replace with Constants.k2color11 -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.black, -// // ), -// // title: Row( -// // children: [ -// // Text( -// // "Sentiment Score", -// // style: TextStyle( -// // color: Colors.black, -// // fontWeight: FontWeight.normal, -// // fontSize: 17.0, -// // ), -// // ), -// // const SizedBox(width: 8.0), -// // Text( -// // "(3)", -// // style: TextStyle( -// // color: Colors.black, -// // fontWeight: FontWeight.normal, -// // fontSize: 17.0, -// // ), -// // ), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of(context).size.width, -// // ), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Product', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600), -// // ), -// // ), -// // ), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Aissel Engagement', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600), -// // ), -// // ), -// // ), -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // publication_data.length, -// // (index) => DataRow( -// // onSelectChanged: (value) { -// // showModalBottomSheet( -// // useRootNavigator: true, -// // isScrollControlled: false, -// // enableDrag: true, -// // useSafeArea: true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double.infinity, -// // ), -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.vertical( -// // top: Radius.circular(0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: context, -// // builder: (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell( -// // Text( -// // publication_data[index] -// // ['artical_title'] ?? -// // '', -// // softWrap: true, -// // ), -// // ), -// // DataCell( -// // Text( -// // publication_data[index] -// // ['author'] ?? -// // '', -// // softWrap: true, -// // ), -// // ), -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData(), -// // ), -// // ); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Colors -// // .blue), // Replace with Constants.k2color -// // ), -// // style: OutlinedButton.styleFrom( -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // ), - -// // SizedBox( -// // height: 10.0, -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: -// // const EdgeInsets.only(left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons.keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Note", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(0)", -// // txtcolor: Colors.black, -// // fontweight: FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: TextField( -// // decoration: InputDecoration( -// // border: OutlineInputBorder( -// // borderRadius: -// // BorderRadius.circular(8.0), -// // ), -// // hintText: 'Write your note here', -// // contentPadding: EdgeInsets.all(16.0), -// // ), -// // maxLines: -// // null, // Allows the TextField to expand vertically -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Save', -// // style: TextStyle( -// // color: Constants.k2color), -// // ), -// // style: OutlinedButton.styleFrom( -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(12), -// // ), -// // ), -// // ), -// // ), -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // SizedBox( -// // height: 10.0, -// // ), -// // ], -// // ), -// // Container( -// // // color: Colors.black, -// // height: MediaQuery.sizeOf(context).height * 0.7, -// // width: MediaQuery.sizeOf(context).width, -// // child: DefaultTabController( -// // length: 3, - -// // child: Column( -// // children: [ -// // Container( -// // color: Constants.bgcolor2, -// // child: const TabBar( -// // indicatorColor: Colors.white, -// // labelColor: Colors -// // .white, // Color of the selected tab text - -// // unselectedLabelColor: -// // Color.fromARGB(255, 163, 159, 159), -// // tabs: [ -// // // Tab(text: "Sentiment"), -// // Tab( -// // // text: "Related " -// // child: Text( -// // 'Related', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), -// // Tab( -// // // text: "Activities " -// // child: Text( -// // 'Activities', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), -// // Tab( -// // //text: "Engagement " - -// // child: Text( -// // 'Engagement', -// // style: TextStyle( -// // fontWeight: FontWeight.bold, -// // fontSize: 17.0), -// // ), -// // ), - -// // // Tab(icon: Icon(Icons.email)), -// // ], -// // ), -// // ), -// // // TabBarView -// // Expanded( -// // child: TabBarView( -// // children: [ -// // ListView(children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Locations", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // const RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Phone Numbers", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'phone Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Location', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Emails", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Email Type', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Email', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Staff/Assistant", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Location', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), - -// // ///elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "State License", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'License No', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'State', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Institution'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'Address'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // ], -// // ]), -// // ListView(children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Affiliations", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // // width: -// // // MediaQuery.of(context) -// // // .size -// // // .width, -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Organization Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Time Frame', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // affiliation_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${affiliation_data[index]}"); - -// // bottomshet( -// // affiliation_data[ -// // index]); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // affiliation_data[ -// // index] -// // [ -// // 'org_name'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // affiliation_data[ -// // index] -// // [ -// // 'time_frame'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // AffiliationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Publications", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // //isAlwaysShown: true, -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Artical Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: true), -// // )), - -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Authors', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), - -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[ -// // index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // publication_data[ -// // index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Events", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: -// // BoxConstraints( -// // minWidth: MediaQuery.of( -// // context) -// // .size -// // .width, -// // ), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Event Name', -// // softWrap: true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600)), -// // )), - -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Role', -// // softWrap: -// // true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), - -// // // Add more columns as needed -// // ], -// // rows: List.generate( -// // event_data.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${event_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // event_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // event_data[index] -// // [ -// // 'event_name'] -// // .toString(), -// // softWrap: -// // true)), - -// // DataCell(Text( -// // event_data[index] -// // [ -// // 'role'] -// // .toString(), -// // softWrap: -// // true)), - -// // // Add more DataCells as needed -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EventsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons.keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Trials", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Trial Name', -// // softWrap: true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600)), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Status', -// // softWrap: -// // true, -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // trial_data.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${trial_data[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: Clip -// // .antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // trial_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // trial_data[index] -// // [ -// // 'trial_name'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // trial_data[index] -// // [ -// // 'status'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets.all( -// // 8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EventsData())); -// // }, -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image -// // ]), - -// // // -// // ListView( -// // children: [ -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // // initiallyExpanded: true, -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Medical Insight", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Container( -// // width: -// // MediaQuery.of(context) -// // .size -// // .width, - -// // /// 5, -// // color: Colors.white, -// // child: Consumer< -// // MediacalInsightProvider>( -// // builder: (BuildContext -// // context, -// // value, -// // Widget? child) { -// // print( -// // "med1 : ${value.med.length}"); - -// // if (value.med.length != -// // 0) { -// // return ListView.builder( -// // physics: -// // const ScrollPhysics(), -// // // scrollDirection: Axis.vertical, -// // shrinkWrap: true, -// // itemCount: value.med -// // .take(2) -// // .length, -// // itemBuilder: -// // (context, -// // index) { -// // item = value -// // .med[index]; - -// // print( -// // "Item_Medical_insight ${item['Therapeutic Area']}"); -// // return Padding( -// // padding: -// // const EdgeInsets -// // .all( -// // 8.0), -// // child: Card( -// // margin: -// // EdgeInsets -// // .zero, - -// // elevation: 4, -// // surfaceTintColor: -// // Colors -// // .white, -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .zero, -// // ), - -// // child: -// // SizedBox( -// // width: MediaQuery.sizeOf( -// // context) -// // .width, -// // child: -// // ListTile( -// // dense: -// // true, -// // title: -// // Column( -// // // crossAxisAlignment: CrossAxisAlignment.center, -// // children: [ -// // // Text( -// // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - -// // RichText( -// // text: -// // TextSpan( -// // text: '', -// // style: DefaultTextStyle.of(context).style, -// // children: const [ -// // TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), -// // // TextSpan( -// // // text: ' therapeutic area ', -// // // style: TextStyle( -// // // fontWeight: -// // // FontWeight.bold)), -// // TextSpan(text: 'is the therapeutic area of the medical insight for '), -// // TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), -// // TextSpan(text: ' is the topic of interest for this source type'), -// // TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), -// // ], -// // ), -// // ), - -// // const Padding( -// // padding: -// // EdgeInsets.all(8.0), -// // child: -// // Row( -// // mainAxisAlignment: MainAxisAlignment.spaceBetween, -// // children: [ -// // Row( -// // children: [ -// // Icon( -// // Icons.person, -// // size: 20, -// // ), -// // Text( -// // "pooja", -// // style: TextStyle(fontSize: 14.0), -// // ) -// // ], -// // ), -// // Row( -// // children: [ -// // Icon( -// // Icons.calendar_today, -// // size: 20, -// // ), -// // Text( -// // "11/11/2022 ", -// // style: TextStyle(fontSize: 14.0), -// // ) -// // ], -// // ) -// // ], -// // ), -// // ), -// // ], -// // ), -// // ), -// // ), -// // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), -// // ), -// // ); -// // }); -// // } else { -// // return Container( -// // color: Colors.white, -// // width: MediaQuery.of( -// // context) -// // .size -// // .width, -// // child: Column( -// // children: [ -// // Text( -// // "No records"), -// // ], -// // ), -// // ); -// // } -// // }), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // const MedicalInsight1())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // //mainAxisSize: MainAxisSize.min, -// // children: [ -// // GestureDetector( -// // onTap: () async { -// // final provider = Provider -// // .of( -// // context, -// // listen: false); -// // if (getCount( -// // provider -// // .intConfigDataList[ -// // 0] -// // .name, -// // provider) != -// // 0) { -// // provider.savedList -// // .where((element) => -// // element -// // .form == -// // provider -// // .intConfigDataList[ -// // 0] -// // .name) -// // .toList(); -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext -// // context) => -// // SavedFormListScreen( -// // formname: provider -// // .intConfigDataList[0] -// // .name, -// // ))); -// // } -// // }, -// // child: Text1( -// // title: "Interactions", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ), -// // const SizedBox( -// // width: 8.0, -// // ), -// // ], -// // ), -// // children: [ -// // Container( -// // height: -// // MediaQuery.of(context) -// // .size -// // .height / -// // 5, -// // color: Colors.white, -// // child: Consumer< -// // ViewInteractionProvider>( -// // builder: (BuildContext -// // context, -// // provider, -// // Widget? child) { -// // print( -// // "P_leangth : ${provider.savedList.length}"); - -// // if (provider.savedList -// // .length != -// // 0) { -// // return ListView.builder( -// // shrinkWrap: true, -// // physics: -// // NeverScrollableScrollPhysics(), -// // itemCount: provider -// // .savedList -// // .take(2) -// // .length, -// // itemBuilder: -// // (context, -// // index) { -// // print( -// // "Indexxxxxx $index"); -// // return Column( -// // children: [ -// // ListTile( -// // subtitle: -// // Text( -// // 'Updated on ${provider.savedList[index].updatedTime}', -// // //style: TextStyle(fontStyle: FontStyle.italic), -// // ), -// // title: Text( -// // provider -// // .savedList[ -// // index] -// // .id, -// // ), -// // trailing: -// // SizedBox( -// // width: -// // 150, -// // child: Row( -// // children: [ -// // IconButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => ViewInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))); -// // }, -// // icon: const Icon( -// // Icons.info_outline, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // IconButton( -// // onPressed: () async { -// // await provider.initConfigData().then({ -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => EditInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))) -// // }); -// // }, -// // icon: const Icon( -// // Icons.edit, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // IconButton( -// // onPressed: () { -// // showDeleteRecordAlertDialog(context, provider.savedList[index].id, provider.savedList[index]); -// // }, -// // icon: const Icon( -// // Icons.delete, -// // size: 24, -// // color: Color.fromARGB(255, 8, 39, 92), -// // ), -// // ), -// // ]), -// // ), -// // onTap: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext context) => ViewInteractionScreen( -// // saveInteraction: provider.savedList[index], -// // ))); -// // }, -// // ), -// // const Divider(), -// // ], -// // ); -// // }); -// // } else { -// // return Container( -// // color: Colors.white, -// // width: MediaQuery.of( -// // context) -// // .size -// // .width, -// // child: Column( -// // children: [ -// // Text( -// // "No records"), -// // ], -// // ), -// // ); -// // } -// // }), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // final provider = -// // Provider.of< -// // InteractionProvider>( -// // context, -// // listen: -// // false); -// // if (getCount( -// // provider -// // .intConfigDataList[ -// // 0] -// // .name, -// // provider) != -// // 0) { -// // provider.savedList -// // .where((element) => -// // element -// // .form == -// // provider -// // .intConfigDataList[ -// // 0] -// // .name) -// // .toList(); -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (BuildContext -// // context) => -// // SavedFormListScreen( -// // formname: -// // provider.intConfigDataList[0].name, -// // ))); -// // } -// // }, -// // child: -// // Text('Show More'), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Speaker Evalution", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(4)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Program Topic', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Speaker Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // speaker.length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${speaker[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // speaker[ -// // index]); -// // }, -// // ); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // speaker[index] -// // [ -// // 'programtopic'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // speaker[index] -// // [ -// // 'speakername'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // // Navigator.push( -// // // context, -// // // MaterialPageRoute( -// // // builder: (_) => -// // // AffiliationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Engagement", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Main Therapeutic Area', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // ), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Date', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // eng.take(2).length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // // =======> Use onSelectChanged for tab -// // print( -// // "message ${eng[index]}"); - -// // // bsheet( -// // // publication_data[ -// // // index]); -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // eng[index]); -// // }, -// // ); -// // }, -// // color: MaterialStateProperty -// // .resolveWith< -// // Color?>((Set< -// // MaterialState> -// // states) { -// // if (index -// // .isEven) { -// // return Colors -// // .grey -// // .withOpacity( -// // 0.1); -// // } -// // return null; -// // }), -// // cells: [ -// // DataCell(Text( -// // eng[index][ -// // 'main thereutic area'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // eng[index][ -// // 'date'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // EngagementList())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "NIH Grants", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'NIH Center', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Organization Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Procedures", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Program Year', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Procedure', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Patents", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Patent Title', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Status', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // //elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: -// // "Patient Referrals", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 17.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: -// // Expanded( -// // child: Text( -// // 'Referred By', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type of Referrals', -// // style: -// // TextStyle(fontWeight: FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => -// // DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: -// // double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular(0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: -// // (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: -// // OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // backgroundColor: -// // Constants.k2color11, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Training", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Institute Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Degree', -// // style: TextStyle( -// // fontWeight: -// // FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular( -// // 0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), // adds spacing between the text and image - -// // ListTileTheme( -// // dense: true, -// // child: Padding( -// // padding: const EdgeInsets.only( -// // left: 8.0, right: 8.0), -// // child: Container( -// // child: Card( -// // margin: EdgeInsets.all(1.0), -// // // elevation: 5, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// // color: Constants.k2color11, -// // child: ExpansionTile( -// // backgroundColor: -// // Constants.k2color11, -// // initiallyExpanded: false, -// // maintainState: true, -// // // backgroundColor: Colors.white, -// // // collapsedBackgroundColor: Color(0xFF2b9af3), -// // onExpansionChanged: -// // (bool expanded) { -// // setState(() { -// // _isExpanded = expanded; -// // }); -// // }, -// // trailing: Icon( -// // _isExpanded -// // ? Icons -// // .keyboard_arrow_up -// // : Icons -// // .keyboard_arrow_down, -// // color: Colors.black), -// // title: Row( -// // mainAxisAlignment: -// // MainAxisAlignment.start, -// // // mainAxisSize: MainAxisSize.min, -// // children: [ -// // Text1( -// // title: "Case", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // const SizedBox( -// // width: 8.0, -// // ), -// // Text1( -// // title: "(3)", -// // txtcolor: -// // Colors.black, -// // fontweight: -// // FontWeight.normal, -// // txtfont: 16.0), -// // ], -// // ), -// // children: [ -// // Scrollbar( -// // child: -// // SingleChildScrollView( -// // scrollDirection: -// // Axis.horizontal, -// // child: Container( -// // constraints: BoxConstraints( -// // minWidth: -// // MediaQuery.of( -// // context) -// // .size -// // .width), -// // color: Colors.white, -// // child: DataTable( -// // showCheckboxColumn: -// // false, -// // columns: const [ -// // DataColumn( -// // label: -// // Expanded( -// // child: Text( -// // 'Name', -// // style: TextStyle( -// // fontWeight: -// // FontWeight -// // .w600), -// // softWrap: -// // true), -// // )), -// // DataColumn( -// // label: Expanded( -// // child: Text( -// // 'Type', -// // style: -// // TextStyle(fontWeight: FontWeight.w600)))), -// // ], -// // rows: List.generate( -// // publication_data -// // .length, -// // (index) => -// // DataRow( -// // onSelectChanged: -// // (value) { -// // print( -// // "message ${publication_data[index]}"); - -// // showModalBottomSheet( -// // useRootNavigator: -// // true, -// // isScrollControlled: -// // false, -// // enableDrag: -// // true, -// // useSafeArea: -// // true, -// // constraints: -// // const BoxConstraints( -// // maxWidth: -// // double -// // .infinity, -// // ), -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .vertical( -// // top: Radius -// // .circular(0), -// // ), -// // ), -// // clipBehavior: -// // Clip.antiAliasWithSaveLayer, -// // context: -// // context, -// // builder: -// // (context) { -// // return bsheet( -// // publication_data[ -// // index]); -// // }, -// // ); -// // }, -// // cells: [ -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'artical_title'] -// // .toString(), -// // softWrap: -// // true)), -// // DataCell(Text( -// // publication_data[index] -// // [ -// // 'author'] -// // .toString(), -// // softWrap: -// // true)), -// // ], -// // ), -// // ), -// // ), -// // ), -// // ), -// // ), -// // Container( -// // color: Colors.white, -// // child: Align( -// // alignment: -// // Alignment.center, -// // child: Padding( -// // padding: -// // const EdgeInsets -// // .all(8.0), -// // child: OutlinedButton( -// // onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: -// // (_) => -// // PublicationsData())); -// // }, -// // child: Text( -// // 'Show More', -// // style: TextStyle( -// // color: Constants -// // .k2color), -// // ), -// // style: -// // OutlinedButton -// // .styleFrom( -// // shape: -// // RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius -// // .circular( -// // 12), -// // ), -// // ), -// // ), -// // ), -// // ), -// // ) -// // ]), -// // ), -// // ), -// // ), -// // ), // adds spacing between the text and image -// // ], -// // ), -// // // Center(child: Icon(Icons.email)), -// // ], -// // ), -// // ), -// // // Other widgets below TabBarView -// // ], -// // ), -// // // ), -// // ), -// // ), -// // ], -// // ), -// // ), -// // ], -// // ), -// // ), -// // // ), -// // ), -// // floatingActionButton: Visibility( -// // visible: true, -// // child: FloatingActionButton( -// // onPressed: () async { -// // // final ConfigDataProvider configDataProvider = -// // // ConfigDataProvider(); - -// // // await configDataProvider.initConfigUIData(); -// // Navigator.push( -// // context, MaterialPageRoute(builder: (context) => FormList())); -// // }, -// // foregroundColor: Colors.white, -// // backgroundColor: const Color.fromARGB(255, 0, 71, 132), -// // child: new Icon(Icons.add), -// // ), -// // ), -// // ); -// // } - -// // Future getCount(String form, InteractionProvider provider) async { -// // await provider.getRecords(); - -// // return provider.savedList.where((element) => element.form == form).length; -// // } - -// // buidCard() { -// // Text("Hiii"); -// // } - -// // showDeleteRecordAlertDialog( -// // BuildContext context, String record, SaveInteraction saveInteraction) { -// // // set up the buttons -// // ViewInteractionProvider provider = -// // Provider.of(context, listen: false); -// // Widget cancelButton = TextButton( -// // child: const Text("YES"), -// // onPressed: () async { -// // await provider.deleteRecord(saveInteraction).then((value) { -// // _displaySnackBar("Deleted sucessfully!"); -// // Navigator.of(context).pop(); -// // }); -// // }, -// // ); -// // Widget continueButton = TextButton( -// // child: const Text("NO"), -// // onPressed: () { -// // Navigator.of(context).pop(); -// // }, -// // ); - -// // // set up the AlertDialog -// // AlertDialog alert = AlertDialog( -// // title: const Text(""), -// // content: Text("Are you sure you want to delete the record $record ?"), -// // actions: [ -// // cancelButton, -// // continueButton, -// // ], -// // ); - -// // // show the dialog -// // showDialog( -// // context: context, -// // builder: (BuildContext context) { -// // return alert; -// // }, -// // ); -// // } - -// // _displaySnackBar(String msg) { -// // final snackBar = SnackBar( -// // content: Text( -// // msg, -// // style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), -// // )); -// // ScaffoldMessenger.of(context).showSnackBar(snackBar); -// // //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); -// // } - -// // Widget makeDismissible({required DraggableScrollableSheet child}) { -// // return GestureDetector( -// // behavior: HitTestBehavior.opaque, -// // onTap: () => Navigator.of(context).pop(), -// // child: GestureDetector( -// // onTap: () {}, -// // child: child, -// // ), -// // ); -// // } - -// // void bottomshet(affiliation_data) { -// // // print("Aff_index_data: ${affiliation_data}"); -// // showModalBottomSheet( -// // // isScrollControlled: -// // // true, - -// // context: context, - -// // useRootNavigator: true, -// // isScrollControlled: false, -// // enableDrag: true, -// // useSafeArea: true, -// // constraints: const BoxConstraints( -// // maxWidth: double.infinity, -// // ), - -// // shape: RoundedRectangleBorder( -// // borderRadius: BorderRadius.vertical( -// // top: Radius.circular(0), -// // ), -// // ), -// // clipBehavior: Clip.antiAliasWithSaveLayer, -// // // sheetAnimationStyle: _animationStyle, -// // builder: (BuildContext context) { -// // return -// // // makeDismissible( -// // // child: -// // DraggableScrollableSheet( -// // expand: false, -// // builder: (BuildContext context, ScrollController scrollController) { -// // return Container( -// // width: MediaQuery.of(context).size.width, -// // //color: Colors.white, -// // color: Color.fromARGB(255, 246, 248, 252), - -// // // decoration: -// // // BoxDecoration(borderRadius: BorderRadius.circular(10)), -// // // child: ListView( -// // // children: [ - -// // // ], -// // // ), - -// // 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: [ -// // // Row( -// // // children: [ -// // // Text( -// // // "Affiliation", -// // // style: TextStyle(fontSize: 20.0), -// // // ) -// // // ], -// // // ), -// // SizedBox( -// // height: 18.0, -// // ), -// // Row( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: GestureDetector( -// // onTap: () async { -// // final ConfigDataProvider -// // configDataProvider = -// // ConfigDataProvider(); -// // await configDataProvider -// // .initConfigUIDataEng(); - -// // final provider = -// // Provider.of( -// // context, -// // listen: false); - -// // if (getCount( -// // provider.intConfigDataList[index] -// // .name, -// // provider) != -// // 0) { -// // provider.savedList -// // .where((element) => -// // element.form == -// // provider -// // .intConfigDataList[index] -// // .name) -// // .toList(); -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: -// // (BuildContext context) => -// // SavedFormListScreen( -// // formname: provider -// // .intConfigDataList[ -// // index] -// // .name, -// // ))); -// // } -// // // Navigator.push( -// // // context, -// // // MaterialPageRoute( -// // // builder: (context) => -// // // const InteractionListScreen())); -// // }, -// // child: Text( -// // affiliation_data['org_name'], -// // style: TextStyle( -// // fontSize: 18.0, -// // color: Colors.grey[700]), -// // ), -// // ), -// // ) -// // ], -// // ), -// // SizedBox( -// // height: 18.0, -// // ), -// // Divider(), -// // SizedBox( -// // height: 8.0, -// // ), - -// // Column( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // "Department", -// // style: TextStyle(fontSize: 13.0), -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // affiliation_data['dept'], -// // style: TextStyle( -// // fontSize: 15.0, -// // color: Colors.grey[700]), -// // ), -// // ) -// // ], -// // ), -// // Column( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only( -// // left: 18.0, top: 18.0), -// // child: Text( -// // "Role", -// // style: TextStyle(fontSize: 13.0), -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // affiliation_data['role'], -// // style: TextStyle( -// // fontSize: 15.0, -// // color: Colors.grey[700]), -// // ), -// // ) -// // ], -// // ), -// // Column( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only( -// // left: 18.0, top: 18.0), -// // child: Text( -// // "Time Frame", -// // style: TextStyle(fontSize: 13.0), -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // affiliation_data['time_frame'], -// // style: TextStyle( -// // fontSize: 15.0, -// // color: Colors.grey[700]), -// // ), -// // ) -// // ], -// // ), -// // Column( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only( -// // left: 18.0, top: 18.0), -// // child: Text( -// // "Oraganization Type", -// // style: TextStyle(fontSize: 13.0), -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // affiliation_data['org_type'], -// // style: TextStyle( -// // fontSize: 15.0, -// // color: Colors.grey[700]), -// // ), -// // ) -// // ], -// // ), -// // Column( -// // crossAxisAlignment: CrossAxisAlignment.start, -// // children: [ -// // Padding( -// // padding: const EdgeInsets.only( -// // left: 18.0, top: 18.0), -// // child: Text( -// // "Eng Type", -// // style: TextStyle(fontSize: 13.0), -// // ), -// // ), -// // Padding( -// // padding: const EdgeInsets.only(left: 18.0), -// // child: Text( -// // affiliation_data['emg_type'], -// // style: TextStyle( -// // fontSize: 15.0, -// // color: Colors.grey[700]), -// // ), -// // ) -// // ], -// // ), -// // ], -// // ); -// // }, -// // ), -// // ), -// // ], -// // ), -// // ); -// // }, -// // ); -// // //); -// // }, -// // ); -// // } - -// // Widget _buildPaginationDots() { -// // return Container( -// // padding: EdgeInsets.symmetric(vertical: 8.0), -// // child: Row( -// // mainAxisAlignment: MainAxisAlignment.center, -// // children: List.generate(10, (index) { -// // return Container( -// // margin: EdgeInsets.symmetric(horizontal: 4.0), -// // width: 8.0, -// // height: 8.0, -// // decoration: BoxDecoration( -// // shape: BoxShape.circle, -// // color: 1 == index ? Colors.blue : Colors.grey, -// // ), -// // ); -// // }), -// // ), -// // ); -// // } - -// // @override -// // void dispose() { -// // //_pageController.dispose(); -// // super.dispose(); -// // } -// // } diff --git a/lib/contacts_module/ui_screen/new_viewinteraction.dart b/lib/contacts_module/ui_screen/new_viewinteraction.dart index 62aa3e7..48c2044 100644 --- a/lib/contacts_module/ui_screen/new_viewinteraction.dart +++ b/lib/contacts_module/ui_screen/new_viewinteraction.dart @@ -1,10 +1,3 @@ -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// import 'package:discover_module/ui_screen/interactionform/util.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:discover_module/contacts_module/constants.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; diff --git a/lib/contacts_module/ui_screen/newformlist.dart b/lib/contacts_module/ui_screen/newformlist.dart index 9b1be27..048face 100644 --- a/lib/contacts_module/ui_screen/newformlist.dart +++ b/lib/contacts_module/ui_screen/newformlist.dart @@ -1,11 +1,3 @@ -// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; -// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -// import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; -// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -// import 'package:discover_module/ui_screen/medical_insight.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/configprovider.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionlistscreen.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; @@ -97,26 +89,6 @@ class _FormListState extends State { trailing: const Icon(Icons.arrow_forward_ios), ), Divider(), - // ListTile( - // title: const Text( - // "Interaction", - // style: TextStyle(fontSize: 18.0), - // ), - // onTap: () async { - // print("I am Interaction"); - // final ConfigDataProvider configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider.initConfigUIData(); - // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => InteractionListScreen())); - // }, - // trailing: const Icon(Icons.arrow_forward_ios), - // ), - ListTile( title: const Text( "Interaction", @@ -126,16 +98,6 @@ class _FormListState extends State { print( "I am Interaction:${index}, ${provider.intConfigDataList[index].name}"); - // final ConfigDataProvider configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider.initConfigUIData(); - // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => InteractionListScreen())); - if (provider.intConfigDataList.length == 1) { setState(() {}); @@ -167,7 +129,6 @@ class _FormListState extends State { }, trailing: const Icon(Icons.arrow_forward_ios), ), - Divider(), ListTile( title: const Text( @@ -186,9 +147,7 @@ class _FormListState extends State { }, trailing: const Icon(Icons.arrow_forward_ios), ), - const Divider(), - ListTile( title: const Text( "Medical Insight", diff --git a/lib/contacts_module/ui_screen/ranking.dart b/lib/contacts_module/ui_screen/ranking.dart deleted file mode 100644 index 40414b2..0000000 --- a/lib/contacts_module/ui_screen/ranking.dart +++ /dev/null @@ -1,576 +0,0 @@ -// import 'dart:convert'; -// import 'dart:io'; -// // import 'dart:js_interop'; - -// import 'package:discover_module/custom_widget/floating_btn.dart'; -// import 'package:discover_module/custom_widget/show_alert.dart'; -// import 'package:discover_module/hive_fun.dart'; -// import 'package:discover_module/provider_class/hcp%20_provider.dart'; -// import 'package:discover_module/ui_screen/contacts.dart'; -// import 'package:discover_module/ui_screen/filters_menu.dart'; -// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -// import 'package:flutter/foundation.dart'; -// import 'package:flutter/foundation.dart' show kIsWeb; -// import 'package:flutter/material.dart'; -// import 'package:hive_flutter/hive_flutter.dart'; -// import 'package:open_file/open_file.dart'; -// import 'package:path_provider/path_provider.dart'; -// import 'package:provider/provider.dart'; -// import 'package:syncfusion_flutter_xlsio/xlsio.dart'; -// import 'package:universal_html/html.dart' show AnchorElement; - -// List<_Row> _rows = []; -// bool isOnline1 = false; - -// class Ranking extends StatefulWidget { -// @override -// State createState() => _RankingState(); -// } - -// class _RankingState extends State { -// late _DataSource _dataSource; - -// List selectedno = []; -// @override -// void initState() { -// super.initState(); -// print("hii_initState"); -// setupConnectivityListener(); - -// gethcpdata(); -// _dataSource = _DataSource(context); // Initialize _DataSource -// } - -// NetworkConnectivity networkConnectivity = NetworkConnectivity(); - -// Future setupConnectivityListener() async { -// while (true) { -// bool isOnline = await networkConnectivity.isInternetAvailable(); -// print('Internet available: $isOnline'); -// // Perform actions based on connectivity status -// await Future.delayed(Duration(seconds: 10)); - - -// } -// } - -// @override -// Widget build(BuildContext context) { -// return SafeArea( -// child: Scaffold( -// body: ListView( -// padding: const EdgeInsets.all(3), -// children: [ -// PaginatedDataTable( -// header: const Text( -// 'HCP RANKING', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 18.0, -// fontStyle: FontStyle.normal), -// ), -// showFirstLastButtons: true, -// showEmptyRows: false, -// showCheckboxColumn: true, -// actions: [ -// IconButton( -// onPressed: () { -// _createExcel(); -// }, -// icon: const Icon(Icons.download, -// color: Color.fromARGB(255, 0, 71, 132))) -// ], -// rowsPerPage: 5, -// columns: const [ -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Name', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Tier', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Rank', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Score', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Event', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Affliations', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Publications', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// DataColumn( -// label: FittedBox( -// fit: BoxFit.scaleDown, -// child: Text('Trails', -// style: TextStyle( -// fontWeight: FontWeight.bold, -// fontSize: 14.0, -// fontStyle: FontStyle.normal)), -// )), -// ], -// source: _dataSource, -// ), -// ], -// ), -// floatingActionButton: Visibility( -// visible: true, -// child: FloatingBtn( -// icon: Icons.add, -// title: "add", -// onTap: () async { -// List selectedRowIds = _dataSource.getSelectedRowIds(); -// // Do something with selectedRowIds -// print('Selected Row IDstrndsss: $selectedRowIds'); - -// if (selectedRowIds.isEmpty) { -// showDialog( -// context: context, -// builder: (_) { -// return Alert( -// data: "Please Select the user", -// onPressed: () { -// Navigator.of(context).pop(); -// print('OK button pressed'); -// }, -// ); -// }); -// } else { -// for (int i = 0; i < selectedRowIds.length; i++) { -// print('The id id : ${selectedRowIds[i]}'); -// //List<_Row> _rows = []; - -// final row = _rows[selectedRowIds[i] - 1]; - -// print( -// "checking_value_istrends: ${selectedRowIds[i]},${row.valueA}"); - -// // selectedno.add(selectedRowIds[i]); - -// // HiveFunctions.addno(selectedRowIds[i]); - -// // _contactbox.put(i, selectedRowIds[i]); - -// HiveFunctions.createUser({ -// "id": selectedRowIds[i], -// "name": row.valueA, -// "org": row.org, -// "addr": row.addr, -// "phone": row.mno, -// "phone_no": row.mno, -// "email": row.valueC, -// "affiliations_count": row.valueG, -// "events_count": row.valueF, -// "publications_count": row.valueH, -// "trail_count": "1", -// "summarry": row.smry, -// "license_no": row.lin, -// "p_suffix": row.suffix, -// "speciality": row.spl, -// "sub_speciality": row.sub_spl, -// }); -// } -// showDialog( -// context: context, -// builder: (_) { -// return Alert( -// data: "User Added Successfully", -// onPressed: () { -// Navigator.of(context).pop(); -// // Navigator.push(context, -// // MaterialPageRoute(builder: (_) => Contacts())); -// }, -// ); -// }); -// } -// }, -// )), -// ), -// ); -// } - -// Future _createExcel() async { -// //Create an Excel document. - -// //Creating a workbook. -// final Workbook workbook = Workbook(); -// //Accessing via index -// final Worksheet sheet = workbook.worksheets[0]; - -// // sheet.getRangeByName('A1').setText('pooja'); -// ///////////////////////////////////////////////////////////////////////////// - -// sheet.getRangeByName('A1').setText('Name'); -// sheet.getRangeByName('A2').setText('Gerosa, Gino'); -// sheet.getRangeByName('A3').setText('Gerosa, Gino'); -// sheet.getRangeByName('A4').setText('Gerosa, Gino'); - -// final Style headingStyle = workbook.styles.add('HeadingStyle'); -// headingStyle.bold = true; -// headingStyle.hAlign = HAlignType.center; -// headingStyle.wrapText = true; -// sheet.getRangeByName('B1').setText('Tier'); -// sheet.getRangeByName('B2').setText("Tier1"); -// sheet.getRangeByName('B3').setText("Tier1"); -// sheet.getRangeByName('B4').setText("Tier1"); -// sheet.getRangeByName('C1').setText('Rank'); -// sheet.getRangeByName('C2').setNumber(1); -// sheet.getRangeByName('C3').setNumber(1); -// sheet.getRangeByName('C4').setNumber(1); -// sheet.getRangeByName('D1').setText('Score'); -// sheet.getRangeByName('D2').setNumber(0); -// sheet.getRangeByName('D3').setNumber(0); -// sheet.getRangeByName('D4').setNumber(0); - -// sheet.getRangeByName('E1').setText('Event'); -// sheet.getRangeByName('E2').setNumber(0); -// sheet.getRangeByName('E3').setNumber(0); -// sheet.getRangeByName('E4').setNumber(0); - -// sheet.getRangeByName('F1').setText('Affiliations'); -// sheet.getRangeByName('F2').setNumber(0); -// sheet.getRangeByName('F3').setNumber(0); -// sheet.getRangeByName('F4').setNumber(0); - -// sheet.getRangeByName('G1').setText('Publications'); -// sheet.getRangeByName('G2').setNumber(0); -// sheet.getRangeByName('G3').setNumber(0); -// sheet.getRangeByName('G4').setNumber(0); - -// sheet.getRangeByName('H1').setText('Trails'); -// sheet.getRangeByName('H2').setNumber(0); -// sheet.getRangeByName('H3').setNumber(0); -// sheet.getRangeByName('H4').setNumber(0); - -// //Defining a global style with properties. -// final Style globalStyle = workbook.styles.add('globalStyle'); -// //globalStyle.backColor = '#37D8E9'; -// globalStyle.fontName = 'Times New Roman'; -// globalStyle.fontSize = 12; -// // globalStyle.fontColor = '#C67878'; -// globalStyle.fontColor = '#C67878'; - -// globalStyle.italic = true; -// globalStyle.bold = true; -// globalStyle.underline = true; -// globalStyle.wrapText = true; -// globalStyle.hAlign = HAlignType.center; -// globalStyle.vAlign = VAlignType.center; -// globalStyle.borders.all.lineStyle = LineStyle.thick; -// // globalStyle.borders.all.color = '#9954CC'; - -// final Style globalStyle1 = workbook.styles.add('globalStyle1'); -// globalStyle1.fontSize = 14; -// // globalStyle1.fontColor = '#362191'; -// globalStyle1.hAlign = HAlignType.center; -// globalStyle1.vAlign = VAlignType.center; -// globalStyle1.borders.bottom.lineStyle = LineStyle.thin; -// //globalStyle1.borders.bottom.color = '#829193'; -// globalStyle1.numberFormat = '0.00'; - -// final List bytes = workbook.saveSync(); - -// print("hii"); - -// if (kIsWeb) { -// AnchorElement( -// href: -// 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}') -// ..setAttribute('download', 'Output.xlsx') -// ..click(); -// } else { -// // final String path = (await getApplicationDocumentsDirectory()).path; -// //final directory = await getExternalStorageDirectory(); - -// Directory? directory = Platform.isAndroid -// ? await getExternalStorageDirectory() -// : await getApplicationDocumentsDirectory(); - -// final path = directory!.path; - -// final String filename = -// Platform.isWindows ? '$path\\Output.xlsx' : '$path/Output.xlsx'; -// // final String filename = '$path/Output.xlsx'; -// final File file = File(filename); -// await file.writeAsBytes(bytes, flush: true); -// OpenFile.open(filename); -// } -// } - -// void gethcpdata() { -// // final data = Provider.of(context, listen: false); -// } -// } - -// class _Row { -// _Row({ -// required this.identifier, -// required this.valueA, -// required this.valueC, -// required this.valueD, -// required this.valueE, -// required this.valueF, -// required this.valueG, -// required this.valueH, -// required this.valueI, -// required this.selected, -// this.org, -// this.mno, -// this.smry, -// this.lin, -// this.suffix, -// this.spl, -// this.sub_spl, -// this.addr, // Add selected parameter -// }); - -// final int identifier; -// final String valueA; -// final String valueC; -// final String valueD; -// final String valueE; -// final String valueF; -// final String valueG; -// final String valueH; -// final String valueI; -// bool selected = false; -// String? org; -// String? mno; -// String? smry; -// String? lin; -// String? suffix; -// String? spl; -// String? sub_spl; -// String? addr; -// } - -// class _DataSource extends DataTableSource { -// final BuildContext context; - -// // List<_Row> _rows = []; -// // late List _selectedRowsIndexes = []; // List to track selected rows -// final List _selectedRowIds = []; - -// List list = []; - -// _DataSource(this.context) { -// render_hcpdata(); -// // _rows = <_Row>[ -// // for (int i = 0; i < 20; i++) -// // _Row( -// // i, 'Gerosa, Gino', 'Tier1', '1', '0', '0', '0', '0', '0', check(i)), -// // ]; -// // } -// } - -// List getSelectedRowIds() { -// return _selectedRowIds; // Return a copy to prevent direct modification -// } - -// int _selectedCount = 0; - -// @override -// DataRow? getRow(int index) { -// assert(index >= 0); -// if (index >= _rows.length) return null; -// final row = _rows[index]; -// return DataRow.byIndex( -// index: index, -// selected: row.selected, -// onSelectChanged: (value) { -// if (row.selected != value) { -// // _selectedCount += value! ? 1 : -1; -// // assert(_selectedCount >= 0); -// row.selected = value!; - -// if (value) { -// print("Selected"); -// _selectedRowIds.add(row.identifier); // Add the row ID to the list -// print("Selected_selectedRowIds :$_selectedRowIds"); -// } else { -// _selectedRowIds -// .remove(row.identifier); // Remove the row ID from the list -// } -// notifyListeners(); - -// print("Selectedddd_is $value"); -// print("Selectedddd_value ${row.valueA}"); -// } -// }, -// cells: [ -// DataCell( -// Text(row.valueA), -// onTap: () { -// print("hiii Data cell tap ${row}"); - -// // Navigator.push( -// // context, MaterialPageRoute(builder: (context) => Profile())); -// }, -// ), -// DataCell(Text(row.valueC)), -// DataCell(Text(row.valueD.toString())), -// DataCell(Text(row.valueE)), -// DataCell(Text(row.valueF)), -// DataCell(Text(row.valueG)), -// DataCell(Text(row.valueH)), -// DataCell(Text(row.valueI)), -// ], -// ); -// } - -// @override -// int get rowCount => _rows.length; - -// @override -// bool get isRowCountApproximate => false; - -// @override -// int get selectedRowCount => _selectedCount; - -// bool check(int i) { -// // print("I_am_i: $i"); -// // print("_selectedRowIds_i: ${HiveFunctions.getno()}"); - -// // //HiveFunctions.getno(); -// // if (HiveFunctions.getno().contains(i)) { -// // print("Iam_in: $i"); -// // return true; -// // } - -// return false; -// } - -// Future render_hcpdata() async { -// NetworkConnectivity networkConnectivity = NetworkConnectivity(); -// // bool isOnline = await networkConnectivity.isInternetAvailable(); - -// bool isOnline = await networkConnectivity.isInternetAvailable(); -// print('Internet available: $isOnline'); -// print("RankingPage_isOnline: $isOnline"); - -// if (isOnline) { -// final hcpdata = Provider.of(context, listen: false); - -// // await hcpdata.getHCPProvider(); - -// final hcplist = hcpdata.list; - -// print("LookingHcpList: $hcplist"); - -// // _rows = <_Row>[ -// // for (int i = 0; i < 20; i++) -// // _Row( -// // i, 'Gerosa, Gino', 'Tier1', '1', '0', '0', '0', '0', '0', check(i)), -// // ]; - -// _rows = hcplist -// .map((e) => _Row( -// identifier: e['id'], -// valueA: e['name'], -// valueC: e['email'], -// valueD: e['rank'].toString(), -// valueE: e['score'].toString(), -// valueF: e['events_count'].toString(), -// valueG: e['affiliations_count'].toString(), -// valueH: e['publications_count'].toString(), -// valueI: '0', -// selected: check(e['id']), -// org: "Aissel", -// mno: e['phone_no'].toString(), -// smry: e['summarry'], -// lin: e['license_no'].toString(), -// suffix: e['p_suffix'], -// spl: e['speciality'], -// sub_spl: e['sub_speciality'], -// addr: e['addr'], -// )) -// .toList(); -// notifyListeners(); -// } else { -// print("get_Storeddata: ${HiveFunctions.gethcpdata()}"); - -// list = HiveFunctions.gethcpdata().toList(); -// // debugPrint(HiveFunctions.gethcpdata()); - -// // List offlinedata = HiveFunctions.gethcpdata(); -// print("offline_data_is: "); - -// print("offline_data_is: $list"); - -// _rows = list -// .map((e) => _Row( -// identifier: e['id'], -// valueA: e['name'], -// valueC: e['email'], -// valueD: e['rank'].toString(), -// valueE: e['score'].toString(), -// valueF: e['events_count'].toString(), -// valueG: e['affiliations_count'].toString(), -// valueH: e['publications_count'].toString(), -// valueI: '0', -// selected: check(e['id']), -// org: "Aissel", -// mno: e['phone_no'].toString(), -// smry: e['sumry'], -// lin: e['licno'].toString(), -// suffix: e['suffix'], -// spl: e['spl'], -// sub_spl: e['sub_sp'], -// )) -// .toList(); -// notifyListeners(); -// } -// } - -// @override -// void dispose() { -// // TODO: implement dispose -// super.dispose(); -// } -// } diff --git a/lib/contacts_module/ui_screen/rising_stars.dart b/lib/contacts_module/ui_screen/rising_stars.dart deleted file mode 100644 index 2309fd4..0000000 --- a/lib/contacts_module/ui_screen/rising_stars.dart +++ /dev/null @@ -1,235 +0,0 @@ -// import 'package:discover_module/custom_widget/floating_btn.dart'; -// import 'package:discover_module/custom_widget/show_alert.dart'; -// import 'package:discover_module/hive_fun.dart'; -// import 'package:discover_module/ui_screen/ranking.dart'; -import 'package:discover_module/contacts_module/custom_widget/floating_btn.dart'; -import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; -import 'package:discover_module/contacts_module/hive_fun.dart'; -import 'package:flutter/material.dart'; - -class RisingStar extends StatefulWidget { - const RisingStar({super.key}); - - @override - State createState() => RisingStarState(); -} - -class RisingStarState extends State { - late _DataSource _dataSource; - - @override - void initState() { - // TODO: implement initState - super.initState(); - - _dataSource = _DataSource(context); - } - - @override - Widget build(BuildContext context) { - return SafeArea( - child: Scaffold( - body: ListView( - padding: const EdgeInsets.all(3), - children: [ - PaginatedDataTable( - header: const Text( - 'HCP RANKING', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - fontStyle: FontStyle.normal), - ), - showFirstLastButtons: true, - showEmptyRows: false, - showCheckboxColumn: true, - // actions: const [Text("jii")], - rowsPerPage: 5, - columns: const [ - DataColumn( - label: Text('Name', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Specialty', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Rank', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Discover Rank', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Indicator', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Previous year \n (2018-2022)', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Current year \n (2022-2024)', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - DataColumn( - label: Text('Status', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.0, - fontStyle: FontStyle.normal))), - ], - source: _dataSource, - ), - ], - ), - floatingActionButton: Visibility( - visible: true, - child: FloatingBtn( - icon: Icons.add, - title: "add", - onTap: () { - List selectedRowIds = _dataSource.getSelectedRowIds(); - // Do something with selectedRowIds - print('Selected Row IDstrndsss: $selectedRowIds'); - - for (int i = 0; i < selectedRowIds.length; i++) { - print("checking_value_istrends: ${selectedRowIds[i]}"); - - // _contactbox.put(i, selectedRowIds[i]); - - HiveFunctions.createUser({ - "name": selectedRowIds[i], - "org": "Azienda Ospedaliera di Padova", - "adrr": "Via Giustiniani 2, Padova, Veneto 35128, Italy", - "phone": "+390498212410X12", - "Pphone": "+390498212410X12", - "email": "Gerosa,Gino@gmail.com", - "affno": "75", - "eveno": "8", - "pubno": "251", - "trailno": "1" - }); - } - showDialog( - context: context, - builder: (_) { - return Alert( - data: "User Added Successfully", - onPressed: () { - Navigator.of(context).pop(); - }, - ); - }); - }, - )), - ), - ); - } -} - -class _Row { - _Row(this.i, this.valueA, this.valueC, this.valueD, this.valueE, this.valueF, - this.valueG, this.valueH, this.valueI); - - final int i; - final String valueA; - final String valueC; - final String valueD; - final String valueE; - final String valueF; - final String valueG; - final String valueH; - final String valueI; - - bool selected = false; -} - -class _DataSource extends DataTableSource { - final BuildContext context; - late List<_Row> _rows; - final List _selectedRowIds = []; - _DataSource(this.context) { - _rows = <_Row>[ - for (int i = 0; i < 20; i++) - _Row(i, 'Gerosa, Gino', 'Cardiology', '1', '0', '0', 'Tier 1', 'Tier 1', - ''), - ]; - //} - } - List getSelectedRowIds() { - return _selectedRowIds; // Return a copy to prevent direct modification - } - - int _selectedCount = 0; - - @override - DataRow? getRow(int index) { - assert(index >= 0); - if (index >= _rows.length) return null; - final row = _rows[index]; - return DataRow.byIndex( - index: index, - selected: row.selected, - onSelectChanged: (value) { - // print("hii"); - // Navigator.push( - - if (row.selected != value) { - // _selectedCount += value! ? 1 : -1; - // assert(_selectedCount >= 0); - row.selected = value!; - - if (value) { - print("Selected"); - _selectedRowIds.add(row.valueA); // Add the row ID to the list - print("Selected_selectedRowIds :$_selectedRowIds"); - } else { - _selectedRowIds - .remove(row.valueA); // Remove the row ID from the list - } - notifyListeners(); - - print("Selectedddd_is $value"); - print("Selectedddd_value ${row.valueA}"); - } - // context, MaterialPageRoute(builder: (context) => Profile())); - }, - cells: [ - DataCell(Text(row.valueA)), - DataCell(Text(row.valueC)), - DataCell(Text(row.valueD.toString())), - DataCell(Text(row.valueE)), - DataCell(Text(row.valueF)), - DataCell(Text(row.valueG)), - DataCell(Text(row.valueH)), - DataCell(Text(row.valueI)), - ], - ); - } - - @override - int get rowCount => _rows.length; - - @override - bool get isRowCountApproximate => false; - - @override - int get selectedRowCount => _selectedCount; -} diff --git a/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart index 61266dd..f8587fe 100644 --- a/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart @@ -121,7 +121,7 @@ class _SavedActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -132,7 +132,7 @@ class _SavedActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -274,7 +274,7 @@ class _SavedActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -285,7 +285,7 @@ class _SavedActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -436,7 +436,7 @@ class _SavedActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -445,7 +445,7 @@ class _SavedActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up @@ -592,7 +592,7 @@ class _SavedActivitiesState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( initiallyExpanded: false, maintainState: true, @@ -601,7 +601,7 @@ class _SavedActivitiesState extends State { _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up diff --git a/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart index c9b4b1e..d4796b5 100644 --- a/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart @@ -194,45 +194,50 @@ class SavedContacts1State extends State { // backgroundColor: const Color.fromARGB(255, 246, 248, 252), // backgroundColor: Color.fromARGB(255, 255, 242, 0.92), + appBar: AppBar( - automaticallyImplyLeading: false, - title: isSearchClickd - ? Container( - height: 40, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(5.0)), - child: TextField( - controller: _searchController, - onChanged: (value) { - setState(() {}); - }, - decoration: InputDecoration( - fillColor: Constants.k2color, - contentPadding: EdgeInsets.symmetric(vertical: 9.0), - border: OutlineInputBorder(), - hintText: "Search", - // labelText: ' Search', - prefixIcon: Icon( - Icons.search, - ), - ), - ), - ) - : Text("Offline Contacts"), - actions: [ - IconButton( - onPressed: () { - setState(() { - isSearchClickd = !isSearchClickd; - if (!isSearchClickd) { - _searchController.clear(); - } - }); - }, - icon: Icon(isSearchClickd ? Icons.close : Icons.search)) - ], + title: Text('Saved Profiles'), ), + // appBar: AppBar( + // automaticallyImplyLeading: false, + // title: isSearchClickd + // ? Container( + // height: 40, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(5.0)), + // child: TextField( + // controller: _searchController, + // onChanged: (value) { + // setState(() {}); + // }, + // decoration: InputDecoration( + // fillColor: Constants.k2color, + // contentPadding: EdgeInsets.symmetric(vertical: 9.0), + // border: OutlineInputBorder(), + // hintText: "Search", + // // labelText: ' Search', + // prefixIcon: Icon( + // Icons.search, + // ), + // ), + // ), + // ) + // : Text("Offline Contacts"), + // actions: [ + // IconButton( + // onPressed: () { + // setState(() { + // isSearchClickd = !isSearchClickd; + // if (!isSearchClickd) { + // _searchController.clear(); + // } + // }); + // }, + // icon: Icon(isSearchClickd ? Icons.close : Icons.search)) + // ], + // ), + endDrawer: Drawer( //width: MediaQuery.of(context).size.width * 99.2, child: listdata(), diff --git a/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart index f95b7a4..fa42ad2 100644 --- a/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart @@ -22,6 +22,7 @@ import 'package:discover_module/contacts_module/ui_screen/engagementtab.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart'; import 'package:discover_module/contacts_module/ui_screen/location_tab.dart'; import 'package:discover_module/contacts_module/ui_screen/newformlist.dart'; import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_activity.dart'; @@ -241,7 +242,8 @@ class SavedNewProfile1State extends State //controller: _tabController, children: [ //LocationTab(text: widget.text.id), - LocationTab(text: 1, offline: 1), + //LocationTab(text: 1, offline: 1), + LocationK2Tab(text: 1, offline: 1), SavedActivities(text: widget.text.id), // SavedActivities(text: widget.text.id), EngagementTab(text: 1, offline: 1), @@ -617,7 +619,7 @@ class SavedNewProfile1State extends State shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), - color: Constants.k2color11, + color: Constants.bgwhitecolor, child: ExpansionTile( // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { @@ -625,7 +627,7 @@ class SavedNewProfile1State extends State _isExpanded = expanded; }); }, - backgroundColor: Constants.k2color11, + backgroundColor: Constants.bgwhitecolor, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up diff --git a/lib/contacts_module/ui_screen/show_morek2/events_showmorek2.dart b/lib/contacts_module/ui_screen/show_morek2/events_showmorek2.dart new file mode 100644 index 0000000..5ce4cb6 --- /dev/null +++ b/lib/contacts_module/ui_screen/show_morek2/events_showmorek2.dart @@ -0,0 +1,252 @@ +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_event_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class Events2ShowMore extends StatefulWidget { + Events2ShowMore({required this.text, Key? key}) : super(key: key); + final int text; + + @override + State createState() => _Events2ShowMoreState(); +} + +class _Events2ShowMoreState extends State { + //List evelist = []; + + // var _items = []; + var _isLoading = false; + + // var events; + + late EventProviderK2 eventProviderK2; + @override + void initState() { + // TODO: implement initState + super.initState(); + + // affdata(); + eventProviderK2 = EventProviderK2(); + } + + @override + void dispose() { + // TODO: implement dispose + // eventProviderK2.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Events'), + ), + body: ChangeNotifierProvider( + create: (context) => eventProviderK2..geteventsdatawithid(), + child: Consumer(builder: (context, eventss, child) { + return NotificationListener( + onNotification: (ScrollNotification scrollinfo) { + if (scrollinfo.metrics.pixels == + scrollinfo.metrics.maxScrollExtent && + !eventProviderK2.isLoading) { + eventss.geteventsdatawithid(); + } + return false; + }, + child: ListView.builder( + itemCount: eventss.eventsListpagination.length + + (eventss.hasMore ? 1 : 0), + // +(events.hasMore ? 1 : 0), + itemBuilder: (context, index) { + if (index == eventss.eventsListpagination.length) { + return const Center(child: CircularProgressIndicator()); + } + var data = eventss.eventsListpagination[index]; + // print("I_amCheckingggggg12345: ${data.name}"); + return ListTile( + title: Text1(title: "Event : " + data.name), + subtitle: + Text1(title: "Created by : " + data.createdByUser), + ); + })); + }), + )); + } +} + + + + + + + + + + +// import 'package:discover_module/contacts_module/custom_widget/text.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_event_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; + +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; +// import 'package:very_good_infinite_list/very_good_infinite_list.dart'; + +// class Events2ShowMore extends StatefulWidget { +// Events2ShowMore({required this.text, Key? key}) : super(key: key); +// final int text; + +// @override +// State createState() => _Events2ShowMoreState(); +// } + +// class _Events2ShowMoreState extends State { +// List evelist = []; + +// // var _items = []; +// var _isLoading = false; + +// var events; +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); + +// affdata(); +// } + +// affdata() async { +// // var location = Provider.of(context, listen: false); +// // await location.locationinfo(widget.text); +// // final loclist = location.locationlist; + +// // setState(() { +// // locationList = loclist; +// // }); + +// events = Provider.of(context, listen: false); +// await events.geteventsdatawithid(widget.text); +// final eventlist = events.eventsListpagination; +// print("getting_listttt_ofEvent: ${eventlist}"); + +// setState(() { +// evelist = eventlist; +// }); +// } + +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar( +// title: Text('Phone Numbers'), +// ), +// body: Consumer(builder: (context, loc, child) { +// return NotificationListener( +// onNotification: (ScrollNotification scrollinfo) { +// if (scrollinfo.metrics.pixels == +// scrollinfo.metrics.maxScrollExtent) { +// events.geteventsdatawithid(widget.text); +// } +// return false; +// }, +// child: ListView.builder( +// itemCount: evelist.length + (events.hasMore ? 1 : 0), +// itemBuilder: (context, index) { +// if (index == evelist.length) { +// return const Center(child: CircularProgressIndicator()); +// } +// var data = evelist[index]; +// // print("I_amCheckingggggg12345: ${data.name}"); +// return ListTile( +// title: Text1(title: data.name), +// ); +// })); +// }) + +// // Scrollbar( +// // child: SingleChildScrollView( +// // scrollDirection: Axis.horizontal, +// // child: SingleChildScrollView( +// // scrollDirection: Axis.vertical, +// // child: Container( +// // constraints: +// // BoxConstraints(minWidth: MediaQuery.of(context).size.width), +// // color: Colors.white, +// // child: DataTable( +// // showCheckboxColumn: false, +// // columns: const [ +// // DataColumn( +// // label: Expanded( +// // child: Text('phone Type', +// // style: TextStyle(fontWeight: FontWeight.w600), +// // softWrap: true), +// // )), +// // DataColumn( +// // label: Expanded( +// // child: Text('Phone No', +// // style: +// // TextStyle(fontWeight: FontWeight.w600)))), +// // ], +// // rows: List.generate( +// // pno.length, +// // (index) => DataRow( +// // onSelectChanged: (value) { +// // print("message ${pno[index]}"); + +// // showModalBottomSheet( +// // useRootNavigator: true, +// // isScrollControlled: false, +// // enableDrag: true, +// // useSafeArea: true, +// // constraints: const BoxConstraints( +// // maxWidth: double.infinity, +// // ), +// // shape: RoundedRectangleBorder( +// // borderRadius: BorderRadius.vertical( +// // top: Radius.circular(0), +// // ), +// // ), +// // clipBehavior: Clip.antiAliasWithSaveLayer, +// // context: context, +// // builder: (context) { +// // return bsheet(pno[index]); +// // }, +// // ); +// // }, +// // cells: [ +// // DataCell(Text(pno[index]['Phone type'].toString(), +// // softWrap: true)), +// // DataCell(Text(pno[index]['phone Number'].toString(), +// // softWrap: true)), +// // ], +// // ), +// // ), +// // ), +// // ), +// // ), +// // ), + +// // ) + +// ); +// } + +// void _fetchData() async { +// setState(() { +// _isLoading = true; +// }); + +// await Future.delayed(const Duration(seconds: 1)); + +// if (!mounted) { +// return; +// } // + +// setState(() { +// _isLoading = false; +// evelist = List.generate(evelist.length + 10, (i) => 'Item $i'); +// }); +// } +// } diff --git a/lib/contacts_module/ui_screen/show_morek2/location_showmorek2.dart b/lib/contacts_module/ui_screen/show_morek2/location_showmorek2.dart new file mode 100644 index 0000000..a5789d6 --- /dev/null +++ b/lib/contacts_module/ui_screen/show_morek2/location_showmorek2.dart @@ -0,0 +1,321 @@ +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/icontext_widget.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; +import 'package:provider/provider.dart'; + +class Lock2ShowMore extends StatefulWidget { + Lock2ShowMore({Key? key}) : super(key: key); + + @override + State createState() => _Lock2ShowMoreState(); +} + +class _Lock2ShowMoreState extends State { + final PagingController _pagingController = + PagingController(firstPageKey: 0); + + int page = 1; + + @override + void initState() { + // TODO: implement initState + super.initState(); + + _pagingController.addPageRequestListener((page) { + _fetchNewPage(); + //affdata(); + }); + + //affdata(); + } + + locdata(int page) async { + var location = Provider.of(context, listen: false); + return await location.locationinfo(page); + } + + Future _fetchNewPage() async { + try { + print("Page_issssss: $page"); + final newItems = await locdata(page); + final isLastPage = newItems.length < 10; + if (isLastPage) { + print("LoadData: Yes"); + + _pagingController.appendLastPage(newItems); + } else { + print("LoadData: No"); + + final nextPageKey = page + newItems.length; + _pagingController.appendPage(newItems, page++); + } + } catch (e) { + _pagingController.error = e; + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Locations'), + ), + body: RefreshIndicator( + onRefresh: () => Future.sync( + () => _pagingController.refresh(), + ), + child: PagedListView( + pagingController: _pagingController, + builderDelegate: PagedChildBuilderDelegate( + itemBuilder: (context, item, index) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: GestureDetector( + onTap: () { + print("OnclickLocationData: ${item.address1}"); + List> keyValue = [ + { + "Address": item.address1, + "Postal Code": item.postalCode, + "Primary": item.formattedIsPrimary, + "organization Name": item.organizationName, + "Country Name": item.countryName, + "State Name": item.stateName, + "City Name": item.cityName, + } + ]; + + modelbsheet(keyValue); + }, + child: Container( + //color: Colors.white, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(30), + bottomRight: Radius.circular(30), + ), + border: Border.all( + color: Constants.k2color, + width: 2.0, + style: BorderStyle.solid)), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: Alignment.centerLeft, + child: IconTextRow( + icon: Icons.business, + text: item.organizationName ?? "Aissel", + fontSize: 16.0, + iconColor: Constants.k2color, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon( + Icons.location_pin, + size: 20.0, + color: Constants.k2color, + ), + SizedBox(width: 8.0), + // Row( + // children: [ + // IconTextRow( + // icon: Icons.business, + // text: item.organizationName ?? "Aissel", + // fontSize: 16.0, + // iconColor: Constants.k2color, + // ), + // ], + // ), + ], + ), + ], + ) + + // Column( + // children: [ + // ListTile( + // leading: Icon( + // Icons.location_on_outlined, + // size: 35.0, + // color: Constants.k2color, + // ), + // title: Text1( + // title: item.organizationName ?? "Aissel"), + // subtitle: Text1(title: item.address1 ?? ""), + // ), + // // Row( + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // // children: [ + // // Padding( + // // padding: const EdgeInsets.only(left: 15.0), + // // child: Column( + // // children: [ + // // Text1(title: "City"), + // // Text1(title: item.cityName ?? "--") + // // ], + // // ), + // // ), + // // Padding( + // // padding: const EdgeInsets.only(right: 15.0), + // // child: Column( + // // children: [ + // // Text1(title: "State"), + // // Text1(title: item.stateName ?? "") + // // ], + // // ), + // // ) + // // ], + // // ), + // // Row( + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // // children: [ + // // Padding( + // // padding: const EdgeInsets.only(left: 15.0), + // // child: Column( + // // children: [ + // // Text1(title: "Country"), + // // Text1(title: item.countryName ?? " ") + // // ], + // // ), + // // ), + // // Padding( + // // padding: const EdgeInsets.only(right: 15.0), + // // child: Column( + // // children: [ + // // Text1(title: "Postal Code"), + // // Text1(title: item.postalCode ?? "") + // // ], + // // ), + // // ) + // // ], + // // ) + // ], + // ), + ), + ), + ), + if (index == _pagingController.itemList!.length - 1) + Container( + child: Text1( + title: "No More Data", + )) + ], + ); + }), + ), + )); + } + + @override + void dispose() { + _pagingController.dispose(); + super.dispose(); + } + + void modelbsheet(List> keyValue) { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheetk2new(keyValue); + }, + ); + } +} + +// import 'package:discover_module/contacts_module/custom_widget/text.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; + +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; +// import 'package:very_good_infinite_list/very_good_infinite_list.dart'; + +// class Lock2ShowMore extends StatefulWidget { +// Lock2ShowMore({Key? key}) : super(key: key); + +// @override +// State createState() => _Lock2ShowMoreState(); +// } + +// class _Lock2ShowMoreState extends State { +// List locationList = []; + +// // var _items = []; +// var _isLoading = false; +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); + +// affdata(); +// } + +// affdata() async { +// var location = Provider.of(context, listen: false); +// final loclist = location.locationlist; + +// setState(() { +// locationList = loclist; +// }); +// } + +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar( +// title: Text('Locations'), +// ), +// body: Consumer(builder: (context, loc, child) { +// return NotificationListener( +// child: ListView.builder( +// itemCount: loc.locationlist.length, +// itemBuilder: (context, index) { +// var data = loc.locationlist[index]; +// return ListTile( +// title: Text1(title: data.address1), +// ); +// })); +// }) + +// ); +// } + +// void _fetchData() async { +// setState(() { +// _isLoading = true; +// }); + +// await Future.delayed(const Duration(seconds: 1)); + +// if (!mounted) { +// return; +// } // + +// setState(() { +// _isLoading = false; +// locationList = List.generate(locationList.length + 10, (i) => 'Item $i'); +// }); +// } +// } diff --git a/lib/contacts_module/ui_screen/tesr_locationtab.dart b/lib/contacts_module/ui_screen/tesr_locationtab.dart new file mode 100644 index 0000000..b6c99e3 --- /dev/null +++ b/lib/contacts_module/ui_screen/tesr_locationtab.dart @@ -0,0 +1,905 @@ +// // import 'package:discover_module/custom_widget/custom_expansiontile.dart'; +// import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; +// import 'package:discover_module/contacts_module/custom_widget/text.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; +// import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; +// import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +// import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_awards_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_education_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_email_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +// import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +// import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; +// import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; +// import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; +// import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; +// import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; +// import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; +// import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; +// import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; + +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; + +// class LocationTest extends StatefulWidget { +// // const LocationTab({super.key}); +// LocationTest({required this.text, this.offline, Key? key, this.offlineMode}) +// : super(key: key); + +// final int text; +// int? offline; +// bool? offlineMode; +// @override +// State createState() => _LocationTestState(); +// } + +// class _LocationTestState extends State { +// //List locationList = []; + +// List locationList = []; +// List pno = []; +// List emailid = []; + +// List training = []; +// List education = []; +// List award = []; +// List certificate = []; + +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); + +// print("I_amFalseee: ${widget.offlineMode}"); + +// print("I_am_locationList: ${locationList}"); + +// // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { +// getAffiliations(); +// // }); +// } + +// Future getAffiliations() async { +// // ignore: prefer_typ(ing_uninitialized_variables +// var loclist, phoneno, emailno1, edu1, awa1, cer1, training1; + +// if (widget.offline == 1) { +// loclist = await retrieveidlocations(widget.text); +// } else if (widget.offlineMode == false) { +// } else { +// if (locationList.isEmpty) { +// print("Location_is_empty"); + +// var location = Provider.of(context, listen: false); +// await location.locationinfo(widget.text); +// locationList = location.locationlist; + +// // setState(() { +// // locationList = loclist; +// // }); +// } else { +// print("Location_not empty"); +// } +// } +// // final locationProvider = +// // Provider.of(context, listen: false); + +// // if (locationProvider.locationList.isEmpty) { +// // await locationProvider.fetchLocations( +// // widget.text, widget.offline, widget.offlineMode); + +// // locationList = locationProvider.locationList; +// // } else { +// // print("Iam_emptyyyy"); +// // } + +// if (mounted) { +// if (widget.offline == 1) { +// phoneno = await retrieveidpnos(widget.text); +// } else { +// var phone = Provider.of(context, listen: false); +// await phone.phoneinfo(widget.text); +// phoneno = phone.phonenolist; +// } +// setState(() { +// pno = phoneno; +// }); +// } + +// if (mounted) { +// if (widget.offline == 1) { +// emailno1 = await retrieveidemails(widget.text); +// print("Saved_CheckingloclistEmailll: $emailno1"); +// } else { +// var email = Provider.of(context, listen: false); +// await email.emailinfo(widget.text); +// emailno1 = email.emailkollist; +// print("Saved_CheckingloclistEmailll123: $emailno1"); +// } + +// setState(() { +// emailid = emailno1; +// }); +// } + +// if (mounted) { +// if (widget.offline == 1) { +// training1 = await retrieveidtri(widget.text); +// print("Saved_CheckingloclistEmailll: $emailno1"); +// } else { +// var trai = Provider.of(context, listen: false); +// await trai.traininginfo(widget.text); +// training1 = trai.traininglist; +// } + +// setState(() { +// training = training1; +// }); +// } + +// if (mounted) { +// if (widget.offline == 1) { +// edu1 = await retrieveidedus(widget.text); +// print("Saved_CheckingloclistEdu: $edu1"); +// } else { +// var edu = Provider.of(context, listen: false); +// await edu.eduinfo(widget.text); +// edu1 = edu.educationlist; +// print("Saved_CheckingloclistEdu123: $edu1"); +// } + +// setState(() { +// education = edu1; +// }); +// } + +// if (mounted) { +// if (widget.offline == 1) { +// awa1 = await retrieveidawa(widget.text); +// print("Saved_CheckingloclistEdu: $edu1"); +// } else { +// var awa = Provider.of(context, listen: false); +// await awa.awainfo(widget.text); +// awa1 = awa.awardlist; +// } +// setState(() { +// award = awa1; +// }); +// } + +// if (mounted) { +// if (widget.offline == 1) { +// cer1 = await retrieveidcer(widget.text); +// print("Saved_CheckingloclistEdu: $edu1"); +// } else { +// var cer = Provider.of(context, listen: false); +// await cer.certificateinfo(widget.text); +// cer1 = cer.certificatelist; +// } + +// setState(() { +// certificate = cer1; +// }); +// } +// } + +// @override +// Widget build(BuildContext context) { +// return Center( +// child: ListView( +// children: [Text1(title: locationList.length.toString())], + +// // children: [ +// // locationList.length != 0 +// // ? CustomExpansionTile( +// // title: "Locations", +// // itemList: locationList.cast(), +// // buttonText: 'Show More', +// // field1: 'Institutation', +// // field2: 'Address', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (Data selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "Address": selectedPhoneNumber.address1, +// // "Postal Code": selectedPhoneNumber.postalCode, +// // "Primary": selectedPhoneNumber.formattedIsPrimary, +// // "organization Name": selectedPhoneNumber.organizationName, +// // "Country Name": selectedPhoneNumber.countryName, +// // "State Name": selectedPhoneNumber.stateName, +// // "City Name": selectedPhoneNumber.cityName, +// // } +// // ]; + +// // modelbsheet(keyValue); +// // }, +// // onButtonPressed: () { +// // print("Show More button clicked"); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Locations", +// // itemList: locationList.cast(), +// // buttonText: 'Show More', +// // field1: 'Institutation', +// // field2: 'Address', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (Data selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // Container(), +// // pno.length != 0 +// // ? CustomExpansionTile( +// // title: "Phone Numbers", +// // itemList: pno.cast(), +// // buttonText: 'Show More', +// // field1: 'Phone Type', +// // field2: 'Phone No', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (DataPhno selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "Phone Number": selectedPhoneNumber.number, +// // "Phone Type": selectedPhoneNumber.phoneTypeName, +// // "Primary": selectedPhoneNumber.formattedIsPrimary, +// // "organization Name": selectedPhoneNumber.organizationName, +// // } +// // ]; + +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Phone Numbers", +// // itemList: pno.cast(), +// // buttonText: 'Show More', +// // field1: 'Phone Type', +// // field2: 'Phone No', +// // noexpand: false, +// // onItemSelected: (DataPhno selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // emailid.length != 0 +// // ? CustomExpansionTile( +// // title: "Emails", +// // itemList: emailid.cast(), +// // buttonText: 'Show More', +// // field1: 'Email Type', +// // field2: 'Email', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (EmailData selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "Email": selectedPhoneNumber.email, +// // "Email Type": selectedPhoneNumber.emailTypeName, +// // } +// // ]; + +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Emails", +// // itemList: emailid.cast(), +// // buttonText: 'Show More', +// // field1: 'Email Type', +// // field2: 'Email', +// // noexpand: false, +// // onItemSelected: (EmailData selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // training.length != 0 +// // ? CustomExpansionTile( +// // title: "Trainings", +// // itemList: training.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (TrainingList selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "organization Id": selectedPhoneNumber.organizationId, +// // "Degree": selectedPhoneNumber.degree, +// // "Specialty": selectedPhoneNumber.specialty, +// // "Start Date": selectedPhoneNumber.startDate, +// // "End Date": selectedPhoneNumber.endDate, +// // } +// // ]; +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Trainings", +// // itemList: training.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: false, +// // onItemSelected: (TrainingList selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // education.length != 0 +// // ? CustomExpansionTile( +// // title: "Education", +// // itemList: education.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (EducationList selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "organization Id": selectedPhoneNumber.organizationId, +// // "Degree": selectedPhoneNumber.degree, +// // "Specialty": selectedPhoneNumber.specialty, +// // "Start Date": selectedPhoneNumber.startDate, +// // "End Date": selectedPhoneNumber.endDate, +// // } +// // ]; +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Education", +// // itemList: education.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: false, +// // onItemSelected: (EducationList selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // award.length != 0 +// // ? CustomExpansionTile( +// // title: "Awards", +// // itemList: award.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (AwardsList selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "Name": selectedPhoneNumber.name, +// // "Start Date": selectedPhoneNumber.startDate, +// // "End Date": selectedPhoneNumber.endDate, +// // } +// // ]; +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Awards", +// // itemList: award.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: false, +// // onItemSelected: (AwardsList selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // certificate.length != 0 +// // ? CustomExpansionTile( +// // title: "Certificates", +// // itemList: certificate.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: widget.offlineMode == null ? true : false, +// // onItemSelected: (CertificateList selectedPhoneNumber) { +// // List> keyValue = [ +// // { +// // "Organization Id": selectedPhoneNumber.organizationId, +// // "specialty": selectedPhoneNumber.specialty, +// // "Start Date": selectedPhoneNumber.startDate, +// // "End Date": selectedPhoneNumber.endDate, +// // } +// // ]; +// // modelbsheet(keyValue); +// // }, +// // ) +// // : widget.offlineMode != null +// // ? CustomExpansionTile( +// // title: "Certificates", +// // itemList: certificate.cast(), +// // buttonText: 'Show More', +// // field1: 'Education Type', +// // field2: 'Institution Name', +// // noexpand: false, +// // onItemSelected: (CertificateList selectedPhoneNumber) {}, +// // ) +// // : Container(), +// // ] +// ), +// ); +// } + +// void modelbsheet(List> keyValue) { +// showModalBottomSheet( +// useRootNavigator: true, +// isScrollControlled: false, +// enableDrag: true, +// useSafeArea: true, +// constraints: const BoxConstraints( +// maxWidth: double.infinity, +// ), +// shape: const RoundedRectangleBorder( +// borderRadius: BorderRadius.vertical( +// top: Radius.circular(0), +// ), +// ), +// clipBehavior: Clip.antiAliasWithSaveLayer, +// context: context, +// builder: (context) { +// return bsheetk2new(keyValue); +// }, +// ); +// } +// } + +// import 'package:discover_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; +import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_awards_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_education_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; +import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class LocationK2Tab1 extends StatefulWidget { + // const LocationTab({super.key}); + LocationK2Tab1({required this.text, this.offline, Key? key, this.offlineMode}) + : super(key: key); + + final int text; + int? offline; + bool? offlineMode; + @override + State createState() => _LocationK2TabState(); +} + +class _LocationK2TabState extends State { + List locationList = []; + + // List locationList = []; + List pno = []; + List emailid = []; + + List training = []; + List education = []; + List award = []; + List certificate = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + + print("I_amFalseee: ${widget.offlineMode}"); + + print("I_am_locationList: ${locationList}"); + + // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getAffiliations(); + // }); + } + + Future getAffiliations() async { + // ignore: prefer_typ(ing_uninitialized_variables + var loclist, phoneno, emailno1, edu1, awa1, cer1, training1; + + if (widget.offline == 1) { + loclist = await retrieveidlocations(widget.text); + } else if (widget.offlineMode == false) { + } else { + if (locationList.isEmpty) { + print("Location_is_empty"); + + var location = Provider.of(context, listen: false); + await location.locationinfo(widget.text); + locationList = location.locationlist; + + // setState(() { + // locationList = loclist; + // }); + } else { + print("Location_not empty"); + } + } + // final locationProvider = + // Provider.of(context, listen: false); + + // if (locationProvider.locationList.isEmpty) { + // await locationProvider.fetchLocations( + // widget.text, widget.offline, widget.offlineMode); + + // locationList = locationProvider.locationList; + // } else { + // print("Iam_emptyyyy"); + // } + + if (mounted) { + if (widget.offline == 1) { + phoneno = await retrieveidpnos(widget.text); + } else { + var phone = Provider.of(context, listen: false); + await phone.phonek2info(widget.text); + phoneno = phone.phonenolist; + } + setState(() { + pno = phoneno; + }); + } + + if (mounted) { + if (widget.offline == 1) { + emailno1 = await retrieveidemails(widget.text); + print("Saved_CheckingloclistEmailll: $emailno1"); + } else { + var email = Provider.of(context, listen: false); + await email.emailinfo(widget.text); + emailno1 = email.emailkollist; + print("Saved_CheckingloclistEmailll123: $emailno1"); + } + + setState(() { + emailid = emailno1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + training1 = await retrieveidtri(widget.text); + print("Saved_CheckingloclistEmailll: $emailno1"); + } else { + var trai = Provider.of(context, listen: false); + await trai.traininginfo(widget.text); + training1 = trai.traininglist; + } + + setState(() { + training = training1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + edu1 = await retrieveidedus(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var edu = Provider.of(context, listen: false); + await edu.eduinfo(widget.text); + edu1 = edu.educationlist; + print("Saved_CheckingloclistEdu123: $edu1"); + } + + setState(() { + education = edu1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + awa1 = await retrieveidawa(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var awa = Provider.of(context, listen: false); + await awa.awainfo(widget.text); + awa1 = awa.awardlist; + } + setState(() { + award = awa1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + cer1 = await retrieveidcer(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var cer = Provider.of(context, listen: false); + await cer.certificateinfo(widget.text); + cer1 = cer.certificatelist; + } + + setState(() { + certificate = cer1; + }); + } + } + + @override + Widget build(BuildContext context) { + return Center( + child: ListView(children: [ + locationList.length != 0 + ? CustomExpansionTile( + title: "Locations", + itemList: locationList.cast(), + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (Data selectedPhoneNumber) { + List> keyValue = [ + { + "Address": selectedPhoneNumber.address1, + "Postal Code": selectedPhoneNumber.postalCode, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": selectedPhoneNumber.organizationName, + "Country Name": selectedPhoneNumber.countryName, + "State Name": selectedPhoneNumber.stateName, + "City Name": selectedPhoneNumber.cityName, + } + ]; + + modelbsheet(keyValue); + }, + onButtonPressed: () { + print("Show More button clicked"); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Locations", + itemList: locationList.cast(), + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (Data selectedPhoneNumber) {}, + ) + : Container(), + Container(), + pno.length != 0 + ? CustomExpansionTile( + title: "Phone Numbers", + itemList: pno.cast(), + buttonText: 'Show More', + field1: 'Phone Type', + field2: 'Phone No', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (DataPhno selectedPhoneNumber) { + List> keyValue = [ + { + "Phone Number": selectedPhoneNumber.number, + "Phone Type": selectedPhoneNumber.phoneTypeName, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": selectedPhoneNumber.organizationName, + } + ]; + + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Phone Numbers", + itemList: pno.cast(), + buttonText: 'Show More', + field1: 'Phone Type', + field2: 'Phone No', + noexpand: false, + onItemSelected: (DataPhno selectedPhoneNumber) {}, + ) + : Container(), + emailid.length != 0 + ? CustomExpansionTile( + title: "Emails", + itemList: emailid.cast(), + buttonText: 'Show More', + field1: 'Email Type', + field2: 'Email', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EmailData selectedPhoneNumber) { + List> keyValue = [ + { + "Email": selectedPhoneNumber.email, + "Email Type": selectedPhoneNumber.emailTypeName, + } + ]; + + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Emails", + itemList: emailid.cast(), + buttonText: 'Show More', + field1: 'Email Type', + field2: 'Email', + noexpand: false, + onItemSelected: (EmailData selectedPhoneNumber) {}, + ) + : Container(), + training.length != 0 + ? CustomExpansionTile( + title: "Trainings", + itemList: training.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (TrainingList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Trainings", + itemList: training.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (TrainingList selectedPhoneNumber) {}, + ) + : Container(), + education.length != 0 + ? CustomExpansionTile( + title: "Education", + itemList: education.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (EducationList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Education", + itemList: education.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (EducationList selectedPhoneNumber) {}, + ) + : Container(), + award.length != 0 + ? CustomExpansionTile( + title: "Awards", + itemList: award.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (AwardsList selectedPhoneNumber) { + List> keyValue = [ + { + "Name": selectedPhoneNumber.name, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Awards", + itemList: award.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (AwardsList selectedPhoneNumber) {}, + ) + : Container(), + certificate.length != 0 + ? CustomExpansionTile( + title: "Certificates", + itemList: certificate.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: widget.offlineMode == null ? true : false, + onItemSelected: (CertificateList selectedPhoneNumber) { + List> keyValue = [ + { + "Organization Id": selectedPhoneNumber.organizationId, + "specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : widget.offlineMode != null + ? CustomExpansionTile( + title: "Certificates", + itemList: certificate.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + noexpand: false, + onItemSelected: (CertificateList selectedPhoneNumber) {}, + ) + : Container(), + ]), + ); + } + + void modelbsheet(List> keyValue) { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheetk2new(keyValue); + }, + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index da3b8be..1d32a23 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'package:discover_module/contacts_module/provider_class/email_provider.da import 'package:discover_module/contacts_module/provider_class/engagement_provider.dart'; import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_add_provider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_aff_provider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_awards_provider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; @@ -16,6 +17,7 @@ import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_l import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_viewnotes.dart'; import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; import 'package:discover_module/contacts_module/provider_class/medicalinsightprovider.dart'; import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; @@ -40,10 +42,10 @@ import 'package:discover_module/contacts_module/storage_hive/patent_data/patent_ import 'package:discover_module/contacts_module/storage_hive/pno_data/pno_model_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/procedure_data/pro_model_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/pub_data/pub_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/savefilter/save_filter_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/traning_data/traning_model_hive.dart'; import 'package:discover_module/contacts_module/storage_hive/trials_data/trial_model_hive.dart'; -import 'package:discover_module/contacts_module/ui_screen/filters_menu.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; @@ -52,10 +54,10 @@ import 'package:discover_module/contacts_module/ui_screen/interactionform/model/ import 'package:discover_module/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; +import 'package:discover_module/test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:provider/provider.dart'; @@ -110,6 +112,7 @@ Future main() async { Hive.registerAdapter(ProAdapter()); Hive.registerAdapter(Training1Adapter()); Hive.registerAdapter(SpeAdapter()); + Hive.registerAdapter(savecontactfilterAdapter()); runApp(MultiProvider( providers: [ @@ -147,6 +150,8 @@ Future main() async { ChangeNotifierProvider(create: (_) => CertificateProviderK2()), ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()), ChangeNotifierProvider(create: (_) => EventProviderK2()), + ChangeNotifierProvider(create: (_) => HcpNotesFecth()), + ChangeNotifierProvider(create: (_) => AddNotesProvider()), //ChangeNotifierProvider(create: (_) => ConfigDataProvider()), ChangeNotifierProvider( @@ -154,10 +159,6 @@ Future main() async { Hive.box('InteractionConfigDataBox'))), ], child: MyApp(), - - // child: MaterialApp( - // home: MyWidget(), - // ), )); } @@ -176,12 +177,6 @@ class _MyAppState extends State { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Flutter Demo', - // theme: ThemeData( - // fontFamily: 'SourceSerif', - // appBarTheme: const AppBarTheme( - // backgroundColor: Color.fromARGB(255, 0, 71, 132), - // foregroundColor: Colors.white //here you can give the text color - // )), theme: ThemeData( fontFamily: 'OpenSans', @@ -192,98 +187,8 @@ class _MyAppState extends State { ), ), // home: Contactsk2(), - home: Contacts1(), - - // home: const MyHomePage(title: 'Discover Module'), - // home: const MedicalInsight(), - ); - } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - final String outerTabValue = 'value1'; - - late bool menuview = true; - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - initState() { - menuview = true; - } - - return Scaffold( - body: DefaultTabController( - length: 1, - child: Scaffold( - drawerEnableOpenDragGesture: false, // Prevent user sliding open - - appBar: AppBar( - automaticallyImplyLeading: false, - title: SvgPicture.asset( - 'assets/konectar_white_logo.svg', - width: 100.0, - // color: Colors.white, - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), - ), - centerTitle: false, - bottom: const TabBar( - indicatorColor: Colors.white, - labelColor: Colors.white, - unselectedLabelColor: Colors.grey, - tabs: [ - Tab( - text: '', - ), - // Tab( - // text: 'Discover', - // ), - // Tab( - // text: 'HCP Report', - // ), - ], - ), - ), - // endDrawer: MyWidget1(), - endDrawer: Drawer( - width: MediaQuery.of(context).size.width * 99.2, - child: Filters(), - ), - - body: const TabBarView( - children: [ - Center(child: Contacts1()), - // Center(child: Discover(outerTabValue)), - // Center(child: DataTableDemo()), - ], - // This trailing comma makes auto-formatting nicer for build methods. - ), - ), - ), + home: DemoPage(), + // const Contacts1(), ); } } diff --git a/lib/test.dart b/lib/test.dart new file mode 100644 index 0000000..2342923 --- /dev/null +++ b/lib/test.dart @@ -0,0 +1,273 @@ +// import 'package:flutter/material.dart'; + +// void main() { +// runApp(MyApp()); +// } + +// class MyApp extends StatelessWidget { +// @override +// Widget build(BuildContext context) { +// return MaterialApp( +// home: FilterableSearchList(), +// ); +// } +// } + +// class Item { +// final String name; +// final String category; + +// Item(this.name, this.category); +// } + +// class FilterableSearchList extends StatefulWidget { +// @override +// _FilterableSearchListState createState() => _FilterableSearchListState(); +// } + +// class _FilterableSearchListState extends State { +// final TextEditingController _searchController = TextEditingController(); + +// List items = [ +// Item('Apple', 'Fruit'), +// Item('Banana', 'Fruit'), +// Item('Carrot', 'Vegetable'), +// Item('Lettuce', 'Vegetable'), +// Item('Chicken', 'Meat'), +// ]; + +// List filteredItems = []; +// Set selectedCategories = {}; + +// @override +// void initState() { +// super.initState(); +// filteredItems = items; // Initially show all items +// _searchController.addListener(_filterItems); +// } + +// @override +// void dispose() { +// _searchController.dispose(); +// super.dispose(); +// } + +// void _filterItems() { +// final query = _searchController.text.toLowerCase(); +// final searchTerms = query.split(',').map((term) => term.trim()).toList(); + +// setState(() { +// filteredItems = items.where((item) { +// final matchesCategory = selectedCategories.isEmpty || +// selectedCategories.contains(item.category); +// // Show all items, but highlight matches +// final matchesSearch = +// searchTerms.any((term) => item.name.toLowerCase() == term); +// return matchesCategory; // Always return true to show all items +// }).toList(); +// }); +// } + +// void _toggleCategory(String category) { +// setState(() { +// if (selectedCategories.contains(category)) { +// selectedCategories.remove(category); +// } else { +// selectedCategories.add(category); +// } +// _filterItems(); +// }); +// } + +// @override +// Widget build(BuildContext context) { +// final categories = ['Fruit', 'Vegetable', 'Meat']; + +// return Scaffold( +// appBar: AppBar(title: Text('Filterable & Searchable ListView')), +// body: Column( +// children: [ +// // Search Field +// Padding( +// padding: const EdgeInsets.all(8.0), +// child: TextField( +// controller: _searchController, +// decoration: InputDecoration( +// labelText: 'Search (e.g., "Apple, Banana")', +// border: OutlineInputBorder(), +// ), +// ), +// ), +// // Filter options +// Wrap( +// spacing: 8.0, +// children: categories.map((category) { +// return FilterChip( +// label: Text(category), +// selected: selectedCategories.contains(category), +// onSelected: (isSelected) => _toggleCategory(category), +// ); +// }).toList(), +// ), +// // ListView +// Expanded( +// child: ListView.builder( +// itemCount: items.length, // Show all items +// itemBuilder: (context, index) { +// final item = items[index]; +// final isMatch = _searchController.text.isNotEmpty && +// (item.name.toLowerCase() == +// _searchController.text.toLowerCase() || +// _searchController.text +// .split(',') +// .map((term) => term.trim()) +// .contains(item.name.toLowerCase())); + +// return ListTile( +// title: Text(item.name, +// style: isMatch +// ? TextStyle(fontWeight: FontWeight.bold) +// : null), +// subtitle: Text(item.category), +// ); +// }, +// ), +// ), +// ], +// ), +// ); +// } +// } +import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_offline/flutter_offline.dart'; + +class DemoPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + body: Builder(builder: (context) { + return OfflineBuilder( + connectivityBuilder: ( + BuildContext context, + List connectivity, + Widget child, + ) { + final bool connected = + !connectivity.contains(ConnectivityResult.none); + + WidgetsBinding.instance.addPostFrameCallback((_) { + final overlay = Overlay.of(context); + final overlayEntry = OverlayEntry( + builder: (context) => Positioned( + top: 0.0, // Position the status bar at the top + left: 0.0, + right: 0.0, + child: Material( + color: Colors.transparent, + child: Container( + height: 24.0, + color: connected + ? Color(0xFF00EE44) + : Color.fromARGB(255, 243, 8, 8), + child: Center( + child: Text( + "${connected ? 'ONLINE' : 'OFFLINE'}", + style: TextStyle(color: Colors.white), + ), + ), + ), + ), + ), + ); + + // Insert the overlay entry above the AppBar + overlay.insert(overlayEntry); + + // // Optionally remove the overlay after some time (or keep it) + // Future.delayed(Duration(seconds: 30), () { + // overlayEntry.remove(); + // }); + }); + + // Returning the rest of the UI + return const Stack( + fit: StackFit.expand, + children: [ + Padding( + padding: EdgeInsets.only( + top: 0.0), // Adjust the top padding to prevent overlap + child: Contacts1(), + ), + ], + ); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Text( + 'There are no buttons to push :)', + ), + new Text( + 'Just turn off your internet.', + ), + ], + ), + ); + }), + ); + } + + // Scaffold( + // // appBar: new AppBar( + // // title: new Text("Offline Demo"), + // // ), + // body: Builder(builder: (context) { + // return OfflineBuilder( + // connectivityBuilder: ( + // BuildContext context, + // List connectivity, + // Widget child, + // ) { + // final bool connected = + // !connectivity.contains(ConnectivityResult.none); + // return Stack( + // fit: StackFit.expand, + // children: [ + // Positioned( + // top: 0, + // //height: 24.0, + // left: 0.0, + // right: 0.0, + // child: Container( + // color: connected + // ? Color(0xFF00EE44) + // : Color.fromARGB(255, 243, 8, 8), + // child: Center( + // child: Text("${connected ? 'ONLINE' : 'OFFLINE'}"), + // ), + // ), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 0.0), + // child: const Contacts1(), + // ), + // ], + // ); + // }, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // new Text( + // 'There are no bottons to push :)', + // ), + // new Text( + // 'Just turn off your internet.', + // ), + // ], + // ), + // ); + // }), + // ); + // } +} diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 9507311..f596f3a 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,7 @@ import FlutterMacOS import Foundation import connectivity_plus +import network_info_plus import path_provider_foundation import shared_preferences_foundation import sqflite @@ -13,6 +14,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 64bbc4b..cdb3589 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -422,6 +422,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + flutter_offline: + dependency: "direct main" + description: + name: flutter_offline + sha256: "6aa1fec500e36ad54cff3eb2a242cc5617f8357f8b566eb5c97584c31b3c4ca9" + url: "https://pub.dev" + source: hosted + version: "4.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -438,6 +446,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + flutter_staggered_grid_view: + dependency: transitive + description: + name: flutter_staggered_grid_view + sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395" + url: "https://pub.dev" + source: hosted + version: "0.7.0" flutter_svg: dependency: "direct main" description: @@ -552,6 +568,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.7" + infinite_scroll_pagination: + dependency: "direct main" + description: + name: infinite_scroll_pagination + sha256: b68bce20752fcf36c7739e60de4175494f74e99e9a69b4dd2fe3a1dd07a7f16a + url: "https://pub.dev" + source: hosted + version: "4.0.0" intl: dependency: "direct main" description: @@ -688,6 +712,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + network_info_plus: + dependency: transitive + description: + name: network_info_plus + sha256: "5bd4b86e28fed5ed4e6ac7764133c031dfb7d3f46aa2a81b46f55038aa78ecc0" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + network_info_plus_platform_interface: + dependency: transitive + description: + name: network_info_plus_platform_interface + sha256: b7f35f4a7baef511159e524499f3c15464a49faa5ec10e92ee0bce265e664906 + url: "https://pub.dev" + source: hosted + version: "2.0.1" nm: dependency: transitive description: @@ -1005,6 +1045,14 @@ packages: description: flutter source: sdk version: "0.0.99" + sliver_tools: + dependency: transitive + description: + name: sliver_tools + sha256: eae28220badfb9d0559207badcbbc9ad5331aac829a88cb0964d330d2a4636a6 + url: "https://pub.dev" + source: hosted + version: "0.2.12" source_gen: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e035b4e..61c3707 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,6 +69,10 @@ dependencies: intl: ^0.17.0 cached_network_image: ^3.4.0 url_launcher: ^6.3.0 + infinite_scroll_pagination: ^4.0.0 + flutter_offline: ^4.0.0 + +