Merge branch 'dev' of https://git.aissel.com/snehalathad/KonectarApp into snehalatha_dev

This commit is contained in:
snehalathad@aissel.com 2024-12-19 11:27:28 +05:30
commit 6bc1eb0433
97 changed files with 15911 additions and 6337 deletions

View File

@ -1,4 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<application android:label="konectar_events" android:name="${applicationName}" android:icon="@mipmap/launcher_icon"> <application android:label="konectar_events" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as

View File

@ -4,22 +4,29 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class Constants { class Constants {
static Color k2color = Color.fromARGB(255, 0, 71, 132); // static Color k2color = Color.fromARGB(255, 0, 71, 132);
static Color k2color1 = Color.fromARGB(255, 0, 71, 132); // static 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 cardtext = Colors.transparent;
static Color cardtextdark = Colors.transparent;
static const Color bgcolor = Color(0xFFF2F3F8); // static Color cardtextdark = Colors.transparent;
static Color bgcolor2 = const Color.fromARGB(255, 0, 112, 184);
static Color k2color11 = Colors.white; // static const Color bgcolor = Color(0xFFF2F3F8);
// static const Color bgwhitecolor = Colors.white;
// static Color bgcolor2 = const Color.fromARGB(255, 0, 112, 184);
// static Color k2color11 = Colors.white;
static final Future<String> response = static final Future<String> response =
rootBundle.loadString('assets/section.json'); rootBundle.loadString('assets/section.json');
static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184); // 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.143:8000/api";
//static const url = "http://192.168.53.50: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://192.168.21.50:8000/api";
@ -27,4 +34,28 @@ class Constants {
//static const url = 'http://192.168.153.50:8082/api';192.168.21.50:8000 //static const url = 'http://192.168.153.50:8082/api';192.168.21.50:8000
static const k2url = "http://192.168.2.130:8888/api"; static const k2url = "http://192.168.2.130:8888/api";
static const notes = "http://192.168.2.170:8001/api/all-routes";
// static const Map<String, int> apiIntervals1 = {
// k2url: 1, // Interval in minutes
// 'http://192.168.2.170:8001/api/all-routes': 2,
// };
static const Map<String, Map<String, dynamic>> apiIntervals1 = {
'api1': {
'url': 'http://192.168.2.170:8000/api/receive-data',
'intervals': 1,
'hivename': 'InteractionDataBox',
'hivetype': 'SaveInteraction'
},
'api2': {
'url': 'http://192.168.2.170:8000/api/receive-data',
'intervals': 2,
'hivename': 'notehive',
'hivetype': 'String'
},
};
static const get_api_list = "http://192.168.2.170:8002/api/all-routes";
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.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,33 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/utils/appcolors.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(
backgroundColor: AppColors.blueColor,
leading: IconButton(
icon: const Icon(
Icons.arrow_back_ios_new,
color: AppColors.contentColorWhite,
),
onPressed: () => Navigator.of(context).pop(false),
),
title: Text1(
title: widget.title,
txtcolor: AppColors.contentColorWhite,
),
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

@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:konectar_events/contacts_module/constants.dart'; import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart'; import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
@ -9,25 +11,29 @@ import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_eve
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_location_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_location_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_training_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_training_k2.dart';
import 'package:flutter/material.dart'; import 'package:konectar_events/utils/appcolors.dart';
class CustomExpansionTile<T> extends StatefulWidget { class CustomExpansionTile<T> extends StatefulWidget {
final String title; final String title;
final List<T> itemList; final List<T>? itemList;
final String buttonText; final String buttonText;
final String field1; final String field1;
final String field2; final String field2;
bool? noexpand;
final VoidCallback? onButtonPressed; // Add this parameter for button callback
final Function(T) onItemSelected; final Function(T) onItemSelected;
const CustomExpansionTile({ CustomExpansionTile({
Key? key, Key? key,
required this.title, required this.title,
required this.itemList, this.itemList,
required this.buttonText, required this.buttonText,
required this.onItemSelected, required this.onItemSelected,
required this.field1, required this.field1,
required this.field2, required this.field2,
this.noexpand,
this.onButtonPressed, // Initialize it
}) : super(key: key); }) : super(key: key);
@override @override
@ -37,6 +43,8 @@ class CustomExpansionTile<T> extends StatefulWidget {
class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> { class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
bool _isExpanded = false; bool _isExpanded = false;
//var noexpand;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print("Chekingg_Field_one: ${widget.field1}"); print("Chekingg_Field_one: ${widget.field1}");
@ -51,9 +59,9 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
onExpansionChanged: (bool expanded) { onExpansionChanged: (bool expanded) {
@ -78,7 +86,7 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
), ),
const SizedBox(width: 8.0), const SizedBox(width: 8.0),
Text1( Text1(
title: "(${widget.itemList.length})", title: "(${widget.itemList!.length})",
txtcolor: Colors.black, txtcolor: Colors.black,
fontweight: FontWeight.normal, fontweight: FontWeight.normal,
txtfont: 16.0, txtfont: 16.0,
@ -86,72 +94,76 @@ class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
], ],
), ),
children: [ children: [
Scrollbar( Visibility(
child: SingleChildScrollView( visible: widget.noexpand!,
scrollDirection: Axis.horizontal, child: Scrollbar(
child: Container( child: SingleChildScrollView(
constraints: BoxConstraints( scrollDirection: Axis.horizontal,
minWidth: MediaQuery.of(context).size.width, child: Container(
), constraints: BoxConstraints(
color: Colors.white, minWidth: MediaQuery.of(context).size.width,
child: DataTable( ),
showCheckboxColumn: false, color: Colors.white,
columns: [ child: DataTable(
DataColumn( showCheckboxColumn: false,
label: Expanded( columns: [
child: Text( DataColumn(
widget.field1 ?? 'Item', label: Expanded(
style: TextStyle(fontWeight: FontWeight.w600), child: Text(
softWrap: true, widget.field1 ?? 'Item',
style: TextStyle(fontWeight: FontWeight.w600),
softWrap: true,
),
), ),
), ),
), DataColumn(
DataColumn( label: Expanded(
label: Expanded( child: Text(
child: Text( widget.field2 ?? 'Details',
widget.field2 ?? 'Details', style: TextStyle(fontWeight: FontWeight.w600),
style: TextStyle(fontWeight: FontWeight.w600), ),
), ),
), ),
), ],
], rows: List.generate(widget.itemList!.take(2).length,
rows: List.generate(widget.itemList.take(2).length, (index) {
(index) { final item = widget.itemList![index];
final item = widget.itemList[index];
return DataRow( return DataRow(
onSelectChanged: (value) { onSelectChanged: (value) {
widget.onItemSelected(widget.itemList[index]); widget.onItemSelected(widget.itemList![index]);
}, },
cells: [ cells: [
DataCell(getdatacel1(item)), DataCell(getdatacel1(item)),
DataCell( DataCell(
getdatacel2(item), getdatacel2(item),
), ),
], ],
); );
}), }),
),
), ),
), ),
), ),
), ),
Container( Visibility(
color: Colors.white, visible: widget.noexpand!,
child: Align( child: Container(
alignment: Alignment.center, color: Colors.white,
child: Padding( child: Align(
padding: const EdgeInsets.all(8.0), alignment: Alignment.center,
child: OutlinedButton( child: Padding(
onPressed: () { padding: const EdgeInsets.all(8.0),
// Handle the button action here child: OutlinedButton(
}, onPressed: widget.onButtonPressed,
child: Text( child: Text(
widget.buttonText, widget.buttonText,
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
),
), ),
), ),
), ),

View File

@ -0,0 +1,78 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/ui_screen/newformlist.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,161 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/clickable_row.dart';
import 'package:konectar_events/contacts_module/custom_widget/custiom_profilepic.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_card.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/utils/appcolors.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: AppColors.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

@ -0,0 +1,161 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/clickable_row.dart';
import 'package:konectar_events/contacts_module/custom_widget/custiom_profilepic.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_card.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/utils/appcolors.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: AppColors.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

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

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
class ApiListProvider extends ChangeNotifier {
var call_api = CallK2api();
List result = [];
List get apiList => result;
apilist() async {
final listallnotes = await call_api.getAllAPIList();
print("HiiiiiilistallAPiList : ${listallnotes}");
result = listallnotes;
notifyListeners();
}
}

View File

@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.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

@ -1,6 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_aff_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart'; import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class AffiliationsProviderk2 extends ChangeNotifier { class AffiliationsProviderk2 extends ChangeNotifier {
final affapi = CallK2api(); final affapi = CallK2api();
@ -26,6 +26,8 @@ class AffiliationsProviderk2 extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
bool get hasData => affiliations1.isNotEmpty;
getAllAffiliationsdata() async { getAllAffiliationsdata() async {
print("Affiliations_is: "); print("Affiliations_is: ");
final affdata = await affapi.getallaffiliationsdata(); final affdata = await affapi.getallaffiliationsdata();

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_email_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_email_k2.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart'; import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart'; import 'package:konectar_events/contacts_module/storage_hive/email_data/crud_email.dart';
class EmailProviderK2 extends ChangeNotifier { class EmailProviderK2 extends ChangeNotifier {
final apicall = CallK2api(); final apicall = CallK2api();
@ -14,4 +15,11 @@ class EmailProviderK2 extends ChangeNotifier {
emaillist = email_result!; emaillist = email_result!;
notifyListeners(); notifyListeners();
} }
bool get hasData => emaillist.isNotEmpty;
storeEmail(row) async {
final emailresult = await apicall.getemaildata(row);
await k2addEmail(emailresult);
}
} }

View File

@ -1,11 +1,18 @@
import 'package:flutter/cupertino.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart'; import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class EventProviderK2 extends ChangeNotifier { class EventProviderK2 extends ChangeNotifier {
final apicall = CallK2api(); final apicall = CallK2api();
List<EventList> eventlist = []; List<EventList> eventlist = [];
List<EventList> eventlistpagination = [];
bool _isLoading = false;
bool _hasMore = true;
int _page = 1;
final int _limit = 10;
List get EventsList => eventlist; List get EventsList => eventlist;
@ -13,17 +20,91 @@ class EventProviderK2 extends ChangeNotifier {
List get allEventsList => alleventlist; List get allEventsList => alleventlist;
geteventdata(text) async { List get eventsListpagination => eventlistpagination;
final events = await apicall.geteventsdata(text);
eventlist = events!; bool get isLoading => _isLoading;
notifyListeners(); 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 { allgeteventdata() async {
final events = await apicall.allgeteventsdata(); final events = await apicall.allgeteventsdata();
alleventlist = events; alleventlist = events;
notifyListeners(); 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:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
// import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
// import 'package:flutter/cupertino.dart';
// class EventProviderK2 extends ChangeNotifier {
// final apicall = CallK2api();
// List<EventList> eventlist = [];
// List get EventsList => eventlist;
// List alleventlist = [];
// List get allEventsList => alleventlist;
// 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,5 +1,6 @@
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:konectar_events/contacts_module/storage_hive/loc_data/crud_loc.dart';
class LocationKolProvider extends ChangeNotifier { class LocationKolProvider extends ChangeNotifier {
final apicall = CallK2api(); final apicall = CallK2api();
@ -12,5 +13,40 @@ class LocationKolProvider extends ChangeNotifier {
final publication_result = await apicall.getlocationsdata(text); final publication_result = await apicall.getlocationsdata(text);
loclist = publication_result; loclist = publication_result;
notifyListeners(); 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,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_pno_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart'; import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart'; import 'package:konectar_events/contacts_module/storage_hive/pno_data/crud_pno.dart';
class PhonenoProviderK2 extends ChangeNotifier { class PhonenoProviderK2 extends ChangeNotifier {
final apicall = CallK2api(); final apicall = CallK2api();
@ -14,4 +15,13 @@ class PhonenoProviderK2 extends ChangeNotifier {
phonelist = phone_result; phonelist = phone_result;
notifyListeners(); 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!; tralist = email_result!;
notifyListeners(); notifyListeners();
} }
bool get hasData => tralist.isNotEmpty;
} }

View File

@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_fetchnotes_k2.dart';
import 'package:konectar_events/contacts_module/service.dart/k2_service/Apicall_k2.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,172 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/hive_fun.dart';
import 'package:konectar_events/contacts_module/provider_class/affiliationsprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/award_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/certificate_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/educationprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/events_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_add_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_email_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_locationprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_pno_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/nih_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/patent_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/procedureprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/publications_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/speaker_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/training_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/trials_provider.dart';
import 'package:konectar_events/contacts_module/storage_hive/kol_info/curd_kol.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());
var addnoteprovider =
Provider.of<AddNotesProvider>(context, listen: false);
await addnoteprovider.addnotes("Background11Synccccc");
// await addnoteprovider.addnotes("Background12");
// await addnoteprovider.addnotes("Background13");
}
}
Future<void> storeAffiliations(String id) async {
await Provider.of<AffiliationsProvider>(context, listen: false)
.storeAff(id);
print("Storingggg_isss:Affiliations");
}
Future<void> storePublications(String id) async {
await Provider.of<PublicatioProvider>(context, listen: false).storePub(id);
print("Storingggg_isss:Publications");
}
Future<void> storeEvents(String id) async {
await Provider.of<EventProvider>(context, listen: false).storeEvent(id);
print("Storingggg_isss:Events");
}
Future<void> storeTrials(String id) async {
await Provider.of<TrialsProvider>(context, listen: false).storeTrials(id);
print("Storingggg_isss:Trials");
}
Future<void> storeLocations(String id) async {
await Provider.of<LocationKolProvider>(context, listen: false).storeLoc(id);
print("Storingggg_isss:Locations");
}
Future<void> storePhoneNumbers(String id) async {
await Provider.of<PhonenoProviderK2>(context, listen: false).storePno(id);
print("Storingggg_isss:Phone_numbers");
}
Future<void> storeEmails(String id) async {
await Provider.of<EmailProviderK2>(context, listen: false).storeEmail(id);
print("Storingggg_isss:Emails");
}
Future<void> storeEducation(String id) async {
await Provider.of<EducationProvider>(context, listen: false).storeEdu(id);
print("Storingggg_isss:Educations");
}
Future<void> storeAwards(String id) async {
await Provider.of<AwardProvider>(context, listen: false).storeAwa(id);
print("Storingggg_isss:Aards");
}
Future<void> storeCertificates(String id) async {
await Provider.of<CertificateProvider>(context, listen: false).storeCer(id);
print("Storingggg_isss:Certificates");
}
Future<void> storePatents(String id) async {
await Provider.of<PatentProvider>(context, listen: false).storePet(id);
print("Storingggg_isss:Parents");
}
Future<void> storeNIHGrants(String id) async {
await Provider.of<NIHGrantsProvider>(context, listen: false).storeNih(id);
print("Storingggg_isss:NIHGrnts");
}
Future<void> storeProcedures(String id) async {
await Provider.of<ProcedureProvider>(context, listen: false).storePro(id);
print("Storingggg_isss:Procedures");
}
Future<void> storeTraining(String id) async {
await Provider.of<TrainigProvider>(context, listen: false)
.storeTraining(id);
print("Storingggg_isss:Training");
}
Future<void> storeSpeakerEvaluations(String id) async {
await Provider.of<SpekerEvalutionProvider>(context, listen: false)
.storeSpeaker(id);
print("Storingggg_isss:Evaluations");
}
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]);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/constants.dart'; import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/model_class/affiliations.dart'; import 'package:konectar_events/contacts_module/model_class/affiliations.dart';
import 'package:konectar_events/contacts_module/model_class/awards_model.dart'; import 'package:konectar_events/contacts_module/model_class/awards_model.dart';
@ -727,4 +728,27 @@ class Callapi {
return jsonEvent.map((awards) => Pro.fromJson(awards)).toList(); return jsonEvent.map((awards) => Pro.fromJson(awards)).toList();
} }
PostApiCall(url, methodName, sendPostData) async {
try {
final response = await Dio().post(
url,
data: sendPostData,
options: Options(
headers: {
'Content-Type': 'application/json',
},
),
);
if (response.statusCode == 200) {
debugPrint("Response_is : ${response.data}");
return response;
} else {
return 'Failed to load data';
}
} catch (e) {
print('Error fetching data123 from $url: $e');
}
}
} }

View File

@ -1,8 +1,8 @@
// import 'package:konectar_events/storage_hive/email_data/email_model_hive.dart'; // import 'package:discover_module/storage_hive/email_data/email_model_hive.dart';
// import 'package:konectar_events/storage_hive/loc_data/location_model_hive.dart'; // import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
// import 'package:konectar_events/storage_hive/pno_data/pno_model_hive.dart'; // import 'package:discover_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/email_data/email_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/storage_hive/email_data/email_model_hive.dart';
addEmail(List emaillist) async { addEmail(List emaillist) async {
// static final apihcpdata = Hive.box("hcpdata"); // static final apihcpdata = Hive.box("hcpdata");
@ -27,25 +27,45 @@ addEmail(List emaillist) async {
for (var email in emails) { for (var email in emails) {
print("Storing_Affff: ${email.emailType}"); 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 { // await box.put(await getNextAutoIncrementValue(), doctor);
// 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
// }
// } // }
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 { 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'); var box = await Hive.openBox<Email>('emailhive');
print('Retrive Doctor}'); print('Retrive Doctor}');
@ -58,3 +78,24 @@ retrieveidemails(int id) async {
} }
return dataemail; 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

@ -1,8 +1,9 @@
// import 'package:konectar_events/storage_hive/loc_data/location_model_hive.dart'; // import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/loc_data/location_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/storage_hive/loc_data/location_model_hive.dart';
addLoc(List loclist) async { addLoc(List loclist) async {
print("Trying to store the data : ${loclist}");
// static final apihcpdata = Hive.box("hcpdata"); // static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Location>('lochive'); var box = await Hive.openBox<Location>('lochive');
@ -14,8 +15,8 @@ addLoc(List loclist) async {
// Convert JSON list to List<Affiliation> // Convert JSON list to List<Affiliation>
List<Location> locations = loclist.map((json) { List<Location> locations = loclist.map((json) {
return Location( return Location(
id: json.id, id: json.id.toString(),
userId: json.userId, userId: json.userId.toString(),
institution: json.institution ?? '', institution: json.institution ?? '',
address: json.address ?? '', address: json.address ?? '',
city: json.city ?? '', city: json.city ?? '',
@ -27,11 +28,30 @@ addLoc(List loclist) async {
print("Publicattionnsss_isss: ${locations}"); print("Publicattionnsss_isss: ${locations}");
for (var loc in 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(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 { // Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive'); // var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}'); // print('Retrive Doctor}');
@ -48,14 +68,56 @@ addLoc(List loclist) async {
retrieveidlocations(int id) async { retrieveidlocations(int id) async {
var box = await Hive.openBox<Location>('lochive'); var box = await Hive.openBox<Location>('lochive');
print('Retrive Doctor}'); print('Retrive Doctor_Locationss : ${box.get}}');
var locations = box.get(id); //var locations = box.get(id);
print('Retrive Doctor locations ${locations}}'); print('Retrive Doctor locations ${box.values.toList()}');
//print('Retrive Doctor locations1233 ${locations}}');
print('Retrive Doctor locationsid ${id}}');
List<Location> dataloc = []; // List<Location> dataloc = [];
if (locations != null) { // if (locations != null) {
dataloc.add(locations); // Add to the list if not null // dataloc.add(locations); // Add to the list if not null
} // }
return dataloc; // 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) @HiveType(typeId: 36)
class Location extends HiveObject { class Location extends HiveObject {
@HiveField(0) @HiveField(0)
final int id; final String? id;
@HiveField(1) @HiveField(1)
final int userId; final String? userId;
@HiveField(2) @HiveField(2)
final String? institution; 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(), for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
}; };
return Location( return Location(
id: fields[0] as int, id: fields[0] as String?,
userId: fields[1] as int, userId: fields[1] as String?,
institution: fields[2] as String?, institution: fields[2] as String?,
address: fields[3] as String?, address: fields[3] as String?,
city: fields[4] as String?, city: fields[4] as String?,

View File

@ -1,20 +1,49 @@
// import 'package:discover_module/storage_hive/note_data/note_model_hive.dart'; // import 'package:discover_module/storage_hive/note_data/note_model_hive.dart';
// import 'package:discover_module/storage_hive/patent_data/patent_model_hive.dart'; // import 'package:discover_module/storage_hive/patent_data/patent_model_hive.dart';
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/storage_hive/note_data/note_model_hive.dart';
final Box<String> box = Hive.box<String>('notehive'); final Box<Note> box = Hive.box<Note>('notehive');
addNote(String text) async { addNote(String text) async {
// var box = await Hive.openBox<String>('notehive');
print("Text_issss: $text"); print("Text_issss: $text");
box.add(text); // Save text with a key //box.add(text);
// await Hive.openBox<Note>('notehive'); // Ensure the box is typed correctly
final note = Note(id: await getNextAutoIncrementValue(), note: text);
print("note_issss: $note");
await box.add(note);
print("noteAdded ${box.isEmpty}");
// List<Note> notes =
// box.values.toList(); // Should return List<Note>, not List<String>
// print("List_isss: ${notes}");
} }
List<String> getText() { List<Note> getText() {
//var box = await Hive.openBox<String>('notehive'); //var box = await Hive.openBox<String>('notehive');
print("SavedNotesssL : ${box.values.toList()}"); print("SavedNotesssL : ${box.values.toList()}");
//box.clear();
return box.values.toList(); return box.values.toList();
} }
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;
}

View File

@ -4,13 +4,17 @@ part 'note_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 47) @HiveType(typeId: 47)
class Note extends HiveObject { class Note extends HiveObject {
@HiveField(0) @HiveField(0)
final int id; final int? id;
@HiveField(1) @HiveField(1)
final String? note; final String? note;
Note({ Note({
required this.id, this.id,
this.note, this.note,
}); });
Map<String, dynamic> toJson() {
return {'note': note};
}
} }

View File

@ -17,7 +17,7 @@ class NoteAdapter extends TypeAdapter<Note> {
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
}; };
return Note( return Note(
id: fields[0] as int, id: fields[0] as int?,
note: fields[1] as String?, note: fields[1] as String?,
); );
} }

View File

@ -1,7 +1,7 @@
// import 'package:konectar_events/storage_hive/loc_data/location_model_hive.dart'; // import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
// import 'package:konectar_events/storage_hive/pno_data/pno_model_hive.dart'; // import 'package:discover_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/storage_hive/pno_data/pno_model_hive.dart';
addPno(List pnolist) async { addPno(List pnolist) async {
// static final apihcpdata = Hive.box("hcpdata"); // static final apihcpdata = Hive.box("hcpdata");
@ -27,10 +27,28 @@ addPno(List pnolist) async {
for (var pno in pnonos) { for (var pno in pnonos) {
print("Storing_Affff: ${pno.phoneNumber}"); 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 { // Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive'); // var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}'); // print('Retrive Doctor}');
@ -49,12 +67,43 @@ retrieveidpnos(int id) async {
var box = await Hive.openBox<PhoneNo>('pnohive'); var box = await Hive.openBox<PhoneNo>('pnohive');
print('Retrive Doctor}'); print('Retrive Doctor}');
var pnos = box.get(id); // var pnos = box.get(id);
print('Retrive Doctor locations ${pnos}}'); // print('Retrive Doctor locations ${pnos}}');
List<PhoneNo> datapno = []; // List<PhoneNo> datapno = [];
if (pnos != null) { // if (pnos != null) {
datapno.add(pnos); // Add to the list if not null // datapno.add(pnos); // Add to the list if not null
} // }
return datapno; // 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) @HiveType(typeId: 37)
class PhoneNo extends HiveObject { class PhoneNo extends HiveObject {
@HiveField(0) @HiveField(0)
final int id; final String? id;
@HiveField(1) @HiveField(1)
final int userId; final String? userId;
@HiveField(2) @HiveField(2)
final String? phoneType; 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(), for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
}; };
return PhoneNo( return PhoneNo(
id: fields[0] as int, id: fields[0] as String?,
userId: fields[1] as int, userId: fields[1] as String?,
phoneType: fields[2] as String?, phoneType: fields[2] as String?,
locations: fields[3] as String?, locations: fields[3] as String?,
phoneNumber: fields[4] as String?, phoneNumber: fields[4] as String?,

View File

@ -0,0 +1,137 @@
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/storage_hive/savefilter/save_filter_hive.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,6 +22,7 @@ import 'package:konectar_events/contacts_module/ui_screen/publication_data.dart'
import 'package:konectar_events/contacts_module/ui_screen/trials_show_more.dart'; import 'package:konectar_events/contacts_module/ui_screen/trials_show_more.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class Activities extends StatefulWidget { class Activities extends StatefulWidget {
@ -125,7 +126,7 @@ class _ActivitiesState extends State<Activities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -136,7 +137,7 @@ class _ActivitiesState extends State<Activities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -250,7 +251,8 @@ class _ActivitiesState extends State<Activities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -278,7 +280,7 @@ class _ActivitiesState extends State<Activities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -289,7 +291,7 @@ class _ActivitiesState extends State<Activities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -412,7 +414,8 @@ class _ActivitiesState extends State<Activities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -440,7 +443,7 @@ class _ActivitiesState extends State<Activities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -449,7 +452,7 @@ class _ActivitiesState extends State<Activities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -568,7 +571,8 @@ class _ActivitiesState extends State<Activities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -596,7 +600,7 @@ class _ActivitiesState extends State<Activities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -605,7 +609,7 @@ class _ActivitiesState extends State<Activities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -727,7 +731,8 @@ class _ActivitiesState extends State<Activities> {
), ),
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
), ),
), ),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,313 @@
// 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:konectar_events/contacts_module/custom_widget/show_alert.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_add_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_viewnotes.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);
});
},
),
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: "Update",
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(() {
fetchNotesProviderK2..fetchhcpnotes();
});
Navigator.of(context).pop();
},
);
});
},
child: Text("Update")),
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

@ -24,6 +24,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
@ -155,11 +156,11 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
// shape: RoundedRectangleBorder( // shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(0.0), // borderRadius: BorderRadius.circular(0.0),
// ), // ),
color: Constants.k2color, color: AppColors.blueColor,
child: ExpansionTile( child: ExpansionTile(
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
backgroundColor: Constants.k2color, backgroundColor: AppColors.blueColor,
// collapsedBackgroundColor: Color(0xFF2b9af3), // collapsedBackgroundColor: Color(0xFF2b9af3),
initiallyExpanded: true, initiallyExpanded: true,
@ -172,7 +173,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFF2b9af3), // color: Color(0xFF2b9af3),
color: Constants.k2color), color: AppColors.blueColor),
child: Text( child: Text(
item.sectionName, item.sectionName,
style: const TextStyle( style: const TextStyle(

View File

@ -25,6 +25,7 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:popover/popover.dart'; import 'package:popover/popover.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -131,10 +132,10 @@ class _InteractionScreenState extends State<InteractionScreen> {
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
elevation: 5, elevation: 5,
color: Constants.k2color, color: AppColors.blueColor,
child: ExpansionTile( child: ExpansionTile(
maintainState: true, maintainState: true,
backgroundColor: Constants.k2color, backgroundColor: AppColors.blueColor,
onExpansionChanged: (bool expanded) { onExpansionChanged: (bool expanded) {
setState(() { setState(() {
_isExpanded = expanded; _isExpanded = expanded;
@ -156,7 +157,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFF2b9af3), // color: Color(0xFF2b9af3),
color: Constants.k2color, color: AppColors.blueColor,
), ),
child: Text( child: Text(
item.sectionName, item.sectionName,

View File

@ -68,6 +68,22 @@ Future<String> formJsonForSync() async {
return jsonstr; return jsonstr;
} }
Future<String> formJsonForIntervalSync(String hivename) async {
final provider = ViewInteractionProvider();
final prov = InteractionProvider();
List<SaveInteractionFormJson> senSavedList = [];
List<SaveInteraction> savedList =
await provider.getAllRecordsforIntervalSync(hivename);
for (var obj in savedList) {
senSavedList.add(prov.formJson(obj));
}
SendSaveJson jsonData = SendSaveJson(savedList: senSavedList);
String jsonstr = saveFormJsonToJson(jsonData);
print(jsonstr);
return jsonstr;
}
Future<bool> checkRecordsAvailable() async { Future<bool> checkRecordsAvailable() async {
final provider = ViewInteractionProvider(); final provider = ViewInteractionProvider();
List<SaveInteraction> savedList = await provider.getAllRecords(); List<SaveInteraction> savedList = await provider.getAllRecords();

View File

@ -13,6 +13,7 @@ import 'package:konectar_events/contacts_module/ui_screen/interactionform/util.d
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
@ -91,7 +92,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
var item = provider.interactionReponseList[index]; var item = provider.interactionReponseList[index];
sectionList = item.sectionList; sectionList = item.sectionList;
return Container( return Container(
color: Constants.k2color, color: AppColors.blueColor,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: true, initiallyExpanded: true,
title: Stack( title: Stack(
@ -103,7 +104,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFF2b9af3), // color: Color(0xFF2b9af3),
color: Constants.k2color, color: AppColors.blueColor,
), ),
child: Text( child: Text(
item.sectionName, item.sectionName,

View File

@ -64,11 +64,11 @@ class ViewInteractionProvider extends ChangeNotifier {
Future<void> getRecords(String formname, {String? hcp}) async { Future<void> getRecords(String formname, {String? hcp}) async {
var box = await Hive.openBox<SaveInteraction>('InteractionDataBox'); var box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
savedList = box.values.toList(); savedList = box.values.toList();
savedList = savedList // savedList = savedList
.where((element) => element.form == formname && element.hcp != null // .where((element) => element.form == formname && element.hcp != null
? element.hcp == hcp // ? element.hcp == hcp
: element.form == formname) // : element.form == formname)
.toList(); // .toList();
notifyListeners(); notifyListeners();
} }
@ -79,6 +79,14 @@ class ViewInteractionProvider extends ChangeNotifier {
return savedList; return savedList;
} }
Future<List<SaveInteraction>> getAllRecordsforIntervalSync(
String hivename) async {
var box = await Hive.openBox<SaveInteraction>(hivename);
List<SaveInteraction> savedList = box.values.toList();
return savedList;
}
init(int index) async { init(int index) async {
// _hiveprovider = HiveDataRepository( // _hiveprovider = HiveDataRepository(
// Hive.box<InteractionConfigData>('InteractionConfigDataBox')); // Hive.box<InteractionConfigData>('InteractionConfigDataBox'));

View File

@ -34,7 +34,7 @@ class CustomButton extends StatelessWidget {
backgroundColor: backgroundColor:
MaterialStateColor.resolveWith((states) => backgroundColor), MaterialStateColor.resolveWith((states) => backgroundColor),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20), // <-- Radius borderRadius: BorderRadius.circular(10), // <-- Radius
), ),
), ),

View File

@ -30,6 +30,7 @@ import 'package:konectar_events/contacts_module/ui_screen/trials_show_more.dart'
// import 'package:discover_module/ui_screen/trials_show_more.dart'; // import 'package:discover_module/ui_screen/trials_show_more.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ActivitiesK2 extends StatefulWidget { class ActivitiesK2 extends StatefulWidget {
@ -146,7 +147,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -157,7 +158,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -280,7 +281,8 @@ class _ActivitiesState extends State<ActivitiesK2> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -329,7 +331,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -338,7 +340,7 @@ class _ActivitiesState extends State<ActivitiesK2> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -460,7 +462,8 @@ class _ActivitiesState extends State<ActivitiesK2> {
), ),
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
), ),
), ),

View File

@ -0,0 +1,344 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_expansiontile.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_sizedbox.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_aff_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_event_provider.dart';
import 'package:konectar_events/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart';
import 'package:konectar_events/contacts_module/ui_screen/show_morek2/events_showmorek2.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

@ -86,6 +86,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
@ -232,7 +233,7 @@ class _Contactsk2State extends State<Contactsk2> {
setState(() {}); setState(() {});
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Constants.k2color, fillColor: AppColors.blueColor,
contentPadding: EdgeInsets.symmetric(vertical: 9.0), contentPadding: EdgeInsets.symmetric(vertical: 9.0),
border: OutlineInputBorder(), border: OutlineInputBorder(),
hintText: "Search", hintText: "Search",
@ -1062,7 +1063,7 @@ class _Contactsk2State extends State<Contactsk2> {
Text( Text(
'Cancel', 'Cancel',
style: TextStyle( style: TextStyle(
color: Constants.k2color), color: AppColors.blueColor),
), ),
], ],
), ),
@ -1126,7 +1127,7 @@ class _Contactsk2State extends State<Contactsk2> {
}, },
child: Text( child: Text(
'Reset Filter', 'Reset Filter',
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -1276,7 +1277,7 @@ class _Contactsk2State extends State<Contactsk2> {
}, },
child: Text( child: Text(
'Saved Profiles123', 'Saved Profiles123',
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

View File

@ -1,4 +1,5 @@
// import 'package:konectar_events/custom_widget/custom_expansiontile.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/card_expansiontile.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_expansiontile.dart'; import 'package:konectar_events/contacts_module/custom_widget/custom_expansiontile.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_awards_k2.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_awards_k2.dart';
@ -14,327 +15,443 @@ import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_e
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_locationprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_pno_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_training_provider.dart';
import 'package:konectar_events/contacts_module/storage_hive/awa_data/crud_awa.dart';
import 'package:konectar_events/contacts_module/storage_hive/cer_hive/crud_cer.dart';
import 'package:konectar_events/contacts_module/storage_hive/edu_data/crud_edu.dart';
import 'package:konectar_events/contacts_module/storage_hive/email_data/crud_email.dart'; import 'package:konectar_events/contacts_module/storage_hive/email_data/crud_email.dart';
import 'package:konectar_events/contacts_module/storage_hive/loc_data/crud_loc.dart'; import 'package:konectar_events/contacts_module/storage_hive/loc_data/crud_loc.dart';
import 'package:konectar_events/contacts_module/storage_hive/pno_data/crud_pno.dart'; import 'package:konectar_events/contacts_module/storage_hive/pno_data/crud_pno.dart';
import 'package:konectar_events/contacts_module/storage_hive/traning_data/crud_training.dart'; import 'package:konectar_events/contacts_module/storage_hive/traning_data/crud_training.dart';
import 'package:konectar_events/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; import 'package:konectar_events/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_Certificate_k2.dart'; import 'package:konectar_events/contacts_module/ui_screen/show_morek2/location_showmorek2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_awards_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_education_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_email_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_location_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_pno_k2.dart';
// import 'package:konectar_events/model_class/k2_api_model/kol_training_k2.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_awards_provider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_certificate_provider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_education_provider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_email_provider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_locationprovider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_pno_provider.dart';
// import 'package:konectar_events/provider_class/k2_provider/kol_training_provider.dart';
// import 'package:konectar_events/storage_hive/awa_data/crud_awa.dart';
// import 'package:konectar_events/storage_hive/cer_hive/crud_cer.dart';
// import 'package:konectar_events/storage_hive/edu_data/crud_edu.dart';
// import 'package:konectar_events/storage_hive/email_data/crud_email.dart';
// import 'package:konectar_events/storage_hive/loc_data/crud_loc.dart';
// import 'package:konectar_events/storage_hive/pno_data/crud_pno.dart';
// import 'package:konectar_events/storage_hive/traning_data/crud_training.dart';
// import 'package:konectar_events/ui_screen/k2api_integrated_ui/k2testbshhet.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LocationK2Tab extends StatefulWidget { class LocationK2Tab extends StatefulWidget {
// const LocationTab({super.key}); const LocationK2Tab(
LocationK2Tab({required this.text, this.offline, Key? key}) : super(key: key); {required this.text, this.offline, super.key, this.offlineMode});
final int text; final int text;
int? offline; final int? offline;
final bool? offlineMode;
@override @override
State<LocationK2Tab> createState() => _LocationK2TabState(); State<LocationK2Tab> createState() => _LocationK2TabState();
} }
class _LocationK2TabState extends State<LocationK2Tab> { class _LocationK2TabState extends State<LocationK2Tab> {
List locationList = []; bool isDataLoaded = false;
List pno = [];
List emailid = [];
List training = []; List locationList = [];
List education = [];
List award = []; List phonenolist = [];
List certificate = [];
List mailList = [];
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((_) {
getAffiliations(); print("I_aminitstate");
if (!isDataLoaded) {
getAffiliations();
}
}); });
} }
Future<void> getAffiliations() async { Future<void> getAffiliations() async {
// ignore: prefer_typing_uninitialized_variables final locationProvider =
var loclist, phoneno, emailno1, edu1, awa1, cer1, training1; Provider.of<LocationKolProvider>(context, listen: false);
if (widget.offline == 1) { final pnoProvider = Provider.of<PhonenoProviderK2>(context, listen: false);
loclist = await retrieveidlocations(widget.text); final emailProvider = Provider.of<EmailProviderK2>(context, listen: false);
print("Saved_Checkingloclist: $loclist"); final trainingProvider =
} else { Provider.of<TrainigProviderK2>(context, listen: false);
var location = Provider.of<LocationKolProvider>(context, listen: false); final educationProvider =
await location.locationinfo(widget.text); Provider.of<EducationProviderK2>(context, listen: false);
loclist = location.locationlist; final awardsProvider = Provider.of<AwardProviderK2>(context, listen: false);
final certificateProvider =
Provider.of<CertificateProviderK2>(context, listen: false);
setState(() { Future<void> _loadData(
locationList = loclist; bool hasData,
}); Function fetchDataOffline,
} Function fetchDataOnline,
dynamic setStateCallback,
if (mounted) { ) async {
if (widget.offline == 1) { if (!hasData) {
phoneno = await retrieveidpnos(widget.text); if (widget.offline == 1) {
print("Saved_Checkingloclist: $loclist"); print("Offline mode: ${widget.offline}");
} else { var data = await fetchDataOffline(widget.text);
var phone = Provider.of<PhonenoProviderK2>(context, listen: false); print("Retrieved data: $data");
await phone.phonek2info(widget.text); setState(() => setStateCallback(data));
phoneno = phone.phonenolist; } else {
await fetchDataOnline(widget.text);
}
} }
setState(() {
pno = phoneno;
});
} }
// Location data fetch logic
if (mounted) { if (mounted) {
if (widget.offline == 1) { await _loadData(
emailno1 = await retrieveidemails(widget.text); locationProvider.hasData,
print("Saved_CheckingloclistEmailll: $emailno1"); retrieveidlocations,
} else { locationProvider.locationinfo,
var email = Provider.of<EmailProviderK2>(context, listen: false); (data) => locationList = data,
await email.emailinfo(widget.text); );
emailno1 = email.emailkollist;
print("Saved_CheckingloclistEmailll123: $emailno1");
}
setState(() {
emailid = emailno1;
});
} }
// Phone number data fetch logic
if (mounted) { if (mounted) {
if (widget.offline == 1) { await _loadData(
training1 = await retrieveidtri(widget.text); pnoProvider.hasData,
print("Saved_CheckingloclistEmailll: $emailno1"); retrieveidpnos,
} else { pnoProvider.phonek2info,
var trai = Provider.of<TrainigProviderK2>(context, listen: false); (data) => phonenolist = data,
await trai.traininginfo(widget.text); );
training1 = trai.traininglist;
}
setState(() {
training = training1;
});
} }
// Email data fetch logic
if (mounted) { if (mounted) {
if (widget.offline == 1) { await _loadData(
edu1 = await retrieveidedus(widget.text); emailProvider.hasData,
print("Saved_CheckingloclistEdu: $edu1"); retrieveidemails,
} else { emailProvider.emailinfo,
var edu = Provider.of<EducationProviderK2>(context, listen: false); (data) => mailList = data,
await edu.eduinfo(widget.text); );
edu1 = edu.educationlist;
print("Saved_CheckingloclistEdu123: $edu1");
}
setState(() {
education = edu1;
});
} }
// Training data fetch logic
if (mounted) { if (mounted) {
if (widget.offline == 1) { await _loadData(
awa1 = await retrieveidawa(widget.text); trainingProvider.hasData,
print("Saved_CheckingloclistEdu: $edu1"); retrieveidtri,
} else { trainingProvider.traininginfo,
var awa = Provider.of<AwardProviderK2>(context, listen: false); (data) => {}, // Handle training data if needed
await awa.awainfo(widget.text); );
awa1 = awa.awardlist;
}
setState(() {
award = awa1;
});
} }
// Education data fetch logic
if (mounted) { if (mounted) {
if (widget.offline == 1) { await _loadData(
cer1 = await retrieveidcer(widget.text); educationProvider.hasData,
print("Saved_CheckingloclistEdu: $edu1"); retrieveidtri,
} else { educationProvider.eduinfo,
var cer = Provider.of<CertificateProviderK2>(context, listen: false); (data) => {}, // Handle education data if needed
await cer.certificateinfo(widget.text); );
cer1 = cer.certificatelist;
}
setState(() {
certificate = cer1;
});
} }
// Awards data fetch logic
if (mounted) {
await _loadData(
awardsProvider.hasData,
retrieveidtri,
awardsProvider.awainfo,
(data) => {}, // Handle awards data if needed
);
}
// Certificate data fetch logic
if (mounted) {
await _loadData(
certificateProvider.hasData,
retrieveidtri,
certificateProvider.certificateinfo,
(data) => {}, // Handle certificate data if needed
);
}
setState(() {
isDataLoaded = true; // Mark data as loaded
});
} }
@override @override
Widget build(BuildContext context) { 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( return Center(
child: ListView(children: [ child: ListView(
locationList.length != 0 children: [
? CustomExpansionTile<Data>( locationProvider.hasData
title: "Locations", ? CardCustomExpansionTile<Data>(
itemList: locationList.cast<Data>(), title: "Locations",
buttonText: 'Show More', itemList: locationProvider.locationlist.cast<Data>(),
field1: 'Institutation', buttonText: 'Show More',
field2: 'Address', field1: 'Institutation',
onItemSelected: (Data selectedPhoneNumber) { field2: 'Address',
List<Map<String, dynamic>> keyValue = [ noexpand: widget.offlineMode == null ? true : false,
{ onItemSelected: (Data selectedPhoneNumber) {
"Address": selectedPhoneNumber.address1, List<Map<String, dynamic>> keyValue = [
"Postal Code": selectedPhoneNumber.postalCode, {
"Primary": selectedPhoneNumber.formattedIsPrimary, "Address": selectedPhoneNumber.address1,
"organization Name": selectedPhoneNumber.organizationName, "Postal Code": selectedPhoneNumber.postalCode,
"Country Name": selectedPhoneNumber.countryName, "Primary": selectedPhoneNumber.formattedIsPrimary,
"State Name": selectedPhoneNumber.stateName, "organization Name":
"City Name": selectedPhoneNumber.cityName, selectedPhoneNumber.organizationName,
} "Country Name": selectedPhoneNumber.countryName,
]; "State Name": selectedPhoneNumber.stateName,
"City Name": selectedPhoneNumber.cityName,
}
];
modelbsheet(keyValue); modelbsheet(keyValue);
}, },
) // onButtonPressed: () {
: Container(), // print("Show More button clicked");
pno.length != 0 // },
? CustomExpansionTile<DataPhno>( onButtonPressed: () {
title: "Phone Numbers", Navigator.push(context,
itemList: pno.cast<DataPhno>(), MaterialPageRoute(builder: (_) => Lock2ShowMore()));
buttonText: 'Show More', },
field1: 'Phone Type', )
field2: 'Phone No', :
onItemSelected: (DataPhno selectedPhoneNumber) { // widget.offlineMode != null
List<Map<String, dynamic>> keyValue = [ // ?
{ CustomExpansionTile<Data>(
"Phone Number": selectedPhoneNumber.number, title: "Locations1",
"Phone Type": selectedPhoneNumber.phoneTypeName, // itemList: locationList.cast<Data>(),
"Primary": selectedPhoneNumber.formattedIsPrimary, itemList: dataList,
"organization Name": selectedPhoneNumber.organizationName, buttonText: 'Show More',
} field1: 'Institutation',
]; field2: 'Address',
noexpand: widget.offlineMode == null ? true : false,
onItemSelected: (Data selectedPhoneNumber) {},
),
modelbsheet(keyValue); //: Container(),
}, pnoProvider.hasData
) ? CardCustomExpansionTile<DataPhno>(
: Container(), title: "Phone Numbers",
emailid.length != 0 itemList: pnoProvider.phonenolist.cast<DataPhno>(),
? CustomExpansionTile<EmailData>( buttonText: 'Show More',
title: "Emails", field1: 'Institutation',
itemList: emailid.cast<EmailData>(), field2: 'Address',
buttonText: 'Show More', noexpand: widget.offlineMode == null ? true : false,
field1: 'Email Type', onItemSelected: (DataPhno selectedPhoneNumber) {
field2: 'Email', List<Map<String, dynamic>> keyValue = [
onItemSelected: (EmailData selectedPhoneNumber) { {
List<Map<String, dynamic>> keyValue = [ "Phone Number": selectedPhoneNumber.number,
{ "Phone Type": selectedPhoneNumber.phoneTypeName,
"Email": selectedPhoneNumber.email, "Primary": selectedPhoneNumber.formattedIsPrimary,
"Email Type": selectedPhoneNumber.emailTypeName, "organization Name":
} selectedPhoneNumber.organizationName,
]; }
];
modelbsheet(keyValue); modelbsheet(keyValue);
}, },
) onButtonPressed: () {
: Container(), print("Show More button clicked");
training.length != 0 },
? CustomExpansionTile<TrainingList>( )
title: "Trainings", :
itemList: training.cast<TrainingList>(), // widget.offlineMode != null
buttonText: 'Show More', // ?
field1: 'Education Type', CustomExpansionTile<DataPhno>(
field2: 'Institution Name', title: "Phone Numbers",
onItemSelected: (TrainingList selectedPhoneNumber) { // itemList: pnoProvider.phonenolist.cast<DataPhno>(),
List<Map<String, dynamic>> keyValue = [ itemList: dataPnoList,
{
"organization Id": selectedPhoneNumber.organizationId, buttonText: 'Show More',
"Degree": selectedPhoneNumber.degree, field1: 'Phone Type',
"Specialty": selectedPhoneNumber.specialty, field2: 'Phone No',
"Start Date": selectedPhoneNumber.startDate, noexpand: widget.offlineMode == null ? true : false,
"End Date": selectedPhoneNumber.endDate, //noexpand: widget.offlineMode == null ? true : false,
} onItemSelected: (DataPhno selectedPhoneNumber) {},
]; ),
modelbsheet(keyValue);
}, // : Container(),
) emailProvider.hasData
: Container(), ? CardCustomExpansionTile<EmailData>(
education.length != 0 title: "Emails",
? CustomExpansionTile<EducationList>( itemList: emailProvider.emailkollist.cast<EmailData>(),
title: "Education", buttonText: 'Show More',
itemList: education.cast<EducationList>(), field1: 'Email Type',
buttonText: 'Show More', field2: 'Email',
field1: 'Education Type', noexpand: widget.offlineMode == null ? true : false,
field2: 'Institution Name', onItemSelected: (EmailData selectedPhoneNumber) {
onItemSelected: (EducationList selectedPhoneNumber) { List<Map<String, dynamic>> keyValue = [
List<Map<String, dynamic>> keyValue = [ {
{ "Email": selectedPhoneNumber.email,
"organization Id": selectedPhoneNumber.organizationId, "Email Type": selectedPhoneNumber.emailTypeName,
"Degree": selectedPhoneNumber.degree, }
"Specialty": selectedPhoneNumber.specialty, ];
"Start Date": selectedPhoneNumber.startDate,
"End Date": selectedPhoneNumber.endDate, modelbsheet(keyValue);
} },
]; onButtonPressed: () {
modelbsheet(keyValue); print("Show More button clicked");
}, },
) )
: Container(), : CustomExpansionTile<EmailData>(
award.length != 0 title: "Emails",
? CustomExpansionTile<AwardsList>( //itemList: emailProvider.emailkollist.cast<EmailData>(),
title: "Awards", itemList: dataEmailList,
itemList: award.cast<AwardsList>(),
buttonText: 'Show More', buttonText: 'Show More',
field1: 'Education Type', field1: 'Email Type',
field2: 'Institution Name', field2: 'Email',
onItemSelected: (AwardsList selectedPhoneNumber) { noexpand: widget.offlineMode == null ? true : false,
List<Map<String, dynamic>> keyValue = [ onItemSelected: (EmailData selectedPhoneNumber) {},
{ ),
"Name": selectedPhoneNumber.name, // : Container(),
"Start Date": selectedPhoneNumber.startDate, trainingProvider.hasData
"End Date": selectedPhoneNumber.endDate, ? CardCustomExpansionTile<TrainingList>(
} title: "Trainings",
]; itemList: trainingProvider.traininglist.cast<TrainingList>(),
modelbsheet(keyValue); buttonText: 'Show More',
}, field1: 'Education Type',
) field2: 'Institution Name',
: Container(), noexpand: widget.offlineMode == null ? true : false,
certificate.length != 0 onItemSelected: (TrainingList selectedPhoneNumber) {
? CustomExpansionTile<CertificateList>( List<Map<String, dynamic>> keyValue = [
title: "Certificates", {
itemList: certificate.cast<CertificateList>(), "organization Id": selectedPhoneNumber.organizationId,
buttonText: 'Show More', "Degree": selectedPhoneNumber.degree,
field1: 'Education Type', "Specialty": selectedPhoneNumber.specialty,
field2: 'Institution Name', "Start Date": selectedPhoneNumber.startDate,
onItemSelected: (CertificateList selectedPhoneNumber) { "End Date": selectedPhoneNumber.endDate,
List<Map<String, dynamic>> keyValue = [ }
{ ];
"Organization Id": selectedPhoneNumber.organizationId, modelbsheet(keyValue);
"specialty": selectedPhoneNumber.specialty, },
"Start Date": selectedPhoneNumber.startDate, )
"End Date": selectedPhoneNumber.endDate, : widget.offlineMode != null
} ? CustomExpansionTile<TrainingList>(
]; title: "Trainings",
modelbsheet(keyValue); // itemList: trainingProvider.traininglist.cast<TrainingList>(),
}, buttonText: 'Show More',
) field1: 'Education Type',
: Container(), 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 = [
{
"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: 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 = [
{
"Name": selectedPhoneNumber.name,
"Start Date": selectedPhoneNumber.startDate,
"End Date": selectedPhoneNumber.endDate,
}
];
modelbsheet(keyValue);
},
)
: 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 = [
{
"Organization Id": selectedPhoneNumber.organizationId,
"specialty": selectedPhoneNumber.specialty,
"Start Date": selectedPhoneNumber.startDate,
"End Date": selectedPhoneNumber.endDate,
}
];
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

@ -48,6 +48,7 @@ import 'package:konectar_events/contacts_module/ui_screen/pno_showmore.dart';
import 'package:konectar_events/contacts_module/ui_screen/training_showmore.dart'; import 'package:konectar_events/contacts_module/ui_screen/training_showmore.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LocationTab extends StatefulWidget { class LocationTab extends StatefulWidget {
@ -188,9 +189,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -310,8 +311,8 @@ class _LocationTabState extends State<LocationTab> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: style: TextStyle(
TextStyle(color: Constants.k2color), color: AppColors.contentColorWhite),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -341,9 +342,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -461,8 +462,8 @@ class _LocationTabState extends State<LocationTab> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: style: TextStyle(
TextStyle(color: Constants.k2color), color: AppColors.contentColorWhite),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -492,9 +493,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -615,7 +616,7 @@ class _LocationTabState extends State<LocationTab> {
child: Text( child: Text(
'Show More', 'Show More',
style: style:
TextStyle(color: Constants.k2color), TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -645,9 +646,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -770,7 +771,7 @@ class _LocationTabState extends State<LocationTab> {
child: Text( child: Text(
'Show More', 'Show More',
style: style:
TextStyle(color: Constants.k2color), TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -799,9 +800,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -920,7 +921,7 @@ class _LocationTabState extends State<LocationTab> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -948,9 +949,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -1073,7 +1074,7 @@ class _LocationTabState extends State<LocationTab> {
child: Text( child: Text(
'Show More', 'Show More',
style: style:
TextStyle(color: Constants.k2color), TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -1102,9 +1103,9 @@ class _LocationTabState extends State<LocationTab> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -1228,7 +1229,7 @@ class _LocationTabState extends State<LocationTab> {
child: Text( child: Text(
'Show More', 'Show More',
style: style:
TextStyle(color: Constants.k2color), TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

View File

@ -2,6 +2,7 @@ import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/provider_class/medicalinsightprovider.dart'; import 'package:konectar_events/contacts_module/provider_class/medicalinsightprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/view_insight.dart'; import 'package:konectar_events/contacts_module/ui_screen/view_insight.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class MedicalInsight1 extends StatefulWidget { class MedicalInsight1 extends StatefulWidget {
@ -150,7 +151,7 @@ class _MedicalInsightState extends State<MedicalInsight1> {
setState(() {}); setState(() {});
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Constants.k2color, fillColor: AppColors.blueColor,
contentPadding: const EdgeInsets.symmetric(vertical: 9.0), contentPadding: const EdgeInsets.symmetric(vertical: 9.0),
border: const OutlineInputBorder( border: const OutlineInputBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(

View File

@ -1,62 +1,27 @@
import 'dart:async'; import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:konectar_events/contacts_module/constants.dart';
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/custiom_profilepic.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_bottomdailog.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_sizedbox.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_switch.dart';
import 'package:konectar_events/contacts_module/custom_widget/show_alert.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart'; import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/hive_fun.dart'; import 'package:konectar_events/contacts_module/hive_fun.dart';
import 'package:konectar_events/contacts_module/provider_class/affiliationsprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/award_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/certificate_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/educationprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/email_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/events_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/hcp%20_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/hcp%20_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/location_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/profile_storage.dart';
import 'package:konectar_events/contacts_module/provider_class/nih_provider.dart'; import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/contacts_module/provider_class/patent_provider.dart'; import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/contacts_module/provider_class/phoneno_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/procedureprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/publications_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/speaker_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/training_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/trials_provider.dart';
import 'package:konectar_events/contacts_module/storage_hive/kol_info/curd_kol.dart';
import 'package:konectar_events/contacts_module/ui_screen/contact_filters.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/util.dart';
import 'package:konectar_events/contacts_module/ui_screen/new_new_profile.dart';
// import 'package:konectar_events/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:konectar_events/utils/constants.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart';
import 'contact_filters.dart';
import 'new_new_profile.dart';
final ValueNotifier<List<String>> ddlist = ValueNotifier<List<String>>([]); final ValueNotifier<List<String>> ddlist = ValueNotifier<List<String>>([]);
String selectedValue = ''; String selectedValue = '';
String? selectedType; String? selectedType;
final TextEditingController searchController = TextEditingController(); final TextEditingController searchController = TextEditingController();
@ -87,7 +52,6 @@ class _Contacts1State extends State<Contacts1> {
bool longpressmy = false; bool longpressmy = false;
late List<dynamic> hcpdataList; late List<dynamic> hcpdataList;
// ignore: prefer_typing_uninitialized_variables
var hcpDataProvider1; var hcpDataProvider1;
@ -95,6 +59,10 @@ class _Contacts1State extends State<Contacts1> {
final Connectivity _connectivity = Connectivity(); final Connectivity _connectivity = Connectivity();
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription; late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
bool offMode = false;
List<Map<String, String>> filterList = [];
get developer => null; get developer => null;
@override @override
@ -106,6 +74,7 @@ class _Contacts1State extends State<Contacts1> {
_connectivitySubscription = _connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus); _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
hcpList(); hcpList();
}); });
} }
@ -119,19 +88,41 @@ class _Contacts1State extends State<Contacts1> {
hcpdataList = hcplist; hcpdataList = hcplist;
} }
void _onSwitchChanged(bool value) {
setState(() {
_switchValue = value; // Update the switch value
});
print("Switch value: $_switchValue"); // Optional: Log the switch value
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle( SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); SystemUiOverlayStyle(statusBarColor: AppColors.blueColor));
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( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: AppColors.contentColorWhite,
key: _scaffoldKey, // Assign the key to the Scaffold key: _scaffoldKey, // Assign the key to the Scaffold
appBar: AppBar( appBar: AppBar(
backgroundColor: AppColors.blueColor,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
centerTitle: true,
backgroundColor: EventsConstants.blueColor,
title: isSearchClickd title: isSearchClickd
? Container( ? Container(
height: 40, height: 40,
@ -141,24 +132,31 @@ class _Contacts1State extends State<Contacts1> {
child: TextField( child: TextField(
controller: searchController, controller: searchController,
onChanged: (value) { onChanged: (value) {
setState(() {}); WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
selectedValue = value;
searchController.text = selectedValue;
});
});
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Constants.k2color, fillColor: AppColors.blueColor,
contentPadding: EdgeInsets.symmetric(vertical: 9.0), contentPadding: EdgeInsets.symmetric(vertical: 9.0),
border: OutlineInputBorder(), border: OutlineInputBorder(),
hintText: "Search", hintText: "Search",
// labelText: ' Search', // labelText: ' Search',
prefixIcon: Icon( prefixIcon: Icon(
color: AppColors.contentColorWhite,
Icons.search, Icons.search,
color: Colors.white,
), ),
), ),
), ),
) )
: Text1( : Center(
title: "Contacts", child: Text1(
txtcolor: Colors.white, title: "Contacts",
txtcolor: AppColors.contentColorWhite,
),
), ),
actions: [ actions: [
IconButton( IconButton(
@ -172,15 +170,14 @@ class _Contacts1State extends State<Contacts1> {
}, },
icon: Icon( icon: Icon(
isSearchClickd ? Icons.close : Icons.search, isSearchClickd ? Icons.close : Icons.search,
color: Colors.white, color: AppColors.contentColorWhite,
)) ))
], ],
), ),
endDrawer: FilterDrawer(_switchValue, searchController), endDrawer: FilterDrawer(_switchValue, searchController,
onValueChanged: updateSelectedValue,
onValueMultiChanged: updatemultivalue),
// Drawer(
// child: listdata(),
// ),
body: Consumer<hcpProvider>( body: Consumer<hcpProvider>(
builder: (context, hcpProvider, child) { builder: (context, hcpProvider, child) {
print("_selectedValueConsumerConsumer_isss: $selectedValue"); print("_selectedValueConsumerConsumer_isss: $selectedValue");
@ -199,81 +196,16 @@ class _Contacts1State extends State<Contacts1> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( _offlineBanner(),
mainAxisAlignment: MainAxisAlignment.spaceBetween, headerRow(),
children: [ const CustomSizedBox(
Wrap( height: 5.0,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 2.0),
child: CupertinoSwitch(
activeColor: Color.fromARGB(255, 0, 71, 132),
value: _switchValue,
onChanged: (value) {
setState(() {
_switchValue = value;
});
},
),
),
Padding(
padding:
const EdgeInsets.only(right: 8.0, top: 9.0),
child: !_switchValue
? Text1(
title: 'My Contacts',
txtfont: 15,
txtcolor: Colors.grey,
)
: Text1(
title: 'My Contacts',
txtfont: 15,
txtcolor: Colors.grey,
))
],
),
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Row(
children: [
GestureDetector(
onTap: () {
print("SearchVon: ${searchController.text}");
setState(() {
selectedValue = '';
});
},
child: Text1(title: 'My Filters'),
// child: Text1(
// title: _connectionStatus[0].toString(),
// )
),
IconButton(
onPressed: () async {
_scaffoldKey.currentState?.openEndDrawer();
},
icon: const Icon(
Icons.sort,
size: 30,
)),
],
),
)
],
), ),
const SizedBox(
height: 5,
),
// !_switchValue
// ? hcpContactlistview(displayedHCPList)
// : hcpContactlistview(myContactHCPList),
// contactsBottomdailog()
!_switchValue !_switchValue
? _connectionStatus[0] ? _connectionStatus[0]
.toString() .toString()
.contains("ConnectivityResult.none") .contains("ConnectivityResult.none")
? hcpContactlistview(myContactHCPList) ? hcpContactlistview(myContactHCPList, offMode)
: hcpContactlistview(displayedHCPList) : hcpContactlistview(displayedHCPList)
: hcpContactlistview(myContactHCPList), : hcpContactlistview(myContactHCPList),
contactsBottomdailog() contactsBottomdailog()
@ -285,40 +217,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( Map<String, dynamic> findRecordById(
List displayedHCPList, String selectedIndic) { List displayedHCPList, String selectedIndic) {
// print( // print(
@ -327,7 +225,7 @@ class _Contacts1State extends State<Contacts1> {
.firstWhere((element) => element['id'] == int.parse(selectedIndic)); .firstWhere((element) => element['id'] == int.parse(selectedIndic));
} }
hcpContactlistview(List HCPList) { hcpContactlistview(List HCPList, [offMode]) {
return Expanded( return Expanded(
child: ListView.builder( child: ListView.builder(
itemCount: HCPList.length, itemCount: HCPList.length,
@ -337,138 +235,114 @@ class _Contacts1State extends State<Contacts1> {
print("CheckinggggImage_path: ${data['img_path']}"); print("CheckinggggImage_path: ${data['img_path']}");
return Column( return Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
ListTile( Padding(
onLongPress: () { padding: const EdgeInsets.only(left: 8.0, right: 8.0),
print("LongPresss"); child: ListTile(
setState(() { onLongPress: () {
longpress = true; print("LongPresss");
}); setState(() {
}, longpress = true;
onTap: () async { });
print("Check_data11 = ${data}"); },
onTap: () async {
print("Check_data11 = ${offMode}");
Navigator.push( offMode != null
context, ? Navigator.push(
MaterialPageRoute( context,
builder: (context) => NewProfile1(text: data), MaterialPageRoute(
), builder: (context) =>
); NewProfile1(text: data, offlinemode: offMode),
}, ),
leading: data["img_path"] == "" )
? ProfilePicture( : Navigator.push(
name: data["First Name"], context,
radius: 30, MaterialPageRoute(
fontsize: 12, builder: (context) => NewProfile1(text: data),
) ),
: ClipOval( );
child: SizedBox.fromSize( },
size: const Size.fromRadius(30), leading: CustomProfile(
child: CachedNetworkImage( imgstring: data["img_path"],
imageUrl: data["img_path"], fontsize: 12.0,
imageBuilder: (context, imageProvider) => Container( radius: 30,
decoration: BoxDecoration( name: data["First Name"],
image: DecorationImage( ),
image: imageProvider, trailing: Visibility(
fit: BoxFit.fill, visible: longpress,
), child: !_switchValue
), ? Checkbox(
value: _selectedIndices
.contains(data["id"].toString()),
onChanged: (value) {
setState(() {
if (value!) {
print("Datata_issss_iddd: ${data["id"]}");
_selectedIndices.add(data["id"].toString());
} else {
_selectedIndices
.remove(data["id"].toString());
}
print("id_total123: ${_selectedIndices}");
});
})
: Checkbox(
value: _selectedremoveIndices.contains(data["id"]),
onChanged: (value) {
setState(() {
if (value!) {
_selectedremoveIndices.add(data["id"]);
} else {
_selectedremoveIndices.remove(data["id"]);
}
print("id_total: ${_selectedremoveIndices}");
});
}),
),
title: Text1(
title: "Dr. " + data['name'],
fontweight: FontWeight.bold,
txtfont: isTablet ? 22 : 15,
),
subtitle: Column(
children: [
Row(
children: [
Expanded(
child: Text1(
title: data["speciality"] ?? data['spl'],
fontweight: FontWeight.normal,
txtcolor: Colors.black,
txtfont: isTablet ? 20 : 13,
), ),
), ),
), ],
), ),
trailing: Visibility( const CustomSizedBox(
visible: longpress, height: 10.0,
child: !_switchValue ),
? Checkbox( Row(
value: mainAxisAlignment: MainAxisAlignment.spaceBetween,
_selectedIndices.contains(data["id"].toString()), children: [
onChanged: (value) { Expanded(
setState(() { child: Text1(
if (value!) { title: "Added by Pooja k on 01/07/2023",
print("Datata_issss_iddd: ${data["id"]}"); fontweight: FontWeight.normal,
_selectedIndices.add(data["id"].toString()); txtfont: 12,
} else { ),
_selectedIndices.remove(data["id"].toString());
}
print("id_total123: ${_selectedIndices}");
});
})
: Checkbox(
value: _selectedremoveIndices.contains(data["id"]),
onChanged: (value) {
setState(() {
if (value!) {
_selectedremoveIndices.add(data["id"]);
} else {
_selectedremoveIndices.remove(data["id"]);
}
print("id_total: ${_selectedremoveIndices}");
});
}),
),
title: Text1(
title: data['name'],
fontweight: FontWeight.bold,
txtfont: isTablet ? 22 : 16,
),
subtitle: Column(
children: [
Row(
children: [
Expanded(
child: Text1(
title: data["speciality"] ?? data['spl'],
fontweight: FontWeight.normal,
txtfont: isTablet ? 20 : 14,
), ),
), ],
], ),
), ],
Row(
children: [
Text1(
title: data["State"] ?? '',
fontweight: FontWeight.normal,
txtfont: 14,
),
SizedBox(
width: 3.0,
),
Expanded(
child: Text1(
title: data["Country"] ?? '',
fontweight: FontWeight.normal,
txtfont: 14,
),
),
],
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(left: 10.0),
child: Text1(
title: "Added by Pooja k",
fontweight: FontWeight.normal,
txtfont: 14,
),
), ),
Padding( ),
padding: EdgeInsets.only(right: 10.0), ),
child: Text1( const Padding(
title: "Added on 01/07/2023", padding: EdgeInsets.only(left: 20.0, right: 20.0),
fontweight: FontWeight.normal, child: Divider(),
txtfont: 14,
),
)
],
), ),
Divider(),
], ],
); );
}, },
@ -476,217 +350,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() { contactsBottomdailog() {
return Align( return Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: longpress child: longpress
? Container( ? CustomLongPressContainer(
color: const Color.fromARGB(255, 251, 242, 242), switchValue: _switchValue,
width: MediaQuery.of(context).size.width, selectedIndices: _selectedIndices,
height: 200.0, selectedRemoveIndices: _selectedremoveIndices,
child: Column( onAddToContacts: _onAddToContacts,
mainAxisAlignment: MainAxisAlignment.center, onRemoveFromContacts: _onRemoveFromContacts,
children: [ onDownload: _onDownload,
!_switchValue onCancel: _onCancel,
? GestureDetector( onSaveOffline: _onSaveOffline,
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),
),
),
],
),
),
),
),
],
),
) )
: Container(), : Container(),
); );
@ -702,9 +378,6 @@ class _Contacts1State extends State<Contacts1> {
return; 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) { if (!mounted) {
return Future.value(null); return Future.value(null);
} }
@ -715,8 +388,160 @@ class _Contacts1State extends State<Contacts1> {
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async { Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
setState(() { setState(() {
_connectionStatus = result; _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 // ignore: avoid_print
print('Connectivity changed: $_connectionStatus'); 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: AppColors.blueColor,
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
}
} }

View File

@ -25,6 +25,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
@ -60,7 +61,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
String? fileName; String? fileName;
final TextEditingController textEditingController = TextEditingController(); final TextEditingController textEditingController = TextEditingController();
final FlutterCarouselController _controller = FlutterCarouselController(); //final CarouselController _controller = CarouselController();
int _currentPage = 0; int _currentPage = 0;
late int _totalPages = late int _totalPages =
@ -122,7 +123,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Constants.k2color, backgroundColor: AppColors.blueColor,
title: Text( title: Text(
widget.saveInteraction.id, widget.saveInteraction.id,
style: TextStyle( style: TextStyle(
@ -146,295 +147,295 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
body: Column( body: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Expanded( // Expanded(
// child: ListView.builder( // // child: ListView.builder(
// itemCount: provider.interactionReponseList.length, // // itemCount: provider.interactionReponseList.length,
// padding: EdgeInsets.zero, // // padding: EdgeInsets.zero,
// cacheExtent: double.parse( // // cacheExtent: double.parse(
// provider.interactionReponseList.length.toString()), // // provider.interactionReponseList.length.toString()),
// itemBuilder: (context, index) { // // itemBuilder: (context, index) {
// var item = provider.interactionReponseList[index]; // // var item = provider.interactionReponseList[index];
// sectionList = item.sectionList; // // sectionList = item.sectionList;
child: FlutterCarousel( // child: FlutterCarousel(
options: FlutterCarouselOptions( // options: CarouselOptions(
onPageChanged: (index, reason) { // onPageChanged: (index, reason) {
setState(() { // setState(() {
_currentPage = index; // _currentPage = index;
}); // });
// Example: Perform actions when reaching the last page // // Example: Perform actions when reaching the last page
// if (_currentPage == _totalPages - 1) { // // if (_currentPage == _totalPages - 1) {
// print('Reached the last page!'); // // print('Reached the last page!');
// // Add your actions here // // // Add your actions here
// } // // }
}, // },
controller: _controller, // controller: _controller,
height: MediaQuery.of(context) // height: MediaQuery.of(context)
.size // .size
.height, // Adjust as needed // .height, // Adjust as needed
// aspectRatio: 16 / 9, // Optional aspect ratio adjustment // // aspectRatio: 16 / 9, // Optional aspect ratio adjustment
//viewportFraction: 0.9, // //viewportFraction: 0.9,
viewportFraction: 1.0, // viewportFraction: 1.0,
initialPage: 0, // initialPage: 0,
enableInfiniteScroll: false, // enableInfiniteScroll: false,
reverse: false, // reverse: false,
autoPlay: false, // autoPlay: false,
autoPlayInterval: Duration(seconds: 3), // autoPlayInterval: Duration(seconds: 3),
autoPlayAnimationDuration: // autoPlayAnimationDuration:
Duration(milliseconds: 800), // Duration(milliseconds: 800),
autoPlayCurve: Curves.fastOutSlowIn, // autoPlayCurve: Curves.fastOutSlowIn,
enlargeCenterPage: false, // enlargeCenterPage: false,
disableCenter: false, // disableCenter: false,
showIndicator: true, // showIndicator: true,
scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
slideIndicator: CircularWaveSlideIndicator( // slideIndicator: CircularWaveSlideIndicator(
slideIndicatorOptions: SlideIndicatorOptions( // slideIndicatorOptions: SlideIndicatorOptions(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
currentIndicatorColor: Constants.k2color, // currentIndicatorColor: Constants.k2color,
indicatorBackgroundColor: Colors.grey), // indicatorBackgroundColor: Colors.grey),
), // ),
), // ),
items: provider.interactionReponseList.map((item) { // items: provider.interactionReponseList.map((item) {
sectionList = item.sectionList; // sectionList = item.sectionList;
print("Item_sectionListt11: ${item.sectionName}"); // print("Item_sectionListt11: ${item.sectionName}");
print("Item_sectionListt: ${item.sectionList}"); // print("Item_sectionListt: ${item.sectionList}");
return ListView( // return ListView(
children: [ // children: [
Padding( // Padding(
padding: const EdgeInsets.all(10.0), // padding: const EdgeInsets.all(10.0),
child: Text( // child: Text(
item.sectionName, // item.sectionName,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: const TextStyle( // style: const TextStyle(
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.normal, // fontWeight: FontWeight.normal,
fontSize: 18.0), // fontSize: 18.0),
), // ),
), // ),
Container( // Container(
color: Colors.white, // color: Colors.white,
child: Padding( // child: Padding(
padding: const EdgeInsets.only(top: 0.0), // padding: const EdgeInsets.only(top: 0.0),
child: Column( // child: Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.center, // CrossAxisAlignment.center,
children: [ // children: [
GridView.count( // GridView.count(
physics: // physics:
const NeverScrollableScrollPhysics(), // const NeverScrollableScrollPhysics(),
// crossAxisCount: // // crossAxisCount:
// context.responsive<int>( // // context.responsive<int>(
// 1, // // 1,
// sm: 1, // small // // sm: 1, // small
// md: 1, // medium // // md: 1, // medium
// lg: sectionList.length == 1 // // lg: sectionList.length == 1
// ? 1 // // ? 1
// : 4, // large // // : 4, // large
// xl: 3, // extra large screen // // xl: 3, // extra large screen
// ), // // ),
crossAxisCount: context.responsive<int>( // crossAxisCount: context.responsive<int>(
1, // 1,
sm: 1, // small // sm: 1, // small
md: 2, // medium // md: 2, // medium
lg: sectionList.length == 1 // lg: sectionList.length == 1
? 1 // ? 1
: 3, // large // : 3, // large
xl: 3, // extra large screen // xl: 3, // extra large screen
), // ),
mainAxisSpacing: // mainAxisSpacing:
sectionList.length == 1 || !isTablet // sectionList.length == 1 || !isTablet
? 1 // ? 1
: 3.5, // : 3.5,
shrinkWrap: true, // shrinkWrap: true,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
childAspectRatio: // childAspectRatio:
sectionList.length == 1 // sectionList.length == 1
? orientation == // ? orientation ==
Orientation.landscape // Orientation.landscape
? 10 // ? 10
: 4.8 // : 4.8
: isTablet // : isTablet
? 2.8 // ? 2.8
: 4.5, // : 4.5,
children: List.generate( // children: List.generate(
sectionList.length, // sectionList.length,
(i) { // (i) {
// print(sectionList); // // print(sectionList);
SectionList sectionItem = // SectionList sectionItem =
sectionList[i]; // sectionList[i];
dropdownvalue = sectionItem // dropdownvalue = sectionItem
.widget == // .widget ==
InteractionWidget.DROPDOWN // InteractionWidget.DROPDOWN
? sectionItem.value ?? "Select" // ? sectionItem.value ?? "Select"
: ' '; // : ' ';
List<InputClass> list = sectionItem // List<InputClass> list = sectionItem
.widget == // .widget ==
InteractionWidget // InteractionWidget
.DROPDOWN || // .DROPDOWN ||
sectionItem.widget == // sectionItem.widget ==
InteractionWidget // InteractionWidget
.AUTOCOMPLETE || // .AUTOCOMPLETE ||
sectionItem.widget == // sectionItem.widget ==
InteractionWidget // InteractionWidget
.MULTISELECT // .MULTISELECT
? provider.getData2(sectionItem) // ? provider.getData2(sectionItem)
: []; // : [];
provider.checkboxlist = sectionItem // provider.checkboxlist = sectionItem
.widget == // .widget ==
InteractionWidget.CHECKBOX // InteractionWidget.CHECKBOX
? provider.getData2(sectionItem) // ? provider.getData2(sectionItem)
: []; // : [];
return Column( // return Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.start, // CrossAxisAlignment.start,
children: [ // children: [
sectionItem.widget == // sectionItem.widget ==
InteractionWidget // InteractionWidget
.BUTTON && // .BUTTON &&
sectionItem.input == // sectionItem.input ==
'add' // 'add'
? const SizedBox.shrink() // ? const SizedBox.shrink()
: Padding( // : Padding(
padding: // padding:
const EdgeInsets // const EdgeInsets
.only( // .only(
left: 8.0, // left: 8.0,
right: 8.0), // right: 8.0),
// child: Text( // // child: Text(
// '${sectionItem.name}:*', // // '${sectionItem.name}:*',
// style: TextStyle( // // style: TextStyle(
// color: Colors // // color: Colors
// .orange // // .orange
// .shade800, // // .shade800,
// fontSize: // // fontSize:
// isTablet // // isTablet
// ? 18 // // ? 18
// : 12, // // : 12,
// ), // // ),
// ), // // ),
child: Text( // child: Text(
sectionItem.isRequired // sectionItem.isRequired
? '${sectionItem.name}:*' // ? '${sectionItem.name}:*'
: '${sectionItem.name}:', // : '${sectionItem.name}:',
style: TextStyle( // style: TextStyle(
color: Colors.orange // color: Colors.orange
.shade800, // .shade800,
fontSize: 18.0, // fontSize: 18.0,
// fontSize: isTablet // // fontSize: isTablet
// ? 18 // // ? 18
// : 12, // // : 12,
), // ),
), // ),
), // ),
// SizedBox( // // SizedBox(
// height: // // height:
// isTablet ? 15 : 5, // // isTablet ? 15 : 5,
// ), // // ),
returnWidget( // returnWidget(
sectionItem: sectionItem, // sectionItem: sectionItem,
item: item, // item: item,
provider: provider, // provider: provider,
list: list, // list: list,
gridIndex: i, // gridIndex: i,
listIndex: 0, // listIndex: 0,
widgetData: // widgetData:
sectionItem.widget!, // sectionItem.widget!,
multiple: false), // multiple: false),
// SizedBox( // // SizedBox(
// height: isTablet ? 15 : 5, // // height: isTablet ? 15 : 5,
// ), // // ),
], // ],
); // );
}, // },
), // ),
), // ),
// SizedBox( // // SizedBox(
// height: isTablet ? 15 : 5, // // height: isTablet ? 15 : 5,
// ), // // ),
item.multiple // item.multiple
? gridViewWidget( // ? gridViewWidget(
provider, // provider,
item.sectionName, // item.sectionName,
item.multipleList ?? [], // item.multipleList ?? [],
orientation, // orientation,
item, // item,
0) // 0)
: const SizedBox.shrink(), // : const SizedBox.shrink(),
provider.interactionReponseList.length == // provider.interactionReponseList.length ==
0 - 1 // 0 - 1
? saveActions(provider) // ? saveActions(provider)
: const SizedBox.shrink() // : const SizedBox.shrink()
//const Spacer(), // //const Spacer(),
], // ],
), // ),
), // ),
), // ),
], // ],
); // );
}).toList(), // }).toList(),
), // ),
), // ),
// const Spacer(), // const Spacer(),
// saveActions(provider), // saveActions(provider),
Padding( // Padding(
padding: const EdgeInsets.only(bottom: 8.0), // padding: const EdgeInsets.only(bottom: 8.0),
child: Align( // child: Align(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
Flexible( // Flexible(
child: OutlinedButton( // child: OutlinedButton(
style: OutlinedButton.styleFrom( // style: OutlinedButton.styleFrom(
shape: CircleBorder()), // shape: CircleBorder()),
onPressed: () { // onPressed: () {
//if (_currentPageIndex > _totalPages - 1) // //if (_currentPageIndex > _totalPages - 1)
_controller.previousPage(); // _controller.previousPage();
}, // },
child: Padding( // child: Padding(
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
child: Icon( // child: Icon(
Icons.arrow_back, // Icons.arrow_back,
color: Constants.k2color, // color: Constants.k2color,
), // ),
), // ),
), // ),
), // ),
Flexible( // Flexible(
child: OutlinedButton( // child: OutlinedButton(
style: OutlinedButton.styleFrom( // style: OutlinedButton.styleFrom(
shape: CircleBorder()), // shape: CircleBorder()),
// onPressed: () { // // onPressed: () {
// _controller.nextPage( // // _controller.nextPage(
// duration: Duration(milliseconds: 300), // // duration: Duration(milliseconds: 300),
// curve: Curves.ease, // // curve: Curves.ease,
// ); // // );
// }, // // },
onPressed: () { // onPressed: () {
_controller.nextPage( // _controller.nextPage(
duration: Duration(milliseconds: 300), // duration: Duration(milliseconds: 300),
curve: Curves.ease, // curve: Curves.ease,
); // );
}, // },
child: Padding( // child: Padding(
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
child: Icon( // child: Icon(
Icons.arrow_forward, // Icons.arrow_forward,
color: Constants.k2color, // color: Constants.k2color,
), // ),
), // ),
), // ),
), // ),
], // ],
), // ),
), // ),
), // ),
], ],
)), )),
); );

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ import 'package:konectar_events/contacts_module/ui_screen/interactionform/util.d
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
@ -63,7 +64,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
//resizeToAvoidBottomInset: false, //resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Constants.k2color, backgroundColor: AppColors.blueColor,
title: Text( title: Text(
widget.saveInteraction.id, widget.saveInteraction.id,
style: TextStyle( style: TextStyle(
@ -216,8 +217,8 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
: Text( : Text(
'${sectionItem.name}:*', '${sectionItem.name}:*',
style: TextStyle( style: TextStyle(
color: Constants color: AppColors
.k2color, .blueColor,
fontSize: fontSize:
isTablet isTablet
? 18 ? 18
@ -492,7 +493,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
: Text( : Text(
'${sectionItem.name}:*', '${sectionItem.name}:*',
style: TextStyle( style: TextStyle(
color: Constants.k2color, color: AppColors.blueColor,
fontSize: isTablet ? 18 : 12, fontSize: isTablet ? 18 : 12,
), ),
), ),

View File

@ -26,6 +26,7 @@ import 'package:konectar_events/contacts_module/ui_screen/publication_data.dart'
import 'package:konectar_events/contacts_module/ui_screen/trials_show_more.dart'; import 'package:konectar_events/contacts_module/ui_screen/trials_show_more.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class SavedActivities extends StatefulWidget { class SavedActivities extends StatefulWidget {
@ -121,7 +122,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -132,7 +133,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -246,7 +247,8 @@ class _SavedActivitiesState extends State<SavedActivities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -274,7 +276,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -285,7 +287,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -408,7 +410,8 @@ class _SavedActivitiesState extends State<SavedActivities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -436,7 +439,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -445,7 +448,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -564,7 +567,8 @@ class _SavedActivitiesState extends State<SavedActivities> {
}, },
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -592,7 +596,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: false, initiallyExpanded: false,
maintainState: true, maintainState: true,
@ -601,7 +605,7 @@ class _SavedActivitiesState extends State<SavedActivities> {
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -723,7 +727,8 @@ class _SavedActivitiesState extends State<SavedActivities> {
), ),
child: Text( child: Text(
'Show More', 'Show More',
style: TextStyle(color: Constants.k2color), style:
TextStyle(color: AppColors.blueColor),
), ),
), ),
), ),

View File

@ -37,6 +37,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
@ -208,7 +209,7 @@ class SavedContacts1State extends State<SavedContacts1> {
setState(() {}); setState(() {});
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Constants.k2color, fillColor: AppColors.blueColor,
contentPadding: EdgeInsets.symmetric(vertical: 9.0), contentPadding: EdgeInsets.symmetric(vertical: 9.0),
border: OutlineInputBorder(), border: OutlineInputBorder(),
hintText: "Search", hintText: "Search",
@ -1030,7 +1031,7 @@ class SavedContacts1State extends State<SavedContacts1> {
Text( Text(
'Cancel', 'Cancel',
style: TextStyle( style: TextStyle(
color: Constants.k2color), color: AppColors.blueColor),
), ),
], ],
), ),
@ -1094,7 +1095,7 @@ class SavedContacts1State extends State<SavedContacts1> {
}, },
child: Text( child: Text(
'Reset Filter', 'Reset Filter',
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

View File

@ -32,6 +32,7 @@ import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -127,7 +128,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
Widget headerview(BuildContext context) { Widget headerview(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: Constants.bgcolor, backgroundColor: AppColors.bgcolor,
// appBar: AppBar(), // appBar: AppBar(),
body: Stack( body: Stack(
children: <Widget>[ children: <Widget>[
@ -171,8 +172,8 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
end: Alignment.topCenter, end: Alignment.topCenter,
colors: [ colors: [
// Constants.blueColor, // Constants.blueColor,
Constants.tabbgColor, AppColors.tabbgColor,
Constants.k2color, AppColors.blueColor,
// Constants.tabbgColor, // Constants.tabbgColor,
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
@ -294,7 +295,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
width: width:
MediaQuery.of(context).size.width, // Adjust width as needed MediaQuery.of(context).size.width, // Adjust width as needed
height: 110, // Adjust height as needed height: 110, // Adjust height as needed
decoration: BoxDecoration(color: Constants.k2color), decoration: BoxDecoration(color: AppColors.blueColor),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -617,7 +618,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
), ),
color: Constants.k2color11, color: AppColors.contentColorWhite,
child: ExpansionTile( child: ExpansionTile(
// collapsedBackgroundColor: Color(0xFF2b9af3), // collapsedBackgroundColor: Color(0xFF2b9af3),
onExpansionChanged: (bool expanded) { onExpansionChanged: (bool expanded) {
@ -625,7 +626,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
_isExpanded = expanded; _isExpanded = expanded;
}); });
}, },
backgroundColor: Constants.k2color11, backgroundColor: AppColors.contentColorWhite,
trailing: Icon( trailing: Icon(
_isExpanded _isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -679,7 +680,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
}, },
child: Text( child: Text(
'Save', 'Save',
style: TextStyle(color: Constants.k2color), style: TextStyle(color: AppColors.blueColor),
), ),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -702,7 +703,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
final note = final note =
getText()[index]; // Get note at current index getText()[index]; // Get note at current index
return ListTile( return ListTile(
title: Text(note), // Display the note title: Text(note.note!), // Display the note
); );
}, },
), ),
@ -1089,7 +1090,7 @@ class SavedNewProfile1State extends State<SavedNewProfile1>
Widget getAppBarUI() { Widget getAppBarUI() {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Constants.k2color, color: AppColors.blueColor,
boxShadow: <BoxShadow>[ boxShadow: <BoxShadow>[
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.2), color: Colors.grey.withOpacity(0.2),

View File

@ -0,0 +1,250 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_event_provider.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,322 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/custom_widget/icontext_widget.dart';
import 'package:konectar_events/contacts_module/custom_widget/text.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_locationprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart';
import 'package:konectar_events/utils/appcolors.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: AppColors.blueColor,
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: AppColors.blueColor,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons.location_pin,
size: 20.0,
color: AppColors.blueColor,
),
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

@ -2,6 +2,7 @@
import 'package:konectar_events/contacts_module/constants.dart'; import 'package:konectar_events/contacts_module/constants.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
class MyWidget22 extends StatefulWidget { class MyWidget22 extends StatefulWidget {
const MyWidget22({super.key}); const MyWidget22({super.key});
@ -30,7 +31,7 @@ class _MyWidget22State extends State<MyWidget22> {
children: [ children: [
Icon( Icon(
Icons.edit, Icons.edit,
color: Constants.k2color, color: AppColors.blueColor,
) )
], ],
), ),

View File

@ -1,6 +1,430 @@
// import 'dart:async';
// import 'dart:convert';
// import 'dart:io';
// import 'dart:ui';
// import 'package:connectivity_plus/connectivity_plus.dart';
// import 'package:dio/dio.dart';
// import 'package:firebase_core/firebase_core.dart';
// import 'package:firebase_remote_config/firebase_remote_config.dart';
// import 'package:flutter/foundation.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter/services.dart';
// import 'package:flutter/widgets.dart';
// import 'package:hive_flutter/hive_flutter.dart';
// import 'package:konectar_events/contacts_module/constants.dart';
// import 'package:konectar_events/contacts_module/provider_class/affiliationsprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/certificate_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/educationprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/email_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/engagement_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/events_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/hcp%20_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_aff_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_awards_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_education_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_email_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_event_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_list_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_locationprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_pno_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_training_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/location_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/medicalinsightprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/nih_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/patent_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/phoneno_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/procedureprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/publications_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/single_hcpprovider.dart';
// import 'package:konectar_events/contacts_module/provider_class/speaker_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/training_provider.dart';
// import 'package:konectar_events/contacts_module/provider_class/trials_provider.dart';
// import 'package:konectar_events/contacts_module/storage_hive/aff_data/aff_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/awa_data/awa_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/cer_hive/cer_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/edu_data/edu_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/email_data/email_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/events_data/event_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/loc_data/location_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/patent_data/patent_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/pno_data/pno_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/procedure_data/pro_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/pub_data/pub_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/traning_data/traning_model_hive.dart';
// import 'package:konectar_events/contacts_module/storage_hive/trials_data/trial_model_hive.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionprovider.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/interaction_data.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/json_form_data.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/save_interaction.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/repository/hive_repository.dart';
// import 'package:konectar_events/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart';
// import 'package:konectar_events/firebaseexample.dart';
// import 'package:konectar_events/model/hive_api_constants.dart';
// import 'package:konectar_events/model/myeventsmodel.dart';
// import 'package:konectar_events/model/neweventsmodel.dart';
// import 'package:konectar_events/model/sessionnotesmodel.dart';
// import 'package:konectar_events/model/userdata_model.dart';
// import 'package:konectar_events/utils/sessionmanager.dart';
// import 'package:konectar_events/view/home.dart';
// import 'package:konectar_events/view/login.dart';
// import 'package:konectar_events/view/login_components/intropaging.dart';
// import 'package:konectar_events/view/navigation_home_screen.dart';
// import 'package:konectar_events/viewmodel/eventsprovider.dart';
// import 'package:konectar_events/viewmodel/hcpprofprovider.dart';
// import 'package:konectar_events/viewmodel/loginprovider.dart';
// import 'package:overlay_support/overlay_support.dart';
// import 'package:provider/provider.dart';
// import 'package:openid_client/openid_client.dart';
// import 'package:flutter_web_plugins/url_strategy.dart';
// import 'package:shared_preferences/shared_preferences.dart';
// //import 'openid/openid_io.dart' if (dart.library.html) 'openid_browser.dart';
// import 'contacts_module/provider_class/award_provider.dart';
// import 'firebase_options.dart';
// import 'package:flutter_background_service/flutter_background_service.dart';
// Future main() async {
// WidgetsFlutterBinding.ensureInitialized();
// final dio = Dio();
// await Hive.initFlutter();
// await initializeService();
// Hive.registerAdapter(UserDataAdapter());
// Hive.registerAdapter(EventsListAdapter());
// Hive.registerAdapter(SessionNotesModelAdapter());
// Hive.registerAdapter(MyEventsModelAdapter());
// Hive.registerAdapter(SaveInteractionAdapter());
// Hive.registerAdapter(InteractionConfigDataAdapter());
// Hive.registerAdapter(InteractionResultDataAdapter());
// Hive.registerAdapter(FormFieldDataAdapter());
// Hive.registerAdapter(ValidationAdapter());
// Hive.registerAdapter(SectionListAdapter());
// Hive.registerAdapter(InputClassAdapter());
// Hive.registerAdapter(InteractionWidgetAdapter());
// // Hive.registerAdapter(UserDataAdapter());
// Hive.registerAdapter(SendSaveJsonAdapter());
// Hive.registerAdapter(MultipleSectionListAdapter());
// Hive.registerAdapter(SaveAdapter());
// Hive.registerAdapter(SaveInteractionFormJsonAdapter());
// await Hive.openBox<SaveInteraction>('InteractionDataBox');
// await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox');
// var box = await Hive.openBox('mycontact');
// var box1 = await Hive.openBox('myfilter');
// await Hive.openBox('checkvalue');
// await Hive.openBox('hcpdata');
// await Hive.openBox<String>('notehive');
// Hive.registerAdapter(AffiliationAdapter());
// // await Hive.openBox<Affiliation>('affiliationshive');
// Hive.registerAdapter(KolInfoAdapter());
// Hive.registerAdapter(PublicationAdapter());
// Hive.registerAdapter(EventsAdapter());
// Hive.registerAdapter(TrialsAdapter());
// Hive.registerAdapter(LocationAdapter());
// Hive.registerAdapter(PhoneNoAdapter());
// Hive.registerAdapter(EmailAdapter());
// Hive.registerAdapter(EduAdapter());
// Hive.registerAdapter(AwaAdapter());
// Hive.registerAdapter(CerAdapter());
// Hive.registerAdapter(PatentAdapter());
// Hive.registerAdapter(NihAdapter());
// Hive.registerAdapter(ProAdapter());
// Hive.registerAdapter(Training1Adapter());
// Hive.registerAdapter(SpeAdapter());
// Hive.registerAdapter(HiveApiConstantsAdapter());
// await Hive.openBox<UserData>("UserDataBox");
// await Hive.openBox<EventsList>("EventsListBox");
// await Hive.openBox<SessionNotesModel>("SessionNotesModelBox");
// await Hive.openBox<MyEventsModel>("MyEventsBox");
// await Hive.openBox<HiveApiConstants>("hiveApiConstants");
// WidgetsFlutterBinding.ensureInitialized();
// // FirebaseMessaging.instance.getToken().then((value) {
// // String? token = value;
// // print("token: $token");
// // });
// usePathUrlStrategy();
// // client = await getClient();
// // //credential = await getRedirectResult(client, scopes: scopes);
// // credential = await authenticate(client, scopes: scopes);
// // userInfo = await credential!.getUserInfo();
// //runApp(const MyApp());
// // activateTimer();
// SharedPreferences.getInstance().then((instance) {
// //StorageService().sharedPreferencesInstance = instance;
// bool isloggedIn = instance.getBool('isloggedin') ?? false;
// print("checkhere before:$isloggedIn");
// String secretkey = instance.getString('secretkey') ?? "";
// OverlaySupportEntry entry;
// Connectivity().onConnectivityChanged.listen((event) {
// print("CHECK INTERNET");
// print(event);
// if (event.toString().contains("ConnectivityResult.none")) {
// entry = showOverlayNotification((context) {
// return Text("this is a message from simple notification");
// }, duration: Duration(hours: 1));
// }
// });
// OverlaySupport overlaySupport = OverlaySupport.global(
// child: Text("ONLINE"),
// );
// runApp(
// MultiProvider(
// providers: [
// ChangeNotifierProvider(create: (_) => LoginProvider()),
// ChangeNotifierProvider(create: (_) => EventsProvider()),
// ChangeNotifierProvider(create: (_) => HcpProfileProvider()),
// //Contacts
// ChangeNotifierProvider(create: (_) => InteractionProvider()),
// ChangeNotifierProvider(create: (_) => ViewInteractionProvider()),
// ChangeNotifierProvider(create: (_) => hcpProvider()),
// ChangeNotifierProvider(create: (_) => Singlehcpdetails()),
// ChangeNotifierProvider(create: (_) => AffiliationsProvider()),
// ChangeNotifierProvider(create: (_) => PublicatioProvider()),
// ChangeNotifierProvider(create: (_) => EventProvider()),
// ChangeNotifierProvider(create: (_) => TrialsProvider()),
// ChangeNotifierProvider(create: (_) => MediacalInsightProvider()),
// ChangeNotifierProvider(create: (_) => SpekerEvalutionProvider()),
// ChangeNotifierProvider(create: (_) => EnagagementProvider()),
// ChangeNotifierProvider(create: (_) => LocationProvider()),
// ChangeNotifierProvider(create: (_) => PhonenoProvider()),
// ChangeNotifierProvider(create: (_) => EmailProvider()),
// ChangeNotifierProvider(create: (_) => PatentProvider()),
// ChangeNotifierProvider(create: (_) => TrainigProvider()),
// ChangeNotifierProvider(create: (_) => EducationProvider()),
// ChangeNotifierProvider(create: (_) => AwardProvider()),
// ChangeNotifierProvider(create: (_) => CertificateProvider()),
// ChangeNotifierProvider(create: (_) => NIHGrantsProvider()),
// ChangeNotifierProvider(create: (_) => ProcedureProvider()),
// //K2 Provider
// ChangeNotifierProvider(create: (_) => KolListProvider()),
// ChangeNotifierProvider(create: (_) => LocationKolProvider()),
// ChangeNotifierProvider(create: (_) => PhonenoProviderK2()),
// ChangeNotifierProvider(create: (_) => EmailProviderK2()),
// ChangeNotifierProvider(create: (_) => EducationProviderK2()),
// ChangeNotifierProvider(create: (_) => TrainigProviderK2()),
// ChangeNotifierProvider(create: (_) => AwardProviderK2()),
// ChangeNotifierProvider(create: (_) => CertificateProviderK2()),
// ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()),
// ChangeNotifierProvider(create: (_) => EventProviderK2()),
// ChangeNotifierProvider<HiveDataRepository>(
// create: (_) => HiveDataRepository(
// Hive.box<InteractionConfigData>('InteractionConfigDataBox'))),
// ],
// child:
// // SafeArea(
// // top: true,
// // child:
// MaterialApp(
// theme: ThemeData(
// //fontFamily: "SourceSerif",
// ),
// debugShowCheckedModeBanner: false,
// title: 'Dynamic Links Example',
// initialRoute: '/',
// routes: <String, WidgetBuilder>{
// '/': (BuildContext context) => FutureBuilder<bool>(
// future: SessionManager().isLoggedIn(),
// builder: (context, snapshot) {
// print("Data_is : $snapshot");
// if (snapshot.connectionState == ConnectionState.waiting) {
// return const CircularProgressIndicator();
// } else if (snapshot.hasError) {
// return Text('Error: ${snapshot.error}');
// } else {
// final isLoggedIn = snapshot.data ?? false;
// print("isLoggedIn_is : $isLoggedIn");
// print("secret : $secretkey");
// return isLoggedIn
// ? NavigationHomeScreen()
// : IntroductionAnimationScreen();
// }
// },
// ), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
// // '/details': (BuildContext context) => const HomeScreen(),
// },
// ),
// ),
// // ),
// );
// });
// }
// Future<void> initializeService() async {
// final service = FlutterBackgroundService();
// await service.configure(
// androidConfiguration: AndroidConfiguration(
// // this will be executed when app is in foreground or background in separated isolate
// onStart: onStart,
// // auto start service
// autoStart: true,
// isForegroundMode: false,
// ),
// iosConfiguration: IosConfiguration(
// // auto start service
// autoStart: true,
// // this will be executed when app is in foreground in separated isolate
// onForeground: onStart,
// // you have to enable background fetch capability on xcode project
// onBackground: onIosBackground,
// ),
// );
// await service.startService();
// }
// @pragma('vm:entry-point')
// Future<bool> onIosBackground(ServiceInstance service) async {
// WidgetsFlutterBinding.ensureInitialized();
// DartPluginRegistrant.ensureInitialized();
// SharedPreferences preferences = await SharedPreferences.getInstance();
// await preferences.reload();
// final log = preferences.getStringList('log') ?? <String>[];
// log.add(DateTime.now().toIso8601String());
// await preferences.setStringList('log', log);
// return true;
// }
// @pragma('vm:entry-point')
// void onStart(ServiceInstance service) async {
// print("Background service started");
// if (service is AndroidServiceInstance) {
// // callApiInBackground;
// service.on('setAsForeground').listen((event) {
// service.setAsForegroundService();
// print("Hey Hi i am foground");
// });
// service.on('setAsBackground').listen((event) {
// service.setAsBackgroundService();
// print("Hey Hi i am background");
// });
// }
// print('NewwwFLUTTER BACKGROUND SERVICE: ${DateTime.now()}');
// service.on('stopService').listen((event) {
// service.stopSelf();
// });
// startPeriodicCalls();
// // Timer.periodic(const Duration(seconds: 20), (timer) async {
// // print('FLUTTER BACKGROUND SERVICE: ${DateTime.now()}');
// // // final response1 =
// // // await http.get(Uri.parse('http://192.168.2.170:8000/all-routes'));
// // // if (response1.statusCode == 200) {
// // // print('API call successful1 : ${response1.body}');
// // // } else {
// // // print('API call failed : ${response1.body}');
// // // }
// // startPeriodicCalls();
// // });
// }
// Map<String, Timer> _timers = {};
// // void startPeriodicCalls() {
// // Constants.apiIntervals1.forEach((url, interval) {
// // print("URL_iss: ${url}, InterVal_iss: ${interval}");
// // _timers[url] = Timer.periodic(Duration(minutes: interval), (timer) async {
// // await fetchApiData(url);
// // });
// // });
// // }
// startPeriodicCalls() {
// print("pooja");
// Constants.apiIntervals1.forEach((key, item) {
// print(
// "URL_iss: ${item['url']}, InterVal_iss: ${item['intervals']}, HiveName: ${item['hivename']}");
// _timers[item['url']] =
// Timer.periodic(Duration(minutes: item['intervals']), (timer) async {
// await fetchApiData(item['url'], item['hivename'], item['hivetype']);
// });
// });
// }
// PostApiCall(url, methodName, sendPostData) async {
// try {
// final response = await Dio().post(
// url,
// data: sendPostData,
// options: Options(
// headers: {
// 'Content-Type': 'application/json',
// },
// ),
// );
// if (response.statusCode == 200) {
// debugPrint("Response_is : ${response.data}");
// return response;
// } else {
// return 'Failed to load data';
// }
// } catch (e) {
// print('Error fetching data123 from $url: $e');
// }
// }
// Future<void> fetchApiData(String url, String hivename, String hivetype) async {
// print("Post_Url_iss: ${url}, ${hivename} , ${hivetype}");
// var box, postdata;
// // var box = Hive.box(hivename);
// switch (hivename) {
// case 'InteractionDataBox':
// box = await Hive.openBox<SaveInteraction>(hivename);
// final provider = ViewInteractionProvider();
// final prov = InteractionProvider();
// postdata = await provider.getAllRecordsforIntervalSync(hivename);
// postdata.forEach((item) async {
// PostApiCall(url, "post", prov.formJson(item));
// });
// break;
// default:
// box = Hive.box<String>(hivename);
// postdata = box.values.toList();
// postdata.forEach((item) async {
// PostApiCall(url, "post", item);
// });
// break;
// }
// }
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ui';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -12,6 +436,7 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/provider_class/affiliationsprovider.dart'; import 'package:konectar_events/contacts_module/provider_class/affiliationsprovider.dart';
import 'package:konectar_events/contacts_module/provider_class/certificate_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/certificate_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/educationprovider.dart'; import 'package:konectar_events/contacts_module/provider_class/educationprovider.dart';
@ -19,6 +444,7 @@ import 'package:konectar_events/contacts_module/provider_class/email_provider.da
import 'package:konectar_events/contacts_module/provider_class/engagement_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/engagement_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/events_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/events_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/hcp%20_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/hcp%20_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_add_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_aff_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_aff_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_awards_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_awards_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart';
@ -40,6 +466,7 @@ import 'package:konectar_events/contacts_module/provider_class/single_hcpprovide
import 'package:konectar_events/contacts_module/provider_class/speaker_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/speaker_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/training_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/training_provider.dart';
import 'package:konectar_events/contacts_module/provider_class/trials_provider.dart'; import 'package:konectar_events/contacts_module/provider_class/trials_provider.dart';
import 'package:konectar_events/contacts_module/service.dart/service.dart';
import 'package:konectar_events/contacts_module/storage_hive/aff_data/aff_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/aff_data/aff_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/awa_data/awa_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/awa_data/awa_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/cer_hive/cer_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/cer_hive/cer_model_hive.dart';
@ -49,6 +476,7 @@ import 'package:konectar_events/contacts_module/storage_hive/events_data/event_m
import 'package:konectar_events/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/loc_data/location_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/loc_data/location_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/note_data/note_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/patent_data/patent_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/patent_data/patent_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/pno_data/pno_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:konectar_events/contacts_module/storage_hive/procedure_data/pro_model_hive.dart'; import 'package:konectar_events/contacts_module/storage_hive/procedure_data/pro_model_hive.dart';
@ -62,6 +490,7 @@ import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/
import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/json_form_data.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/save_interaction.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/repository/hive_repository.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/util.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart';
import 'package:konectar_events/firebaseexample.dart'; import 'package:konectar_events/firebaseexample.dart';
import 'package:konectar_events/model/hive_api_constants.dart'; import 'package:konectar_events/model/hive_api_constants.dart';
@ -69,6 +498,7 @@ import 'package:konectar_events/model/myeventsmodel.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart'; import 'package:konectar_events/model/sessionnotesmodel.dart';
import 'package:konectar_events/model/userdata_model.dart'; import 'package:konectar_events/model/userdata_model.dart';
import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/sessionmanager.dart'; import 'package:konectar_events/utils/sessionmanager.dart';
import 'package:konectar_events/view/home.dart'; import 'package:konectar_events/view/home.dart';
import 'package:konectar_events/view/login.dart'; import 'package:konectar_events/view/login.dart';
@ -88,43 +518,14 @@ import 'package:shared_preferences/shared_preferences.dart';
//import 'openid/openid_io.dart' if (dart.library.html) 'openid_browser.dart'; //import 'openid/openid_io.dart' if (dart.library.html) 'openid_browser.dart';
import 'contacts_module/provider_class/award_provider.dart'; import 'contacts_module/provider_class/award_provider.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
Future main() async { Future main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
final dio = Dio(); // startPeriodicCalls();
// await Firebase.initializeApp(
// options: DefaultFirebaseOptions.currentPlatform,
// );
// final remoteConfig = FirebaseRemoteConfig.instance;
// await remoteConfig.setDefaults(const {
// "clientstring": "client-A",
// });
// await remoteConfig.setConfigSettings(RemoteConfigSettings(
// fetchTimeout: const Duration(seconds: 10),
// minimumFetchInterval: const Duration(seconds: 20),
// ));
// await remoteConfig.fetchAndActivate();
// RemoteConfigValue rawData = remoteConfig.getValue("client-A");
// print(rawData);
// const jsonString =
// '{"text": "foo", "value": 1, "status": false, "extra": null}';
// var map = jsonDecode(rawData.toString());
// String title = await remoteConfig.getString("welcomestring");
//await execute(InternetConnectionChecker());
// Create customized instance which can be registered via dependency injection
// final InternetConnectionChecker customInstance =
// InternetConnectionChecker.createInstance(
// checkTimeout: const Duration(milliseconds: 1),
// checkInterval: const Duration(milliseconds: 1),
// );
// // Check internet connection with created instance
// await execute(customInstance);
await Hive.initFlutter(); await Hive.initFlutter();
await initializeService();
Hive.registerAdapter(UserDataAdapter()); Hive.registerAdapter(UserDataAdapter());
Hive.registerAdapter(EventsListAdapter()); Hive.registerAdapter(EventsListAdapter());
@ -147,7 +548,8 @@ Future main() async {
Hive.registerAdapter(SaveInteractionFormJsonAdapter()); Hive.registerAdapter(SaveInteractionFormJsonAdapter());
await Hive.openBox<SaveInteraction>('InteractionDataBox'); await Hive.openBox<SaveInteraction>('InteractionDataBox');
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox'); var boxhive =
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox');
var box = await Hive.openBox('mycontact'); var box = await Hive.openBox('mycontact');
var box1 = await Hive.openBox('myfilter'); var box1 = await Hive.openBox('myfilter');
@ -156,7 +558,8 @@ Future main() async {
await Hive.openBox('hcpdata'); await Hive.openBox('hcpdata');
await Hive.openBox<String>('notehive'); await Hive.openBox<Note>('notehive');
// Hive.registerAdapter(NoteAdapter());
Hive.registerAdapter(AffiliationAdapter()); Hive.registerAdapter(AffiliationAdapter());
// await Hive.openBox<Affiliation>('affiliationshive'); // await Hive.openBox<Affiliation>('affiliationshive');
@ -178,6 +581,8 @@ Future main() async {
Hive.registerAdapter(SpeAdapter()); Hive.registerAdapter(SpeAdapter());
Hive.registerAdapter(HiveApiConstantsAdapter()); Hive.registerAdapter(HiveApiConstantsAdapter());
// Hive.registerAdapter(NoteAdapter());
await Hive.openBox<UserData>("UserDataBox"); await Hive.openBox<UserData>("UserDataBox");
await Hive.openBox<EventsList>("EventsListBox"); await Hive.openBox<EventsList>("EventsListBox");
await Hive.openBox<SessionNotesModel>("SessionNotesModelBox"); await Hive.openBox<SessionNotesModel>("SessionNotesModelBox");
@ -185,19 +590,10 @@ Future main() async {
await Hive.openBox<HiveApiConstants>("hiveApiConstants"); await Hive.openBox<HiveApiConstants>("hiveApiConstants");
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
// FirebaseMessaging.instance.getToken().then((value) {
// String? token = value;
// print("token: $token");
// });
usePathUrlStrategy(); usePathUrlStrategy();
// client = await getClient();
// //credential = await getRedirectResult(client, scopes: scopes);
// credential = await authenticate(client, scopes: scopes);
// userInfo = await credential!.getUserInfo();
//runApp(const MyApp());
// activateTimer();
SharedPreferences.getInstance().then((instance) { SharedPreferences.getInstance().then((instance) {
//StorageService().sharedPreferencesInstance = instance;
bool isloggedIn = instance.getBool('isloggedin') ?? false; bool isloggedIn = instance.getBool('isloggedin') ?? false;
print("checkhere before:$isloggedIn"); print("checkhere before:$isloggedIn");
@ -244,6 +640,8 @@ Future main() async {
ChangeNotifierProvider(create: (_) => CertificateProviderK2()), ChangeNotifierProvider(create: (_) => CertificateProviderK2()),
ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()), ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()),
ChangeNotifierProvider(create: (_) => EventProviderK2()), ChangeNotifierProvider(create: (_) => EventProviderK2()),
ChangeNotifierProvider(create: (_) => AddNotesProvider()),
ChangeNotifierProvider<HiveDataRepository>( ChangeNotifierProvider<HiveDataRepository>(
create: (_) => HiveDataRepository( create: (_) => HiveDataRepository(
Hive.box<InteractionConfigData>('InteractionConfigDataBox'))), Hive.box<InteractionConfigData>('InteractionConfigDataBox'))),
@ -285,85 +683,131 @@ Future main() async {
}); });
} }
class MyApp extends StatefulWidget { Future<void> initializeService() async {
@override final service = FlutterBackgroundService();
_MyAppState createState() => _MyAppState();
await service.configure(
androidConfiguration: AndroidConfiguration(
// this will be executed when app is in foreground or background in separated isolate
onStart: onStart,
// auto start service
autoStart: true,
isForegroundMode: false,
),
iosConfiguration: IosConfiguration(
// auto start service
autoStart: true,
// this will be executed when app is in foreground in separated isolate
onForeground: onStart,
// you have to enable background fetch capability on xcode project
onBackground: onIosBackground,
),
);
await service.startService();
} }
class _MyAppState extends State<MyApp> { @pragma('vm:entry-point')
@override Future<bool> onIosBackground(ServiceInstance service) async {
void initState() { WidgetsFlutterBinding.ensureInitialized();
OverlaySupportEntry entry; DartPluginRegistrant.ensureInitialized();
Connectivity().onConnectivityChanged.listen((event) {
print("CHECK INTERNET"); SharedPreferences preferences = await SharedPreferences.getInstance();
print(event); await preferences.reload();
if (event.toString().contains("ConnectivityResult.wifi")) { final log = preferences.getStringList('log') ?? <String>[];
entry = showOverlayNotification((context) { log.add(DateTime.now().toIso8601String());
return Text("this is a message from simple notification"); await preferences.setStringList('log', log);
}, duration: Duration(hours: 1));
} return true;
}
@pragma('vm:entry-point')
void onStart(ServiceInstance service) async {
print("Background service started");
if (service is AndroidServiceInstance) {
// callApiInBackground;
service.on('setAsForeground').listen((event) {
service.setAsForegroundService();
print("Hey Hi i am foground");
}); });
super.initState();
}
@override service.on('setAsBackground').listen((event) {
Widget build(BuildContext context) { service.setAsBackgroundService();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( print("Hey Hi i am background");
statusBarColor: Colors.transparent, });
statusBarIconBrightness: Brightness.dark, }
statusBarBrightness: print('NewwwFLUTTER BACKGROUND SERVICE: ${DateTime.now()}');
!kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light,
systemNavigationBarColor: Colors.white, service.on('stopService').listen((event) {
systemNavigationBarDividerColor: Colors.transparent, service.stopSelf();
systemNavigationBarIconBrightness: Brightness.dark, });
)); startPeriodicCalls();
return MaterialApp( }
title: 'Flutter UI',
debugShowCheckedModeBanner: false, Map<String, Timer> _timers = {};
// theme: ThemeData(
// primarySwatch: Colors.blue, startPeriodicCalls() {
// textTheme: AppTheme.textTheme, print("pooja");
// platform: TargetPlatform.iOS, Constants.apiIntervals1.forEach((key, item) {
// ), print(
home: NavigationHomeScreen(), "URL_iss: ${item['url']}, InterVal_iss: ${item['intervals']}, HiveName: ${item['hivename']}");
_timers[item['url']] =
Timer.periodic(Duration(minutes: item['intervals']), (timer) async {
await fetchApiData(item['url'], item['hivename'], item['hivetype']);
});
});
}
PostApiCall(url, methodName, sendPostData) async {
try {
final response = await Dio().post(
url,
data: sendPostData,
options: Options(
headers: {
'Content-Type': 'application/json',
},
),
); );
}
@override if (response.statusCode == 200) {
State<StatefulWidget> createState() { debugPrint("Response_is : ${response.data}");
// TODO: implement createState return response;
throw UnimplementedError(); } else {
return 'Failed to load data';
}
} catch (e) {
print('Error fetching data123 from $url: $e');
} }
} }
// class App extends StatefulWidget { Future<void> fetchApiData(String url, String hivename, String hivetype) async {
// @override print("Post_Url_iss: ${url}, ${hivename} , ${hivetype}");
// _AppState createState() => _AppState(); var box, postdata;
// }
// class _AppState extends State<App> { // var box = Hive.box(hivename);
// @override switch (hivename) {
// void initState() { case 'InteractionDataBox':
// OverlaySupportEntry entry; box = await Hive.openBox<SaveInteraction>(hivename);
// Connectivity().onConnectivityChanged.listen((event) { final provider = ViewInteractionProvider();
// print(event); final prov = InteractionProvider();
// if (event.toString().contains("ConnectivityResult.none")) { postdata = await provider.getAllRecordsforIntervalSync(hivename);
// entry = showOverlayNotification((context) { postdata.forEach((item) async {
// return Text("this is a message from simple notification"); PostApiCall(url, "post", prov.formJson(item));
// }, duration: Duration(hours: 1)); });
// } break;
// }); default:
// super.initState(); box = Hive.box<Note>(hivename);
// } postdata = box.values.toList();
// @override print("PostData_isss: $postdata");
// Widget build(BuildContext context) { postdata.forEach((item) async {
// return OverlaySupport( PostApiCall(url, "post", item);
// child: MaterialApp( });
// title: 'Network Checker App', break;
// debugShowCheckedModeBanner: false, }
// home: Homepage(), }
// ),
// );
// }
// }

View File

@ -12,7 +12,13 @@ class HiveApiConstants {
String? method; String? method;
@HiveField(3) @HiveField(3)
String? module; String? module;
@HiveField(4)
String? hivename;
HiveApiConstants( HiveApiConstants(
{this.functionName, this.interval, this.method, this.module}); {this.functionName,
this.interval,
this.method,
this.module,
this.hivename});
} }

View File

@ -1,5 +1,4 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ffi';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';

View File

@ -24,6 +24,22 @@ class AppColors {
static const Color contentColorCyan = Color(0xFF50E4FF); static const Color contentColorCyan = Color(0xFF50E4FF);
//background: #F3F3F3; //background: #F3F3F3;
static const Color bgcolor = Color(0xFFF2F3F8);
static const Color oldbgcolor = Color.fromARGB(255, 222, 237, 247);
static const Color blueColor = Color.fromARGB(255, 0, 71, 132);
static const Color navcolor = Color(0x1e90ff);
static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184);
static const Color bgtopic = Color.fromARGB(255, 210, 214, 222);
static const Color fonttopic = Color.fromARGB(255, 68, 68, 68);
static const Color btnGreenColor = Color.fromARGB(255, 46, 166, 100);
static const Color btnBlueColor = Color.fromARGB(255, 0, 102, 204);
static const Color homeCardBackgound =
Color.fromRGBO(229, 229, 229, 1); //rgba(243, 243, 243, 1)
static const Color onboardButtonColor = Color.fromRGBO(3, 126, 238, 1);
static const Color profilecard = Color.fromARGB(255, 4, 104, 198);
static Color cardtext = Colors.transparent;
List<Color> appcolors = [ List<Color> appcolors = [
contentColorYellow, contentColorYellow,
contentColorBlue, contentColorBlue,

View File

@ -3,18 +3,18 @@ import 'package:flutter/material.dart';
class EventsConstants { class EventsConstants {
//static const Color bgcolor = Color.fromARGB(255, 246, 248, 252); //static const Color bgcolor = Color.fromARGB(255, 246, 248, 252);
static const Color bgcolor = Color(0xFFF2F3F8); // static const Color bgcolor = Color(0xFFF2F3F8);
static const Color oldbgcolor = Color.fromARGB(255, 222, 237, 247); // static const Color oldbgcolor = Color.fromARGB(255, 222, 237, 247);
static const Color blueColor = Color.fromARGB(255, 0, 71, 132); // static const Color blueColor = Color.fromARGB(255, 0, 71, 132);
static const Color navcolor = Color(0x1e90ff); // static const Color navcolor = Color(0x1e90ff);
static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184); // static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184);
static const Color bgtopic = Color.fromARGB(255, 210, 214, 222); // static const Color bgtopic = Color.fromARGB(255, 210, 214, 222);
static const Color fonttopic = Color.fromARGB(255, 68, 68, 68); // static const Color fonttopic = Color.fromARGB(255, 68, 68, 68);
static const Color btnGreenColor = Color.fromARGB(255, 46, 166, 100); // static const Color btnGreenColor = Color.fromARGB(255, 46, 166, 100);
static const Color btnBlueColor = Color.fromARGB(255, 0, 102, 204); // static const Color btnBlueColor = Color.fromARGB(255, 0, 102, 204);
static const Color homeCardBackgound = // static const Color homeCardBackgound =
Color.fromRGBO(229, 229, 229, 1); //rgba(243, 243, 243, 1) // Color.fromRGBO(229, 229, 229, 1); //rgba(243, 243, 243, 1)
static const Color onboardButtonColor = Color.fromRGBO(3, 126, 238, 1); // static const Color onboardButtonColor = Color.fromRGBO(3, 126, 238, 1);
// static const String domainUrl = "http://192.0.0.2:8007/api/method/"; // static const String domainUrl = "http://192.0.0.2:8007/api/method/";
static const String domainUrl = "http://192.168.2.109:8007/api/method/"; static const String domainUrl = "http://192.168.2.109:8007/api/method/";

View File

@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:konectar_events/model/eventsmodel.dart'; import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/view/hcplist.dart'; import 'package:konectar_events/view/hcplist.dart';
@ -129,7 +130,7 @@ class _EventsDetailTabState extends State<EventsDetailTab> {
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Container( child: Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
// height: isTablet ? height * 0.50 : height * 0.30, // height: isTablet ? height * 0.50 : height * 0.30,
// padding: const EdgeInsets.only(top: 5.0), // padding: const EdgeInsets.only(top: 5.0),
// width: double.maxFinite, // width: double.maxFinite,
@ -280,7 +281,7 @@ class _EventsDetailTabState extends State<EventsDetailTab> {
height: 40, height: 40,
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
backgroundColor: EventsConstants.oldbgcolor, backgroundColor: AppColors.oldbgcolor,
onPressed: () { onPressed: () {
setState(() { setState(() {
isExtended = !isExtended; isExtended = !isExtended;
@ -326,7 +327,7 @@ class _EventsDetailTabState extends State<EventsDetailTab> {
height: 40, height: 40,
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
backgroundColor: EventsConstants.oldbgcolor, backgroundColor: AppColors.oldbgcolor,
onPressed: () { onPressed: () {
setState(() { setState(() {
isExtendedInterested = !isExtendedInterested; isExtendedInterested = !isExtendedInterested;

View File

@ -15,6 +15,7 @@ import 'package:konectar_events/model/events_speakers_k1.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart'; import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventspeakers.dart'; import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart'; import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
@ -254,7 +255,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
return Consumer<ViewInteractionProvider>( return Consumer<ViewInteractionProvider>(
builder: (BuildContext context, provider, Widget? child) { builder: (BuildContext context, provider, Widget? child) {
return Container( return Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
@ -407,11 +408,11 @@ class _EventsListingScreenState extends State<EventsListingScreen>
//return SafeArea( //return SafeArea(
return Container( return Container(
child: Scaffold( child: Scaffold(
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
appBar: AppBar( appBar: AppBar(
// title: Text(""), // title: Text(""),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: false, centerTitle: false,
flexibleSpace: Row( flexibleSpace: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -451,7 +452,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
style: TextStyle( style: TextStyle(
// decoration: TextDecoration.underline, // decoration: TextDecoration.underline,
// decorationColor: Colors.blue, // decorationColor: Colors.blue,
color: EventsConstants.blueColor, color: AppColors.blueColor,
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
fontSize: isTablet ? 22 : 14, fontSize: isTablet ? 22 : 14,
@ -522,7 +523,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat, floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat,
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
// backgroundColor: const Color.fromARGB(255, 222, 237, 247), // backgroundColor: const Color.fromARGB(255, 222, 237, 247),
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
tooltip: 'Actions', tooltip: 'Actions',
// heroTag: "floatbtn232342", // heroTag: "floatbtn232342",
onPressed: () { onPressed: () {
@ -546,7 +547,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// child: // child:
Container( Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
// width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,
// constraints: BoxConstraints(minHeight: 120, maxHeight: 130), // constraints: BoxConstraints(minHeight: 120, maxHeight: 130),
//height: 240, //height: 240,
@ -729,7 +730,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
return Column( return Column(
children: [ children: [
Container( Container(
color: EventsConstants.blueColor, color: AppColors.blueColor,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
buildCardView( buildCardView(
@ -764,7 +765,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Colors.black, labelColor: Colors.black,
tabAlignment: TabAlignment.fill, tabAlignment: TabAlignment.fill,
indicatorColor: EventsConstants.blueColor, indicatorColor: AppColors.blueColor,
unselectedLabelColor: Colors.grey, unselectedLabelColor: Colors.grey,
labelStyle: TextStyle( labelStyle: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -814,7 +815,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
visible: isLoading, visible: isLoading,
child: Center( child: Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
), ),
), ),
), ),
@ -859,7 +860,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8), padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(38.0), Radius.circular(38.0),
), ),
@ -926,7 +927,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
Widget getAppBarUI(EventsList eventsList) { Widget getAppBarUI(EventsList eventsList) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.blueColor, color: AppColors.blueColor,
boxShadow: <BoxShadow>[ boxShadow: <BoxShadow>[
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.2), color: Colors.grey.withOpacity(0.2),
@ -1397,7 +1398,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
// heroTag: "following45", // heroTag: "following45",
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
//backgroundColor: Colors.red, //backgroundColor: Colors.red,
onPressed: () async { onPressed: () async {
// String msg = await provider // String msg = await provider
@ -1506,7 +1507,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
height: 45, height: 45,
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
onPressed: () async { onPressed: () async {
if (!event.eventUserInterest!) { if (!event.eventUserInterest!) {
await provider.addEventsToFavs(event.eventId!); await provider.addEventsToFavs(event.eventId!);
@ -1617,7 +1618,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// : // :
Container( Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
padding: EdgeInsets.only(left: 8, right: 8), padding: EdgeInsets.only(left: 8, right: 8),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Expanded( child: Expanded(
@ -1739,7 +1740,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
padding: EdgeInsets.only(left: 8), padding: EdgeInsets.only(left: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color.fromARGB(179, 248, 238, 238), // color: Color.fromARGB(179, 248, 238, 238),
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
), ),
child: Column( child: Column(
children: [ children: [
@ -2089,7 +2090,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
@override @override
Widget build( Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) { BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(color: EventsConstants.tabbgColor, child: _tabBar); return Container(color: AppColors.tabbgColor, child: _tabBar);
} }
@override @override

View File

@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart'; import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventsmodel.dart'; import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart'; import 'package:konectar_events/utils/dateformater.dart';
@ -73,7 +74,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
return DefaultTabController( return DefaultTabController(
length: 4, length: 4,
//child: SafeArea( //child: SafeArea(
// appBar: CustomAppBar(title: "", backgroundcolor: EventsConstants.bgcolor), // appBar: CustomAppBar(title: "", backgroundcolor: AppColors.bgcolor),
//body: //body:
// NestedScrollView( // NestedScrollView(
// headerSliverBuilder: // headerSliverBuilder:
@ -87,7 +88,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
// floating: false, // floating: false,
// pinned: true, // pinned: true,
// stretch: false, // stretch: false,
// backgroundColor: EventsConstants.bgcolor, // backgroundColor: AppColors.bgcolor,
// flexibleSpace: FlexibleSpaceBar( // flexibleSpace: FlexibleSpaceBar(
// centerTitle: false, // centerTitle: false,
// expandedTitleScale: 2.4, // expandedTitleScale: 2.4,
@ -156,11 +157,11 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
//return SafeArea( //return SafeArea(
return Container( return Container(
child: Scaffold( child: Scaffold(
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
appBar: AppBar( appBar: AppBar(
// title: Text(""), // title: Text(""),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: false, centerTitle: false,
flexibleSpace: Row( flexibleSpace: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -200,7 +201,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
style: TextStyle( style: TextStyle(
// decoration: TextDecoration.underline, // decoration: TextDecoration.underline,
// decorationColor: Colors.blue, // decorationColor: Colors.blue,
color: EventsConstants.blueColor, color: AppColors.blueColor,
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
fontSize: isTablet ? 22 : 14, fontSize: isTablet ? 22 : 14,
@ -260,7 +261,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat, floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat,
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
// backgroundColor: const Color.fromARGB(255, 222, 237, 247), // backgroundColor: const Color.fromARGB(255, 222, 237, 247),
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
tooltip: 'Actions', tooltip: 'Actions',
// heroTag: "floatbtn232342", // heroTag: "floatbtn232342",
onPressed: () { onPressed: () {
@ -268,7 +269,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 240, height: 240,
child: Center( child: Center(
@ -412,7 +413,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
return Column( return Column(
children: [ children: [
Container( Container(
color: EventsConstants.blueColor, color: AppColors.blueColor,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
buildCardView( buildCardView(
@ -447,7 +448,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Colors.black, labelColor: Colors.black,
tabAlignment: TabAlignment.fill, tabAlignment: TabAlignment.fill,
indicatorColor: EventsConstants.blueColor, indicatorColor: AppColors.blueColor,
unselectedLabelColor: Colors.grey, unselectedLabelColor: Colors.grey,
labelStyle: TextStyle( labelStyle: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -490,7 +491,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8), padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(38.0), Radius.circular(38.0),
), ),
@ -557,7 +558,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
Widget getAppBarUI(EventsList eventsList) { Widget getAppBarUI(EventsList eventsList) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.blueColor, color: AppColors.blueColor,
boxShadow: <BoxShadow>[ boxShadow: <BoxShadow>[
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.2), color: Colors.grey.withOpacity(0.2),
@ -1015,7 +1016,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
// heroTag: "following45", // heroTag: "following45",
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
//backgroundColor: Colors.red, //backgroundColor: Colors.red,
onPressed: () async { onPressed: () async {
// String msg = await provider // String msg = await provider
@ -1125,7 +1126,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
height: 45, height: 45,
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
onPressed: () async { onPressed: () async {
if (!event.isfav) { if (!event.isfav) {
event.isfav = !event.isfav; event.isfav = !event.isfav;
@ -1213,7 +1214,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
// : // :
Container( Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
padding: EdgeInsets.only(left: 8, right: 8), padding: EdgeInsets.only(left: 8, right: 8),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
@ -1317,7 +1318,7 @@ class _EventsListingOfflineScreenState extends State<EventsListingOfflineScreen>
padding: EdgeInsets.only(left: 8), padding: EdgeInsets.only(left: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color.fromARGB(179, 248, 238, 238), // color: Color.fromARGB(179, 248, 238, 238),
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
), ),
child: Column( child: Column(
children: [ children: [
@ -1654,7 +1655,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
@override @override
Widget build( Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) { BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(color: EventsConstants.tabbgColor, child: _tabBar); return Container(color: AppColors.tabbgColor, child: _tabBar);
} }
@override @override

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/view/eventslist.dart'; import 'package:konectar_events/view/eventslist.dart';
import 'package:word_cloud/word_cloud_data.dart'; import 'package:word_cloud/word_cloud_data.dart';
@ -105,7 +106,7 @@ class _EventsTabState extends State<EventsTab> {
top: false, top: false,
child: Scaffold( child: Scaffold(
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
currentIndex: _selectedIndex, currentIndex: _selectedIndex,
//backgroundColor: Color.fromARGB(255, 35, 79, 150), //backgroundColor: Color.fromARGB(255, 35, 79, 150),

View File

@ -5,6 +5,7 @@ import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/widgets/customappbar.dart'; import 'package:konectar_events/widgets/customappbar.dart';
import 'package:konectar_events/widgets/customtextfield.dart'; import 'package:konectar_events/widgets/customtextfield.dart';
@ -71,7 +72,7 @@ class _HelpDeskScreenState extends State<HelpDeskScreen> {
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: true, centerTitle: true,
), ),
body: Container( body: Container(
@ -152,7 +153,7 @@ class _HelpDeskScreenState extends State<HelpDeskScreen> {
), ),
Center( Center(
child: CustomButton( child: CustomButton(
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
onPressed: () => (), onPressed: () => (),
title: "Submit", title: "Submit",
textColor: Colors.white, textColor: Colors.white,

View File

@ -10,10 +10,12 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:konectar_events/contacts_module/custom_widget/custom_switch.dart';
import 'package:konectar_events/contacts_module/custom_widget/show_alert.dart'; import 'package:konectar_events/contacts_module/custom_widget/show_alert.dart';
import 'package:konectar_events/model/keywords_model.dart'; import 'package:konectar_events/model/keywords_model.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/apicall.dart'; import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart'; import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
@ -339,7 +341,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
endDrawer: populateDrawer(provider), endDrawer: populateDrawer(provider),
appBar: AppBar( appBar: AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: true, centerTitle: true,
title: _isSearch title: _isSearch
? Padding( ? Padding(
@ -379,7 +381,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
} }
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: EventsConstants.blueColor, fillColor: AppColors.blueColor,
contentPadding: EdgeInsets.symmetric(vertical: 9.0), contentPadding: EdgeInsets.symmetric(vertical: 9.0),
border: OutlineInputBorder(), border: OutlineInputBorder(),
hintText: "Search for events...", hintText: "Search for events...",
@ -463,7 +465,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
]; ];
}, },
body: Container( body: Container(
//color: EventsConstants.bgcolor, //color: AppColors.bgcolor,
color: Colors.white, color: Colors.white,
child: buildPaginationListView(context, provider)), child: buildPaginationListView(context, provider)),
), ),
@ -486,7 +488,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: Container( child: Container(
height: 24, height: 24,
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
boxShadow: <BoxShadow>[ boxShadow: <BoxShadow>[
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.2), color: Colors.grey.withOpacity(0.2),
@ -497,7 +499,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
//color: EventsConstants.bgcolor, //color: AppColors.bgcolor,
color: Colors.white, color: Colors.white,
child: Padding( child: Padding(
padding: padding:
@ -565,31 +567,23 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 2.0), padding: const EdgeInsets.only(left: 8.0, right: 2.0),
child: CupertinoSwitch(
activeColor: Color.fromARGB(255, 0, 71, 132), child: CustomSwitch(
value: provider.isFavSeleted, activeclor: AppColors.blueColor,
onChanged: (value) { switchvalue: provider.isFavSeleted,
onchanged: (value) {
provider.isFavSeleted = value; provider.isFavSeleted = value;
if (provider.isFavSeleted) { if (provider.isFavSeleted) {
pagingController.refresh(); pagingController.refresh();
//_pagingController.
// _pagingController
// .addPageRequestListener((pageKey) {
// await _fetchPage(0);
// });
} else { } else {
provider.isFavSeleted = false; provider.isFavSeleted = false;
provider.isAllSelected = !provider.isAllSelected; provider.isAllSelected = !provider.isAllSelected;
pagingController.refresh(); pagingController.refresh();
// _pagingController
// .addPageRequestListener((pageKey) {
// await _fetchPage(0);
// });
} }
setState(() {}); setState(() {});
}, },
), ),
// ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(right: 8.0, top: 9.0), padding: const EdgeInsets.only(right: 8.0, top: 9.0),
@ -694,7 +688,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
padding: const EdgeInsets.only(right: 12, top: 8, bottom: 8), padding: const EdgeInsets.only(right: 12, top: 8, bottom: 8),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(24.0), Radius.circular(24.0),
), ),
@ -933,28 +927,20 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
populateDrawer(EventsProvider provider) { populateDrawer(EventsProvider provider) {
return Theme( return Theme(
data: Theme.of(context).copyWith(canvasColor: EventsConstants.bgcolor), data: Theme.of(context).copyWith(canvasColor: AppColors.bgcolor),
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.60, width: MediaQuery.of(context).size.width * 0.60,
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Drawer( child: Drawer(
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
// DrawerHeader(
// child: Center(
// child: Text('Filters'),
// // child: Image.asset("assets/images/lf_logo.png",
// // height: 100, width: 100),
// ),
// ),
Container( Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
padding: EdgeInsets.only(top: 20, left: 5.0), padding: EdgeInsets.only(top: 20, left: 5.0),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0), padding: const EdgeInsets.only(left: 8.0),
child: Row( child: Row(
@ -977,29 +963,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
const Spacer(), const Spacer(),
// Align(
// alignment: Alignment.topRight,
// child: Container(
// height: 30,
// child: OutlinedButton(
// onPressed: () {
// },
// child: Text(
// 'Apply',
// style: TextStyle(
// // fontFamily: "SourceSerif",
// fontSize: 14,
// color: Colors.white,
// fontWeight: FontWeight.normal),
// ),
// style: OutlinedButton.styleFrom(
// shape: StadiumBorder(),
// backgroundColor: Colors.green,
// ),
// ),
// ),
// ),
SizedBox( SizedBox(
width: 8.0, width: 8.0,
), ),
@ -1010,39 +973,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
height: 7, height: 7,
color: Colors.black, color: Colors.black,
), ),
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('Search Scope'),
// subtitle: customAutoCompletedropdown(),
// onTap: () {},
// ),
// ),
// StringAutoCompleteTags(
// initialTags: [
// TagsData(name: "cancer screening ", id: "1"),
// TagsData(name: "cosmetic surgery", id: "2"),
// TagsData(name: "sleep medicine", id: "3"),
// TagsData(name: "ADHD", id: "4"),
// ],
// hintText: "Enter scope",
// ),
// Container(
// padding: const EdgeInsets.all(4.0),
// height: 40,
// width: double.infinity,
// decoration: BoxDecoration(
// border: Border.all(color: Colors.grey),
// borderRadius: BorderRadius.circular(8.0)),
// child: dropDown(underline: Container())),
Wrap( Wrap(
//spacing: 4,
// runSpacing: 4,
// crossAxisAlignment: WrapCrossAlignment.start,
// runAlignment: WrapAlignment.spaceEvenly,
// alignment: WrapAlignment.spaceEvenly,
// direction: Axis.horizontal,
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
SizedBox( SizedBox(
width: isTablet width: isTablet
@ -1157,7 +1088,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
), ),
], ],
), ),
Divider( Divider(
height: 1, height: 1,
color: Colors.black, color: Colors.black,
@ -1528,9 +1458,9 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
}, },
child: Card( child: Card(
//elevation: 4, //elevation: 4,
color: EventsConstants.homeCardBackgound, color: AppColors.homeCardBackgound,
//surfaceTintColor: Colors.white, //surfaceTintColor: Colors.white,
surfaceTintColor: EventsConstants.homeCardBackgound, surfaceTintColor: AppColors.homeCardBackgound,
// shadowColor: Constants.bgcolor, // shadowColor: Constants.bgcolor,
child: buildCardView(context, eventsList, provider), child: buildCardView(context, eventsList, provider),
), ),
@ -1603,7 +1533,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
}, },
child: Card( child: Card(
elevation: 1, elevation: 1,
shadowColor: EventsConstants.bgcolor, shadowColor: AppColors.bgcolor,
child: buildCardView( child: buildCardView(
context, provider.eventList[index], provider))); context, provider.eventList[index], provider)));
}, },
@ -1629,7 +1559,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
// color: Color.fromARGB(179, 248, 238, 238), // color: Color.fromARGB(179, 248, 238, 238),
// color: Colors.white, // color: Colors.white,
color: EventsConstants.homeCardBackgound, color: AppColors.homeCardBackgound,
borderRadius: BorderRadius.all(Radius.circular(20))), borderRadius: BorderRadius.all(Radius.circular(20))),
// height: MediaQuery.of(context).size.height * 0.2, // height: MediaQuery.of(context).size.height * 0.2,
// height: 136, // height: 136,
@ -1660,11 +1590,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
text: TextSpan(children: [ text: TextSpan(children: [
// WidgetSpan( // WidgetSpan(
// child: Icon(Icons.bookmark, // child: Icon(Icons.bookmark,
// color: EventsConstants.blueColor, // color: AppColors.blueColor,
// size: isTablet ? 14 : 18) // size: isTablet ? 14 : 18)
// // provider.ifOfflineExists(event.eventId!) // // provider.ifOfflineExists(event.eventId!)
// // ? Icon(Icons.bookmark, // // ? Icon(Icons.bookmark,
// // color: EventsConstants.blueColor, // // color: AppColors.blueColor,
// // size: isTablet ? 14 : 18) // // size: isTablet ? 14 : 18)
// // : SizedBox.shrink(), // // : SizedBox.shrink(),
// ), // ),
@ -1766,7 +1696,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
text: TextSpan(children: [ text: TextSpan(children: [
WidgetSpan( WidgetSpan(
child: Icon(Icons.bookmark, child: Icon(Icons.bookmark,
color: EventsConstants.blueColor, color: AppColors.blueColor,
size: isTablet ? 14 : 16), size: isTablet ? 14 : 16),
), ),
TextSpan( TextSpan(
@ -1799,9 +1729,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
shape: CircleBorder(), shape: CircleBorder(),
backgroundColor: backgroundColor: AppColors.bgcolor,
EventsConstants.bgcolor, //backgroundColor: AppColors.homeCardBackgound,
//backgroundColor: EventsConstants.homeCardBackgound,
onPressed: () async { onPressed: () async {
// event.isfav = !event.isfav; // event.isfav = !event.isfav;

View File

@ -7,6 +7,7 @@ import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/keywords_model.dart'; import 'package:konectar_events/model/keywords_model.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/apicall.dart'; import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
@ -227,7 +228,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
endDrawer: populateDrawer(provider), endDrawer: populateDrawer(provider),
appBar: AppBar( appBar: AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: false, centerTitle: false,
title: _isSearch title: _isSearch
? Container( ? Container(
@ -246,7 +247,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
} }
}, },
decoration: InputDecoration( decoration: InputDecoration(
fillColor: EventsConstants.blueColor, fillColor: AppColors.blueColor,
contentPadding: EdgeInsets.symmetric(vertical: 9.0), contentPadding: EdgeInsets.symmetric(vertical: 9.0),
border: OutlineInputBorder(), border: OutlineInputBorder(),
hintText: "Search for events...", hintText: "Search for events...",
@ -321,7 +322,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
]; ];
}, },
body: Container( body: Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: buildListView(context, provider)), child: buildListView(context, provider)),
), ),
), ),
@ -342,7 +343,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
child: Container( child: Container(
height: 24, height: 24,
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
boxShadow: <BoxShadow>[ boxShadow: <BoxShadow>[
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.2), color: Colors.grey.withOpacity(0.2),
@ -353,7 +354,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
), ),
), ),
Container( Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Padding( child: Padding(
padding: padding:
const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 4), const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 4),
@ -534,7 +535,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
padding: const EdgeInsets.only(right: 12, top: 8, bottom: 8), padding: const EdgeInsets.only(right: 12, top: 8, bottom: 8),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(24.0), Radius.circular(24.0),
), ),
@ -762,10 +763,10 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
populateDrawer(EventsOfflineProvider provider) { populateDrawer(EventsOfflineProvider provider) {
return Theme( return Theme(
data: Theme.of(context).copyWith(canvasColor: EventsConstants.bgcolor), data: Theme.of(context).copyWith(canvasColor: AppColors.bgcolor),
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.60, width: MediaQuery.of(context).size.width * 0.60,
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Drawer( child: Drawer(
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
@ -1429,7 +1430,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
}, },
child: Card( child: Card(
elevation: 2, elevation: 2,
shadowColor: EventsConstants.bgcolor, shadowColor: AppColors.bgcolor,
child: buildCardView( child: buildCardView(
context, provider.eventList[index], provider))); context, provider.eventList[index], provider)));
}, },
@ -1561,7 +1562,7 @@ class _OfflineHomeScreenState extends State<OfflineHomeScreen>
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
elevation: 1, elevation: 1,
shape: CircleBorder(), shape: CircleBorder(),
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
onPressed: () async { onPressed: () async {
// String msg = await provider // String msg = await provider
// .addEventsToFavs(event.eventId!); // .addEventsToFavs(event.eventId!);

View File

@ -8,6 +8,7 @@ import 'package:konectar_events/model/affiliationsmodel.dart';
import 'package:konectar_events/model/allsessionnotesmodel.dart'; import 'package:konectar_events/model/allsessionnotesmodel.dart';
import 'package:konectar_events/model/neweventsmodel.dart'; import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/specialtymodel.dart'; import 'package:konectar_events/model/specialtymodel.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/viewmodel/eventsprovider.dart'; import 'package:konectar_events/viewmodel/eventsprovider.dart';
import 'package:konectar_events/viewmodel/hcpprofprovider.dart'; import 'package:konectar_events/viewmodel/hcpprofprovider.dart';
@ -80,7 +81,7 @@ class _EventsInsightsState extends State<EventsInsights> {
widgets.add(ScatterItem(widget.kFlutterHashtags[i], i)); widgets.add(ScatterItem(widget.kFlutterHashtags[i], i));
} }
return Scaffold( return Scaffold(
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
body: Padding( body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0), padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: SingleChildScrollView( child: SingleChildScrollView(
@ -135,7 +136,7 @@ class _EventsInsightsState extends State<EventsInsights> {
provider.isLoadingInsights provider.isLoadingInsights
? Center( ? Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: EventsConstants.blueColor, color: AppColors.blueColor,
), ),
) )
: _buildCharts(provider, widgets), : _buildCharts(provider, widgets),

View File

@ -9,6 +9,7 @@ import 'package:konectar_events/firebaseexample.dart';
import 'package:konectar_events/model/userdata_model.dart'; import 'package:konectar_events/model/userdata_model.dart';
import 'package:konectar_events/model/verify_user_resp.dart'; import 'package:konectar_events/model/verify_user_resp.dart';
import 'package:konectar_events/utils/apicall.dart'; import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/sessionmanager.dart'; import 'package:konectar_events/utils/sessionmanager.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
@ -261,7 +262,7 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
Center( Center(
child: CustomButton( child: CustomButton(
backgroundColor: EventsConstants.onboardButtonColor, backgroundColor: AppColors.onboardButtonColor,
onPressed: () async { onPressed: () async {
if (textFieldsValidation(provider).isEmpty) { if (textFieldsValidation(provider).isEmpty) {
setState(() { setState(() {

View File

@ -1,5 +1,6 @@
import 'package:animations/animations.dart'; import 'package:animations/animations.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
class CenterNextButton extends StatelessWidget { class CenterNextButton extends StatelessWidget {
@ -76,7 +77,7 @@ class CenterNextButton extends StatelessWidget {
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
8 + 32 * (1 - _signUpMoveAnimation.value)), 8 + 32 * (1 - _signUpMoveAnimation.value)),
//color: Color(0xff132137), //color: Color(0xff132137),
color: EventsConstants.onboardButtonColor, color: AppColors.onboardButtonColor,
), ),
child: PageTransitionSwitcher( child: PageTransitionSwitcher(
duration: Duration(milliseconds: 480), duration: Duration(milliseconds: 480),

View File

@ -6,6 +6,7 @@ import 'package:konectar_events/contacts_module/ui_screen/new_contacts.dart';
import 'package:konectar_events/contacts_module/ui_screen/new_editinteraction.dart'; import 'package:konectar_events/contacts_module/ui_screen/new_editinteraction.dart';
import 'package:konectar_events/contacts_module/ui_screen/new_viewinteraction.dart'; import 'package:konectar_events/contacts_module/ui_screen/new_viewinteraction.dart';
import 'package:konectar_events/utils/app_theme.dart'; import 'package:konectar_events/utils/app_theme.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart'; import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/view/helpdesk.dart'; import 'package:konectar_events/view/helpdesk.dart';
@ -48,10 +49,10 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
onDrawerCall: (DrawerIndex drawerIndexdata) async { onDrawerCall: (DrawerIndex drawerIndexdata) async {
bool checkContacts = await HiveOperations.checkIfApiExists( bool checkContacts = await HiveOperations.checkIfApiExists(
EventsConstants.contactsListapi, EventsConstants.moduleName); EventsConstants.contactsListapi, EventsConstants.moduleName);
if (!checkContacts && drawerIndexdata.name == "Contacts") { // if (!checkContacts && drawerIndexdata.name == "Contacts") {
} else { // } else {
changeIndex(drawerIndexdata); changeIndex(drawerIndexdata);
} // }
//callback from drawer for replace screen as user need with passing DrawerIndex(Enum index) //callback from drawer for replace screen as user need with passing DrawerIndex(Enum index)
}, },
screenView: screenView, screenView: screenView,
@ -66,7 +67,7 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
return Consumer<ViewInteractionProvider>( return Consumer<ViewInteractionProvider>(
builder: (BuildContext context, provider, Widget? child) { builder: (BuildContext context, provider, Widget? child) {
return Container( return Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(

View File

@ -26,6 +26,7 @@ import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventspeakers.dart'; import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart'; import 'package:konectar_events/model/sessionnotesmodel.dart';
import 'package:konectar_events/model/sessionstopics_model.dart'; import 'package:konectar_events/model/sessionstopics_model.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart'; import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
@ -235,11 +236,11 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
return DefaultTabController( return DefaultTabController(
length: provider.tabs.length, length: provider.tabs.length,
child: Scaffold( child: Scaffold(
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
appBar: AppBar( appBar: AppBar(
// title: Text(""), // title: Text(""),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor, backgroundColor: AppColors.blueColor,
centerTitle: false, centerTitle: false,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
background: Padding( background: Padding(
@ -291,7 +292,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
SliverAppBar( SliverAppBar(
expandedHeight: 280.0, expandedHeight: 280.0,
// expandedHeight: MediaQuery.of(context).size.height * 0.25, // expandedHeight: MediaQuery.of(context).size.height * 0.25,
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
//backgroundColor: Colors.white, //backgroundColor: Colors.white,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
floating: false, floating: false,
@ -325,7 +326,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
tabAlignment: TabAlignment.fill, tabAlignment: TabAlignment.fill,
labelColor: Colors.black, labelColor: Colors.black,
indicatorColor: EventsConstants.blueColor, indicatorColor: AppColors.blueColor,
labelStyle: TextStyle( labelStyle: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -400,9 +401,9 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
begin: Alignment.bottomCenter, begin: Alignment.bottomCenter,
end: Alignment.topCenter, end: Alignment.topCenter,
colors: [ colors: [
EventsConstants.blueColor, AppColors.blueColor,
EventsConstants.blueColor, AppColors.blueColor,
EventsConstants.blueColor, AppColors.blueColor,
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
// Color(0xff006df1) // Color(0xff006df1)
@ -681,7 +682,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// sessionList = eventsdetail.sessionName!.split(','); // sessionList = eventsdetail.sessionName!.split(',');
sessionList = widget.sessionNames; sessionList = widget.sessionNames;
return Container( return Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -819,7 +820,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
height: 40, height: 40,
child: child:
// CustomButton( // CustomButton(
// backgroundColor: EventsConstants.btnGreenColor, // backgroundColor: AppColors.btnGreenColor,
// onPressed: () async { // onPressed: () async {
// isLoading = true; // isLoading = true;
@ -977,7 +978,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
visible: isLoading, visible: isLoading,
child: Center( child: Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: EventsConstants.blueColor, color: AppColors.blueColor,
)), )),
), ),
], ],
@ -991,7 +992,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// padding: EdgeInsets.all(4.0), // padding: EdgeInsets.all(4.0),
// child: Text('Cancel', // child: Text('Cancel',
// style: TextStyle( // style: TextStyle(
// fontSize: 14, color: EventsConstants.blueColor)), // fontSize: 14, color: AppColors.blueColor)),
// ), // ),
child: OutlinedButton( child: OutlinedButton(
onPressed: () { onPressed: () {
@ -1033,7 +1034,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// ), // ),
// child: const Text('Cancel', // child: const Text('Cancel',
// style: TextStyle( // style: TextStyle(
// fontSize: 14, color: EventsConstants.blueColor)), // fontSize: 14, color: AppColors.blueColor)),
// onPressed: () { // onPressed: () {
// enableCancel = false; // enableCancel = false;
// notesController.clear(); // notesController.clear();
@ -1242,7 +1243,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
padding: EdgeInsets.only(left: 8), padding: EdgeInsets.only(left: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color.fromARGB(179, 248, 238, 238), // color: Color.fromARGB(179, 248, 238, 238),
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
), ),
child: ListView.separated( child: ListView.separated(
padding: EdgeInsets.only(top: 10.0, left: 4.0), padding: EdgeInsets.only(top: 10.0, left: 4.0),
@ -1339,7 +1340,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// minWidth: MediaQuery.of(context).size.width * 0.34, // minWidth: MediaQuery.of(context).size.width * 0.34,
maxWidth: MediaQuery.of(context).size.width), maxWidth: MediaQuery.of(context).size.width),
decoration: BoxDecoration( decoration: BoxDecoration(
color: EventsConstants.bgtopic, color: AppColors.bgtopic,
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
@ -1358,7 +1359,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
style: TextStyle( style: TextStyle(
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
color: EventsConstants.fonttopic, color: AppColors.fonttopic,
fontSize: isTablet ? 16 : 14), fontSize: isTablet ? 16 : 14),
), ),
); );
@ -1371,7 +1372,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
return Consumer<ViewInteractionProvider>( return Consumer<ViewInteractionProvider>(
builder: (BuildContext context, provider, Widget? child) { builder: (BuildContext context, provider, Widget? child) {
return Container( return Container(
color: EventsConstants.bgcolor, color: AppColors.bgcolor,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
@ -1549,8 +1550,8 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
// end: Alignment.topCenter, // end: Alignment.topCenter,
// colors: [ // colors: [
// // Constants.blueColor, // // Constants.blueColor,
// EventsConstants.tabbgColor, // AppColors.tabbgColor,
// EventsConstants.blueColor, // AppColors.blueColor,
// // Constants.tabbgColor, // // Constants.tabbgColor,
// // const Color.fromARGB(255, 222, 237, 247), // // const Color.fromARGB(255, 222, 237, 247),
// // const Color.fromARGB(255, 222, 237, 247), // // const Color.fromARGB(255, 222, 237, 247),
@ -1651,9 +1652,9 @@ class _TopPortion extends StatelessWidget {
begin: Alignment.bottomCenter, begin: Alignment.bottomCenter,
end: Alignment.topCenter, end: Alignment.topCenter,
colors: [ colors: [
EventsConstants.blueColor, AppColors.blueColor,
EventsConstants.blueColor, AppColors.blueColor,
EventsConstants.blueColor, AppColors.blueColor,
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
// const Color.fromARGB(255, 222, 237, 247), // const Color.fromARGB(255, 222, 237, 247),
// Color(0xff006df1) // Color(0xff006df1)

View File

@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_scatter/flutter_scatter.dart'; import 'package:flutter_scatter/flutter_scatter.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/util.dart'; import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/widgets/customappbar.dart'; import 'package:konectar_events/widgets/customappbar.dart';
@ -36,7 +37,7 @@ class _SocialMediaState extends State<SocialMedia> {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
final ratio = screenSize.width / (screenSize.height / 2); final ratio = screenSize.width / (screenSize.height / 2);
return Scaffold( return Scaffold(
backgroundColor: EventsConstants.bgcolor, backgroundColor: AppColors.bgcolor,
// appBar: CustomAppBar( // appBar: CustomAppBar(
// title: "Social Media", // title: "Social Media",
// fontColor: Colors.black, // fontColor: Colors.black,

View File

@ -6,7 +6,8 @@ class HiveOperations {
late Box<HiveApiConstants> hiveApiConstantsBox; late Box<HiveApiConstants> hiveApiConstantsBox;
hiveApiConstantsBox = hiveApiConstantsBox =
await Hive.openBox<HiveApiConstants>('hiveApiConstants'); await Hive.openBox<HiveApiConstants>('hiveApiConstants');
print("DataAffing");
// hiveApiConstantsBox.clear();
hiveApiConstantsBox.addAll(hiveList); hiveApiConstantsBox.addAll(hiveList);
} }
@ -16,6 +17,8 @@ class HiveOperations {
await Hive.openBox<HiveApiConstants>('hiveApiConstants'); await Hive.openBox<HiveApiConstants>('hiveApiConstants');
List<HiveApiConstants> list = hiveApiConstantsBox.values.toList(); List<HiveApiConstants> list = hiveApiConstantsBox.values.toList();
print("Show/HideApiList: $list");
return list.indexWhere( return list.indexWhere(
(element) => (element) =>
element.functionName == api && element.module == moduleName, element.functionName == api && element.module == moduleName,

View File

@ -107,6 +107,12 @@ class LoginProvider extends ChangeNotifier {
interval: 0, interval: 0,
method: "POST", method: "POST",
module: "eventapis"), module: "eventapis"),
HiveApiConstants(
functionName: "ContactList",
interval: 0,
method: "POST",
module: "contactapis"),
// HiveApiConstants(functionName: "contactslistapi", interval: 0), // HiveApiConstants(functionName: "contactslistapi", interval: 0),
]; ];

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
class ChartLine extends StatelessWidget { class ChartLine extends StatelessWidget {
@ -47,7 +48,7 @@ class ChartLine extends StatelessWidget {
), ),
Container( Container(
//constraints: BoxConstraints(maxWidth: lineWidget), //constraints: BoxConstraints(maxWidth: lineWidget),
color: EventsConstants.blueColor, color: AppColors.blueColor,
height: 40, height: 40,
width: lineWidget, width: lineWidget,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),

View File

@ -5,6 +5,8 @@ import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/sessionmanager.dart'; import 'package:konectar_events/utils/sessionmanager.dart';
import 'package:konectar_events/view/login.dart'; import 'package:konectar_events/view/login.dart';
import 'package:konectar_events/viewmodel/hive_repository.dart'; import 'package:konectar_events/viewmodel/hive_repository.dart';
import 'package:konectar_events/viewmodel/loginprovider.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class HomeDrawer extends StatefulWidget { class HomeDrawer extends StatefulWidget {
@ -42,76 +44,149 @@ class _HomeDrawerState extends State<HomeDrawer> {
} }
void setDrawerListArray() async { void setDrawerListArray() async {
print("HiiisetDrawerListArray");
bool checkContacts = await HiveOperations.checkIfApiExists( bool checkContacts = await HiveOperations.checkIfApiExists(
EventsConstants.contactsListapi, EventsConstants.moduleName); EventsConstants.contactsListapi, EventsConstants.moduleName);
if (!checkContacts) { print("CheckContacts_123$checkContacts");
drawerList = <DrawerList>[ // if (!checkContacts) {
DrawerList( // drawerList = <DrawerList>[
index: DrawerIndex.HOME, // DrawerList(
labelName: 'Events', // index: DrawerIndex.HOME,
icon: Icon(Icons.event), // labelName: 'Events',
), // icon: Icon(Icons.event),
// ),
DrawerList( // DrawerList(
index: DrawerIndex.FeedBack, // index: DrawerIndex.FeedBack,
labelName: 'HelpDesk', // labelName: 'HelpDesk',
icon: Icon(Icons.help), // icon: Icon(Icons.help),
), // ),
DrawerList( // DrawerList(
index: DrawerIndex.Invite, // index: DrawerIndex.Invite,
labelName: 'Medical Insight', // labelName: 'Medical Insight',
icon: Icon(Icons.group), // icon: Icon(Icons.group),
), // ),
// DrawerList( // // DrawerList(
// index: DrawerIndex.Share, // // index: DrawerIndex.Share,
// labelName: 'Rate the app', // // labelName: 'Rate the app',
// icon: Icon(Icons.share), // // icon: Icon(Icons.share),
// ), // // ),
// DrawerList( // // DrawerList(
// index: DrawerIndex.About, // // index: DrawerIndex.About,
// labelName: 'About Us', // // labelName: 'About Us',
// icon: Icon(Icons.info), // // icon: Icon(Icons.info),
// ), // // ),
]; // ];
} else { // } else {
drawerList = <DrawerList>[ drawerList = <DrawerList>[
DrawerList( DrawerList(
index: DrawerIndex.Contacts, index: DrawerIndex.Contacts,
labelName: 'Contacts', labelName: 'Contacts',
icon: Icon(Icons.account_circle), icon: Icon(Icons.account_circle),
// isAssetsImage: true, // isAssetsImage: true,
// imageName: 'assets/images/supportIcon.png', // imageName: 'assets/images/supportIcon.png',
), ),
DrawerList( DrawerList(
index: DrawerIndex.HOME, index: DrawerIndex.HOME,
labelName: 'Events', labelName: 'Events',
icon: Icon(Icons.event), icon: Icon(Icons.event),
), ),
DrawerList( DrawerList(
index: DrawerIndex.FeedBack, index: DrawerIndex.FeedBack,
labelName: 'HelpDesk', labelName: 'HelpDesk',
icon: Icon(Icons.help), icon: Icon(Icons.help),
), ),
DrawerList( DrawerList(
index: DrawerIndex.Invite, index: DrawerIndex.Invite,
labelName: 'Medical Insight', labelName: 'Medical Insight',
icon: Icon(Icons.group), icon: Icon(Icons.group),
), ),
// DrawerList( // DrawerList(
// index: DrawerIndex.Share, // index: DrawerIndex.Share,
// labelName: 'Rate the app', // labelName: 'Rate the app',
// icon: Icon(Icons.share), // icon: Icon(Icons.share),
// ), // ),
// DrawerList( // DrawerList(
// index: DrawerIndex.About, // index: DrawerIndex.About,
// labelName: 'About Us', // labelName: 'About Us',
// icon: Icon(Icons.info), // icon: Icon(Icons.info),
// ), // ),
]; ];
} // }
} }
// void setDrawerListArray() async {
// bool checkContacts = await HiveOperations.checkIfApiExists(
// EventsConstants.contactsListapi, EventsConstants.moduleName);
// // if (!checkContacts) {
// // drawerList = <DrawerList>[
// // DrawerList(
// // index: DrawerIndex.HOME,
// // labelName: 'Events',
// // icon: Icon(Icons.event),
// // ),
// // DrawerList(
// // index: DrawerIndex.FeedBack,
// // labelName: 'HelpDesk',
// // icon: Icon(Icons.help),
// // ),
// // DrawerList(
// // index: DrawerIndex.Invite,
// // labelName: 'Medical Insight',
// // icon: Icon(Icons.group),
// // ),
// // // DrawerList(
// // // index: DrawerIndex.Share,
// // // labelName: 'Rate the app',
// // // icon: Icon(Icons.share),
// // // ),
// // // DrawerList(
// // // index: DrawerIndex.About,
// // // labelName: 'About Us',
// // // icon: Icon(Icons.info),
// // // ),
// // ];
// // } else {
// drawerList = <DrawerList>[
// DrawerList(
// index: DrawerIndex.Contacts,
// labelName: 'Contacts',
// icon: Icon(Icons.account_circle),
// // isAssetsImage: true,
// // imageName: 'assets/images/supportIcon.png',
// ),
// DrawerList(
// index: DrawerIndex.HOME,
// labelName: 'Events',
// icon: Icon(Icons.event),
// ),
// DrawerList(
// index: DrawerIndex.FeedBack,
// labelName: 'HelpDesk',
// icon: Icon(Icons.help),
// ),
// DrawerList(
// index: DrawerIndex.Invite,
// labelName: 'Medical Insight',
// icon: Icon(Icons.group),
// ),
// // DrawerList(
// // index: DrawerIndex.Share,
// // labelName: 'Rate the app',
// // icon: Icon(Icons.share),
// // ),
// // DrawerList(
// // index: DrawerIndex.About,
// // labelName: 'About Us',
// // icon: Icon(Icons.info),
// // ),
// ];
// // }
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var brightness = MediaQuery.of(context).platformBrightness; var brightness = MediaQuery.of(context).platformBrightness;
@ -243,6 +318,8 @@ class _HomeDrawerState extends State<HomeDrawer> {
color: Colors.red, color: Colors.red,
), ),
onTap: () { onTap: () {
// Provider.of<LoginProvider>(context, listen: false)
// .saveApiData();
onTapped(); onTapped();
}, },
), ),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:konectar_events/utils/appcolors.dart';
import 'package:konectar_events/utils/constants.dart'; import 'package:konectar_events/utils/constants.dart';
class SnackBarWidget { class SnackBarWidget {
@ -9,9 +10,8 @@ class SnackBarWidget {
msg, msg,
style: TextStyle(color: Colors.black), style: TextStyle(color: Colors.black),
), ),
backgroundColor: error backgroundColor:
? Color.fromARGB(255, 235, 110, 76) error ? Color.fromARGB(255, 235, 110, 76) : AppColors.oldbgcolor,
: EventsConstants.oldbgcolor,
duration: error ? Durations.long3 : Durations.long1, duration: error ? Durations.long3 : Durations.long1,
); );
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);

View File

@ -534,6 +534,38 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_background_service:
dependency: "direct main"
description:
name: flutter_background_service
sha256: d32f078ec57647c9cfd6e1a8da9297f7d8f021d4dcc204a35aaad2cdbfe255f0
url: "https://pub.dev"
source: hosted
version: "5.0.10"
flutter_background_service_android:
dependency: transitive
description:
name: flutter_background_service_android
sha256: "39da42dddf877beeef82bc2583130d8bedb4d0765e99ca9e7b4a32e8c6abd239"
url: "https://pub.dev"
source: hosted
version: "6.2.7"
flutter_background_service_ios:
dependency: transitive
description:
name: flutter_background_service_ios
sha256: "6037ffd45c4d019dab0975c7feb1d31012dd697e25edc05505a4a9b0c7dc9fba"
url: "https://pub.dev"
source: hosted
version: "5.0.3"
flutter_background_service_platform_interface:
dependency: transitive
description:
name: flutter_background_service_platform_interface
sha256: ca74aa95789a8304f4d3f57f07ba404faa86bed6e415f83e8edea6ad8b904a41
url: "https://pub.dev"
source: hosted
version: "5.1.2"
flutter_cache_manager: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:

View File

@ -96,6 +96,8 @@ dependencies:
flutter_svg_provider: ^1.0.7 flutter_svg_provider: ^1.0.7
zoom_widget: ^2.0.1 zoom_widget: ^2.0.1
http: ^1.2.2 http: ^1.2.2
flutter_background_service: ^5.0.10
dev_dependencies: dev_dependencies: