flutter profileui

This commit is contained in:
poojakhatawate 2024-11-22 16:08:43 +05:30
parent c9b71a1386
commit 77e1a769ea
104 changed files with 8512 additions and 28236 deletions

View File

@ -15,7 +15,7 @@ migration:
- platform: root
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
- platform: web
- platform: android
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
base_revision: 300451adae589accbece3490f4396f10bdf15e6e

View File

@ -13,7 +13,7 @@
android:name="${applicationName}"
android:usesCleartextTraffic="true"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/konectar1">
<activity
android:name=".MainActivity"
android:exported="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

1
devtools_options.yaml Normal file
View File

@ -0,0 +1 @@
extensions:

View File

@ -1,230 +0,0 @@
// import 'package:flutter/material.dart';
// class ModalBottomSheetDemo extends StatelessWidget {
// const ModalBottomSheetDemo({Key? key}) : super(key: key);
// @override
// Widget build(BuildContext context) {
// return Center(
// child: ElevatedButton(
// child: const Text('showModalBottomSheet'),
// onPressed: () {
// // when raised button is pressed
// // we display showModalBottomSheet
// 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: <Widget>[
// 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(),
// ),
// );
// }
// }

View File

@ -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<String> 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

File diff suppressed because it is too large Load Diff

View File

@ -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<ClickRow> createState() => _ClickRowState();
}
class _ClickRowState extends State<ClickRow> {
@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),
),
],
),
),
);
}
}

View File

@ -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,
),
),
),
),
),
);
}
}

View File

@ -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<CustomAppbar> createState() => _CustomAppbarState();
}
class _CustomAppbarState extends State<CustomAppbar> {
@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: <Widget>[],
);
}
}

View File

@ -0,0 +1,141 @@
import 'package:flutter/material.dart';
class CustomLongPressContainer extends StatelessWidget {
final bool? switchValue;
final List<String>? selectedIndices;
final List<int>? 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),
),
),
],
),
),
),
],
),
);
}
}

View File

@ -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<CustomCard> createState() => _CustomCardState();
}
class _CustomCardState extends State<CustomCard> {
@override
Widget build(BuildContext context) {
return Card(
elevation: widget.elevation!,
color: widget.color,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(widget.bradius!)),
child: widget.child,
);
}
}

View File

@ -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<T> extends StatefulWidget {
final String title;
final List<T> itemList;
final List<T>? 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<T> extends StatefulWidget {
class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
bool _isExpanded = false;
//var noexpand;
@override
Widget build(BuildContext context) {
print("Chekingg_Field_one: ${widget.field1}");
@ -51,9 +58,9 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
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<T> extends State<CustomExpansionTile<T>> {
),
const SizedBox(width: 8.0),
Text1(
title: "(${widget.itemList.length})",
title: "(${widget.itemList!.length})",
txtcolor: Colors.black,
fontweight: FontWeight.normal,
txtfont: 16.0,
@ -86,7 +93,9 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
],
),
children: [
Scrollbar(
Visibility(
visible: widget.noexpand!,
child: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
@ -115,13 +124,13 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
),
),
],
rows: List.generate(widget.itemList.take(2).length,
rows: List.generate(widget.itemList!.take(2).length,
(index) {
final item = widget.itemList[index];
final item = widget.itemList![index];
return DataRow(
onSelectChanged: (value) {
widget.onItemSelected(widget.itemList[index]);
widget.onItemSelected(widget.itemList![index]);
},
cells: [
DataCell(getdatacel1(item)),
@ -135,16 +144,17 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
),
),
),
Container(
),
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: () {
// Handle the button action here
},
onPressed: widget.onButtonPressed,
child: Text(
widget.buttonText,
style: TextStyle(color: Constants.k2color),
@ -158,6 +168,7 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
),
),
),
),
],
),
),

View File

@ -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<CustomFloatingBtn> createState() => _CustomFloatingBtnState();
}
class _CustomFloatingBtnState extends State<CustomFloatingBtn> {
@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,
),
),
),
);
}
}

View File

@ -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,
);
}
}

View File

@ -0,0 +1,28 @@
import 'package:flutter/cupertino.dart';
class CustomSwitch extends StatefulWidget {
final Color? activeclor;
final bool? switchvalue;
final ValueChanged<bool>? onchanged;
const CustomSwitch(
{super.key, this.activeclor, this.switchvalue, this.onchanged});
@override
State<CustomSwitch> createState() => _CustomSwitchState();
}
class _CustomSwitchState extends State<CustomSwitch> {
@override
Widget build(BuildContext context) {
return CupertinoSwitch(
activeColor: widget.activeclor,
value: widget.switchvalue!,
onChanged: widget.onchanged
// (value) {
// setState(() {
// _switchValue = value;
// });
// },
);
}
}

View File

@ -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),
),
],
);
}
}

View File

@ -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<ProfileCard> createState() => _ProfileCardState();
}
class _ProfileCardState extends State<ProfileCard> {
@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<void> _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<void> emailSend(email) async {
String? encodeQueryParameters(Map<String, String> params) {
return params.entries
.map((MapEntry<String, String> entry) =>
Uri.encodeComponent(entry.key) +
'=' +
Uri.encodeComponent(entry.value))
.join('&');
}
final Uri emailLaunchUri = Uri(
scheme: 'mailto',
path: email,
query: encodeQueryParameters(<String, String>{
'subject': 'Example Subject',
'body': 'Hello, this is a sample body text.',
}),
);
if (await launchUrl(emailLaunchUri)) {
launchUrl(emailLaunchUri);
} else {
throw 'Could not launch $emailLaunchUri';
}
}
Future<void> callinfo(pno) async {
final call = Uri.parse('tel:$pno');
if (await canLaunchUrl(call)) {
launchUrl(call);
} else {
throw 'Could not launch $call';
}
}

View File

@ -24,6 +24,7 @@ class _Text1State extends State<Text1> {
return Text(
widget.title,
softWrap: true,
maxLines: 5,
style: TextStyle(
color: widget.txtcolor,
fontSize: widget.txtfont,

View File

@ -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<String> selectedIndices, [List displayedHCPList]) async {
// print("Iam selectedd $selectedIndices");
// for (int i = 0; i < selectedIndices.length; i++) {
// Map<String, dynamic>? row = await findRecordById1(selectedIndices[i]);
// print("StoringgggMyContactneww_isss_isss:Row $row");
// }
// }
// Map<String, dynamic> findRecordById(String selectedIndic) {
// final list = _contactbox.values.toList();
// }
static Map<String, dynamic>? 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");

View File

@ -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<HcpNotes>? data;
int? lastPage;
int? lastRow;
int? count;
FetchNotes({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory FetchNotes.fromJson(Map<String, dynamic> json) => FetchNotes(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<HcpNotes>.from(
json["data"]!.map((x) => HcpNotes.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.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<String, dynamic> 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<String, dynamic> 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(),
};
}

View File

@ -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;

View File

@ -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<String> 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();
}
}

View File

@ -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();
}
}

View File

@ -26,6 +26,8 @@ class AffiliationsProviderk2 extends ChangeNotifier {
notifyListeners();
}
bool get hasData => affiliations1.isNotEmpty;
getAllAffiliationsdata() async {
print("Affiliations_is: ");
final affdata = await affapi.getallaffiliationsdata();

View File

@ -14,4 +14,6 @@ class AwardProviderK2 extends ChangeNotifier {
awalist = email_result!;
notifyListeners();
}
bool get hasData => awalist.isNotEmpty;
}

View File

@ -14,4 +14,6 @@ class CertificateProviderK2 extends ChangeNotifier {
cerlist = email_result!;
notifyListeners();
}
bool get hasData => cerlist.isNotEmpty;
}

View File

@ -14,4 +14,6 @@ class EducationProviderK2 extends ChangeNotifier {
edulist = email_result!;
notifyListeners();
}
bool get hasData => edulist.isNotEmpty;
}

View File

@ -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);
}
}

View File

@ -6,6 +6,13 @@ class EventProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<EventList> eventlist = [];
List<EventList> 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;
List get eventsListpagination => eventlistpagination;
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<void> 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> 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();
// }
// }

View File

@ -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<void> 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);
}
}

View File

@ -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);
}
}

View File

@ -14,4 +14,6 @@ class TrainigProviderK2 extends ChangeNotifier {
tralist = email_result!;
notifyListeners();
}
bool get hasData => tralist.isNotEmpty;
}

View File

@ -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<HcpNotes> 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();
}
}

View File

@ -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<String> selectedIndices,
[List? displayedHCPList]) async {
for (int i = 0; i < selectedIndices.length; i++) {
print('The id id : ${selectedIndices[i]}');
Map<String, dynamic>? 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<void> storeAffiliations(String id) async {
await Provider.of<AffiliationsProvider>(context, listen: false)
.storeAff(id);
}
Future<void> storePublications(String id) async {
await Provider.of<PublicatioProvider>(context, listen: false).storePub(id);
}
Future<void> storeEvents(String id) async {
await Provider.of<EventProvider>(context, listen: false).storeEvent(id);
}
Future<void> storeTrials(String id) async {
await Provider.of<TrialsProvider>(context, listen: false).storeTrials(id);
}
Future<void> storeLocations(String id) async {
await Provider.of<LocationKolProvider>(context, listen: false).storeLoc(id);
}
Future<void> storePhoneNumbers(String id) async {
await Provider.of<PhonenoProviderK2>(context, listen: false).storePno(id);
}
Future<void> storeEmails(String id) async {
await Provider.of<EmailProviderK2>(context, listen: false).storeEmail(id);
}
Future<void> storeEducation(String id) async {
await Provider.of<EducationProvider>(context, listen: false).storeEdu(id);
}
Future<void> storeAwards(String id) async {
await Provider.of<AwardProvider>(context, listen: false).storeAwa(id);
}
Future<void> storeCertificates(String id) async {
await Provider.of<CertificateProvider>(context, listen: false).storeCer(id);
}
Future<void> storePatents(String id) async {
await Provider.of<PatentProvider>(context, listen: false).storePet(id);
}
Future<void> storeNIHGrants(String id) async {
await Provider.of<NIHGrantsProvider>(context, listen: false).storeNih(id);
}
Future<void> storeProcedures(String id) async {
await Provider.of<ProcedureProvider>(context, listen: false).storePro(id);
}
Future<void> storeTraining(String id) async {
await Provider.of<TrainigProvider>(context, listen: false)
.storeTraining(id);
}
Future<void> storeSpeakerEvaluations(String id) async {
await Provider.of<SpekerEvalutionProvider>(context, listen: false)
.storeSpeaker(id);
}
Map<String, dynamic> 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<String> selectedIndices, List displayedHCPList) async {
for (int i = 0; i < selectedIndices.length; i++) {
print('The id id : ${selectedIndices[i]}');
Map<String, dynamic>? row =
findRecordById(displayedHCPList!, selectedIndices[i]);
print("Storingggg_isss:Row $row");
await HiveFunctions.savemyContact(row);
}
}
offlineProfileRemoveContact(List<int> _selectedremoveIndices) async {
print("Selected: ${_selectedremoveIndices.length}");
for (int i = 0; i < _selectedremoveIndices.length; i++) {
await HiveFunctions.deleteUser11(_selectedremoveIndices[i]);
}
}
}

View File

@ -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<dynamic> 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<EventList> 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<List<EventList>?> 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<EventList> 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 {
const url = '$curl/contacts/v2/en/kol_location_fetch';
// 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 {
var url = '$curl/contacts/v2/en/kol_location_fetch';
// 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<Data> kolLocation = jsonEvent.map((e) => Data.fromJson(e)).toList();
@ -256,9 +243,11 @@ class CallK2api {
}
}
Future<List<DataPhno>?> 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<DataPhno>? datalist = dataPno.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<DataPhno>? datalist = dataPno.data;
// List kol_pno = jsonpno.map((e) => pno.PhnoData.fromJson(e)).toList();
// print("All_kol_pnoDataa123: ${datalist}");
print("All_kol_pnoDataa123: ${datalist}");
// List<Datum> users = (response.data['data'] as List)
// .map((userJson) => Datum.fromJson(userJson))
// .toList();
// return users;
return datalist;
}
// return datalist;
// }
// return jsonEvent.map((pno) => Phoneno.fromJson(pno)).toList();
final List jsonEvent = phoneno.data["data"]; // Directly use the data
if (phoneno.statusCode == 200) {
List<DataPhno> kolPno =
jsonEvent.map((e) => DataPhno.fromJson(e)).toList();
print("All_locDataaK22: ${kolPno}");
return kolPno;
}
}
Future<List<EmailData>?> 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<EmailData> 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<EmailData>? emailinfo = email1.data;
// return emailinfo;
// }
// final List jsonEvent = phoneno.data["data"]; // Directly use the data
// if (phoneno.statusCode == 200) {
// List<DataPhno> kolPno =
// jsonEvent.map((e) => DataPhno.fromJson(e)).toList();
// print("All_locDataaK22: ${kolPno}");
// return kolPno;
// }
}
Future<List<EmailData>?> 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<List<CertificateList>?> 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<List<EducationList>?> 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<List<AwardsList>?> getawarddata(id) async {
@ -420,20 +457,12 @@ class CallK2api {
List<AwardsList> 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<List<TrainingList>?> 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<List<EventList>?> 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<EventList> evelist = dataeve.data!;
return evelist;
}
return null;
}
Future<List<HcpNotes>?> 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<HcpNotes> 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<String, dynamic> 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<dynamic> jsonList = jsonDecode(response);
// return jsonList;
List<Map<String, dynamic>> jsonList = [allnotes.data];
return jsonList;
// FetchNotes notes = FetchNotes.fromJson(allnotes.data);
// List<HcpNotes> 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<HcpNotes> noteslist = notes.data!;
// print("GetAllNotesss: $noteslist");
// return noteslist;
List<Map<String, dynamic>> jsonList = [allnotes.data];
print("DELETE_List_isss: ${jsonList}");
return jsonList;
}
return null;
}
}

View File

@ -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<Map<String, dynamic>> filteredData = Affiliation['Affiliations']
// // .where((item) => item['user_id'] == id)
// // .cast<Map<String, dynamic>>()
// // .toList();
// // print("filteredDatafilteredDatafilteredData: ${filteredData}");
// // // Print filtered data
// // final List<dynamic> 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<dynamic> publication = Publications['Publications'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Publications['Publications']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Events['Events'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Events['Events']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> trials = Trials['Trials'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Trials['Trials']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> 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<dynamic> event = Location['Location'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Location['Location']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = PhoneNo['Location'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = PhoneNo['PhoneNo']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Email['Email'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Email['Email']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Patent['Patent'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Patent['Patent']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Certificate['Certificate'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Certificate['Certificate']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Education['Education'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Education['Education']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Awards['Awards'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Awards['Awards']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Training['Training'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Training['Training']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Nih['NIHGrants'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Nih['NIHGrants']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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<dynamic> event = Pro['Procedure'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Pro['Procedure']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .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}");

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Affiliation>('affiliationshive');
print('Retrive Doctor}');

View File

@ -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<Awa>('awahive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Awa> 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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Awa>('awahive');

View File

@ -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<Awa>('cerhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Awa> 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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Awa>('cerhive');

View File

@ -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<Edu>('edulhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Edu> 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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Edu>('edulhive');

View File

@ -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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Email>('emailhive');
// print('Retrive Doctor}');
// var pnos = box.get(id);
// print('Retrive Doctor locations ${pnos}}');
// List<Email> 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<Email>('emailhive');
print('Retrive Doctor}');
@ -58,3 +78,24 @@ retrieveidemails(int id) async {
}
return dataemail;
}
k2addEmail(List emaillist) async {
var box = await Hive.openBox<Email>('emailhive');
List<Email> 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);
}
}

View File

@ -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;

View File

@ -17,8 +17,8 @@ class EmailAdapter extends TypeAdapter<Email> {
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?,
);

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<void> retrieveEventss() async {
var box = await Hive.openBox<Events>('eventhive');
print('Retrive Doctor}');

View File

@ -27,12 +27,22 @@ addKolInfo(Map<String, dynamic> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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 {

View File

@ -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<Location>('lochive');
@ -14,8 +15,8 @@ addLoc(List loclist) async {
// Convert JSON list to List<Affiliation>
List<Location> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
@ -48,14 +68,56 @@ addLoc(List loclist) async {
retrieveidlocations(int id) async {
var box = await Hive.openBox<Location>('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<Location> dataloc = [];
if (locations != null) {
dataloc.add(locations); // Add to the list if not null
}
return dataloc;
// List<Location> 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<Location>('lochive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Location> 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);
}
}

View File

@ -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;

View File

@ -17,8 +17,8 @@ class LocationAdapter extends TypeAdapter<Location> {
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?,

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Nih>('nihhive');

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Patent>('pethive');

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
@ -49,12 +67,43 @@ retrieveidpnos(int id) async {
var box = await Hive.openBox<PhoneNo>('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<PhoneNo> datapno = [];
if (pnos != null) {
datapno.add(pnos); // Add to the list if not null
}
return datapno;
// List<PhoneNo> 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<PhoneNo>('pnohive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<PhoneNo> 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);
}
}

View File

@ -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;

View File

@ -17,8 +17,8 @@ class PhoneNoAdapter extends TypeAdapter<PhoneNo> {
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?,

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Pro>('prohive');

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<void> retrievePublications() async {
var box = await Hive.openBox<Publication>('pubhive');
print('Retrive Doctor}');

View File

@ -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<savecontactfilter>('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<savecontactfilter>('filtershive');
List<savecontactfilter> 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<Map<String, String>> filtersToSave = filters;
// Store the list in the Hive box
await box.put('filters', flist);
// var box = await Hive.openBox<savecontactfilter>('filtershive');
// await box.put(await getNextAutoIncrementValue(), flist);
// List<savecontactfilter> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<savecontactfilter>('filtershive');
print(
"GetAllFiltersss: ${box.values.toList()}, ${box.values.toList().length}");
return box.values.toList();
}
Future<List<savecontactfilter?>> getFiltersFromHive1() async {
var box = await Hive.openBox<savecontactfilter>('filtershive');
// Getting all the keys in the box
final keys = box.keys;
// Mapping the keys to the corresponding values
List<savecontactfilter?> filters = keys.map((key) {
return box.get(key);
}).toList();
return filters;
}
Future<List<Map<String, String>>> getFiltersFromHive() async {
var box = await Hive.openBox<savecontactfilter>('filtershive');
List<Map<String, String>> 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<List<Map<String, String>>> getFilters() async {
var box = await Hive.openBox('filtersBox');
// Get the list from the box
List<Map<String, String>>? filters = box.get('filters');
print("Checking Filters: ${filters}");
return filters ?? []; // Return an empty list if none found
}

View File

@ -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,
});
}

View File

@ -0,0 +1,47 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'save_filter_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class savecontactfilterAdapter extends TypeAdapter<savecontactfilter> {
@override
final int typeId = 48;
@override
savecontactfilter read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
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;
}

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Spe>('speahive');

View File

@ -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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<Training1>('traininghive');

View File

@ -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<Trials>('trialshive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Trials> 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<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('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<void> retrieveTrials() async {
var box = await Hive.openBox<Trials>('trialshive');
print('Retrive Doctor}');
@ -61,7 +70,6 @@ Future<void> 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<Trials> datatrials = [];
if (trials != null) {
datatrials.add(trials); // Add to the list if not null
datatrials.add(trials);
}
return datatrials;
}

View File

@ -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<Activities> {
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<Activities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -278,7 +267,7 @@ class _ActivitiesState extends State<Activities> {
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<Activities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -440,7 +429,7 @@ class _ActivitiesState extends State<Activities> {
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<Activities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -596,7 +585,7 @@ class _ActivitiesState extends State<Activities> {
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<Activities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up

View File

@ -106,80 +106,7 @@ class _AffiliationsDataState extends State<AffiliationsData> {
// 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<AffiliationsData> {
),
),
),
// Padding(
// padding: const EdgeInsets.only(left: 18.0),
// child:
// GestureDetector(
// onTap: () async {
// final ConfigDataProvider
// configDataProvider =
// ConfigDataProvider();
// await configDataProvider
// .initConfigUIDataEng();
// final provider =
// Provider.of<InteractionProvider>(
// 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(

View File

@ -627,11 +627,6 @@ class _MyWidgetState extends State<bsheet> {
.name,
)));
}
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// const InteractionListScreen()));
},
child: Text(
"View Engagement Form",
@ -902,498 +897,3 @@ class _MyWidgetState extends State<bsheet> {
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<bsheet> createState() => _MyWidgetState();
// }
// class _MyWidgetState extends State<bsheet> {
// 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<InteractionProvider>(
// 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<int> getCount(String form, InteractionProvider provider) async {
// await provider.getRecords();
// return provider.savedList.where((element) => element.form == form).length;
// }
// }

View File

@ -1,215 +0,0 @@
// import 'package:flutter/cupertino.dart';
// class bsheetDynamicheight extends StatefulWidget {
// const bsheetDynamicheight(this.publicationdata, {super.key});
// final publicationdata;
// @override
// State<bsheetDynamicheight> createState() => _bsheetDynamicheightState();
// }
// class _bsheetDynamicheightState extends State<bsheetDynamicheight> {
// 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: <Widget>[
// // Text(
// // 'GeeksforGeeks'),
// // Text(
// // 'GeeksforGeeks'),
// // ListView(
// // children: [
// ...List.generate(
// 20,
// (index) => Text('GeeksforGeeks $index'),
// )
// ],
// // )
// // ],
// ),
// ),
// ),
// ],
// ),
// );
// },
// ),
// );
// }
// }

View File

@ -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<Chart> createState() => _ChartState();
// }
// class _ChartState extends State<Chart> {
// @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<LinearSales, String>(
// 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<int> 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<Chart> createState() => _ChartState();
}
class _ChartState extends State<Chart> {
@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<LinearSales, String>(
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<int> 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<LinearSales, String>(
// 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<int> 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<LinearSales, String>(
// 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<int> 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);
// }

View File

@ -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<FilterDrawer> createState() => _FilterDrawerState();
@ -37,12 +43,58 @@ class _FilterDrawerState extends State<FilterDrawer> {
'Event',
];
var selectedtypevalue;
List filtersdata = [];
// List savefiltersdata = [];
List<Map<String, String>> savefiltersdata = [];
List<Map<String, String>> filtersdataarray = [];
List multidatalist = [];
@override
void initState() {
// TODO: implement initState
super.initState();
getFilterss();
}
Future<void> getFilterss() async {
// var filters = await getAllFilters();
var filters = await getFilters();
print("Filterdataaaa_iss: $filters, ${filters.length}");
setState(() {
// filtersdataarray.clear();
filtersdata = filters;
});
}
Future<void> getFilterss123(List<Map<String, String>> 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<hcpProvider>(context); // Adjust to your provider
return Drawer(
child: Column(
children: [
Flexible(
flex: 2,
child: ValueListenableBuilder<List<String>>(
valueListenable: ddlist,
builder: (context, value, child) {
@ -124,7 +176,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
onChanged: (String? newValue) {
setState(() {
selectedType = newValue;
optionsData();
optionsData(selectedType);
});
},
buttonStyleData: const ButtonStyleData(
@ -146,12 +198,6 @@ class _FilterDrawerState extends State<FilterDrawer> {
searchInnerWidgetHeight: 50,
searchInnerWidget: Container(
height: 50,
// padding: const EdgeInsets.only(
// top: 8,
// bottom: 4,
// right: 8,
// left: 8,
// ),
child: TextFormField(
expands: true,
maxLines: null,
@ -199,18 +245,22 @@ class _FilterDrawerState extends State<FilterDrawer> {
child: DropDownField(
hintText: 'Select an option',
items: value,
onValueChanged: (newValue) {
// setState(() {
selectedValue = newValue;
onValueChanged: (newValue) async {
widget.onValueChanged(newValue);
searchController.text = selectedValue;
setState(() {
selectedtypevalue = newValue;
});
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Contacts1()),
).then((value) => setState(() {}));
// });
// await AddFilterstoSave(
// selectedtypevalue, selectedType);
// getFilterss();
print(
"checkingFilterss: ${newValue}, ${selectedType}");
// Navigator.pop(context); // Close the drawers
SaveFilter(newValue, selectedType);
},
value: selectedValue,
),
@ -224,6 +274,8 @@ class _FilterDrawerState extends State<FilterDrawer> {
children: [
OutlinedButton(
onPressed: () {
// getAllFilters();
Navigator.push(
context,
MaterialPageRoute(
@ -245,12 +297,166 @@ class _FilterDrawerState extends State<FilterDrawer> {
],
),
),
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"]);
}
optionsData() async {
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(String? selectedType) async {
print("hiiiiiiiii");
if (selectedType == "Profile Type") {
print("PPPP11");
@ -311,4 +517,447 @@ class _FilterDrawerState extends State<FilterDrawer> {
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<FilterDrawer> createState() => _FilterDrawerState();
// }
// class _FilterDrawerState extends State<FilterDrawer> {
// 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<void> getFilterss() async {
// var filters = await getAllFilters();
// print("Filterdataaaa_iss: $filters, ${filters.length}");
// setState(() {
// filtersdata = filters;
// });
// }
// @override
// Widget build(BuildContext context) {
// final dropdownProvider =
// Provider.of<hcpProvider>(context); // Adjust to your provider
// return Drawer(
// child: Column(
// children: [
// Expanded(
// child: ValueListenableBuilder<List<String>>(
// valueListenable: ddlist,
// builder: (context, value, child) {
// return ListView(
// children: <Widget>[
// // 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<String>(
// 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<String>(
// 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<void> fetchhcpname([String? selectedType]) async {
// print("selectedTypeselectedType: ${selectedType}, ${widget.switchValue}");
// var hcpDataProvider1 = Provider.of<hcpProvider>(context, listen: false);
// if (widget.switchValue == false) {
// List<String> namelist =
// await hcpDataProvider1.gethcpNamefilter(selectedType);
// ddlist.value = namelist;
// setState(() {});
// } else {
// List<String> 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")),
// );
// }
// }

View File

@ -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<Contacts> createState() => _ContactsState();
// // }
// // class _ContactsState extends State<Contacts> {
// // // final _contactbox = Hive.box('mycontact');
// // static final _contactbox = Hive.box("mycontact");
// // bool _switchValue = false;
// // bool isOnline2 = false;
// // // List<dynamic> alldata = _contactbox.values.toList();
// // @override
// // void initState() {
// // // TODO: implement initState
// // super.initState();
// // setupConnectivityListener();
// // getcall();
// // }
// // NetworkConnectivity networkConnectivity = NetworkConnectivity();
// // Future<void> 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<hcpProvider>(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<hcpProvider>(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<Contacts> createState() => _ContactsState();
// }
// class _ContactsState extends State<Contacts> {
// final _contactBox = Hive.box("mycontact");
// bool _switchValue = false;
// bool? isOnline2;
// @override
// void initState() {
// super.initState();
// setupConnectivityListener();
// // getCall();
// }
// Future<void> 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<hcpProvider>(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<hcpProvider>(
// 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,
// ),
// ),
// );
// },
// ),
// ),
// ],
// );
// },
// ),
// ),
// );
// }
// }

View File

@ -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<Discover> createState() => _DiscoverState();
// }
// class _DiscoverState extends State<Discover> 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: <Widget>[
// 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 <Widget>[
// Tab(text: 'Ranking'),
// // Tab(text: 'Chart'),
// Tab(text: 'Trends'),
// //Tab(text: 'Referral'),
// Tab(text: 'Rising Stars '),
// ],
// ),
// Expanded(
// child: TabBarView(
// controller: _tabController,
// children: <Widget>[
// Ranking(),
// // const Chart1(),
// const Trends(),
// //const Referral(),
// const RisingStar(),
// ],
// ),
// ),
// ],
// );
// }
// }

View File

@ -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<EngagementTab> createState() => _EngagementTabState();
}
@ -71,6 +74,8 @@ class _EngagementTabState extends State<EngagementTab> {
@override
void initState() {
// TODO: implement initState
print("Engagement_offlineModee: ${widget.offlineMode}");
super.initState();
getdata();
}
@ -139,225 +144,6 @@ class _EngagementTabState extends State<EngagementTab> {
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<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 <b> therapeutic </b> 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>[
// 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<EngagementTab> {
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<EngagementTab> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -585,7 +371,11 @@ class _EngagementTabState extends State<EngagementTab> {
),
speakerlistt.length != 0
? ListTileTheme(
? GestureDetector(
onTap: () {
// Do nothing to prevent expansion
},
child: ListTileTheme(
dense: true,
child: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
@ -595,7 +385,7 @@ class _EngagementTabState extends State<EngagementTab> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0),
),
color: Constants.k2color11,
color: Constants.bgwhitecolor,
child: ExpansionTile(
initiallyExpanded: false,
maintainState: true,
@ -604,17 +394,14 @@ class _EngagementTabState extends State<EngagementTab> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
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",
@ -625,20 +412,26 @@ class _EngagementTabState extends State<EngagementTab> {
width: 8.0,
),
Text1(
title: "(${speakerlistt.length.toString()})",
title:
"(${speakerlistt.length.toString()})",
txtcolor: Colors.black,
fontweight: FontWeight.normal,
txtfont: 17.0),
],
),
children: [
Scrollbar(
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),
minWidth: MediaQuery.of(context)
.size
.width),
color: Colors.white,
child: DataTable(
showCheckboxColumn: false,
@ -655,8 +448,8 @@ class _EngagementTabState extends State<EngagementTab> {
label: Expanded(
child: Text('Speaker Name',
style: TextStyle(
fontWeight:
FontWeight.w600)))),
fontWeight: FontWeight
.w600)))),
],
rows: List.generate(
speakerlistt.take(2).length,
@ -674,7 +467,8 @@ class _EngagementTabState extends State<EngagementTab> {
isScrollControlled: false,
enableDrag: true,
useSafeArea: true,
constraints: const BoxConstraints(
constraints:
const BoxConstraints(
maxWidth: double.infinity,
),
shape: RoundedRectangleBorder(
@ -694,9 +488,11 @@ class _EngagementTabState extends State<EngagementTab> {
},
color: MaterialStateProperty
.resolveWith<Color?>(
(Set<MaterialState> states) {
(Set<MaterialState>
states) {
if (index.isEven) {
return Colors.grey.withOpacity(0.1);
return Colors.grey
.withOpacity(0.1);
}
return null;
}),
@ -718,7 +514,12 @@ class _EngagementTabState extends State<EngagementTab> {
),
),
),
Container(
),
Visibility(
visible: widget.offlineMode == null
? true
: widget.offlineMode!,
child: Container(
color: Colors.white,
child: Align(
alignment: Alignment.center,
@ -734,12 +535,14 @@ class _EngagementTabState extends State<EngagementTab> {
},
child: Text(
'Show More',
style:
TextStyle(color: Constants.k2color),
style: TextStyle(
color: Constants.k2color),
),
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
borderRadius:
BorderRadius.circular(12),
),
),
),
),
@ -749,6 +552,7 @@ class _EngagementTabState extends State<EngagementTab> {
]),
),
),
),
)
: Container(), // adds spacing between the text and image
@ -763,7 +567,7 @@ class _EngagementTabState extends State<EngagementTab> {
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<EngagementTab> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -916,7 +720,7 @@ class _EngagementTabState extends State<EngagementTab> {
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<EngagementTab> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -1069,7 +873,7 @@ class _EngagementTabState extends State<EngagementTab> {
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<EngagementTab> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up

View File

@ -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<ViewNotes> createState() => _ViewNotesState();
}
class _ViewNotesState extends State<ViewNotes> {
// 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<void> fetchhcpnotes() async {
// print("Hiiiiii");
// var notesprovider = Provider.of<HcpNotesFecth>(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<HcpNotesFecth>(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<AddNotesProvider>(
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<AddNotesProvider>(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<ViewNotes> createState() => _ViewNotesState();
// }
// class _ViewNotesState extends State<ViewNotes> {
// // late FetchNotes;
// List notess = [];
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// fetchhcpnotes();
// }
// Future<void> fetchhcpnotes() async {
// print("Hiiiiii");
// var notesprovider = Provider.of<HcpNotesFecth>(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);
// }));
// }
// }

View File

@ -6,10 +6,6 @@ import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
class NetworkConnectivity {
// Future<bool> isInternetAvailable() async {
// var connectivityResult = await (Connectivity().checkConnectivity());
// return connectivityResult != ConnectivityResult.none;
// }
Future<bool> 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;

View File

@ -1320,16 +1320,6 @@ class _InteractionScreenState extends State<InteractionScreen> {
//);
}
// String fieldsValidation(InteractionProvider provider) {
// List<SectionList> 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 '';
}

View File

@ -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';

View File

@ -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}
// // }
// ],
// },
]
}
]

View File

@ -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<FormFieldData> formFields;
// UIDataResponse({
// required this.success,
// required this.message,
// required this.formFields,
// });
// factory UIDataResponse.fromJson(Map<String, dynamic> json) => UIDataResponse(
// success: json["success"],
// message: json["message"],
// formFields: List<FormFieldData>.from(
// json["data"].map((x) => FormFieldData.fromJson(x))),
// );
// Map<String, dynamic> toJson() => {
// "success": success,
// "message": message,
// "form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
// };
// @override
// String toString() {
// // TODO: implement toString
// return List<dynamic>.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<String, dynamic> 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';

View File

@ -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<checkinter> createState() => _checkinterState();
// }
// class _checkinterState extends State<checkinter> {
// @override
// Widget build(BuildContext context) {
// return const Placeholder();
// }
// }
// final Connectivity _connectivity = Connectivity();
// get developer => null;
// Future<void> initConnectivitycheck() async {
// late List<ConnectivityResult> 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);
// }

View File

@ -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<ActivitiesK2> createState() => _ActivitiesState();
@ -118,6 +105,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
buttonText: 'Show More',
field1: 'Organization Name',
field2: 'TimeFrame',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (AffList selectedLocation) {
List<Map<String, dynamic>> keyValue = [
{
@ -133,6 +121,16 @@ class _ActivitiesState extends State<ActivitiesK2> {
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<AffList>(
title: "Affiliations",
itemList: affiliation_data.cast<AffList>(),
buttonText: 'Show More',
field1: 'Organization Name',
field2: 'TimeFrame',
noexpand: false,
onItemSelected: (AffList selectedLocation) {},
)
: Container(),
publication_data.length != 0
@ -146,7 +144,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
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<ActivitiesK2> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -304,6 +302,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
buttonText: 'Show More',
field1: 'Event Name',
field2: 'Role',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EventList selectedLocation) {
List<Map<String, dynamic>> keyValue = [
{
@ -315,6 +314,22 @@ class _ActivitiesState extends State<ActivitiesK2> {
];
modelbsheet(keyValue);
},
onButtonPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => Events2ShowMore(text: widget.text)));
},
)
: widget.offlineMode != null
? CustomExpansionTile<EventList>(
title: "Events",
itemList: event_data.cast<EventList>(),
buttonText: 'Show More',
field1: 'Event Name',
field2: 'Role',
noexpand: false,
onItemSelected: (EventList selectedLocation) {},
)
: Container(),
@ -329,7 +344,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
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<ActivitiesK2> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up

View File

@ -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<ActivitiesK2Demo> createState() => _ActivitiesState();
}
class _ActivitiesState extends State<ActivitiesK2Demo> {
bool isDataLoaded = false;
@override
void initState() {
super.initState();
getaffiliations();
}
Future<void> getaffiliations() async {
final affProvider =
Provider.of<AffiliationsProviderk2>(context, listen: false);
final eveProvider = Provider.of<EventProviderK2>(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<AffiliationsProviderk2>(context, listen: false);
final eveProvider = Provider.of<EventProviderK2>(context, listen: false);
return Center(
child: ListView(children: [
affProvider.hasData
? CustomExpansionTile<AffList>(
title: "Affiliations",
itemList: affProvider.adddta.cast<AffList>(),
buttonText: 'Show More',
field1: 'Organization Name',
field2: 'TimeFrame',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (AffList selectedLocation) {
List<Map<String, dynamic>> 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<EventList>(
title: "Events",
itemList: eveProvider.EventsList.cast<EventList>(),
buttonText: 'Show More',
field1: 'Event Name',
field2: 'Role',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EventList selectedLocation) {
List<Map<String, dynamic>> 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<void>(
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<Map<String, dynamic>> 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);
},
);
}
}

View File

@ -54,10 +54,13 @@ class _bsheetk2State extends State<bsheetk2new> {
Padding(
padding:
const EdgeInsets.symmetric(vertical: 4.0),
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)
],
);

View File

@ -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,195 +14,210 @@ 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<LocationK2Tab> createState() => _LocationK2TabState();
}
class _LocationK2TabState extends State<LocationK2Tab> {
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) {
WidgetsBinding.instance.addPostFrameCallback((_) {
print("I_aminitstate");
if (!isDataLoaded) {
getAffiliations();
}
});
}
Future<void> getAffiliations() async {
// ignore: prefer_typing_uninitialized_variables
var loclist, phoneno, emailno1, edu1, awa1, cer1, training1;
final locationProvider =
Provider.of<LocationKolProvider>(context, listen: false);
final pnoProvider = Provider.of<PhonenoProviderK2>(context, listen: false);
final emailProvider = Provider.of<EmailProviderK2>(context, listen: false);
final trainingProvider =
Provider.of<TrainigProviderK2>(context, listen: false);
final educationProvider =
Provider.of<EducationProviderK2>(context, listen: false);
final awardsProvider = Provider.of<AwardProviderK2>(context, listen: false);
final certificateProvider =
Provider.of<CertificateProviderK2>(context, listen: false);
Future<void> _loadData(
bool hasData,
Function fetchDataOffline,
Function fetchDataOnline,
dynamic setStateCallback,
) async {
if (!hasData) {
if (widget.offline == 1) {
loclist = await retrieveidlocations(widget.text);
print("Saved_Checkingloclist: $loclist");
print("Offline mode: ${widget.offline}");
var data = await fetchDataOffline(widget.text);
print("Retrieved data: $data");
setState(() => setStateCallback(data));
} else {
var location = Provider.of<LocationKolProvider>(context, listen: false);
await location.locationinfo(widget.text);
loclist = location.locationlist;
setState(() {
locationList = loclist;
});
await fetchDataOnline(widget.text);
}
}
}
// Location data fetch logic
if (mounted) {
if (widget.offline == 1) {
phoneno = await retrieveidpnos(widget.text);
print("Saved_Checkingloclist: $loclist");
} else {
var phone = Provider.of<PhonenoProviderK2>(context, listen: false);
await phone.phonek2info(widget.text);
phoneno = phone.phonenolist;
}
setState(() {
pno = phoneno;
});
await _loadData(
locationProvider.hasData,
retrieveidlocations,
locationProvider.locationinfo,
(data) => locationList = data,
);
}
// Phone number data fetch logic
if (mounted) {
if (widget.offline == 1) {
emailno1 = await retrieveidemails(widget.text);
print("Saved_CheckingloclistEmailll: $emailno1");
} else {
var email = Provider.of<EmailProviderK2>(context, listen: false);
await email.emailinfo(widget.text);
emailno1 = email.emailkollist;
print("Saved_CheckingloclistEmailll123: $emailno1");
}
setState(() {
emailid = emailno1;
});
await _loadData(
pnoProvider.hasData,
retrieveidpnos,
pnoProvider.phonek2info,
(data) => phonenolist = data,
);
}
// Email data fetch logic
if (mounted) {
if (widget.offline == 1) {
training1 = await retrieveidtri(widget.text);
print("Saved_CheckingloclistEmailll: $emailno1");
} else {
var trai = Provider.of<TrainigProviderK2>(context, listen: false);
await trai.traininginfo(widget.text);
training1 = trai.traininglist;
}
setState(() {
training = training1;
});
await _loadData(
emailProvider.hasData,
retrieveidemails,
emailProvider.emailinfo,
(data) => mailList = data,
);
}
// Training data fetch logic
if (mounted) {
if (widget.offline == 1) {
edu1 = await retrieveidedus(widget.text);
print("Saved_CheckingloclistEdu: $edu1");
} else {
var edu = Provider.of<EducationProviderK2>(context, listen: false);
await edu.eduinfo(widget.text);
edu1 = edu.educationlist;
print("Saved_CheckingloclistEdu123: $edu1");
}
setState(() {
education = edu1;
});
await _loadData(
trainingProvider.hasData,
retrieveidtri,
trainingProvider.traininginfo,
(data) => {}, // Handle training data if needed
);
}
// Education data fetch logic
if (mounted) {
if (widget.offline == 1) {
awa1 = await retrieveidawa(widget.text);
print("Saved_CheckingloclistEdu: $edu1");
} else {
var awa = Provider.of<AwardProviderK2>(context, listen: false);
await awa.awainfo(widget.text);
awa1 = awa.awardlist;
}
setState(() {
award = awa1;
});
await _loadData(
educationProvider.hasData,
retrieveidtri,
educationProvider.eduinfo,
(data) => {}, // Handle education data if needed
);
}
// Awards data fetch logic
if (mounted) {
if (widget.offline == 1) {
cer1 = await retrieveidcer(widget.text);
print("Saved_CheckingloclistEdu: $edu1");
} else {
var cer = Provider.of<CertificateProviderK2>(context, listen: false);
await cer.certificateinfo(widget.text);
cer1 = cer.certificatelist;
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(() {
certificate = cer1;
isDataLoaded = true; // Mark data as loaded
});
}
}
@override
Widget build(BuildContext context) {
final locationProvider = Provider.of<LocationKolProvider>(context);
final pnoProvider = Provider.of<PhonenoProviderK2>(context);
final emailProvider = Provider.of<EmailProviderK2>(context);
final trainingProvider =
Provider.of<TrainigProviderK2>(context, listen: false);
final educationProvider =
Provider.of<EducationProviderK2>(context, listen: false);
final awardsProvider = Provider.of<AwardProviderK2>(context, listen: false);
var certificateProvider =
Provider.of<CertificateProviderK2>(context, listen: false);
print("LocationProvider_hasdata: ${locationProvider.hasData}");
List<Data> dataList = locationList.map((location) {
print("Location_dataaaa_issss: ${location.address}");
return Data(address1: location.address, postalCode: location.city);
}).toList();
List<DataPhno> dataPnoList = phonenolist.map((location) {
print("Pnooo_dataaaa_issss: ${location.phoneType}");
return DataPhno(
organizationName: location.phoneType.toString(),
number: int.parse(location.phoneNumber));
}).toList();
List<EmailData> 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<Data>(
child: ListView(
children: [
locationProvider.hasData
? CardCustomExpansionTile<Data>(
title: "Locations",
itemList: locationList.cast<Data>(),
itemList: locationProvider.locationlist.cast<Data>(),
buttonText: 'Show More',
field1: 'Institutation',
field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (Data selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Address": selectedPhoneNumber.address1,
"Postal Code": selectedPhoneNumber.postalCode,
"Primary": selectedPhoneNumber.formattedIsPrimary,
"organization Name": selectedPhoneNumber.organizationName,
"organization Name":
selectedPhoneNumber.organizationName,
"Country Name": selectedPhoneNumber.countryName,
"State Name": selectedPhoneNumber.stateName,
"City Name": selectedPhoneNumber.cityName,
@ -211,36 +226,79 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
// onButtonPressed: () {
// print("Show More button clicked");
// },
onButtonPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => Lock2ShowMore()));
},
)
: Container(),
pno.length != 0
? CustomExpansionTile<DataPhno>(
title: "Phone Numbers",
itemList: pno.cast<DataPhno>(),
:
// widget.offlineMode != null
// ?
CustomExpansionTile<Data>(
title: "Locations1",
// itemList: locationList.cast<Data>(),
itemList: dataList,
buttonText: 'Show More',
field1: 'Phone Type',
field2: 'Phone No',
field1: 'Institutation',
field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (Data selectedPhoneNumber) {},
),
//: Container(),
pnoProvider.hasData
? CardCustomExpansionTile<DataPhno>(
title: "Phone Numbers",
itemList: pnoProvider.phonenolist.cast<DataPhno>(),
buttonText: 'Show More',
field1: 'Institutation',
field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (DataPhno selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Phone Number": selectedPhoneNumber.number,
"Phone Type": selectedPhoneNumber.phoneTypeName,
"Primary": selectedPhoneNumber.formattedIsPrimary,
"organization Name": selectedPhoneNumber.organizationName,
"organization Name":
selectedPhoneNumber.organizationName,
}
];
modelbsheet(keyValue);
},
onButtonPressed: () {
print("Show More button clicked");
},
)
: Container(),
emailid.length != 0
? CustomExpansionTile<EmailData>(
:
// widget.offlineMode != null
// ?
CustomExpansionTile<DataPhno>(
title: "Phone Numbers",
// itemList: pnoProvider.phonenolist.cast<DataPhno>(),
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<EmailData>(
title: "Emails",
itemList: emailid.cast<EmailData>(),
itemList: emailProvider.emailkollist.cast<EmailData>(),
buttonText: 'Show More',
field1: 'Email Type',
field2: 'Email',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EmailData selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
@ -251,15 +309,30 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
onButtonPressed: () {
print("Show More button clicked");
},
)
: Container(),
training.length != 0
? CustomExpansionTile<TrainingList>(
: CustomExpansionTile<EmailData>(
title: "Emails",
//itemList: emailProvider.emailkollist.cast<EmailData>(),
itemList: dataEmailList,
buttonText: 'Show More',
field1: 'Email Type',
field2: 'Email',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EmailData selectedPhoneNumber) {},
),
// : Container(),
trainingProvider.hasData
? CardCustomExpansionTile<TrainingList>(
title: "Trainings",
itemList: training.cast<TrainingList>(),
itemList: trainingProvider.traininglist.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (TrainingList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
@ -273,14 +346,26 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
)
: Container(),
education.length != 0
? CustomExpansionTile<EducationList>(
title: "Education",
itemList: education.cast<EducationList>(),
: widget.offlineMode != null
? CustomExpansionTile<TrainingList>(
title: "Trainings",
// itemList: trainingProvider.traininglist.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (TrainingList selectedPhoneNumber) {},
)
: Container(),
educationProvider.hasData
? CardCustomExpansionTile<EducationList>(
title: "Education",
itemList:
educationProvider.educationlist.cast<EducationList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EducationList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
@ -294,14 +379,25 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
)
: Container(),
award.length != 0
? CustomExpansionTile<AwardsList>(
title: "Awards",
itemList: award.cast<AwardsList>(),
: widget.offlineMode != null
? CustomExpansionTile<EducationList>(
title: "Education",
// itemList: trainingProvider.traininglist.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (EducationList selectedPhoneNumber) {},
)
: Container(),
awardsProvider.hasData
? CardCustomExpansionTile<AwardsList>(
title: "Awards",
itemList: awardsProvider.awardlist.cast<AwardsList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (AwardsList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
@ -313,14 +409,25 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
)
: Container(),
certificate.length != 0
? CustomExpansionTile<CertificateList>(
title: "Certificates",
itemList: certificate.cast<CertificateList>(),
: widget.offlineMode != null
? CustomExpansionTile<AwardsList>(
title: "Awards",
// itemList: trainingProvider.traininglist.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (AwardsList selectedPhoneNumber) {},
)
: Container(),
certificateProvider.hasData
? CardCustomExpansionTile<CertificateList>(
title: "Certificates",
itemList: certificateProvider.cerlist.cast<CertificateList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (CertificateList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
@ -333,8 +440,19 @@ class _LocationK2TabState extends State<LocationK2Tab> {
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<CertificateList>(
title: "Awards",
// itemList: trainingProvider.traininglist.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (CertificateList selectedPhoneNumber) {},
)
: Container(),
]),
],
),
);
}

View File

@ -188,9 +188,9 @@ class _LocationTabState extends State<LocationTab> {
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<LocationTab> {
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<LocationTab> {
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<LocationTab> {
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<LocationTab> {
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<LocationTab> {
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<LocationTab> {
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,

View File

@ -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<List<String>> ddlist = ValueNotifier<List<String>>([]);
String selectedValue = '';
String? selectedType;
final TextEditingController searchController = TextEditingController();
@ -86,7 +50,6 @@ class _Contacts1State extends State<Contacts1> {
bool longpressmy = false;
late List<dynamic> hcpdataList;
// ignore: prefer_typing_uninitialized_variables
var hcpDataProvider1;
@ -94,6 +57,10 @@ class _Contacts1State extends State<Contacts1> {
final Connectivity _connectivity = Connectivity();
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
bool offMode = false;
List<Map<String, String>> filterList = [];
get developer => null;
@override
@ -105,6 +72,7 @@ class _Contacts1State extends State<Contacts1> {
_connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
hcpList();
});
}
@ -118,13 +86,36 @@ class _Contacts1State extends State<Contacts1> {
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<Contacts1> {
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<Contacts1> {
icon: Icon(isSearchClickd ? Icons.close : Icons.search))
],
),
endDrawer: FilterDrawer(_switchValue, searchController),
endDrawer: FilterDrawer(_switchValue, searchController,
onValueChanged: updateSelectedValue,
onValueMultiChanged: updatemultivalue),
// Drawer(
// child: listdata(),
// ),
body: Consumer<hcpProvider>(
builder: (context, hcpProvider, child) {
print("_selectedValueConsumerConsumer_isss: $selectedValue");
@ -189,81 +184,16 @@ class _Contacts1State extends State<Contacts1> {
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;
});
},
_offlineBanner(),
headerRow(),
const CustomSizedBox(
height: 5.0,
),
),
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,
)),
],
),
)
],
),
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<Contacts1> {
);
}
Future<void> _showMyDialog(String data) async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Successfully'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
// Text('This is a demo alert dialog.'),
Text(data),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('Ok'),
onPressed: () {
Navigator.of(context).pop();
setState(() {
_selectedIndices.clear();
_selectedremoveIndices.clear();
longpress = false;
longpressmy = false;
});
},
),
],
);
},
);
}
Map<String, dynamic> findRecordById(
List displayedHCPList, String selectedIndic) {
// print(
@ -317,7 +213,7 @@ class _Contacts1State extends State<Contacts1> {
.firstWhere((element) => element['id'] == int.parse(selectedIndic));
}
hcpContactlistview(List HCPList) {
hcpContactlistview(List HCPList, [offMode]) {
return Expanded(
child: ListView.builder(
itemCount: HCPList.length,
@ -327,8 +223,13 @@ class _Contacts1State extends State<Contacts1> {
print("CheckinggggImage_path: ${data['img_path']}");
return Column(
mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.end,
children: [
ListTile(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: ListTile(
onLongPress: () {
print("LongPresss");
setState(() {
@ -336,50 +237,43 @@ class _Contacts1State extends State<Contacts1> {
});
},
onTap: () async {
print("Check_data11 = ${data}");
print("Check_data11 = ${offMode}");
Navigator.push(
offMode != null
? Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
NewProfile1(text: data, offlinemode: offMode),
),
)
: Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NewProfile1(text: data),
),
);
},
leading: data["img_path"] == ""
? ProfilePicture(
name: data["First Name"],
leading: CustomProfile(
imgstring: data["img_path"],
fontsize: 12.0,
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,
),
),
),
),
),
name: data["First Name"],
),
trailing: Visibility(
visible: longpress,
child: !_switchValue
? Checkbox(
value:
_selectedIndices.contains(data["id"].toString()),
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());
_selectedIndices
.remove(data["id"].toString());
}
print("id_total123: ${_selectedIndices}");
});
@ -398,9 +292,9 @@ class _Contacts1State extends State<Contacts1> {
}),
),
title: Text1(
title: data['name'],
title: "Dr. " + data['name'],
fontweight: FontWeight.bold,
txtfont: isTablet ? 22 : 16,
txtfont: isTablet ? 22 : 15,
),
subtitle: Column(
children: [
@ -410,55 +304,35 @@ class _Contacts1State extends State<Contacts1> {
child: Text1(
title: data["speciality"] ?? data['spl'],
fontweight: FontWeight.normal,
txtfont: isTablet ? 20 : 14,
txtcolor: Colors.black,
txtfont: isTablet ? 20 : 13,
),
),
],
),
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,
),
),
],
),
],
),
const CustomSizedBox(
height: 10.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(left: 10.0),
Expanded(
child: Text1(
title: "Added by Pooja k",
title: "Added by Pooja k on 01/07/2023",
fontweight: FontWeight.normal,
txtfont: 14,
txtfont: 12,
),
),
Padding(
padding: EdgeInsets.only(right: 10.0),
child: Text1(
title: "Added on 01/07/2023",
fontweight: FontWeight.normal,
txtfont: 14,
),
)
],
),
Divider(),
],
),
),
),
const Padding(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Divider(),
),
],
);
},
@ -466,217 +340,19 @@ class _Contacts1State extends State<Contacts1> {
);
}
Future<void> offlineProfileStore(List<String> selectedIndices) async {
for (int i = 0; i < selectedIndices.length; i++) {
print('The id id : ${selectedIndices[i]}');
Map<String, dynamic>? row =
findRecordById(displayedHCPList, selectedIndices[i]);
print("Storingggg_isss:Row $row");
await addKolInfo(row);
await Provider.of<AffiliationsProvider>(context, listen: false)
.storeAff(row["id"]);
await Provider.of<PublicatioProvider>(context, listen: false)
.storePub(row["id"]);
await Provider.of<EventProvider>(context, listen: false)
.storeEvent(row["id"]);
await Provider.of<TrialsProvider>(context, listen: false)
.storeTrials(row["id"]);
await Provider.of<LocationProvider>(context, listen: false)
.storeLoc(row["id"]);
await Provider.of<PhonenoProvider>(context, listen: false)
.storePno(row["id"]);
await Provider.of<EmailProvider>(context, listen: false)
.storeEmail(row["id"]);
await Provider.of<EducationProvider>(context, listen: false)
.storeEdu(row["id"]);
await Provider.of<AwardProvider>(context, listen: false)
.storeAwa(row["id"]);
await Provider.of<CertificateProvider>(context, listen: false)
.storeCer(row["id"]);
await Provider.of<PatentProvider>(context, listen: false)
.storePet(row["id"]);
await Provider.of<NIHGrantsProvider>(context, listen: false)
.storeNih(row["id"]);
await Provider.of<ProcedureProvider>(context, listen: false)
.storePro(row["id"]);
await Provider.of<TrainigProvider>(context, listen: false)
.storeTraining(row["id"]);
await Provider.of<SpekerEvalutionProvider>(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<String, dynamic>? 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<Contacts1> {
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<Contacts1> {
Future<void> _updateConnectionStatus(List<ConnectivityResult> 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<void> _onAddToContacts() async {
print("Selected: ${_selectedIndices}");
print("Selected: ${_selectedIndices.length}");
ProfileStorageService profileStorageService =
ProfileStorageService(context);
await profileStorageService.offlineProfileAddContact(
_selectedIndices, displayedHCPList);
displayAlert("Added");
}
Future<void> _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<void> _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
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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';

View File

@ -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<FormList> {
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<FormList> {
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<FormList> {
},
trailing: const Icon(Icons.arrow_forward_ios),
),
Divider(),
ListTile(
title: const Text(
@ -186,9 +147,7 @@ class _FormListState extends State<FormList> {
},
trailing: const Icon(Icons.arrow_forward_ios),
),
const Divider(),
ListTile(
title: const Text(
"Medical Insight",

View File

@ -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<Ranking> createState() => _RankingState();
// }
// class _RankingState extends State<Ranking> {
// late _DataSource _dataSource;
// List<int> selectedno = [];
// @override
// void initState() {
// super.initState();
// print("hii_initState");
// setupConnectivityListener();
// gethcpdata();
// _dataSource = _DataSource(context); // Initialize _DataSource
// }
// NetworkConnectivity networkConnectivity = NetworkConnectivity();
// Future<void> 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<int> 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<void> _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<int> 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<hcpProvider>(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<int> _selectedRowsIndexes = []; // List to track selected rows
// final List<int> _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<int> 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<void> 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<hcpProvider>(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();
// }
// }

View File

@ -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<RisingStar> createState() => RisingStarState();
}
class RisingStarState extends State<RisingStar> {
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<String> 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<String> _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<String> 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;
}

View File

@ -121,7 +121,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
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<SavedActivities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -274,7 +274,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
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<SavedActivities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -436,7 +436,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
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<SavedActivities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
@ -592,7 +592,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
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<SavedActivities> {
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up

View File

@ -194,45 +194,50 @@ class SavedContacts1State extends State<SavedContacts1> {
// 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(),

View File

@ -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<SavedNewProfile1>
//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<SavedNewProfile1>
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<SavedNewProfile1>
_isExpanded = expanded;
});
},
backgroundColor: Constants.k2color11,
backgroundColor: Constants.bgwhitecolor,
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up

View File

@ -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<Events2ShowMore> createState() => _Events2ShowMoreState();
}
class _Events2ShowMoreState extends State<Events2ShowMore> {
//List evelist = [];
// var _items = <String>[];
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<EventProviderK2>(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<Events2ShowMore> createState() => _Events2ShowMoreState();
// }
// class _Events2ShowMoreState extends State<Events2ShowMore> {
// List evelist = [];
// // var _items = <String>[];
// var _isLoading = false;
// var events;
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// affdata();
// }
// affdata() async {
// // var location = Provider.of<LocationKolProvider>(context, listen: false);
// // await location.locationinfo(widget.text);
// // final loclist = location.locationlist;
// // setState(() {
// // locationList = loclist;
// // });
// events = Provider.of<EventProviderK2>(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<LocationKolProvider>(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');
// });
// }
// }

View File

@ -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<Lock2ShowMore> createState() => _Lock2ShowMoreState();
}
class _Lock2ShowMoreState extends State<Lock2ShowMore> {
final PagingController<int, dynamic> _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<LocationKolProvider>(context, listen: false);
return await location.locationinfo(page);
}
Future<void> _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<int, dynamic>(
pagingController: _pagingController,
builderDelegate: PagedChildBuilderDelegate<dynamic>(
itemBuilder: (context, item, index) {
return Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
onTap: () {
print("OnclickLocationData: ${item.address1}");
List<Map<String, dynamic>> 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<Map<String, dynamic>> 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<Lock2ShowMore> createState() => _Lock2ShowMoreState();
// }
// class _Lock2ShowMoreState extends State<Lock2ShowMore> {
// List locationList = [];
// // var _items = <String>[];
// var _isLoading = false;
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// affdata();
// }
// affdata() async {
// var location = Provider.of<LocationKolProvider>(context, listen: false);
// final loclist = location.locationlist;
// setState(() {
// locationList = loclist;
// });
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: AppBar(
// title: Text('Locations'),
// ),
// body: Consumer<LocationKolProvider>(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');
// });
// }
// }

View File

@ -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<LocationTest> createState() => _LocationTestState();
// }
// class _LocationTestState extends State<LocationTest> {
// //List<dynamic> 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<void> 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<LocationProvider>(context, listen: false);
// await location.locationinfo(widget.text);
// locationList = location.locationlist;
// // setState(() {
// // locationList = loclist;
// // });
// } else {
// print("Location_not empty");
// }
// }
// // final locationProvider =
// // Provider.of<LocationKolProvider>(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<PhonenoProvider>(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<EmailProvider>(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<TrainigProvider>(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<EducationProvider>(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<AwardProvider>(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<CertificateProvider>(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<Data>(
// // title: "Locations",
// // itemList: locationList.cast<Data>(),
// // buttonText: 'Show More',
// // field1: 'Institutation',
// // field2: 'Address',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (Data selectedPhoneNumber) {
// // List<Map<String, dynamic>> 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<Data>(
// // title: "Locations",
// // itemList: locationList.cast<Data>(),
// // buttonText: 'Show More',
// // field1: 'Institutation',
// // field2: 'Address',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (Data selectedPhoneNumber) {},
// // )
// // : Container(),
// // Container(),
// // pno.length != 0
// // ? CustomExpansionTile<DataPhno>(
// // title: "Phone Numbers",
// // itemList: pno.cast<DataPhno>(),
// // buttonText: 'Show More',
// // field1: 'Phone Type',
// // field2: 'Phone No',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (DataPhno selectedPhoneNumber) {
// // List<Map<String, dynamic>> keyValue = [
// // {
// // "Phone Number": selectedPhoneNumber.number,
// // "Phone Type": selectedPhoneNumber.phoneTypeName,
// // "Primary": selectedPhoneNumber.formattedIsPrimary,
// // "organization Name": selectedPhoneNumber.organizationName,
// // }
// // ];
// // modelbsheet(keyValue);
// // },
// // )
// // : widget.offlineMode != null
// // ? CustomExpansionTile<DataPhno>(
// // title: "Phone Numbers",
// // itemList: pno.cast<DataPhno>(),
// // buttonText: 'Show More',
// // field1: 'Phone Type',
// // field2: 'Phone No',
// // noexpand: false,
// // onItemSelected: (DataPhno selectedPhoneNumber) {},
// // )
// // : Container(),
// // emailid.length != 0
// // ? CustomExpansionTile<EmailData>(
// // title: "Emails",
// // itemList: emailid.cast<EmailData>(),
// // buttonText: 'Show More',
// // field1: 'Email Type',
// // field2: 'Email',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (EmailData selectedPhoneNumber) {
// // List<Map<String, dynamic>> keyValue = [
// // {
// // "Email": selectedPhoneNumber.email,
// // "Email Type": selectedPhoneNumber.emailTypeName,
// // }
// // ];
// // modelbsheet(keyValue);
// // },
// // )
// // : widget.offlineMode != null
// // ? CustomExpansionTile<EmailData>(
// // title: "Emails",
// // itemList: emailid.cast<EmailData>(),
// // buttonText: 'Show More',
// // field1: 'Email Type',
// // field2: 'Email',
// // noexpand: false,
// // onItemSelected: (EmailData selectedPhoneNumber) {},
// // )
// // : Container(),
// // training.length != 0
// // ? CustomExpansionTile<TrainingList>(
// // title: "Trainings",
// // itemList: training.cast<TrainingList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (TrainingList selectedPhoneNumber) {
// // List<Map<String, dynamic>> 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<TrainingList>(
// // title: "Trainings",
// // itemList: training.cast<TrainingList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: false,
// // onItemSelected: (TrainingList selectedPhoneNumber) {},
// // )
// // : Container(),
// // education.length != 0
// // ? CustomExpansionTile<EducationList>(
// // title: "Education",
// // itemList: education.cast<EducationList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (EducationList selectedPhoneNumber) {
// // List<Map<String, dynamic>> 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<EducationList>(
// // title: "Education",
// // itemList: education.cast<EducationList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: false,
// // onItemSelected: (EducationList selectedPhoneNumber) {},
// // )
// // : Container(),
// // award.length != 0
// // ? CustomExpansionTile<AwardsList>(
// // title: "Awards",
// // itemList: award.cast<AwardsList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (AwardsList selectedPhoneNumber) {
// // List<Map<String, dynamic>> keyValue = [
// // {
// // "Name": selectedPhoneNumber.name,
// // "Start Date": selectedPhoneNumber.startDate,
// // "End Date": selectedPhoneNumber.endDate,
// // }
// // ];
// // modelbsheet(keyValue);
// // },
// // )
// // : widget.offlineMode != null
// // ? CustomExpansionTile<AwardsList>(
// // title: "Awards",
// // itemList: award.cast<AwardsList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: false,
// // onItemSelected: (AwardsList selectedPhoneNumber) {},
// // )
// // : Container(),
// // certificate.length != 0
// // ? CustomExpansionTile<CertificateList>(
// // title: "Certificates",
// // itemList: certificate.cast<CertificateList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: widget.offlineMode == null ? true : false,
// // onItemSelected: (CertificateList selectedPhoneNumber) {
// // List<Map<String, dynamic>> keyValue = [
// // {
// // "Organization Id": selectedPhoneNumber.organizationId,
// // "specialty": selectedPhoneNumber.specialty,
// // "Start Date": selectedPhoneNumber.startDate,
// // "End Date": selectedPhoneNumber.endDate,
// // }
// // ];
// // modelbsheet(keyValue);
// // },
// // )
// // : widget.offlineMode != null
// // ? CustomExpansionTile<CertificateList>(
// // title: "Certificates",
// // itemList: certificate.cast<CertificateList>(),
// // buttonText: 'Show More',
// // field1: 'Education Type',
// // field2: 'Institution Name',
// // noexpand: false,
// // onItemSelected: (CertificateList selectedPhoneNumber) {},
// // )
// // : Container(),
// // ]
// ),
// );
// }
// void modelbsheet(List<Map<String, dynamic>> 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<LocationK2Tab1> createState() => _LocationK2TabState();
}
class _LocationK2TabState extends State<LocationK2Tab1> {
List<dynamic> 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<void> 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<LocationKolProvider>(context, listen: false);
await location.locationinfo(widget.text);
locationList = location.locationlist;
// setState(() {
// locationList = loclist;
// });
} else {
print("Location_not empty");
}
}
// final locationProvider =
// Provider.of<LocationKolProvider>(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<PhonenoProviderK2>(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<EmailProviderK2>(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<TrainigProviderK2>(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<EducationProviderK2>(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<AwardProviderK2>(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<CertificateProviderK2>(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<Data>(
title: "Locations",
itemList: locationList.cast<Data>(),
buttonText: 'Show More',
field1: 'Institutation',
field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (Data selectedPhoneNumber) {
List<Map<String, dynamic>> 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<Data>(
title: "Locations",
itemList: locationList.cast<Data>(),
buttonText: 'Show More',
field1: 'Institutation',
field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (Data selectedPhoneNumber) {},
)
: Container(),
Container(),
pno.length != 0
? CustomExpansionTile<DataPhno>(
title: "Phone Numbers",
itemList: pno.cast<DataPhno>(),
buttonText: 'Show More',
field1: 'Phone Type',
field2: 'Phone No',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (DataPhno selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Phone Number": selectedPhoneNumber.number,
"Phone Type": selectedPhoneNumber.phoneTypeName,
"Primary": selectedPhoneNumber.formattedIsPrimary,
"organization Name": selectedPhoneNumber.organizationName,
}
];
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<DataPhno>(
title: "Phone Numbers",
itemList: pno.cast<DataPhno>(),
buttonText: 'Show More',
field1: 'Phone Type',
field2: 'Phone No',
noexpand: false,
onItemSelected: (DataPhno selectedPhoneNumber) {},
)
: Container(),
emailid.length != 0
? CustomExpansionTile<EmailData>(
title: "Emails",
itemList: emailid.cast<EmailData>(),
buttonText: 'Show More',
field1: 'Email Type',
field2: 'Email',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EmailData selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Email": selectedPhoneNumber.email,
"Email Type": selectedPhoneNumber.emailTypeName,
}
];
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<EmailData>(
title: "Emails",
itemList: emailid.cast<EmailData>(),
buttonText: 'Show More',
field1: 'Email Type',
field2: 'Email',
noexpand: false,
onItemSelected: (EmailData selectedPhoneNumber) {},
)
: Container(),
training.length != 0
? CustomExpansionTile<TrainingList>(
title: "Trainings",
itemList: training.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (TrainingList selectedPhoneNumber) {
List<Map<String, dynamic>> 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<TrainingList>(
title: "Trainings",
itemList: training.cast<TrainingList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (TrainingList selectedPhoneNumber) {},
)
: Container(),
education.length != 0
? CustomExpansionTile<EducationList>(
title: "Education",
itemList: education.cast<EducationList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (EducationList selectedPhoneNumber) {
List<Map<String, dynamic>> 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<EducationList>(
title: "Education",
itemList: education.cast<EducationList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (EducationList selectedPhoneNumber) {},
)
: Container(),
award.length != 0
? CustomExpansionTile<AwardsList>(
title: "Awards",
itemList: award.cast<AwardsList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (AwardsList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Name": selectedPhoneNumber.name,
"Start Date": selectedPhoneNumber.startDate,
"End Date": selectedPhoneNumber.endDate,
}
];
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<AwardsList>(
title: "Awards",
itemList: award.cast<AwardsList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (AwardsList selectedPhoneNumber) {},
)
: Container(),
certificate.length != 0
? CustomExpansionTile<CertificateList>(
title: "Certificates",
itemList: certificate.cast<CertificateList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (CertificateList selectedPhoneNumber) {
List<Map<String, dynamic>> keyValue = [
{
"Organization Id": selectedPhoneNumber.organizationId,
"specialty": selectedPhoneNumber.specialty,
"Start Date": selectedPhoneNumber.startDate,
"End Date": selectedPhoneNumber.endDate,
}
];
modelbsheet(keyValue);
},
)
: widget.offlineMode != null
? CustomExpansionTile<CertificateList>(
title: "Certificates",
itemList: certificate.cast<CertificateList>(),
buttonText: 'Show More',
field1: 'Education Type',
field2: 'Institution Name',
noexpand: false,
onItemSelected: (CertificateList selectedPhoneNumber) {},
)
: Container(),
]),
);
}
void modelbsheet(List<Map<String, dynamic>> 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);
},
);
}
}

View File

@ -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<void> main() async {
Hive.registerAdapter(ProAdapter());
Hive.registerAdapter(Training1Adapter());
Hive.registerAdapter(SpeAdapter());
Hive.registerAdapter(savecontactfilterAdapter());
runApp(MultiProvider(
providers: [
@ -147,6 +150,8 @@ Future<void> main() async {
ChangeNotifierProvider(create: (_) => CertificateProviderK2()),
ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()),
ChangeNotifierProvider(create: (_) => EventProviderK2()),
ChangeNotifierProvider(create: (_) => HcpNotesFecth()),
ChangeNotifierProvider(create: (_) => AddNotesProvider()),
//ChangeNotifierProvider(create: (_) => ConfigDataProvider()),
ChangeNotifierProvider<HiveDataRepository>(
@ -154,10 +159,6 @@ Future<void> main() async {
Hive.box<InteractionConfigData>('InteractionConfigDataBox'))),
],
child: MyApp(),
// child: MaterialApp(
// home: MyWidget(),
// ),
));
}
@ -176,12 +177,6 @@ class _MyAppState extends State<MyApp> {
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<MyApp> {
),
),
// 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<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
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(),
);
}
}

Some files were not shown because too many files have changed in this diff Show More