snehalatha_dev #2

Merged
snehalathad merged 2 commits from snehalatha_dev into dev 2024-12-03 06:06:45 +00:00
64 changed files with 9726 additions and 1325 deletions
Showing only changes of commit 624ee33537 - Show all commits

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -0,0 +1,184 @@
{
"data": [
{
"id": "MedInsight",
"name": "Medical Insights Form",
"form-fields": [
{
"sectionName": "Medical Insight",
"multiple": false,
"sectionList": [
{
"name": "HCP Name",
"id": "hcpname",
"depid": "",
"widget": "label",
"input": "label",
"validation": {
"isRequired": false
}
},
{
"name": "Date",
"id": "date",
"depid": "",
"widget": "text",
"input": "Date",
"validation": {
"isRequired": true
}
},
{
"name": "Therapeutic Area",
"param": "therapeutic_area",
"id": "therapeutic",
"selectedValue": [],
"depid": "",
"widget": "dropdown",
"input": "dropdown",
"inputList": [
{
"id": "1",
"name": "Acute Neurology1"
},
{
"id": "2",
"name": "Cystic Fibrosis"
}
],
"validation": {
"isRequired": true
}
},
{
"name": "Product",
"id": "product",
"depid": "therapeutic",
"widget": "dropdown",
"input": "dropdown",
"inputList": [
{
"id": "11",
"pid": "1",
"name": "Prometra Pump"
},
{
"id": "12",
"pid": "2",
"name": "Prometra Pump"
},
{
"id": "13",
"pid": "2",
"name": "Prometra Catheter"
}
],
"validation": {
"isRequired": true
}
},
{
"name": "Source Type",
"id": "sourcetype",
"depid": "",
"widget": "dropdown",
"input": "dropdown",
"inputList": [
{
"id": "21",
"name": "Advisory Board/Expert Committee"
},
{
"id": "22",
"name": "Congress"
},
{
"id": "23",
"name": "Industry professional direct knowledge "
}
],
"validation": {
"isRequired": true
}
},
{
"name": "Congress Source",
"id": "congresssource",
"depid": "sourcetype",
"widget": "dropdown",
"input": "dropdown",
"inputList": [
{
"id": "31",
"pid": "22",
"name": "Industry professional"
},
{
"id": "32",
"pid": "22",
"name": "Symposium"
}
],
"validation": {
"isRequired": false
}
},
{
"name": "Congress Name",
"id": "congressName",
"depid": "sourcetype",
"widget": "text",
"input": "text",
"validation": {
"isRequired": false
}
}
]
},
{
"sectionName": "Key Insight Topics",
"multiple": false,
"sectionList": [
{
"name": "Key Insight Topics",
"id": "keyinsighttopics",
"depid": "",
"param": "keyinsighttopics",
"widget": "dropdown",
"input": "dropdown",
"inputList": [
{
"id": "41",
"name": "Data Gap"
}
],
"validation": {
"isRequired": true
}
}
]
},
{
"sectionName": "Medical Insights Details",
"multiple": false,
"sectionList": [
{
"name": "Medical Insight Summary",
"id": "summary",
"depid": "",
"widget": "text",
"input": "textArea",
"validation": {
"isRequired": true,
"maxchars": "300"
}
}
]
}
]
}
]
}

View File

@ -3,9 +3,7 @@ PODS:
- Flutter
- connectivity_plus (0.0.1):
- Flutter
- ReachabilitySwift
- device_info_plus (0.0.1):
- Flutter
- FlutterMacOS
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
@ -94,7 +92,7 @@ PODS:
- mobile_device_identifier (0.0.1):
- Flutter
- JNKeychain
- package_info_plus (0.4.5):
- open_file (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
@ -102,31 +100,33 @@ PODS:
- permission_handler_apple (9.3.0):
- Flutter
- PromisesObjC (2.4.0)
- ReachabilitySwift (5.0.0)
- SDWebImage (5.18.10):
- SDWebImage/Core (= 5.18.10)
- SDWebImage/Core (5.18.10)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.4)
- url_launcher_ios (0.0.1):
- Flutter
DEPENDENCIES:
- add_2_calendar (from `.symlinks/plugins/add_2_calendar/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
- Flutter (from `Flutter`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- mobile_device_identifier (from `.symlinks/plugins/mobile_device_identifier/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- open_file (from `.symlinks/plugins/open_file/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
SPEC REPOS:
@ -144,7 +144,6 @@ SPEC REPOS:
- GoogleUtilities
- JNKeychain
- PromisesObjC
- ReachabilitySwift
- SDWebImage
- SwiftyGif
@ -152,9 +151,7 @@ EXTERNAL SOURCES:
add_2_calendar:
:path: ".symlinks/plugins/add_2_calendar/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
:path: ".symlinks/plugins/connectivity_plus/darwin"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
firebase_core:
@ -167,24 +164,25 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios"
mobile_device_identifier:
:path: ".symlinks/plugins/mobile_device_identifier/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
open_file:
:path: ".symlinks/plugins/open_file/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS:
add_2_calendar: 5eee66d5a3b99cd5e1487a7e03abd4e3ac4aff11
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
firebase_core: 0b39f4f424e02eecabb2356ddf331fa07b772af8
firebase_remote_config: f57c28ff78d1d933bbe1b2cc11659cc82f9978e8
@ -200,13 +198,13 @@ SPEC CHECKSUMS:
image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
JNKeychain: fb6cc9ec95959ba46cd95d0ee6f7a05e41da9f42
mobile_device_identifier: 34f80c8985bb1506880c2ae10cb24cfb9918f1a7
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
SDWebImage: fc8f2d48bbfd72ef39d70e981bd24a3f3be53fec
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586

View File

@ -490,7 +490,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 69ERN967NS;
DEVELOPMENT_TEAM = 44SNAJ6T8L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -668,8 +668,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 69ERN967NS;
DEVELOPMENT_TEAM = 44SNAJ6T8L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -678,6 +680,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.konectarEvents;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;

View File

@ -3,6 +3,9 @@
// import 'package:konectar_events/ui_screen/interactionform/model/interaction_config_data.dart';
// import 'package:konectar_events/ui_screen/interactionform/model/interaction_data.dart';
// import 'package:konectar_events/ui_screen/interactionform/util.dart';
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/mockapi.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart';
@ -151,6 +154,39 @@ class ConfigDataProvider extends ChangeNotifier {
notifyListeners();
}
Future<void> initConfigUIDataMediccalInsight() async {
List<InteractionConfigData> interactionConfigData = [];
// interactionConfigData = await fetchInteactionConfigData();
//interactionConfigData = fetchInteactionUIConfigData(jsonResult);
NetworkConnectivity networkConnectivity = NetworkConnectivity();
bool isOnline = await networkConnectivity.isInternetAvailable();
if (isOnline) {
// if (await InternetConnectionChecker().hasConnection) {
interactionConfigData = await fetchLocalMedicalInsight();
var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
if (!box.isOpen) {
box = await Hive.openBox<InteractionConfigData>(
'InteractionConfigDataBox');
}
if (box.isEmpty) {
for (InteractionConfigData data in interactionConfigData) {
box.put(await getNextAutoIncrementValue(), data);
}
} else {
box.clear();
print("IamELse");
for (InteractionConfigData data in interactionConfigData) {
box.put(await getNextAutoIncrementValue(), data);
}
}
}
notifyListeners();
}
Future<List<InteractionConfigData>>
fetchLocalInteactionConfigDataMedical() async {
// dynamic jsonResult = jsonDecode(
@ -171,6 +207,25 @@ class ConfigDataProvider extends ChangeNotifier {
return interactionConfigData;
}
Future<List<InteractionConfigData>> fetchLocalMedicalInsight() async {
dynamic jsonResult = jsonDecode(
await rootBundle.loadString("assets/medicalinsightform.json"));
//dynamic jsonResult = await MockApiCall().getConfigDataMedical();
List<InteractionConfigData> interactionConfigData = [];
ResponseData responseData = ResponseDataFromJson(jsonResult);
print('Response_data_is: $responseData');
print('Response_data_dta_is: ${responseData.data}');
for (InteractionResultData obj in responseData.data) {
interactionConfigData
.add(InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
}
print("interactionConfigData_issss: ${interactionConfigData.length}");
return interactionConfigData;
}
Future<void> initConfigUIDataEng() async {
List<InteractionConfigData> interactionConfigData = [];
// interactionConfigData = await fetchInteactionConfigData();

View File

@ -560,11 +560,12 @@ class _InteractionScreenState extends State<InteractionScreen> {
),
),
);
case InteractionWidget.DROPDOWN:
// return customdropdown(sectionItem, provider, list, multiple);
return customAutoCompletedropdown(
sectionItem, provider, list, multiple);
case InteractionWidget.DROPDOWN:
return customdropdown(sectionItem, provider, list, multiple);
// return customAutoCompletedropdown(
// sectionItem, provider, list, multiple);
}
}
@ -671,7 +672,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
backgroundColor: Colors.green.shade500,
onPressed: () async {
String record =
await provider.saveJsonObject(context, widget.form);
await provider.saveJsonObject(context, widget.form, "hc");
print("Validation_isss: ${provider.isLoading}");

View File

@ -1496,7 +1496,8 @@ class InteractionProvider extends ChangeNotifier {
return false;
}
Future<String> saveJsonObject(BuildContext context, String form,
Future<String> saveJsonObject(
BuildContext context, String form, String? title,
{bool isEdit = false}) async {
print("form_data: $form");
// for (var ob in interactionReponseList) {
@ -1562,6 +1563,7 @@ class InteractionProvider extends ChangeNotifier {
id: generateId,
updatedTime: DateTime.now().toString(),
form: form,
hcp: title,
intId: intId ?? "id",
intName: intName ?? "name");
var box = Hive.box<SaveInteraction>('InteractionDataBox');

View File

@ -38,6 +38,8 @@ class SaveInteraction {
String intId;
@HiveField(5)
String intName;
@HiveField(6)
String? hcp;
SaveInteraction(
{required this.save,
@ -45,6 +47,7 @@ class SaveInteraction {
this.form,
this.updatedTime,
required this.intId,
this.hcp,
required this.intName});
factory SaveInteraction.fromJson(Map<String, dynamic> json) =>
@ -53,6 +56,7 @@ class SaveInteraction {
json["save"].map((x) => SaveData.fromJson(x))),
intId: 'intId',
intName: 'intName',
hcp: 'hcp',
id: 'id');
Map<String, dynamic> toJson() => {
@ -62,6 +66,7 @@ class SaveInteraction {
Map<String, dynamic> savetoJson() => {
"form": form,
"intId": intId,
"hcp": hcp,
};
@override

View File

@ -22,6 +22,7 @@ class SaveInteractionAdapter extends TypeAdapter<SaveInteraction> {
form: fields[2] as String?,
updatedTime: fields[3] as String?,
intId: fields[4] as String,
hcp: fields[6] as String?,
intName: fields[5] as String,
);
}
@ -29,7 +30,7 @@ class SaveInteractionAdapter extends TypeAdapter<SaveInteraction> {
@override
void write(BinaryWriter writer, SaveInteraction obj) {
writer
..writeByte(6)
..writeByte(7)
..writeByte(0)
..write(obj.id)
..writeByte(1)
@ -41,7 +42,9 @@ class SaveInteractionAdapter extends TypeAdapter<SaveInteraction> {
..writeByte(4)
..write(obj.intId)
..writeByte(5)
..write(obj.intName);
..write(obj.intName)
..writeByte(6)
..write(obj.hcp);
}
@override

View File

@ -5,6 +5,7 @@ import 'package:konectar_events/contacts_module/constants.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/model/interaction_data.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/widget/custombutton.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart';
@ -34,7 +35,9 @@ import 'widget/interatciontextfield.dart';
class InteractionScreen1 extends StatefulWidget {
int index;
String form;
InteractionScreen1({super.key, required this.index, required this.form});
String? title;
InteractionScreen1(
{super.key, required this.index, required this.form, this.title});
@override
State<InteractionScreen1> createState() => _InteractionScreen1State();
@ -119,10 +122,11 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const FittedBox(
backgroundColor: Constants.k2color,
title: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
'Record New Interaction',
widget.title ?? 'Record New Interaction',
style: TextStyle(color: Colors.white, fontSize: 18.0),
),
),
@ -316,7 +320,7 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
: 4.8
: isTablet
? 2.8
: 4.5,
: 5.5,
children: List.generate(
sectionList.length,
@ -484,7 +488,9 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
onPressed: () async {
String record =
await provider.saveJsonObject(
context, widget.form);
context,
widget.form,
widget.title);
print(
"Validation_isss: ${provider.isLoading}");
@ -618,7 +624,14 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
: buildRadio(sectionItem, provider);
case InteractionWidget.LABEL:
return Text(sectionItem.input!);
sectionItem.selectedValue!.add(widget.title ?? "NA");
return Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"${widget.title}",
style: TextStyle(fontSize: 18),
),
);
case InteractionWidget.RANGESLIDER:
return CustomRangeSlider(
@ -687,8 +700,8 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
// maxchars: int.parse(sectionItem.validation!.chars ?? "0"),
controller: sectionItem.controller!,
labelText: sectionItem.name,
// maxlines: 8,
//minlines: 4,
maxlines: 8,
minlines: 8,
onChanged: (val) {
sectionItem.selectedValue = [];
setState(() {});
@ -997,10 +1010,10 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
),
);
case InteractionWidget.DROPDOWN:
// return customdropdown(sectionItem, provider, list, multiple);
return customdropdown(sectionItem, provider, list, multiple);
return customAutoCompletedropdown(
sectionItem, provider, list, multiple);
// return customAutoCompletedropdown(
// sectionItem, provider, list, multiple);
}
}
@ -1015,11 +1028,13 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
}
Widget buildDateWidget(SectionList sectionItem) {
// sectionItem.controller!.text =
// DateFormat('yyyy-MM-dd').format(DateTime.now());
return Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
// height: isTablet ? 50 : 40,
height: isTablet ? 50 : 40,
width: MediaQuery.of(context).size.width,
child: TextField(
controller:
@ -1106,8 +1121,8 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
child: CustomButton(
backgroundColor: Colors.green.shade500,
onPressed: () async {
String record =
await provider.saveJsonObject(context, widget.form);
String record = await provider.saveJsonObject(
context, widget.form, widget.title);
print("Validation_isss: ${provider.isLoading}");
@ -1843,6 +1858,8 @@ class _InteractionScreen1State extends State<InteractionScreen1> {
Widget cancelButton = TextButton(
child: const Text("Ok"),
onPressed: () async {
await Provider.of<ViewInteractionProvider>(context, listen: false)
.getRecords(widget.form, hcp: widget.title ?? "");
Navigator.of(context).pop();
Navigator.of(context).pop();
},

View File

@ -300,7 +300,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.LABEL:
return Text(sectionItem.input!);
return Text(sectionItem.selectedValue!.last.toString());
case InteractionWidget.RANGESLIDER:
return Text(sectionItem.selectedValue!.isNotEmpty

View File

@ -61,13 +61,13 @@ class ViewInteractionProvider extends ChangeNotifier {
notifyListeners();
}
Future<void> getRecords(String formname) async {
Future<void> getRecords(String formname, {String? hcp}) async {
var box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
savedList = box.values.toList();
savedList = savedList
.where(
(element) => element.form == formname,
)
.where((element) => element.form == formname && element.hcp != null
? element.hcp == hcp
: element.form == formname)
.toList();
notifyListeners();
}

View File

@ -122,6 +122,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
return SafeArea(
child: Scaffold(
appBar: AppBar(
backgroundColor: Constants.k2color,
title: Text(
widget.saveInteraction.id,
style: TextStyle(
@ -258,7 +259,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
: 4.8
: isTablet
? 2.8
: 3.5,
: 4.5,
children: List.generate(
sectionList.length,
(i) {
@ -474,7 +475,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
: buildRadio(sectionItem, provider);
case InteractionWidget.LABEL:
return Text(sectionItem.input!);
return Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
sectionItem.selectedValue!.last.toString(),
style: TextStyle(fontSize: 18),
),
);
case InteractionWidget.RANGESLIDER:
return CustomRangeSlider(
@ -579,10 +586,10 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
),
);
case InteractionWidget.DROPDOWN:
// return customdropdown(sectionItem, provider, list, multiple);
return customdropdown(sectionItem, provider, list, multiple);
return customAutoCompletedropdown(
sectionItem, provider, list, multiple);
// return customAutoCompletedropdown(
// sectionItem, provider, list, multiple);
}
}
@ -593,7 +600,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width,
// height: isTablet ? 50 : 40,
height: isTablet ? 50 : 40,
child: TextField(
controller:
sectionItem.controller, //editing controller of this TextField
@ -764,13 +771,17 @@ class _EditInteractionScreenState extends State<EditInteractionScreen1> {
// sectionItem.value = '';
// print("%%%%${sectionItem.selectedValue!.last}");
print("ItemList_is: $list");
// if (list.isEmpty) {
// print("###list empty###");
// list = [];
// InputClass inputClass =
// InputClass(id: "no value", name: "Select ${sectionItem.name}");
// list.add(inputClass);
// sectionItem.selectedObject = list[0];
// }
if (list.isEmpty) {
print("###list empty###");
list = [];
InputClass inputClass =
InputClass(id: "no value", name: "Select ${sectionItem.name}");
list.add(inputClass);
sectionItem.selectedObject = list[0];
list = sectionItem.inputList!;
}
// InputClass selectedObj = list[0];
return Padding(

View File

@ -63,6 +63,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
backgroundColor: Colors.white,
//resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Constants.k2color,
title: Text(
widget.saveInteraction.id,
style: TextStyle(
@ -320,7 +321,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
case InteractionWidget.LABEL:
return Text(
sectionItem.input!,
sectionItem.selectedValue!.last.toString(),
style: TextStyle(fontSize: 18.0),
);

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
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';
@ -70,10 +71,12 @@ 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';
@ -190,11 +193,25 @@ Future main() async {
// userInfo = await credential!.getUserInfo();
//runApp(const MyApp());
// activateTimer();
SharedPreferences.getInstance().then((instance) async {
SharedPreferences.getInstance().then((instance) {
//StorageService().sharedPreferencesInstance = instance;
bool isloggedIn = instance.getBool('isloggedin') ?? false;
String secretkey = instance.getString('secretkey') ?? "";
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: [
@ -242,32 +259,38 @@ Future main() async {
],
child: SafeArea(
top: true,
child: MaterialApp(
theme: ThemeData(
fontFamily: "OpenSans",
child: new OverlaySupport.global(
toastTheme: ToastThemeData(background: Colors.green),
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
? IntroductionAnimationScreen()
: IntroductionAnimationScreen();
}
},
), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
// '/details': (BuildContext context) => const HomeScreen(),
},
),
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 ? MyApp() : LoginScreen();
}
},
), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
// '/details': (BuildContext context) => const HomeScreen(),
},
),
),
),
@ -275,7 +298,27 @@ Future main() async {
});
}
class MyApp extends StatelessWidget {
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
OverlaySupportEntry entry;
Connectivity().onConnectivityChanged.listen((event) {
print("CHECK INTERNET");
print(event);
if (event.toString().contains("ConnectivityResult.wifi")) {
entry = showOverlayNotification((context) {
return Text("this is a message from simple notification");
}, duration: Duration(hours: 1));
}
});
super.initState();
}
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
@ -287,15 +330,55 @@ class MyApp extends StatelessWidget {
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,
));
return MaterialApp(
title: 'Flutter UI',
debugShowCheckedModeBanner: false,
// theme: ThemeData(
// primarySwatch: Colors.blue,
// textTheme: AppTheme.textTheme,
// platform: TargetPlatform.iOS,
// ),
home: NavigationHomeScreen(),
return OverlaySupport(
child: MaterialApp(
title: 'Flutter UI',
debugShowCheckedModeBanner: false,
// theme: ThemeData(
// primarySwatch: Colors.blue,
// textTheme: AppTheme.textTheme,
// platform: TargetPlatform.iOS,
// ),
home: NavigationHomeScreen(),
),
);
}
@override
State<StatefulWidget> createState() {
// TODO: implement createState
throw UnimplementedError();
}
}
// class App extends StatefulWidget {
// @override
// _AppState createState() => _AppState();
// }
// class _AppState extends State<App> {
// @override
// void initState() {
// OverlaySupportEntry entry;
// Connectivity().onConnectivityChanged.listen((event) {
// print(event);
// if (event.toString().contains("ConnectivityResult.none")) {
// entry = showOverlayNotification((context) {
// return Text("this is a message from simple notification");
// }, duration: Duration(hours: 1));
// }
// });
// super.initState();
// }
// @override
// Widget build(BuildContext context) {
// return OverlaySupport(
// child: MaterialApp(
// title: 'Network Checker App',
// debugShowCheckedModeBanner: false,
// home: Homepage(),
// ),
// );
// }
// }

View File

@ -47,24 +47,54 @@ class AffiliationsResp {
};
}
List<Affiliations> affiliationsFromJson(String str) => List<Affiliations>.from(
json.decode(str).map((x) => Affiliations.fromJson(x)));
String affiliationsToJson(List<Affiliations> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Affiliations {
List<String> affiliationNames;
List<String> affiliationCount;
String? id;
String? orgCount;
String? orgName;
Affiliations({
required this.affiliationNames,
required this.affiliationCount,
this.id,
this.orgCount,
this.orgName,
});
factory Affiliations.fromJson(Map<String, dynamic> json) => Affiliations(
affiliationNames:
List<String>.from(json["affiliationNames"].map((x) => x)),
affiliationCount:
List<String>.from(json["affiliationCount"].map((x) => x)),
id: json["id"],
orgCount: json["org_count"],
orgName: json["org_name"],
);
Map<String, dynamic> toJson() => {
"affiliationNames": List<dynamic>.from(affiliationNames.map((x) => x)),
"affiliationCount": List<dynamic>.from(affiliationCount.map((x) => x)),
"id": id,
"org_count": orgCount,
"org_name": orgName,
};
}
// class Affiliations {
// List<String> affiliationNames;
// List<String> affiliationCount;
// Affiliations({
// required this.affiliationNames,
// required this.affiliationCount,
// });
// factory Affiliations.fromJson(Map<String, dynamic> json) => Affiliations(
// affiliationNames:
// List<String>.from(json["affiliationNames"].map((x) => x)),
// affiliationCount:
// List<String>.from(json["affiliationCount"].map((x) => x)),
// );
// Map<String, dynamic> toJson() => {
// "affiliationNames": List<dynamic>.from(affiliationNames.map((x) => x)),
// "affiliationCount": List<dynamic>.from(affiliationCount.map((x) => x)),
// };
// }

View File

@ -0,0 +1,347 @@
// To parse this JSON data, do
//
// final eventsOverviewDetails = eventsOverviewDetailsFromJson(jsonString);
import 'dart:convert';
EventsOverviewDetails eventsOverviewDetailsFromJson(String str) =>
EventsOverviewDetails.fromJson(json.decode(str));
String eventsOverviewDetailsToJson(EventsOverviewDetails data) =>
json.encode(data.toJson());
class EventsOverviewDetails {
OverviewData? data;
EventsOverviewDetails({
this.data,
});
factory EventsOverviewDetails.fromJson(Map<String, dynamic> json) =>
EventsOverviewDetails(
data: json["data"] == null ? null : OverviewData.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"data": data?.toJson(),
};
}
class OverviewData {
int? projectKolAttendee;
bool? cal;
int? grid;
String? eventFor;
String? eventId;
List<TopSpeakers>? eventData;
dynamic eventTopics;
List<EventSponser>? eventSponsers;
bool? eventUserAttendee;
bool? eventUserInterest;
List<ArrEvent>? arrEvents;
int? attendeeCount;
OverviewData({
this.projectKolAttendee,
this.cal,
this.grid,
this.eventFor,
this.eventId,
this.eventData,
this.eventTopics,
this.eventSponsers,
this.eventUserAttendee,
this.eventUserInterest,
this.arrEvents,
this.attendeeCount,
});
factory OverviewData.fromJson(Map<String, dynamic> json) => OverviewData(
projectKolAttendee: json["project_kol_attendee"],
cal: json["cal"],
grid: json["grid"],
eventFor: json["eventFor"],
eventId: json["eventId"],
eventData: json["eventData"] == null
? []
: List<TopSpeakers>.from(
json["eventData"]!.map((x) => TopSpeakers.fromJson(x))),
eventTopics: json["eventTopics"],
eventSponsers: json["eventSponsers"] == null
? []
: List<EventSponser>.from(
json["eventSponsers"]!.map((x) => EventSponser.fromJson(x))),
eventUserAttendee: json["event_user_attendee"],
eventUserInterest: json["event_user_interest"],
arrEvents: json["arrEvents"] == null
? []
: List<ArrEvent>.from(
json["arrEvents"]!.map((x) => ArrEvent.fromJson(x))),
attendeeCount: json["attendeeCount"],
);
Map<String, dynamic> toJson() => {
"project_kol_attendee": projectKolAttendee,
"cal": cal,
"grid": grid,
"eventFor": eventFor,
"eventId": eventId,
"eventData": eventData == null
? []
: List<dynamic>.from(eventData!.map((x) => x.toJson())),
"eventTopics": eventTopics,
"eventSponsers": eventSponsers == null
? []
: List<dynamic>.from(eventSponsers!.map((x) => x.toJson())),
"event_user_attendee": eventUserAttendee,
"event_user_interest": eventUserInterest,
"arrEvents": arrEvents == null
? []
: List<dynamic>.from(arrEvents!.map((x) => x.toJson())),
"attendeeCount": attendeeCount,
};
}
class ArrEvent {
String? sponsorType;
String? sponsorTypeName;
String? id;
String? kolId;
String? type;
String? eventType;
String? eventId;
String? sessionType;
String? sessionName;
String? role;
dynamic topic;
String? start;
String? end;
String? organizer;
String? sessionSponsor;
String? organizerType;
String? location;
String? address;
String? cityId;
String? stateId;
String? countryId;
String? postalCode;
dynamic subject;
String? url1;
dynamic url2;
dynamic notes;
String? createdBy;
DateTime? createdOn;
dynamic modifiedBy;
DateTime? modifiedOn;
String? clientId;
dynamic projectId;
String? activityType;
String? profileType;
dynamic globalEventId;
String? eventUniqueId;
String? name;
String? confEventType;
String? country;
dynamic eventTopic;
String? confSessionType;
String? region;
String? city;
ArrEvent({
this.sponsorType,
this.sponsorTypeName,
this.id,
this.kolId,
this.type,
this.eventType,
this.eventId,
this.sessionType,
this.sessionName,
this.role,
this.topic,
this.start,
this.end,
this.organizer,
this.sessionSponsor,
this.organizerType,
this.location,
this.address,
this.cityId,
this.stateId,
this.countryId,
this.postalCode,
this.subject,
this.url1,
this.url2,
this.notes,
this.createdBy,
this.createdOn,
this.modifiedBy,
this.modifiedOn,
this.clientId,
this.projectId,
this.activityType,
this.profileType,
this.globalEventId,
this.eventUniqueId,
this.name,
this.confEventType,
this.country,
this.eventTopic,
this.confSessionType,
this.region,
this.city,
});
factory ArrEvent.fromJson(Map<String, dynamic> json) => ArrEvent(
sponsorType: json["sponsor_type"],
sponsorTypeName: json["sponsor_type_name"],
id: json["id"],
kolId: json["kol_id"],
type: json["type"],
eventType: json["event_type"],
eventId: json["event_id"],
sessionType: json["session_type"],
sessionName: json["session_name"],
role: json["role"],
topic: json["topic"],
start: json["start"],
end: json["end"],
organizer: json["organizer"],
sessionSponsor: json["session_sponsor"],
organizerType: json["organizer_type"],
location: json["location"],
address: json["address"],
cityId: json["city_id"],
stateId: json["state_id"],
countryId: json["country_id"],
postalCode: json["postal_code"],
subject: json["subject"],
url1: json["url1"],
url2: json["url2"],
notes: json["notes"],
createdBy: json["created_by"],
createdOn: json["created_on"] == null
? null
: DateTime.parse(json["created_on"]),
modifiedBy: json["modified_by"],
modifiedOn: json["modified_on"] == null
? null
: DateTime.parse(json["modified_on"]),
clientId: json["client_id"],
projectId: json["project_id"],
activityType: json["activity_type"],
profileType: json["profile_type"],
globalEventId: json["global_event_id"],
eventUniqueId: json["event_unique_id"],
name: json["name"],
confEventType: json["conf_event_type"],
country: json["country"],
eventTopic: json["event_topic"],
confSessionType: json["conf_session_type"],
region: json["region"],
city: json["city"],
);
Map<String, dynamic> toJson() => {
"sponsor_type": sponsorType,
"sponsor_type_name": sponsorTypeName,
"id": id,
"kol_id": kolId,
"type": type,
"event_type": eventType,
"event_id": eventId,
"session_type": sessionType,
"session_name": sessionName,
"role": role,
"topic": topic,
"start": start,
"end": end,
"organizer": organizer,
"session_sponsor": sessionSponsor,
"organizer_type": organizerType,
"location": location,
"address": address,
"city_id": cityId,
"state_id": stateId,
"country_id": countryId,
"postal_code": postalCode,
"subject": subject,
"url1": url1,
"url2": url2,
"notes": notes,
"created_by": createdBy,
"created_on": createdOn?.toIso8601String(),
"modified_by": modifiedBy,
"modified_on": modifiedOn?.toIso8601String(),
"client_id": clientId,
"project_id": projectId,
"activity_type": activityType,
"profile_type": profileType,
"global_event_id": globalEventId,
"event_unique_id": eventUniqueId,
"name": name,
"conf_event_type": confEventType,
"country": country,
"event_topic": eventTopic,
"conf_session_type": confSessionType,
"region": region,
"city": city,
};
}
class TopSpeakers {
String? firstName;
dynamic middleName;
dynamic lastName;
String? numSess;
TopSpeakers({
this.firstName,
this.middleName,
this.lastName,
this.numSess,
});
factory TopSpeakers.fromJson(Map<String, dynamic> json) => TopSpeakers(
firstName: json["first_name"],
middleName: json["middle_name"],
lastName: json["last_name"],
numSess: json["num_sess"],
);
Map<String, dynamic> toJson() => {
"first_name": firstName,
"middle_name": middleName,
"last_name": lastName,
"num_sess": numSess,
};
}
class EventSponser {
String? numSess;
String? sessionSponsor;
String? type;
String? sponsorsType;
EventSponser({
this.numSess,
this.sessionSponsor,
this.type,
this.sponsorsType,
});
factory EventSponser.fromJson(Map<String, dynamic> json) => EventSponser(
numSess: json["num_sess"],
sessionSponsor: json["session_sponsor"],
type: json["type"],
sponsorsType: json["sponsors_type"],
);
Map<String, dynamic> toJson() => {
"num_sess": numSess,
"session_sponsor": sessionSponsor,
"type": type,
"sponsors_type": sponsorsType,
};
}

View File

@ -0,0 +1,219 @@
class EventsListResp2 {
int? code;
String? message;
List<EventsListingData>? data;
int? lastPage;
int? lastRow;
int? count;
EventsListResp2(
{this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count});
EventsListResp2.fromJson(Map<String, dynamic> json) {
if (json["code"] is int) {
code = json["code"];
}
if (json["message"] is String) {
message = json["message"];
}
if (json["data"] is List) {
data = json["data"] == null
? null
: (json["data"] as List)
.map((e) => EventsListingData.fromJson(e))
.toList();
}
if (json["last_page"] is int) {
lastPage = json["last_page"];
}
if (json["last_row"] is int) {
lastRow = json["last_row"];
}
if (json["count"] is int) {
count = json["count"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["code"] = code;
_data["message"] = message;
if (data != null) {
_data["data"] = data?.map((e) => e.toJson()).toList();
}
_data["last_page"] = lastPage;
_data["last_row"] = lastRow;
_data["count"] = count;
return _data;
}
}
class EventsListingData {
String? uniqueId;
String? sessionName;
String? startDate;
String? endDate;
String? organizer;
String? sessionSponsor;
dynamic location;
dynamic address;
dynamic postalCode;
dynamic url;
String? activityType;
String? role;
String? eventTypeName;
String? countryName;
String? stateName;
String? cityName;
String? organizerTypeName;
String? sponsorTypeName;
String? sessionTypeName;
String? kolName;
dynamic kolUniqueId;
String? eventName;
String? eventUniqueId;
String? createdByUser;
String? updatedByUser;
String? formattedCreatedAt;
String? formattedUpdatedAt;
EventsListingData(
{this.uniqueId,
this.sessionName,
this.startDate,
this.endDate,
this.organizer,
this.sessionSponsor,
this.location,
this.address,
this.postalCode,
this.url,
this.activityType,
this.role,
this.eventTypeName,
this.countryName,
this.stateName,
this.cityName,
this.organizerTypeName,
this.sponsorTypeName,
this.sessionTypeName,
this.kolName,
this.kolUniqueId,
this.eventName,
this.eventUniqueId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt});
EventsListingData.fromJson(Map<String, dynamic> json) {
if (json["unique_id"] is String) {
uniqueId = json["unique_id"];
}
if (json["session_name"] is String) {
sessionName = json["session_name"];
}
if (json["start_date"] is String) {
startDate = json["start_date"];
}
if (json["end_date"] is String) {
endDate = json["end_date"];
}
if (json["organizer"] is String) {
organizer = json["organizer"];
}
if (json["session_sponsor"] is String) {
sessionSponsor = json["session_sponsor"];
}
location = json["location"];
address = json["address"];
postalCode = json["postal_code"];
url = json["url"];
if (json["activity_type"] is String) {
activityType = json["activity_type"];
}
if (json["role"] is String) {
role = json["role"];
}
if (json["event_type_name"] is String) {
eventTypeName = json["event_type_name"];
}
if (json["country_name"] is String) {
countryName = json["country_name"];
}
if (json["state_name"] is String) {
stateName = json["state_name"];
}
if (json["city_name"] is String) {
cityName = json["city_name"];
}
if (json["organizer_type_name"] is String) {
organizerTypeName = json["organizer_type_name"];
}
if (json["sponsor_type_name"] is String) {
sponsorTypeName = json["sponsor_type_name"];
}
if (json["session_type_name"] is String) {
sessionTypeName = json["session_type_name"];
}
if (json["kol_name"] is String) {
kolName = json["kol_name"];
}
kolUniqueId = json["kol_unique_id"];
if (json["event_name"] is String) {
eventName = json["event_name"];
}
if (json["event_unique_id"] is String) {
eventUniqueId = json["event_unique_id"];
}
if (json["created_by_user"] is String) {
createdByUser = json["created_by_user"];
}
if (json["updated_by_user"] is String) {
updatedByUser = json["updated_by_user"];
}
if (json["formatted_created_at"] is String) {
formattedCreatedAt = json["formatted_created_at"];
}
if (json["formatted_updated_at"] is String) {
formattedUpdatedAt = json["formatted_updated_at"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["unique_id"] = uniqueId;
_data["session_name"] = sessionName;
_data["start_date"] = startDate;
_data["end_date"] = endDate;
_data["organizer"] = organizer;
_data["session_sponsor"] = sessionSponsor;
_data["location"] = location;
_data["address"] = address;
_data["postal_code"] = postalCode;
_data["url"] = url;
_data["activity_type"] = activityType;
_data["role"] = role;
_data["event_type_name"] = eventTypeName;
_data["country_name"] = countryName;
_data["state_name"] = stateName;
_data["city_name"] = cityName;
_data["organizer_type_name"] = organizerTypeName;
_data["sponsor_type_name"] = sponsorTypeName;
_data["session_type_name"] = sessionTypeName;
_data["kol_name"] = kolName;
_data["kol_unique_id"] = kolUniqueId;
_data["event_name"] = eventName;
_data["event_unique_id"] = eventUniqueId;
_data["created_by_user"] = createdByUser;
_data["updated_by_user"] = updatedByUser;
_data["formatted_created_at"] = formattedCreatedAt;
_data["formatted_updated_at"] = formattedUpdatedAt;
return _data;
}
}

View File

@ -0,0 +1,330 @@
// To parse this JSON data, do
//
// final speakersResponse = speakersResponseFromJson(jsonString);
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/model_class/speaker.dart';
part 'eventspeakers.g.dart';
SpeakersResponse speakersResponseFromJson(String str) =>
SpeakersResponse.fromJson(json.decode(str));
String speakersResponseToJson(SpeakersResponse data) =>
json.encode(data.toJson());
class SpeakersResponse {
int? code;
String? message;
List<SpeakersList>? data;
int? lastPage;
int? lastRow;
int? count;
SpeakersResponse({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory SpeakersResponse.fromJson(Map<String, dynamic> json) =>
SpeakersResponse(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<SpeakersList>.from(
json["data"]!.map((x) => SpeakersList.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 SpeakersResponse1 {
Data1? data;
SpeakersResponse1({
this.data,
});
factory SpeakersResponse1.fromJson(Map<String, dynamic> json) =>
SpeakersResponse1(
data: json["data"] == null ? null : Data1.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"data": data?.toJson(),
};
}
class Data1 {
List<SpeakersList>? data;
Data1({
this.data,
});
factory Data1.fromJson(Map<String, dynamic> json) => Data1(
data: json["data"] == null
? []
: List<SpeakersList>.from(
json["data"]!.map((x) => SpeakersList.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
@HiveType(typeId: 25)
class SpeakersList {
@HiveField(0)
String? uniqueId;
@HiveField(1)
String? hcpFullName;
@HiveField(2)
String? hcpPin;
@HiveField(3)
int? npiNum;
@HiveField(4)
String? specialty;
@HiveField(5)
String? organization;
@HiveField(6)
String? therapeuticArea;
@HiveField(7)
dynamic cleansStatus;
@HiveField(8)
int? isDeleted;
@HiveField(9)
CreatedByUser? createdByUser;
@HiveField(10)
CreatedByUser? updatedByUser;
@HiveField(11)
String? cityName;
@HiveField(12)
String? stateName;
@HiveField(13)
String? countryName;
@HiveField(14)
dynamic deletedByUser;
@HiveField(15)
DateTime? formattedCreatedAt;
@HiveField(16)
DateTime? formattedUpdatedAt;
@HiveField(17)
dynamic formattedDeletedAt;
@HiveField(18)
List<String>? sessionNames;
@HiveField(19)
List<String>? topics;
SpeakersList({
this.uniqueId,
this.hcpFullName,
this.hcpPin,
this.npiNum,
this.specialty,
this.organization,
this.therapeuticArea,
this.cleansStatus,
this.isDeleted,
this.createdByUser,
this.updatedByUser,
this.cityName,
this.stateName,
this.countryName,
this.deletedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
this.formattedDeletedAt,
this.sessionNames,
this.topics,
});
// SpeakersList.fromJson(Map<String, dynamic> json) {
// if (json["unique_id"] is String) {
// city = json["city_name"] ?? null;
// }
// if (json["country_name"] is String) {
// country = json["country_name"] ?? null;
// }
// if (json["state_name"] is String) {
// region = json["state_name"] ?? null;
// }
// if (json["activity_type"] is String) {
// activityType = json["activity_type"];
// }
// if (json["address"] is String) {
// address = json["address"];
// }
// if (json["city_id"] is String) {
// cityId = json["city_id"];
// }
// if (json["client_id"] is String) {
// clientId = json["client_id"];
// }
// if (json["cnt"] is String) {
// cnt = json["cnt"];
// }
// if (json["country_id"] is String) {
// countryId = json["country_id"];
// }
// if (json["created_by"] is String) {
// createdBy = json["created_by"];
// }
// if (json["created_on"] is String) {
// createdOn = json["created_on"];
// }
// if (json["dAllowed"] is bool) {
// dAllowed = json["dAllowed"];
// }
// if (json["eAllowed"] is bool) {
// eAllowed = json["eAllowed"];
// }
// if (json["end_date"] is String) {
// end = json["end_date"];
// }
// if (json["eventLat"] is String) {
// eventLat = json["eventLat"];
// }
// if (json["eventLong"] is String) {
// eventLong = json["eventLong"];
// }
// if (json["unique_id"] is String) {
// eventId = json["unique_id"];
// }
// if (json["event_type_name"] is String) {
// eventType = json["event_type_name"];
// }
// if (json["event_unique_id"] is String) {
// eventUniqueId = json["event_unique_id"];
// }
// if (json["event_user_attendee"] is bool) {
// eventUserAttendee = json["event_user_attendee"];
// }
// if (json["global_event_id"] is String) {
// globalEventId = json["global_event_id"];
// }
// if (json["hcp_pin"] is String) {
// hcpPin = json["hcp_pin"];
// }
// if (json["id"] is String) {
// id = json["id"];
// }
// if (json["kol_id"] is String) {
// kolId = json["kol_id"];
// }
// if (json["location"] is String) {
// location = json["location"];
// }
// if (json["modified_by"] is String) {
// modifiedBy = json["modified_by"];
// }
// if (json["modified_on"] is String) {
// modifiedOn = json["modified_on"];
// }
// if (json["event_name"] is String) {
// name1 = json["event_name"];
// }
// }
factory SpeakersList.fromJson(Map<String, dynamic> json) => SpeakersList(
uniqueId: json["unique_id"],
hcpFullName: json["hcp_full_name"] ?? null,
hcpPin: json["hcp_pin"] ?? null,
npiNum: json["npi_num"] ?? null,
specialty: json["specialty"] ?? null,
organization: json["organization"] ?? null,
therapeuticArea: json["therapeutic_area"] ?? null,
cleansStatus: json["cleans_status"] ?? null,
isDeleted: json["is_deleted"] ?? null,
createdByUser: CreatedByUserValues.map[json["created_by_user"]] ?? null,
updatedByUser: CreatedByUserValues.map[json["updated_by_user"]] ?? null,
cityName: json["city_name"] ?? null,
stateName: json["state_name"] ?? null,
countryName: json["country_name"] ?? null,
deletedByUser: json["deleted_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"]),
formattedDeletedAt: json["formatted_deleted_at"],
sessionNames: json["session_names"] == null
? []
: List<String>.from(json["session_names"]!.map((x) => x)),
topics: json["topics"] == null
? []
: List<String>.from(json["topics"]!.map((x) => x)),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"hcp_full_name": hcpFullName,
"hcp_pin": hcpPin,
"npi_num": npiNum,
"specialty": specialty,
"organization": organization,
"therapeutic_area": therapeuticAreaValues.reverse[therapeuticArea],
"cleans_status": cleansStatus,
"is_deleted": isDeleted,
"created_by_user": CreatedByUserValues.reverse[createdByUser],
"updated_by_user": CreatedByUserValues.reverse[updatedByUser],
"city_name": cityName,
"state_name": stateName,
"country_name": countryName,
"deleted_by_user": deletedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
"formatted_deleted_at": formattedDeletedAt,
"session_names": sessionNames == null
? []
: List<dynamic>.from(sessionNames!.map((x) => x)),
"topics":
topics == null ? [] : List<dynamic>.from(topics!.map((x) => x)),
};
}
enum CreatedByUser { ADMIN_SUPER_ROOT }
final CreatedByUserValues =
EnumValues({"admin super root": CreatedByUser.ADMIN_SUPER_ROOT});
enum TherapeuticArea { ONCOLOGY_WOMENS_HEALTH }
final therapeuticAreaValues = EnumValues(
{"Oncology | Womens Health": TherapeuticArea.ONCOLOGY_WOMENS_HEALTH});
class EnumValues<T> {
Map<String, T> map;
late Map<T, String> reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
reverseMap = map.map((k, v) => MapEntry(v, k));
return reverseMap;
}
}

View File

@ -0,0 +1,98 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'eventspeakers.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class SpeakersListAdapter extends TypeAdapter<SpeakersList> {
@override
final int typeId = 25;
@override
SpeakersList read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return SpeakersList(
uniqueId: fields[0] as String?,
hcpFullName: fields[1] as String?,
hcpPin: fields[2] as String?,
npiNum: fields[3] as int?,
specialty: fields[4] as String?,
organization: fields[5] as String?,
therapeuticArea: fields[6] as String?,
cleansStatus: fields[7] as dynamic,
isDeleted: fields[8] as int?,
createdByUser: fields[9] as CreatedByUser?,
updatedByUser: fields[10] as CreatedByUser?,
cityName: fields[11] as String?,
stateName: fields[12] as String?,
countryName: fields[13] as String?,
deletedByUser: fields[14] as dynamic,
formattedCreatedAt: fields[15] as DateTime?,
formattedUpdatedAt: fields[16] as DateTime?,
formattedDeletedAt: fields[17] as dynamic,
sessionNames: (fields[18] as List?)?.cast<String>(),
topics: (fields[19] as List?)?.cast<String>(),
);
}
@override
void write(BinaryWriter writer, SpeakersList obj) {
writer
..writeByte(20)
..writeByte(0)
..write(obj.uniqueId)
..writeByte(1)
..write(obj.hcpFullName)
..writeByte(2)
..write(obj.hcpPin)
..writeByte(3)
..write(obj.npiNum)
..writeByte(4)
..write(obj.specialty)
..writeByte(5)
..write(obj.organization)
..writeByte(6)
..write(obj.therapeuticArea)
..writeByte(7)
..write(obj.cleansStatus)
..writeByte(8)
..write(obj.isDeleted)
..writeByte(9)
..write(obj.createdByUser)
..writeByte(10)
..write(obj.updatedByUser)
..writeByte(11)
..write(obj.cityName)
..writeByte(12)
..write(obj.stateName)
..writeByte(13)
..write(obj.countryName)
..writeByte(14)
..write(obj.deletedByUser)
..writeByte(15)
..write(obj.formattedCreatedAt)
..writeByte(16)
..write(obj.formattedUpdatedAt)
..writeByte(17)
..write(obj.formattedDeletedAt)
..writeByte(18)
..write(obj.sessionNames)
..writeByte(19)
..write(obj.topics);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SpeakersListAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,486 @@
import 'package:hive_flutter/hive_flutter.dart';
class MyEventsListModel {
int? code;
String? message;
List<MyEventsData>? data;
int? lastPage;
int? lastRow;
int? count;
MyEventsListModel(
{this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count});
MyEventsListModel.fromJson(Map<String, dynamic> json) {
if (json["code"] is int) {
code = json["code"];
}
if (json["message"] is String) {
message = json["message"];
}
if (json["data"] is List) {
data = json["data"] == null
? null
: (json["data"] as List)
.map((e) => MyEventsData.fromJson(e))
.toList();
}
if (json["last_page"] is int) {
lastPage = json["last_page"];
}
if (json["last_row"] is int) {
lastRow = json["last_row"];
}
if (json["count"] is int) {
count = json["count"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["code"] = code;
_data["message"] = message;
if (data != null) {
_data["data"] = data?.map((e) => e.toJson()).toList();
}
_data["last_page"] = lastPage;
_data["last_row"] = lastRow;
_data["count"] = count;
return _data;
}
}
class MyEventsData {
String? uniqueId;
dynamic switchedId;
String? createdByUser;
String? updatedByUser;
dynamic deletedByUser;
String? formattedCreatedAt;
String? formattedUpdatedAt;
dynamic formattedDeletedAt;
List<MyEventsList>? events;
MyEventsData(
{this.uniqueId,
this.switchedId,
this.createdByUser,
this.updatedByUser,
this.deletedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
this.formattedDeletedAt,
this.events});
MyEventsData.fromJson(Map<String, dynamic> json) {
if (json["unique_id"] is String) {
uniqueId = json["unique_id"];
}
switchedId = json["switched_id"];
if (json["created_by_user"] is String) {
createdByUser = json["created_by_user"];
}
if (json["updated_by_user"] is String) {
updatedByUser = json["updated_by_user"];
}
deletedByUser = json["deleted_by_user"];
if (json["formatted_created_at"] is String) {
formattedCreatedAt = json["formatted_created_at"];
}
if (json["formatted_updated_at"] is String) {
formattedUpdatedAt = json["formatted_updated_at"];
}
formattedDeletedAt = json["formatted_deleted_at"];
if (json["events"] is List) {
events = json["events"] == null
? null
: (json["events"] as List)
.map((e) => MyEventsList.fromJson(e))
.toList();
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["unique_id"] = uniqueId;
_data["switched_id"] = switchedId;
_data["created_by_user"] = createdByUser;
_data["updated_by_user"] = updatedByUser;
_data["deleted_by_user"] = deletedByUser;
_data["formatted_created_at"] = formattedCreatedAt;
_data["formatted_updated_at"] = formattedUpdatedAt;
_data["formatted_deleted_at"] = formattedDeletedAt;
if (events != null) {
_data["events"] = events?.map((e) => e.toJson()).toList();
}
return _data;
}
}
@HiveType(typeId: 101)
class MyEventsList {
@HiveField(0)
String? myeventid;
@HiveField(1)
String? eventid;
@HiveField(2)
String? sessionName;
@HiveField(3)
String? start;
@HiveField(4)
String? end;
@HiveField(5)
String? organizer;
@HiveField(6)
String? sessionSponsor;
@HiveField(7)
dynamic location;
@HiveField(8)
dynamic address;
@HiveField(9)
dynamic postalCode;
@HiveField(10)
String? url;
@HiveField(11)
String? activityType;
@HiveField(12)
dynamic topic;
@HiveField(13)
String? role;
@HiveField(14)
String? eventTypeName;
@HiveField(15)
String? country;
@HiveField(16)
String? region;
@HiveField(17)
String? city;
@HiveField(18)
String? organizerTypeName;
@HiveField(19)
String? sponsorTypeName;
@HiveField(20)
String? sessionTypeName;
@HiveField(21)
String? kolName;
@HiveField(22)
dynamic kolUniqueId;
@HiveField(23)
String? name1;
@HiveField(24)
String? eventUniqueId;
@HiveField(25)
String? createdByUser;
@HiveField(26)
String? updatedByUser;
@HiveField(27)
String? formattedCreatedAt;
@HiveField(28)
String? formattedUpdatedAt;
@HiveField(29)
List<Attendees>? attendees;
@HiveField(30)
bool isfav = false;
@HiveField(31)
bool isAttending = false;
@HiveField(32)
String? speakerscount;
@HiveField(33)
String? topTopics;
@HiveField(34)
String? topSpeakers;
MyEventsList(
{this.eventid,
this.sessionName,
this.start,
this.end,
this.organizer,
this.sessionSponsor,
this.location,
this.address,
this.postalCode,
this.url,
this.activityType,
this.topic,
this.role,
this.eventTypeName,
this.country,
this.region,
this.city,
this.organizerTypeName,
this.sponsorTypeName,
this.sessionTypeName,
this.kolName,
this.kolUniqueId,
this.name1,
this.eventUniqueId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
this.attendees});
MyEventsList.fromJson(Map<String, dynamic> json) {
if (json["unique_id"] is String) {
eventid = json["unique_id"];
}
if (json["session_name"] is String) {
sessionName = json["session_name"];
}
if (json["start_date"] is String) {
start = json["start_date"];
}
if (json["end_date"] is String) {
end = json["end_date"];
}
if (json["organizer"] is String) {
organizer = json["organizer"];
}
if (json["session_sponsor"] is String) {
sessionSponsor = json["session_sponsor"];
}
location = json["location"];
address = json["address"];
postalCode = json["postal_code"];
if (json["url"] is String) {
url = json["url"];
}
if (json["activity_type"] is String) {
activityType = json["activity_type"];
}
topic = json["topic"];
if (json["role"] is String) {
role = json["role"];
}
if (json["event_type_name"] is String) {
eventTypeName = json["event_type_name"];
}
if (json["country_name"] is String) {
country = json["country_name"];
}
if (json["state_name"] is String) {
region = json["state_name"];
}
if (json["city_name"] is String) {
city = json["city_name"];
}
if (json["organizer_type_name"] is String) {
organizerTypeName = json["organizer_type_name"];
}
if (json["sponsor_type_name"] is String) {
sponsorTypeName = json["sponsor_type_name"];
}
if (json["session_type_name"] is String) {
sessionTypeName = json["session_type_name"];
}
if (json["kol_name"] is String) {
kolName = json["kol_name"];
}
kolUniqueId = json["kol_unique_id"];
if (json["event_name"] is String) {
name1 = json["event_name"];
}
if (json["event_unique_id"] is String) {
eventUniqueId = json["event_unique_id"];
}
if (json["created_by_user"] is String) {
createdByUser = json["created_by_user"];
}
if (json["updated_by_user"] is String) {
updatedByUser = json["updated_by_user"];
}
if (json["formatted_created_at"] is String) {
formattedCreatedAt = json["formatted_created_at"];
}
if (json["formatted_updated_at"] is String) {
formattedUpdatedAt = json["formatted_updated_at"];
}
if (json["attendees"] is List) {
attendees = json["attendees"] == null
? null
: (json["attendees"] as List)
.map((e) => Attendees.fromJson(e))
.toList();
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["unique_id"] = eventid;
_data["session_name"] = sessionName;
_data["start_date"] = start;
_data["end_date"] = end;
_data["organizer"] = organizer;
_data["session_sponsor"] = sessionSponsor;
_data["location"] = location;
_data["address"] = address;
_data["postal_code"] = postalCode;
_data["url"] = url;
_data["activity_type"] = activityType;
_data["topic"] = topic;
_data["role"] = role;
_data["event_type_name"] = eventTypeName;
_data["country_name"] = country;
_data["state_name"] = region;
_data["city_name"] = city;
_data["organizer_type_name"] = organizerTypeName;
_data["sponsor_type_name"] = sponsorTypeName;
_data["session_type_name"] = sessionTypeName;
_data["kol_name"] = kolName;
_data["kol_unique_id"] = kolUniqueId;
_data["event_name"] = name1;
_data["event_unique_id"] = eventUniqueId;
_data["created_by_user"] = createdByUser;
_data["updated_by_user"] = updatedByUser;
_data["formatted_created_at"] = formattedCreatedAt;
_data["formatted_updated_at"] = formattedUpdatedAt;
if (attendees != null) {
_data["attendees"] = attendees?.map((e) => e.toJson()).toList();
}
return _data;
}
}
@HiveType(typeId: 102)
class Attendees {
@HiveField(0)
String? uniqueId;
@HiveField(1)
int? kolEventId;
@HiveField(2)
int? kolId;
@HiveField(3)
String? hcpFullName;
@HiveField(4)
String? hcpPin;
@HiveField(5)
int? npiNum;
@HiveField(6)
dynamic specialty;
@HiveField(7)
dynamic organization;
@HiveField(8)
String? therapeuticArea;
@HiveField(9)
dynamic cityId;
@HiveField(10)
dynamic stateId;
@HiveField(11)
dynamic countryId;
@HiveField(12)
dynamic cleansStatus;
@HiveField(13)
int? isDeleted;
@HiveField(14)
String? createdByUser;
@HiveField(15)
String? updatedByUser;
@HiveField(16)
dynamic deletedByUser;
@HiveField(17)
String? formattedCreatedAt;
@HiveField(18)
String? formattedUpdatedAt;
@HiveField(19)
dynamic formattedDeletedAt;
Attendees(
{this.uniqueId,
this.kolEventId,
this.kolId,
this.hcpFullName,
this.hcpPin,
this.npiNum,
this.specialty,
this.organization,
this.therapeuticArea,
this.cityId,
this.stateId,
this.countryId,
this.cleansStatus,
this.isDeleted,
this.createdByUser,
this.updatedByUser,
this.deletedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
this.formattedDeletedAt});
Attendees.fromJson(Map<String, dynamic> json) {
if (json["unique_id"] is String) {
uniqueId = json["unique_id"];
}
if (json["kol_event_id"] is int) {
kolEventId = json["kol_event_id"];
}
if (json["kol_id"] is int) {
kolId = json["kol_id"];
}
if (json["hcp_full_name"] is String) {
hcpFullName = json["hcp_full_name"];
}
if (json["hcp_pin"] is String) {
hcpPin = json["hcp_pin"];
}
if (json["npi_num"] is int) {
npiNum = json["npi_num"];
}
specialty = json["specialty"];
organization = json["organization"];
if (json["therapeutic_area"] is String) {
therapeuticArea = json["therapeutic_area"];
}
cityId = json["city_id"];
stateId = json["state_id"];
countryId = json["country_id"];
cleansStatus = json["cleans_status"];
if (json["is_deleted"] is int) {
isDeleted = json["is_deleted"];
}
if (json["created_by_user"] is String) {
createdByUser = json["created_by_user"];
}
if (json["updated_by_user"] is String) {
updatedByUser = json["updated_by_user"];
}
deletedByUser = json["deleted_by_user"];
if (json["formatted_created_at"] is String) {
formattedCreatedAt = json["formatted_created_at"];
}
if (json["formatted_updated_at"] is String) {
formattedUpdatedAt = json["formatted_updated_at"];
}
formattedDeletedAt = json["formatted_deleted_at"];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["unique_id"] = uniqueId;
_data["kol_event_id"] = kolEventId;
_data["kol_id"] = kolId;
_data["hcp_full_name"] = hcpFullName;
_data["hcp_pin"] = hcpPin;
_data["npi_num"] = npiNum;
_data["specialty"] = specialty;
_data["organization"] = organization;
_data["therapeutic_area"] = therapeuticArea;
_data["city_id"] = cityId;
_data["state_id"] = stateId;
_data["country_id"] = countryId;
_data["cleans_status"] = cleansStatus;
_data["is_deleted"] = isDeleted;
_data["created_by_user"] = createdByUser;
_data["updated_by_user"] = updatedByUser;
_data["deleted_by_user"] = deletedByUser;
_data["formatted_created_at"] = formattedCreatedAt;
_data["formatted_updated_at"] = formattedUpdatedAt;
_data["formatted_deleted_at"] = formattedDeletedAt;
return _data;
}
}

View File

@ -1,4 +1,5 @@
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
part 'neweventsmodel.g.dart';
class EventsResp {
@ -27,12 +28,10 @@ class EventsData {
EventsData({this.events});
EventsData.fromJson(Map<String, dynamic> json) {
if (json["events"] is List) {
events = json["events"] == null
if (json["data"] is List) {
events = json["data"] == null
? null
: (json["events"] as List)
.map((e) => EventsList.fromJson(e))
.toList();
: (json["data"] as List).map((e) => EventsList.fromJson(e)).toList();
}
}
@ -67,6 +66,61 @@ class EventsDataStaging {
}
}
// RESPONSE FROM K2
class EventsListRespK2 {
int? code;
String? message;
List<EventsList>? data;
int? lastPage;
int? lastRow;
int? count;
EventsListRespK2(
{this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count});
EventsListRespK2.fromJson(Map<String, dynamic> json) {
if (json["code"] is int) {
code = json["code"];
}
if (json["message"] is String) {
message = json["message"];
}
if (json["data"] is List) {
data = json["data"] == null
? null
: (json["data"] as List).map((e) => EventsList.fromJson(e)).toList();
}
if (json["last_page"] is int) {
lastPage = json["last_page"];
}
if (json["last_row"] is int) {
lastRow = json["last_row"];
}
if (json["count"] is int) {
count = json["count"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["code"] = code;
_data["message"] = message;
if (data != null) {
_data["data"] = data?.map((e) => e.toJson()).toList();
}
_data["last_page"] = lastPage;
_data["last_row"] = lastRow;
_data["count"] = count;
return _data;
}
}
@HiveType(typeId: 2)
class EventsList {
@HiveField(0)
@ -195,319 +249,449 @@ class EventsList {
String? topSpeakers;
@HiveField(62)
String? sponsors;
@HiveField(63)
bool? eventUserInterest = false;
EventsList(
{this.city,
this.sponsors,
this.speakerscount,
this.topSpeakers,
this.topTopics,
this.isfav = false,
this.isAttending = false,
this.country,
this.region,
this.activityType,
this.address,
this.cityId,
this.clientId,
this.cnt,
this.countryId,
this.createdBy,
this.createdOn,
this.dAllowed,
this.eAllowed,
this.end,
this.eventLat,
this.eventLong,
this.eventId,
this.eventType,
this.eventUniqueId,
this.eventUserAttendee,
this.globalEventId,
this.hcpPin,
this.id,
this.kolId,
this.location,
this.modifiedBy,
this.modifiedOn,
this.name1,
this.notes,
this.organizer,
this.organizerAlias,
this.organizerType,
this.otype,
this.partialcount,
this.partiallyReleasedEvent,
this.postalCode,
this.profileType,
this.projectId,
this.role,
this.sessionName,
this.sessionNote,
this.sessionNote1,
this.sessionSponsor,
this.sessionType,
this.sponsorType,
this.start,
this.stateId,
this.stype,
this.subject,
this.therapeuticArea,
this.topic,
this.topicName,
this.type,
this.updated,
this.url1,
this.url2,
this.userCount});
EventsList({
this.city,
this.sponsors,
this.speakerscount,
this.topSpeakers,
this.topTopics,
this.isfav = false,
this.isAttending = false,
this.country,
this.region,
this.activityType,
this.address,
this.cityId,
this.clientId,
this.cnt,
this.countryId,
this.createdBy,
this.createdOn,
this.dAllowed,
this.eAllowed,
this.end,
this.eventLat,
this.eventLong,
this.eventId,
this.eventType,
this.eventUniqueId,
this.eventUserAttendee,
this.globalEventId,
this.hcpPin,
this.id,
this.kolId,
this.location,
this.modifiedBy,
this.modifiedOn,
this.name1,
this.notes,
this.organizer,
this.organizerAlias,
this.organizerType,
this.otype,
this.partialcount,
this.partiallyReleasedEvent,
this.postalCode,
this.profileType,
this.projectId,
this.role,
this.sessionName,
this.sessionNote,
this.sessionNote1,
this.sessionSponsor,
this.sessionType,
this.sponsorType,
this.start,
this.stateId,
this.stype,
this.subject,
this.therapeuticArea,
this.topic,
this.topicName,
this.type,
this.updated,
this.url1,
this.url2,
this.userCount,
this.eventUserInterest,
});
EventsList.fromJson(Map<String, dynamic> json) {
isfav = false;
if (json["City"] is String) {
city = json["City"] ?? null;
}
if (json["Country"] is String) {
country = json["Country"] ?? null;
}
if (json["Region"] is String) {
region = json["Region"] ?? null;
}
if (json["activity_type"] is String) {
activityType = json["activity_type"];
}
if (json["address"] is String) {
address = json["address"];
}
if (json["city_id"] is String) {
cityId = json["city_id"];
}
if (json["client_id"] is String) {
clientId = json["client_id"];
}
if (json["cnt"] is String) {
cnt = json["cnt"];
}
if (json["country_id"] is String) {
countryId = json["country_id"];
}
if (json["created_by"] is String) {
createdBy = json["created_by"];
}
if (json["created_on"] is String) {
createdOn = json["created_on"];
}
if (json["dAllowed"] is bool) {
dAllowed = json["dAllowed"];
}
if (json["eAllowed"] is bool) {
eAllowed = json["eAllowed"];
}
if (json["end"] is String) {
end = json["end"];
}
if (json["eventLat"] is String) {
eventLat = json["eventLat"];
}
if (json["eventLong"] is String) {
eventLong = json["eventLong"];
}
if (json["event_id"] is String) {
eventId = json["event_id"];
}
if (json["event_type"] is String) {
eventType = json["event_type"];
}
if (json["event_unique_id"] is String) {
eventUniqueId = json["event_unique_id"];
}
if (json["event_user_attendee"] is bool) {
eventUserAttendee = json["event_user_attendee"];
}
if (json["global_event_id"] is String) {
globalEventId = json["global_event_id"];
}
if (json["hcp_pin"] is String) {
hcpPin = json["hcp_pin"];
}
if (json["id"] is String) {
id = json["id"];
}
if (json["kol_id"] is String) {
kolId = json["kol_id"];
}
if (json["location"] is String) {
location = json["location"];
}
if (json["modified_by"] is String) {
modifiedBy = json["modified_by"];
}
if (json["modified_on"] is String) {
modifiedOn = json["modified_on"];
}
if (json["name1"] is String) {
name1 = json["name1"];
}
if (json["notes"] is String) {
notes = json["notes"];
}
if (json["organizer"] is String) {
organizer = json["organizer"];
}
if (json["organizerAlias"] is String) {
organizerAlias = json["organizerAlias"];
}
if (json["organizer_type"] is String) {
organizerType = json["organizer_type"];
}
if (json["otype"] is String) {
otype = json["otype"];
}
if (json["partialcount"] is String) {
partialcount = json["partialcount"];
}
if (json["partially_released_event"] is String) {
partiallyReleasedEvent = json["partially_released_event"];
}
if (json["postal_code"] is String) {
postalCode = json["postal_code"];
}
if (json["profile_type"] is String) {
profileType = json["profile_type"];
}
if (json["project_id"] is String) {
projectId = json["project_id"];
}
if (json["role"] is String) {
role = json["role"];
}
if (json["session_name"] is String) {
sessionName = json["session_name"];
}
if (json["session_note"] is String) {
sessionNote = json["session_note"];
}
if (json["session_note1"] is String) {
sessionNote1 = json["session_note1"];
}
if (json["session_sponsor"] is String) {
sessionSponsor = json["session_sponsor"];
}
if (json["session_type"] is String) {
sessionType = json["session_type"];
}
if (json["sponsor_type"] is String) {
sponsorType = json["sponsor_type"];
}
if (json["start"] is String) {
start = json["start"];
}
if (json["state_id"] is String) {
stateId = json["state_id"];
}
if (json["stype"] is String) {
stype = json["stype"];
}
if (json["subject"] is String) {
subject = json["subject"];
}
if (json["therapeutic_area"] is String) {
therapeuticArea = json["therapeutic_area"];
}
if (json["topic"] is String) {
topic = json["topic"];
}
if (json["topic_name"] is String) {
topicName = json["topic_name"];
}
if (json["type"] is String) {
type = json["type"];
}
if (json["updated"] is bool) {
updated = json["updated"];
}
if (json["url1"] is String) {
url1 = json["url1"];
}
if (json["url2"] is String) {
url2 = json["url2"];
}
if (json["user_count"] is String) {
userCount = json["user_count"];
}
factory EventsList.fromJson(Map<String, dynamic> json) => EventsList(
therapeuticArea: json["therapeutic_area"],
hcpPin: json["hcp_pin"],
cnt: json["cnt"],
id: json["id"],
kolId: json["kol_id"],
type: json["type"],
eventType: json["event_type"],
eventId: json["event_id"],
sessionType: json["session_type"],
sessionName: json["session_name"],
role: json["role"],
topic: json["topic"],
start: json["start"],
end: json["end"],
organizer: json["organizer"],
sponsorType: json["sponsor_type"],
sessionSponsor: json["session_sponsor"],
organizerType: json["organizer_type"],
location: json["location"],
address: json["address"],
cityId: json["city_id"],
stateId: json["state_id"],
countryId: json["country_id"],
postalCode: json["postal_code"],
subject: json["subject"],
url1: json["url1"],
url2: json["url2"],
notes: json["notes"],
createdBy: json["created_by"],
createdOn: json["created_on"],
modifiedBy: json["modified_by"],
modifiedOn: json[
"modified_on"], // == null ? null : DateTime.parse(json["modified_on"]),
clientId: json["client_id"],
projectId: json["project_id"],
activityType: json["activity_type"],
profileType: json["profile_type"],
globalEventId: json["global_event_id"],
eventUniqueId: json["event_unique_id"],
stype: json["stype"],
otype: json["otype"],
// name: json["name"],
partiallyReleasedEvent: json["partially_released_event"],
country: json["Country"],
region: json["Region"],
city: json["City"],
topicName: json["topic_name"],
eventLat: json["eventLat"],
eventLong: json["eventLong"],
userCount: json["user_count"],
partialcount: json["partialcount"],
sessionNote1: json["session_note1"],
sessionNote: json["session_note"],
organizerAlias: json["organizerAlias"],
eAllowed: json["eAllowed"],
dAllowed: json["dAllowed"],
updated: json["updated"],
eventUserAttendee: json["event_user_attendee"],
eventUserInterest: json["event_user_interest"],
name1: json["name1"],
);
if (json["speakerscount"] is String) {
speakerscount = json["speakerscount"];
}
if (json["topTopics"] is String) {
topTopics = json["topTopics"];
}
if (json["topSpeakers"] is String) {
topSpeakers = json["topSpeakers"];
}
if (json["sponsors"] is String) {
sponsors = json["sponsors"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["City"] = city;
_data["country"] = country;
_data["region"] = region;
_data["activity_type"] = activityType;
_data["address"] = address;
_data["city_id"] = cityId;
_data["client_id"] = clientId;
_data["cnt"] = cnt;
_data["country_id"] = countryId;
_data["created_by"] = createdBy;
_data["created_on"] = createdOn;
_data["dAllowed"] = dAllowed;
_data["eAllowed"] = eAllowed;
_data["end"] = end;
_data["eventLat"] = eventLat;
_data["eventLong"] = eventLong;
_data["event_id"] = eventId;
_data["event_type"] = eventType;
_data["event_unique_id"] = eventUniqueId;
_data["event_user_attendee"] = eventUserAttendee;
_data["global_event_id"] = globalEventId;
_data["hcp_pin"] = hcpPin;
_data["id"] = id;
_data["kol_id"] = kolId;
_data["location"] = location;
_data["modified_by"] = modifiedBy;
_data["modified_on"] = modifiedOn;
_data["name1"] = name1;
_data["notes"] = notes;
_data["organizer"] = organizer;
_data["organizerAlias"] = organizerAlias;
_data["organizer_type"] = organizerType;
_data["otype"] = otype;
_data["partialcount"] = partialcount;
_data["partially_released_event"] = partiallyReleasedEvent;
_data["postal_code"] = postalCode;
_data["profile_type"] = profileType;
_data["project_id"] = projectId;
_data["role"] = role;
_data["session_name"] = sessionName;
_data["session_note"] = sessionNote;
_data["session_note1"] = sessionNote1;
_data["session_sponsor"] = sessionSponsor;
_data["session_type"] = sessionType;
_data["sponsor_type"] = sponsorType;
_data["start"] = start;
_data["state_id"] = stateId;
_data["stype"] = stype;
_data["subject"] = subject;
_data["therapeutic_area"] = therapeuticArea;
_data["topic"] = topic;
_data["topic_name"] = topicName;
_data["type"] = type;
_data["updated"] = updated;
_data["url1"] = url1;
_data["url2"] = url2;
_data["user_count"] = userCount;
return _data;
}
Map<String, dynamic> toJson() => {
"therapeutic_area": therapeuticArea,
"hcp_pin": hcpPin,
"cnt": cnt,
"id": id,
"kol_id": kolId,
"type": type,
"event_type": eventType,
"event_id": eventId,
"session_type": sessionType,
"session_name": sessionName,
"role": role,
"topic": topic,
"start": start,
"end": end,
"organizer": organizer,
"sponsor_type": sponsorType,
"session_sponsor": sessionSponsor,
"organizer_type": organizerType,
"location": location,
"address": address,
"city_id": cityId,
"state_id": stateId,
"country_id": countryId,
"postal_code": postalCode,
"subject": subject,
"url1": url1,
"url2": url2,
"notes": notes,
"created_by": createdBy,
"created_on": createdOn,
"modified_by": modifiedBy,
"modified_on": modifiedOn,
"client_id": clientId,
"project_id": projectId,
"activity_type": activityType,
"profile_type": profileType,
"global_event_id": globalEventId,
"event_unique_id": eventUniqueId,
"stype": stype,
"otype": otype,
// "name": name,
"partially_released_event": partiallyReleasedEvent,
"Country": country,
"Region": region,
"City": city,
"topic_name": topicName,
"eventLat": eventLat,
"eventLong": eventLong,
"user_count": userCount,
"partialcount": partialcount,
"session_note1": sessionNote1,
"session_note": sessionNote,
"organizerAlias": organizerAlias,
"eAllowed": eAllowed,
"dAllowed": dAllowed,
"updated": updated,
"event_user_attendee": eventUserAttendee,
"event_user_interest": eventUserInterest,
"name1": name1,
};
}
// EventsList.fromJson(Map<String, dynamic> json) {
// isfav = false;
// if (json["city_name"] is String) {
// city = json["city_name"] ?? null;
// }
// if (json["country_name"] is String) {
// country = json["country_name"] ?? null;
// }
// if (json["state_name"] is String) {
// region = json["state_name"] ?? null;
// }
// if (json["activity_type"] is String) {
// activityType = json["activity_type"];
// }
// if (json["address"] is String) {
// address = json["address"];
// }
// if (json["city_id"] is String) {
// cityId = json["city_id"];
// }
// if (json["client_id"] is String) {
// clientId = json["client_id"];
// }
// if (json["cnt"] is String) {
// cnt = json["cnt"];
// }
// if (json["country_id"] is String) {
// countryId = json["country_id"];
// }
// if (json["created_by"] is String) {
// createdBy = json["created_by"];
// }
// if (json["created_on"] is String) {
// createdOn = json["created_on"];
// }
// if (json["dAllowed"] is bool) {
// dAllowed = json["dAllowed"];
// }
// if (json["eAllowed"] is bool) {
// eAllowed = json["eAllowed"];
// }
// if (json["end_date"] is String) {
// end = json["end_date"];
// }
// if (json["eventLat"] is String) {
// eventLat = json["eventLat"];
// }
// if (json["eventLong"] is String) {
// eventLong = json["eventLong"];
// }
// if (json["unique_id"] is String) {
// eventId = json["unique_id"];
// }
// if (json["event_type_name"] is String) {
// eventType = json["event_type_name"];
// }
// if (json["event_unique_id"] is String) {
// eventUniqueId = json["event_unique_id"];
// }
// if (json["event_user_attendee"] is bool) {
// eventUserAttendee = json["event_user_attendee"];
// }
// if (json["global_event_id"] is String) {
// globalEventId = json["global_event_id"];
// }
// if (json["hcp_pin"] is String) {
// hcpPin = json["hcp_pin"];
// }
// if (json["id"] is String) {
// id = json["id"];
// }
// if (json["kol_id"] is String) {
// kolId = json["kol_id"];
// }
// if (json["location"] is String) {
// location = json["location"];
// }
// if (json["modified_by"] is String) {
// modifiedBy = json["modified_by"];
// }
// if (json["modified_on"] is String) {
// modifiedOn = json["modified_on"];
// }
// if (json["event_name"] is String) {
// name1 = json["event_name"];
// }
// if (json["notes"] is String) {
// notes = json["notes"];
// }
// if (json["organizer"] is String) {
// organizer = json["organizer"];
// }
// if (json["organizerAlias"] is String) {
// organizerAlias = json["organizerAlias"];
// }
// if (json["organizer_type_name"] is String) {
// organizerType = json["organizer_type_name"];
// }
// if (json["otype"] is String) {
// otype = json["otype"];
// }
// if (json["partialcount"] is String) {
// partialcount = json["partialcount"];
// }
// if (json["partially_released_event"] is String) {
// partiallyReleasedEvent = json["partially_released_event"];
// }
// if (json["postal_code"] is String) {
// postalCode = json["postal_code"];
// }
// if (json["profile_type"] is String) {
// profileType = json["profile_type"];
// }
// if (json["project_id"] is String) {
// projectId = json["project_id"];
// }
// if (json["role"] is String) {
// role = json["role"];
// }
// if (json["session_name"] is String) {
// sessionName = json["session_name"];
// }
// if (json["session_note"] is String) {
// sessionNote = json["session_note"];
// }
// if (json["session_note1"] is String) {
// sessionNote1 = json["session_note1"];
// }
// if (json["session_sponsor"] is String) {
// sessionSponsor = json["session_sponsor"];
// }
// if (json["session_type"] is String) {
// sessionType = json["session_type"];
// }
// if (json["sponsor_type_name"] is String) {
// sponsorType = json["sponsor_type_name"];
// }
// if (json["start_date"] is String) {
// start = json["start_date"];
// }
// if (json["state_id"] is String) {
// stateId = json["state_id"];
// }
// if (json["stype"] is String) {
// stype = json["stype"];
// }
// if (json["subject"] is String) {
// subject = json["subject"];
// }
// if (json["therapeutic_area"] is String) {
// therapeuticArea = json["therapeutic_area"];
// }
// if (json["topic"] is String) {
// topic = json["topic"];
// }
// if (json["topic_name"] is String) {
// topicName = json["topic_name"];
// }
// if (json["type"] is String) {
// type = json["type"];
// }
// if (json["updated"] is bool) {
// updated = json["updated"];
// }
// if (json["url"] is String) {
// url1 = json["url"];
// }
// if (json["url2"] is String) {
// url2 = json["url2"];
// }
// if (json["user_count"] is String) {
// userCount = json["user_count"];
// }
// if (json["speakerscount"] is String) {
// speakerscount = json["speakerscount"];
// }
// if (json["topTopics"] is String) {
// topTopics = json["topTopics"];
// }
// if (json["topSpeakers"] is String) {
// topSpeakers = json["topSpeakers"];
// }
// if (json["sponsors"] is String) {
// sponsors = json["sponsors"];
// }
// }
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> _data = <String, dynamic>{};
// _data["City"] = city;
// _data["country"] = country;
// _data["region"] = region;
// _data["activity_type"] = activityType;
// _data["address"] = address;
// _data["city_id"] = cityId;
// _data["client_id"] = clientId;
// _data["cnt"] = cnt;
// _data["country_id"] = countryId;
// _data["created_by"] = createdBy;
// _data["created_on"] = createdOn;
// _data["dAllowed"] = dAllowed;
// _data["eAllowed"] = eAllowed;
// _data["end"] = end;
// _data["eventLat"] = eventLat;
// _data["eventLong"] = eventLong;
// _data["event_id"] = eventId;
// _data["event_type"] = eventType;
// _data["event_unique_id"] = eventUniqueId;
// _data["event_user_attendee"] = eventUserAttendee;
// _data["global_event_id"] = globalEventId;
// _data["hcp_pin"] = hcpPin;
// _data["id"] = id;
// _data["kol_id"] = kolId;
// _data["location"] = location;
// _data["modified_by"] = modifiedBy;
// _data["modified_on"] = modifiedOn;
// _data["name1"] = name1;
// _data["notes"] = notes;
// _data["organizer"] = organizer;
// _data["organizerAlias"] = organizerAlias;
// _data["organizer_type"] = organizerType;
// _data["otype"] = otype;
// _data["partialcount"] = partialcount;
// _data["partially_released_event"] = partiallyReleasedEvent;
// _data["postal_code"] = postalCode;
// _data["profile_type"] = profileType;
// _data["project_id"] = projectId;
// _data["role"] = role;
// _data["session_name"] = sessionName;
// _data["session_note"] = sessionNote;
// _data["session_note1"] = sessionNote1;
// _data["session_sponsor"] = sessionSponsor;
// _data["session_type"] = sessionType;
// _data["sponsor_type"] = sponsorType;
// _data["start"] = start;
// _data["state_id"] = stateId;
// _data["stype"] = stype;
// _data["subject"] = subject;
// _data["therapeutic_area"] = therapeuticArea;
// _data["topic"] = topic;
// _data["topic_name"] = topicName;
// _data["type"] = type;
// _data["updated"] = updated;
// _data["url1"] = url1;
// _data["url2"] = url2;
// _data["user_count"] = userCount;
// return _data;
// }
// }

View File

@ -46,13 +46,19 @@ class Specialtyresp {
};
}
List<Specialty> specialtyFromJson(String str) =>
List<Specialty>.from(json.decode(str).map((x) => Specialty.fromJson(x)));
String specialtyToJson(List<Specialty> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Specialty {
String specialtyCount;
String specialtyName;
String? specialtyCount;
String? specialtyName;
Specialty({
required this.specialtyCount,
required this.specialtyName,
this.specialtyCount,
this.specialtyName,
});
factory Specialty.fromJson(Map<String, dynamic> json) => Specialty(

View File

@ -54,6 +54,13 @@ class Topicsresp {
};
}
List<TopicsCloudData> topicsCloudDataFromJson(String str) =>
List<TopicsCloudData>.from(
json.decode(str).map((x) => TopicsCloudData.fromJson(x)));
String topicsCloudDataToJson(List<TopicsCloudData> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class TopicsCloudData {
String? total;
String? topic;

View File

@ -5,9 +5,11 @@ import 'package:dio/dio.dart';
import 'package:dio/io.dart';
import 'package:flutter/services.dart';
import 'package:konectar_events/model/affiliationsmodel.dart';
import 'package:konectar_events/model/events_list_resp_2.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/eventsoverview.dart';
import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/keywords_model.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/scope_model.dart';
@ -19,6 +21,7 @@ import 'package:konectar_events/utils/constants.dart';
class ApiCall {
final dio = Dio();
//K1 API CALLS
Future<dynamic> parseInfo() async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
@ -42,30 +45,6 @@ class ApiCall {
return response.data;
}
//https://cardio-staging.konectar.io/notifications/list_all_notifications
Future<dynamic> listnotifications() async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.post(
'https://cardio-staging.konectar.io/requested_kols/list_my_pending_approvals/',
options: Options(
followRedirects: false,
validateStatus: (status) {
return status! < 500;
},
headers: {'Content-type': 'application/json; charset=UTF-8'}),
data: {"rows": "10", "page": "1", "sidx": "name", "sord": "desc"});
print("response user settings here ");
print(response.data.toString());
return response.data;
}
Future<List<Therapeutic>> getscopes() async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
@ -122,7 +101,7 @@ class ApiCall {
return keywordList;
}
Future<List<EventsList>?> getStagingEvents() async {
Future<List<EventsList>> getEventsFromK1({String? type}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
@ -134,10 +113,222 @@ class ApiCall {
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"project_id": "",
"start": "",
"start": DateTime.now().toString,
"end": "",
"order_by": "7",
"type": "1"
"type": type ?? "1"
});
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.eventslistapi}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"project_id": "",
"start": DateTime.now().toString,
"end": "",
"order_by": "7",
"type": type ?? "1"
},
data: formData);
print("response user eventssssss here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.data);
EventsData eventresponse = EventsData.fromJson(jsondata);
List<EventsList>? eventdata = eventresponse.events;
return eventdata!;
}
Future<dynamic> followUnfollowEvent(String flag, String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap(
{"user_email": "vinodh@aissel.com", "eid": eventid, "flag": flag});
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.followUnfollowEvent}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eid": eventid,
"flag": flag,
},
data: formData);
print("response user FOLLOW UNFOLLOW here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
return response.data.toString();
}
Future<dynamic> attendNotAttendEvent(String flag, String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap(
{"user_email": "vinodh@aissel.com", "eid": eventid, "flag": flag});
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.attendNotAttendEvent}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eid": eventid,
"flag": flag,
},
data: formData);
print("response user FOLLOW UNFOLLOW here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
return response.data.toString();
}
Future<List<Specialty>> specialtyOfSpeakers({
required String eventid,
required String startDate,
required String endDate,
}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
});
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.specialtyOfSpeakers}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
},
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
// Map<String, dynamic> jsondata = json.decode(response.data);
// Specialtyresp resp = Specialtyresp.fromJson(jsondata);
List<Specialty> data = specialtyFromJson(response.data);
return data;
}
Future<List<TopicsCloudData>> insightsTopicsCloud({
required String eventid,
required String startDate,
required String endDate,
}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
});
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.insightsTopicsCloud}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
},
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
// Map<String, dynamic> jsondata = json.decode(response.data);
// Specialtyresp resp = Specialtyresp.fromJson(jsondata);
List<TopicsCloudData> data = topicsCloudDataFromJson(response.data);
return data;
}
Future<List<Affiliations>> insightsBarChart({
required String eventid,
required String startDate,
required String endDate,
}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
});
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.devUrl}${EventsConstants.insightsBarChart}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": "\"$startDate\"",
"ed": "\"$endDate\"",
"type": "\"1\"",
},
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
// Map<String, dynamic> jsondata = json.decode(response.data);
// Specialtyresp resp = Specialtyresp.fromJson(jsondata);
List<Affiliations> data = affiliationsFromJson(response.data);
return data;
}
Future<OverviewData> getEventsOverview(
String eventid, String startDate, String endDate) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"start": startDate,
"end": endDate,
"event_id": eventid,
});
response = await dio.post(
'${EventsConstants.stagingUrl}${EventsConstants.eventslistapi}',
@ -149,14 +340,16 @@ class ApiCall {
print("response user eventssssss here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.data);
EventsDataStaging? eventdata = EventsDataStaging.fromJson(jsondata);
List<EventsList>? eventList = eventdata.events;
EventsDetailsResp? eventdata = EventsDetailsResp.fromJson(jsondata);
OverviewData overviewData = eventdata.data;
return eventList;
return overviewData;
}
Future<dynamic> verifyEmail(
String email, String deviceid, String platform) async {
//************ K2 API CALLS ***********************************************************************************************************************************
Future<List<EventsList>> getEventsFromK2(int page, String search,
{String? startdate, String? enddate}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
@ -165,27 +358,178 @@ class ApiCall {
return client;
};
Response response;
var formData = FormData.fromMap({
"email": email,
});
response = await dio.post('${EventsConstants.getTokenApi}',
options: Options(),
queryParameters: {
"email": email,
"device_id": deviceid,
"platform": platform,
},
var formData;
if (startdate != "") {
formData = {
"page": page,
"limit": 20,
"start_date": startdate,
"end_date": enddate,
};
} else {
formData = {
"page": page,
"limit": 20,
"conditions": [
{"field": "event_name", "type": "like", "value": search}
]
};
}
response = await dio.post('${EventsConstants.eventslistapifromk2}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
HttpHeaders.contentTypeHeader: "application/json",
}),
// queryParameters: {
// "page": page,
// "limit": 20,
// // "id": "11c39192480587d2d6213bfef6744571",
// "conditions": jsonEncode([
// {"field": eventfield, "type": "like", "value": searchkey}
// ])
// },
data: formData);
if (response.statusCode == 200) {
print("response user login!!!!!!!!!!!!!!!!!!!!! ");
print("response EVENTS!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
return response.data;
Map<String, dynamic> jsondata = response.data;
EventsListRespK2 eventresponse = EventsListRespK2.fromJson(jsondata);
List<EventsList>? eventdata = eventresponse.data;
return eventdata!;
} else {
print("isEmplty");
return null;
print("isEmpty");
return [];
}
}
Future<List<EventsList>> getMyEventsFromK2(int page, String search,
{String? startdate, String? enddate}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData;
if (startdate != "") {
formData = {
"page": page,
"limit": 20,
"id": "11c39192480587d2d6213bfef6744571",
"start_date": startdate,
"end_date": enddate,
};
} else {
formData = {
"page": page,
"limit": 20,
"id": "11c39192480587d2d6213bfef6744571",
"conditions": [
{"field": "event_name", "type": "like", "value": search}
]
};
}
response = await dio.post('${EventsConstants.eventslistapifromk2}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
HttpHeaders.contentTypeHeader: "application/json",
}),
// queryParameters: {
// "page": page,
// "limit": 20,
// // "id": "11c39192480587d2d6213bfef6744571",
// "conditions": jsonEncode([
// {"field": eventfield, "type": "like", "value": searchkey}
// ])
// },
data: formData);
if (response.statusCode == 200) {
print("response MY EVENTS!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = response.data;
EventsListRespK2 eventresponse = EventsListRespK2.fromJson(jsondata);
List<EventsList>? eventdata = eventresponse.data;
return eventdata!;
} else {
print("isEmpty");
return [];
}
}
//ADD TO FAVS
Future<String> addEventsToFav(String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.post(
'${EventsConstants.addToMyEventsApi}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a"
}),
queryParameters: {
"event_id": eventid,
"user_id": "11c39192480587d2d6213bfef6744571",
},
);
print("response user keywords here########## ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.toString());
String message = jsondata["message"];
print("***$message");
return message;
}
//REMOVE FROM FAVS
Future<String> removeEventsFromFav(String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.post(
'${EventsConstants.removeFromMyEventsApi}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
}),
queryParameters: {
"event_id": eventid,
"user_id": "11c39192480587d2d6213bfef6744571",
},
);
print("response user keywords here########## ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.toString());
String message = jsondata["message"];
print("***$message");
return message;
}
//GET MY EVENTS
Future<dynamic> verifyCode(String email, String code) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
@ -238,8 +582,151 @@ class ApiCall {
return response.data;
}
Future<OverviewData> getEventsOverview(
String eventid, String startDate, String endDate) async {
//SEARCH EVENTS API FROM K2
Future<List<EventsList>> getSearchedEventsFromK2(
int page, String eventfield, String searchkey) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = {
"page": page,
"limit": 20,
"conditions": [
{"field": eventfield, "type": "like", "value": searchkey}
]
};
response = await dio.post('${EventsConstants.eventslistapifromk2}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
HttpHeaders.contentTypeHeader: "application/json",
}),
// queryParameters: {
// "page": page,
// "limit": 20,
// // "id": "11c39192480587d2d6213bfef6744571",
// "conditions": jsonEncode([
// {"field": eventfield, "type": "like", "value": searchkey}
// ])
// },
data: formData);
if (response.statusCode == 200) {
print("response SEARCH EVENTS!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = response.data;
EventsListRespK2 eventresponse = EventsListRespK2.fromJson(jsondata);
List<EventsList>? eventdata = eventresponse.data;
return eventdata!;
} else {
print("isEmpty");
return [];
}
}
//SPEAKERS LIST FROM K2
Future<Map<String, Object?>> getSpeakersFromK2(
int page, String eventid, String event_unique_id,
{String? searchkey}) async {
Dio dio = Dio();
print("see pages^^^^^^^ : $page");
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = {
"page": page,
"limit": 40,
"id": eventid,
"event_id": event_unique_id,
"hcp_full_name": searchkey
// "conditions": [
// {"field": eventfield, "type": "like", "value": searchkey}
// ]
};
response = await dio.post('${EventsConstants.speakerslistapifromk2}',
options: Options(headers: {
"Authorization":
"Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
HttpHeaders.contentTypeHeader: "application/json",
}),
// queryParameters: {
// "page": page,
// "limit": 20,
// // "id": "11c39192480587d2d6213bfef6744571",
// "conditions": jsonEncode([
// {"field": eventfield, "type": "like", "value": searchkey}
// ])
// },
data: formData);
if (response.statusCode == 200) {
print("respons Speakers !!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = response.data;
SpeakersResponse resp = SpeakersResponse.fromJson(jsondata);
List<SpeakersList>? data = resp.data;
var respdata = {"count": resp.count, "list": data ?? []};
return respdata;
} else {
print("isEmpty");
return {};
}
}
//************ OTHER API CALLS ***********************************************************************************************************************************
Future<dynamic> dummyapi() async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.get('http://203.129.219.14:3043/weather?city=London',
options: Options());
print("response PLATFORMATIC here ");
print(response.data.toString());
return response.data;
}
//https://cardio-staging.konectar.io/notifications/list_all_notifications
Future<dynamic> listnotifications() async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.post(
'https://cardio-staging.konectar.io/requested_kols/list_my_pending_approvals/',
options: Options(
followRedirects: false,
validateStatus: (status) {
return status! < 500;
},
headers: {'Content-type': 'application/json; charset=UTF-8'}),
data: {"rows": "10", "page": "1", "sidx": "name", "sord": "desc"});
print("response user settings here ");
print(response.data.toString());
return response.data;
}
Future<dynamic> verifyEmail(
String email, String deviceid, String platform) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
@ -249,25 +736,24 @@ class ApiCall {
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"start": startDate,
"end": endDate,
"event_id": eventid,
"email": email,
});
response = await dio.post(
'${EventsConstants.stagingUrl}${EventsConstants.eventslistapi}',
response = await dio.post('${EventsConstants.getTokenApi}',
options: Options(),
queryParameters: {
"user_email": "vinodh@aissel.com",
"email": email,
"device_id": deviceid,
"platform": platform,
},
data: formData);
print("response user eventssssss here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.data);
EventsDetailsResp? eventdata = EventsDetailsResp.fromJson(jsondata);
OverviewData overviewData = eventdata.data;
return overviewData;
if (response.statusCode == 200) {
print("response user login!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
return response.data;
} else {
print("isEmplty");
return null;
}
}
Future<List<EventsList>?> getEvents() async {
@ -324,29 +810,6 @@ class ApiCall {
return eventsdetailList;
}
Future<String> addEventsToFav(String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
response = await dio.post(
'${EventsConstants.domainUrl}eventsapi.api.addEventsToFav?eventid=$eventid',
options: Options(),
);
print("response user keywords here########## ");
print(response.data.toString());
Map<String, dynamic> jsondata = json.decode(response.toString());
String message = jsondata["message"];
print("***$message");
return message;
}
Future<String> attendEvents(String eventid) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
@ -619,4 +1082,58 @@ class ApiCall {
return data;
}
Future<Map<String, Object?>> getSpeakersFromLocal(
int page, String eventid, String event_unique_id,
{String? searchkey}) async {
Dio dio = Dio();
print("see pages^^^^^^^ : $page");
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
Response response;
var formData = {
"page": page,
"limit": 40,
"id": eventid,
"event_id": event_unique_id,
"hcp_full_name": searchkey
// "conditions": [
// {"field": eventfield, "type": "like", "value": searchkey}
// ]
};
response = await dio.post(
'${EventsConstants.speakerslistapifromLocal}',
// options: Options(headers: {
// "Authorization":
// "Bearer 242|f4s7EfBjD01z1tuGeJfgKm7v2WzZk22uDOehqFyla72c481a",
// HttpHeaders.contentTypeHeader: "application/json",
// }),
// queryParameters: {
// "page": page,
// "limit": 20,
// // "id": "11c39192480587d2d6213bfef6744571",
// "conditions": jsonEncode([
// {"field": eventfield, "type": "like", "value": searchkey}
// ])
// },
// data: formData
);
if (response.statusCode == 200) {
print("respons Speakers !!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
Map<String, dynamic> jsondata = response.data;
SpeakersResponse1 resp = SpeakersResponse1.fromJson(jsondata);
List<SpeakersList>? data = resp.data!.data;
var respdata = {"count": 92, "list": data ?? []};
return respdata;
} else {
print("isEmpty");
return {};
}
}
}

View File

@ -14,14 +14,38 @@ class EventsConstants {
static const Color btnBlueColor = Color.fromARGB(255, 0, 102, 204);
// static const String domainUrl = "http://192.0.0.2:8007/api/method/";
static const String domainUrl = "http://192.168.2.109:8007/api/method/";
//192.0.0.2:8007 - iphone
// 192.168.2.109:8007 - office
static const String stagingUrl =
"https://cardio-staging.konectar.io/reports/";
static const String devUrl = "http://192.168.2.130/konectar-sandbox/reports/";
static const String eventslistapi = "load_future_events";
static const String followUnfollowEvent = "save_user_interested_event/";
static const String attendNotAttendEvent = "save_user_attending_event/";
static const String specialtyOfSpeakers = "get_top_specialities_donut_chart";
static const String insightsTopicsCloud = "get_topic_clouds_chart/";
static const String insightsBarChart = "get_top_affiliation_bar_chart/";
static const String speakerslistapi = "view_micro_event_data";
static const String eventdetailsapi = "view_micro_event";
static const String eventslistapifromk2 =
"http://192.168.2.130:8888/api/kolevents/v1/en/fetch";
static const String speakerslistapifromk2 =
"http://192.168.2.130:8888/api/kolevents/v1/en/event_speakers";
static const String speakerslistapifromLocal =
"http://events.localhost:8007/api/method/speakerslist";
static const String addToMyEventsApi =
"http://192.168.2.130:8888/api/kolevents/v1/en/add_to_my_event";
static const String removeFromMyEventsApi =
"http://192.168.2.130:8888/api/kolevents/v1/en/delete_my_event";
static const String fetchMyEventsApi =
"http://192.168.2.130:8888/api/kolevents/v1/en/list_my_events";
static const String unfollowMyEventsApi =
"http://192.168.2.130:8888/api/kolevents/v1/en/delete_my_event";
static const String getTokenApi =
"http://192.168.2.155:8002/api/auth/mobile/get_token";
static const String validateTokenApi =

View File

@ -3,13 +3,29 @@ import 'package:intl/intl.dart';
class CustomDateFormatter {
DateTime convertStringToDate(String datestring) {
print("Date string : $datestring");
List<String> datearray = datestring.split('/');
String char = "/";
if (datestring.contains("-")) {
char = "-";
}
List<String> datearray = datestring.split(char);
DateTime outputDate = DateTime(int.parse(datearray[2]),
int.parse(datearray[0]), int.parse(datearray[1]));
print("Output date : $outputDate");
return outputDate;
}
String convertDateTimeToDate(String datestring) {
print("Date string : $datestring");
List<String> datearray1 = datestring.split(' ');
print("Date string22 : $datearray1[0]");
List<String> datearray = datearray1[0].split('-');
DateTime outputDate = DateTime(int.parse(datearray[0]),
int.parse(datearray[1]), int.parse(datearray[2]));
final DateFormat formatter = DateFormat('dd-MM-yyyy');
print("Output date : $outputDate");
return formatter.format(outputDate);
}
String formatDate() {
final DateFormat formatter = DateFormat('yyyy-MM-dd hh:mm');
final String formatted = formatter.format(DateTime.now());

View File

@ -2,22 +2,19 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/view/hcplist.dart';
import 'package:konectar_events/view/home.dart';
import 'package:konectar_events/view/insights.dart';
import 'package:konectar_events/view/login_components/intropaging.dart';
import 'package:konectar_events/view/profileview.dart';
import 'package:konectar_events/view/socialmedia.dart';
import 'package:konectar_events/viewmodel/eventsprovider.dart';
import 'package:konectar_events/viewmodel/hcpprofprovider.dart';
import 'package:konectar_events/widgets/customappbar.dart';
import 'package:konectar_events/widgets/gridview.dart';
import 'package:konectar_events/widgets/snackbar.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -39,7 +36,10 @@ class _EventsListingScreenState extends State<EventsListingScreen>
bool isExtended = false;
bool isExtendedInterested = false;
final ScrollController _scrollController = ScrollController();
final PagingController<int, SpeakersList> pagingController =
PagingController(firstPageKey: 1);
static const _pageSize = 20;
String searchSpeaker = "";
@override
void initState() {
super.initState();
@ -47,6 +47,45 @@ class _EventsListingScreenState extends State<EventsListingScreen>
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
init();
});
pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
}
Future<void> _fetchPage(int pageKey) async {
//await initConnectivity();
// if (connectionStatus.toString().contains("ConnectivityResult.none")) {
// try {
// final newItems =
// await Provider.of<EventsProvider>(context, listen: false)
// .getOfflineMyEvents();
// final isLastPage = newItems.length < _pageSize;
// if (isLastPage) {
// _pagingController.appendLastPage(newItems);
// } else {
// final nextPageKey = pageKey + newItems.length;
// _pagingController.appendPage(newItems, nextPageKey);
// }
// } catch (error) {
// _pagingController.error = error;
// }
// } else {
try {
final newItems = await Provider.of<EventsProvider>(context, listen: false)
.getSpeakersDetails(pageKey, widget.event.eventId!,
widget.event.eventUniqueId!, searchSpeaker);
final isLastPage = newItems.isEmpty;
if (isLastPage) {
pagingController.appendLastPage(newItems);
} else {
final nextPageKey = pageKey + 1;
pagingController.appendPage(newItems, nextPageKey);
}
} catch (error) {
pagingController.error = error;
}
// }
}
init() async {
@ -54,15 +93,22 @@ class _EventsListingScreenState extends State<EventsListingScreen>
CustomDateFormatter().convertStringToDate(widget.event.start!));
String end = CustomDateFormatter().formatYearDate(
CustomDateFormatter().convertStringToDate(widget.event.end!));
// await Provider.of<EventsProvider>(context, listen: false)
// .getSessionCount(widget.event.eventId!, widget.event.eventUniqueId!);
final provider = Provider.of<EventsProvider>(context, listen: false);
// pagingController.addPageRequestListener((pageKey) {
// _fetchPage(pageKey);
// });
// await Provider.of<EventsProvider>(context, listen: false)
// .getEventsDetails(widget.event.eventId!);
// await Provider.of<EventsProvider>(context, listen: false).getSessionCount();
await Provider.of<EventsProvider>(context, listen: false)
.getEventsDetails(widget.event.eventId!);
await Provider.of<EventsProvider>(context, listen: false).getSessionCount();
.getTopicsCloud(widget.event);
await Provider.of<EventsProvider>(context, listen: false)
.getTopicsCloud(widget.event.eventId!);
.getSpecialtyData(widget.event);
await Provider.of<EventsProvider>(context, listen: false)
.getSpecialtyData(widget.event.eventId!);
await Provider.of<EventsProvider>(context, listen: false)
.getAffiliations(widget.event.eventId!);
.getAffiliations(widget.event);
// await Provider.of<EventsProvider>(context, listen: false)
// .getOverviewData(widget.event.eventId!, start, end);
setState(() {});
@ -71,6 +117,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
@override
void dispose() {
_tabController.dispose();
pagingController.dispose();
super.dispose();
}
@ -78,7 +125,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
return Consumer<EventsProvider>(
builder: (BuildContext context, provider, Widget? child) {
return DefaultTabController(
length: 4,
length: 3,
//child: SafeArea(
// appBar: CustomAppBar(title: "", backgroundcolor: Constants.bgcolor),
//body:
@ -214,7 +261,18 @@ class _EventsListingScreenState extends State<EventsListingScreen>
),
),
),
// const Spacer(),
const Spacer(),
IconButton(
icon: Icon(
provider.ifOfflineExists(widget.event.eventId!)
? Icons.bookmark
: Icons.bookmark_add_outlined,
color: Colors.white,
size: isTablet ? 14 : 18),
onPressed: () async {
setState(() {});
},
)
// widget.event.isfav
// ? RichText(
// text: TextSpan(
@ -271,6 +329,17 @@ class _EventsListingScreenState extends State<EventsListingScreen>
tooltip: 'Actions',
// heroTag: "floatbtn232342",
onPressed: () {
if (provider.offlineEvents.isNotEmpty) {
provider.offlineEvents.forEach(
(element) {
if (element.eventId == widget.event.eventId) {
provider.offlineExists = true;
} else {
provider.offlineExists = false;
}
},
);
}
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
@ -292,6 +361,25 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// 'Actions',
// style: TextStyle(fontSize: 18),
// )),
// ),IntroductionAnimationScreen
// InkWell(
// onTap: () {
// Navigator.push<dynamic>(
// context,
// MaterialPageRoute<dynamic>(
// builder: (BuildContext context) =>
// IntroductionAnimationScreen(),
// ),
// );
// // Navigator.pop(context);
// },
// child: ListTile(
// title: Text("GOTO"),
// leading: Icon(
// Icons.calendar_month,
// color: Colors.green,
// ),
// ),
// ),
InkWell(
onTap: () {
@ -309,11 +397,30 @@ class _EventsListingScreenState extends State<EventsListingScreen>
),
),
InkWell(
onTap: () {
onTap: () async {
if (provider.offlineEvents.isEmpty) {
await provider.saveEventsData(widget.event);
SnackBarWidget.displaySnackBar(
"Event Saved Offline", context);
} else {
if (!provider.offlineExists) {
await provider.saveEventsData(widget.event);
SnackBarWidget.displaySnackBar(
"Event Saved Offline", context);
} else {
await provider.delateOfflineEvent(widget.event);
provider.offlineExists = false;
SnackBarWidget.displaySnackBar(
"Removed from Offline", context);
}
}
Navigator.pop(context);
},
child: ListTile(
title: Text("Download Pdf"),
title: Text(provider.offlineExists
? "Remove the event from offline"
: "Save the event offline"),
leading: Icon(
Icons.download,
color: Colors.blue,
@ -322,8 +429,8 @@ class _EventsListingScreenState extends State<EventsListingScreen>
),
InkWell(
onTap: () {
if (widget.event.isAttending) {
widget.event.isAttending = false;
if (widget.event.eventUserAttendee!) {
widget.event.eventUserAttendee = false;
// if (event.isAttending) {
// SnackBarWidget.displaySnackBar(
@ -428,10 +535,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
ProfileInfoItem(
"Session(s)", provider.eventSessionCount),
ProfileInfoItem(
"Speakers(s)",
// int.parse(
// provider.overviewData!.attendeeCount
0),
"Speaker(s)", provider.speakercount),
//ProfileInfoItem("Note(s)", 1),
], widget.event, provider),
SizedBox(
@ -465,14 +569,14 @@ class _EventsListingScreenState extends State<EventsListingScreen>
//controller: _tabController,
children: [
expandableDetails(),
speakersList(provider),
speakersList(context, provider),
EventsInsights(
eventid: widget.event.eventId!,
kFlutterHashtags: provider.kFlutterHashtags,
specialtyList: provider.specialtyList,
affiliations: provider.affiliations,
),
SocialMedia(),
//SocialMedia(),
],
),
),
@ -861,7 +965,8 @@ class _EventsListingScreenState extends State<EventsListingScreen>
),
InkWell(
onTap: () async {
await _launchUrl(provider.eventdetailList[0].url1!);
print("URL:${event.url1!}");
await _launchUrl(event.url1!);
},
child: RichText(
text: TextSpan(
@ -967,7 +1072,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
}
Widget favbtn(EventsList event, EventsProvider provider) {
return event.isfav
return event.eventUserInterest!
? SizedBox(
height: 40,
child: TextButton(
@ -977,18 +1082,19 @@ class _EventsListingScreenState extends State<EventsListingScreen>
onPressed: () async {
// String msg = await provider
// .addEventsToFavs(event.eventId!);
setState(() {
event.isfav = !event.isfav;
if (event.isfav) {
provider.favsEventsData(event);
SnackBarWidget.displaySnackBar(
"You are following the event!", context);
} else {
provider.delateEventsData(event);
SnackBarWidget.displaySnackBar("Not Following", context);
}
});
event.eventUserInterest = !event.eventUserInterest!;
if (event.eventUserInterest!) {
await provider.addEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar(
"You are following the event!", context);
} else {
// provider.delateOfflineEvent(event);
await provider.removeEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar("Not Following", context);
}
setState(() {});
},
child: AnimatedSwitcher(
duration: Duration(seconds: 1),
@ -1025,18 +1131,19 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// String msg = await provider
// .addEventsToFavs(event.eventId!);
setState(() {
event.isfav = !event.isfav;
event.eventUserInterest = !event.eventUserInterest!;
if (event.isfav) {
provider.favsEventsData(event);
SnackBarWidget.displaySnackBar(
"You are following the event!", context);
} else {
provider.delateEventsData(event);
SnackBarWidget.displaySnackBar("Not Following", context);
}
});
if (event.eventUserInterest!) {
await provider.addEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar(
"You are following the event!", context);
} else {
// provider.delateOfflineEvent(event);
await provider.removeEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar("Not Following", context);
}
setState(() {});
},
label: AnimatedSwitcher(
duration: Duration(seconds: 1),
@ -1058,14 +1165,16 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// ),
Icon(
Icons.favorite,
color: event.isfav ? Colors.red : Colors.grey,
color: event.eventUserInterest!
? Colors.white
: Colors.grey,
size: 14,
),
const SizedBox(
width: 10,
),
Text(
event.isfav ? "Following" : "Follow",
event.eventUserInterest! ? "Following" : "Follow",
style: TextStyle(color: Colors.black),
)
],
@ -1074,7 +1183,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
}
Widget attendingbtn(EventsList event, EventsProvider provider) {
return event.isAttending
return event.eventUserAttendee!
? SizedBox(
height: 40,
child: TextButton(
@ -1082,22 +1191,18 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// : Colors.transparent,
onPressed: () async {
if (!event.isfav) {
event.isfav = !event.isfav;
// String msg1 = await provider
// .addEventsToFavs(event.eventId!);
}
event.eventUserAttendee = !event.eventUserAttendee!;
// String msg = await provider
// .markAttending(event.eventId!);
if (event.eventUserAttendee!) {
await provider.attendNotAttendEvent(event.eventId!, "1");
SnackBarWidget.displaySnackBar("Attending", context);
} else {
await provider.attendNotAttendEvent(event.eventId!, "0");
SnackBarWidget.displaySnackBar("Not Attending", context);
}
setState(() {
event.isAttending = !event.isAttending;
if (event.isAttending) {
SnackBarWidget.displaySnackBar("Attending", context);
} else {
SnackBarWidget.displaySnackBar("Not Attending", context);
}
//
});
},
child: AnimatedSwitcher(
@ -1131,23 +1236,26 @@ class _EventsListingScreenState extends State<EventsListingScreen>
elevation: 1,
backgroundColor: EventsConstants.bgcolor,
onPressed: () async {
if (!event.isfav) {
event.isfav = !event.isfav;
if (!event.eventUserInterest!) {
await provider.addEventsToFavs(event.eventId!);
event.eventUserInterest = !event.eventUserInterest!;
// String msg1 = await provider
// .addEventsToFavs(event.eventId!);
}
// String msg = await provider
// .markAttending(event.eventId!);
setState(() {
event.isAttending = !event.isAttending;
if (event.isAttending) {
SnackBarWidget.displaySnackBar("Attending", context);
} else {
SnackBarWidget.displaySnackBar("Not Attending", context);
}
});
event.eventUserAttendee = !event.eventUserAttendee!;
// String msg = await provider
// .markAttending(event.eventId!);
if (event.eventUserAttendee!) {
await provider.attendNotAttendEvent(event.eventId!, "1");
SnackBarWidget.displaySnackBar("Attending", context);
} else {
await provider.attendNotAttendEvent(event.eventId!, "0");
SnackBarWidget.displaySnackBar("Not Attending", context);
}
setState(() {});
},
//heroTag: "attending545",
label: AnimatedSwitcher(
@ -1162,7 +1270,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
axis: Axis.horizontal,
),
),
child: event.isAttending
child: event.eventUserAttendee!
? Row(
children: [
Padding(
@ -1228,12 +1336,12 @@ class _EventsListingScreenState extends State<EventsListingScreen>
SizedBox(
height: 3,
),
listViewTopicCard(
"Speakers with most sessions", widget.event.topSpeakers!, true),
listViewTopicCard("Speakers with most sessions",
widget.event.topSpeakers ?? "", true),
SizedBox(
height: 3,
),
listViewTopicCard("Sponsors", widget.event.sponsors!, true)
listViewTopicCard("Sponsors", widget.event.sponsors ?? "", true)
]),
),
);
@ -1314,8 +1422,14 @@ class _EventsListingScreenState extends State<EventsListingScreen>
);
}
Widget speakersList(EventsProvider provider) {
void _updateSearchTerm(String searchTerm) {
setState(() => searchSpeaker = searchTerm);
pagingController.refresh();
}
Widget speakersList(BuildContext context, EventsProvider provider) {
var searchtextEditingController;
// pagingController.refresh();
return Container(
width: double.maxFinite,
padding: EdgeInsets.only(left: 8),
@ -1332,15 +1446,15 @@ class _EventsListingScreenState extends State<EventsListingScreen>
// decoration: BoxDecoration(
// // color: Colors.white,
// borderRadius: BorderRadius.circular(5.0)),
child: TextField(
controller: searchtextEditingController,
onChanged: (String txt) async {
if (txt.length >= 2) {
provider.OnSearchSpeakers(txt);
if (txt.length >= 1) {
_updateSearchTerm(txt);
}
if (txt.length < 2) {
await provider
.onSearchSpeakersReset(widget.event.eventId!);
if (txt.length == 0) {
_updateSearchTerm("");
}
},
decoration: InputDecoration(
@ -1374,155 +1488,166 @@ class _EventsListingScreenState extends State<EventsListingScreen>
),
),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.all(8),
itemCount: provider.isSearchSpeakers
? provider.srcheventdetailList.length
: provider.eventdetailList.length,
itemBuilder: (BuildContext context, int index) {
Eventsdetail detail = provider.isSearchSpeakers
? provider.srcheventdetailList[index]
: provider.eventdetailList[index];
return GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => HCPProfileScreen(
eventsdetail: detail,
eventid: widget.event.eventId!,
title: widget.event.name1!,
child: PagedListView<int, SpeakersList>.separated(
pagingController: pagingController,
builderDelegate: PagedChildBuilderDelegate<SpeakersList>(
//padding: const EdgeInsets.all(8),
// itemCount: provider.isSearchSpeakers
// ? provider.srcheventdetailList.length
// : provider.eventdetailList.length,
itemBuilder: (BuildContext context, detail, int index) {
// Eventsdetail detail = provider.isSearchSpeakers
// ? provider.srcheventdetailList[index]
// : provider.eventdetailList[index];
return GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => HCPProfileScreen(
eventsdetail: detail,
eventid: widget.event.eventId!,
title: widget.event.name1!,
),
),
),
);
},
child: Container(
// height: double.infinity,
child: Column(
children: [
Row(
children: [
Center(
child: CircleAvatar(
radius: 24,
backgroundColor: Colors.grey,
// child: Icon(
// Icons.person,
// size: 18,
// color: Colors.white,
// ),
child: Text(
detail.kolFullName![0],
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white),
);
},
child: Container(
// height: double.infinity,
child: Column(
children: [
Row(
children: [
Center(
child: CircleAvatar(
radius: 24,
backgroundColor: Colors.grey,
// child: Icon(
// Icons.person,
// size: 18,
// color: Colors.white,
// ),
child: Text(
detail.hcpFullName![0],
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
),
),
// Container(
// width: 45,
// height: 45,
// decoration: const BoxDecoration(
// color: Colors.black,
// shape: BoxShape.circle,
// image: DecorationImage(
// fit: BoxFit.cover,
// image: NetworkImage(
// 'https://cardio-staging.konectar.io/images/kol_images/resized/1093755944.jpeg')),
// // 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80')),
// ),
// ),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
detail.kolFullName!,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
maxLines: 2,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
SizedBox(
width: isTablet
? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.5,
child: Text(
detail.eventTopics ??
'Programmed Cell Death 1 Receptor | Human Epidermal Growth Factor Receptor 2 +6more',
maxLines: 3,
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
// Container(
// width: 45,
// height: 45,
// decoration: const BoxDecoration(
// color: Colors.black,
// shape: BoxShape.circle,
// image: DecorationImage(
// fit: BoxFit.cover,
// image: NetworkImage(
// 'https://cardio-staging.konectar.io/images/kol_images/resized/1093755944.jpeg')),
// // 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80')),
// ),
// ),
SizedBox(
width: 20,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"$index : ${detail.hcpFullName!}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
maxLines: 2,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
SizedBox(
width: isTablet
? MediaQuery.of(context).size.width *
0.25
: MediaQuery.of(context).size.width *
0.5,
child: Text(
detail.topics!.join(" | "),
maxLines: 3,
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
color: Colors.black,
color: Colors.black,
//fontStyle: FontStyle.italic,
fontSize: 14),
),
//fontStyle: FontStyle.italic,
fontSize: 14),
),
),
],
),
],
),
// const Spacer(),
// SizedBox(
// height: 30,
// child: OutlinedButton(
// onPressed: () {},
// child: Icon(
// Icons.add,
// size: 24,
// color: Colors.white,
// ),
// style: OutlinedButton.styleFrom(
// shape: CircleBorder(),
// backgroundColor: Constants.bgcolor,
// ),
// ),
// ),
],
),
// SEE ALL BUTTON CODE..
// index == provider.eventdetailList.length - 1
// ? Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// height: 30,
// child: OutlinedButton(
// onPressed: () {
// setState(() {
// itemcount = 15;
// });
// // Navigator.of(context).push(
// // MaterialPageRoute(
// // builder: (context) => HcpListScreen(),
// // ),
// // );
// },
// child: Text(
// 'See All',
// style: TextStyle(
// // fontFamily: "SourceSerif",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.normal),
// ),
// style: OutlinedButton.styleFrom(
// shape: StadiumBorder(),
// ),
// ),
// ),
// )
// : SizedBox.shrink()
],
)),
);
},
),
// const Spacer(),
// SizedBox(
// height: 30,
// child: OutlinedButton(
// onPressed: () {},
// child: Icon(
// Icons.add,
// size: 24,
// color: Colors.white,
// ),
// style: OutlinedButton.styleFrom(
// shape: CircleBorder(),
// backgroundColor: Constants.bgcolor,
// ),
// ),
// ),
],
),
// SEE ALL BUTTON CODE..
// index == provider.eventdetailList.length - 1
// ? Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// height: 30,
// child: OutlinedButton(
// onPressed: () {
// setState(() {
// itemcount = 15;
// });
// // Navigator.of(context).push(
// // MaterialPageRoute(
// // builder: (context) => HcpListScreen(),
// // ),
// // );
// },
// child: Text(
// 'See All',
// style: TextStyle(
// // fontFamily: "SourceSerif",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.normal),
// ),
// style: OutlinedButton.styleFrom(
// shape: StadiumBorder(),
// ),
// ),
// ),
// )
// : SizedBox.shrink()
],
)),
);
},
),
separatorBuilder: (BuildContext context, int index) {
return Divider();
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 14.0),
child: Divider(),
);
},
),
),
@ -1562,7 +1687,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
item.value.toString(),
item.value.toString() == 0 ? "..." : item.value.toString(),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
@ -1642,7 +1767,7 @@ const _tabs = [
Tab(text: "Details"),
Tab(text: "Speakers"),
Tab(text: "Insights"),
Tab(text: "Social Media"),
//Tab(text: "Social Media"),
];
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
@ -1666,3 +1791,27 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
return true;
}
}
class ContestTabHeader extends SliverPersistentHeaderDelegate {
ContestTabHeader(
this.searchUI,
);
final TabBar searchUI;
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(color: Colors.white, child: searchUI);
}
@override
double get maxExtent => 52.0;
@override
double get minExtent => 52.0;
@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
return true;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/view/eventdetailstab.dart';
import 'package:konectar_events/view/eventsdetails.dart';
import 'package:konectar_events/view/eventslist.dart';
import 'package:konectar_events/view/insights.dart';
import 'package:konectar_events/view/socialmedia.dart';
import 'package:konectar_events/widgets/autocompletetags_widget.dart';
import 'package:konectar_events/widgets/customactionsheet.dart';
import 'package:konectar_events/widgets/gridview.dart';
import 'package:konectar_events/widgets/word_cloud.dart';
import 'package:word_cloud/word_cloud_data.dart';
import 'package:word_cloud/word_cloud_shape.dart';
import 'package:word_cloud/word_cloud_tap.dart';
import 'package:word_cloud/word_cloud_tap_view.dart';
import 'package:word_cloud/word_cloud_view.dart';
import 'package:flutter/material.dart';
import 'package:add_2_calendar/add_2_calendar.dart';
class EventsTab extends StatefulWidget {

View File

@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/widgets/customappbar.dart';
import 'package:konectar_events/widgets/customeventsappbar.dart';
class HcpListScreen extends StatefulWidget {
const HcpListScreen({super.key});

226
lib/view/helpdesk.dart Normal file
View File

@ -0,0 +1,226 @@
import 'dart:convert';
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/widgets/customappbar.dart';
import 'package:konectar_events/widgets/customtextfield.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:path/path.dart' as p;
class HelpDeskScreen extends StatefulWidget {
const HelpDeskScreen({super.key});
@override
State<HelpDeskScreen> createState() => _HelpDeskScreenState();
}
class _HelpDeskScreenState extends State<HelpDeskScreen> {
TextEditingController subjectTextController = TextEditingController(text: "");
TextEditingController TextController = TextEditingController(text: "");
String? _selectedValue;
final List<String> type = [
"Question",
"Software Issue",
"Content Issue",
"Training Request",
"Callback Request",
"Feature Request",
];
Widget dropDown({
Widget? underline,
Widget? icon,
TextStyle? style,
TextStyle? hintStyle,
Color? dropdownColor,
}) =>
DropdownButton<String>(
value: _selectedValue,
underline: underline,
icon: Align(alignment: Alignment.centerRight, child: icon),
dropdownColor: dropdownColor,
isExpanded: true,
style: TextStyle(
//fontFamily: "SourceSerif",
color: Colors.black,
fontSize: 14.0,
),
// iconEnabledColor: iconEnabledColor,
onChanged: (String? newValue) {
setState(() {
_selectedValue = newValue;
});
},
hint: Text("Select Type", style: hintStyle),
items: type
.map((session) => DropdownMenuItem<String>(
value: session, child: Text(session)))
.toList());
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
"Help Desk",
style: TextStyle(color: Colors.white),
),
automaticallyImplyLeading: false,
backgroundColor: EventsConstants.blueColor,
centerTitle: true,
),
body: Container(
height: MediaQuery.of(context).size.height / 2,
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
CustomTextField(
labelText: "Subject*", controller: subjectTextController),
SizedBox(
height: 30,
),
Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8.0)),
child: dropDown(underline: Container())),
SizedBox(
height: 30,
),
TextFormField(
validator: (value) {
// add email validation
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
// bool emailValid = RegExp(
// r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
// .hasMatch(value);
// if (!emailValid) {
// return 'Please enter a valid email';
// }
return null;
},
maxLines: 3,
decoration: const InputDecoration(
labelText: 'Description',
hintText: 'Description',
border: OutlineInputBorder(),
),
),
SizedBox(
height: 10,
),
Row(
children: [
Text("Attach a file :"),
SizedBox(
width: 10,
),
CustomButton(
backgroundColor: const Color.fromARGB(255, 233, 229, 229),
onPressed: () async {
// sectionItem.selectedValue = [];
// sectionItem.extension = [];
// sectionItem.fileName = [];
await getEncodedFile();
setState(() {});
},
width: 120,
height: 40,
fontsize: 12,
textColor: Colors.black,
title: "Choose file"),
],
),
SizedBox(
height: 30,
),
Center(
child: CustomButton(
backgroundColor: EventsConstants.blueColor,
onPressed: () => (),
title: "Submit",
textColor: Colors.white,
),
)
],
),
),
);
}
Future<void> getEncodedFile() async {
String base64Image = '';
var status = Platform.isAndroid
? await Permission.manageExternalStorage.status
: await Permission.storage.status;
if (status.isGranted) {
FilePickerResult? result =
await FilePicker.platform.pickFiles(allowMultiple: true);
if (result != null) {
print(result.files.first.path);
print(result.files.last.path);
for (var files in result.files) {
File file = File(files.path!);
print("check file path : ${file.path}");
var fileName = file.path.split('/').last;
// Get the application folder directory
Directory? directory = Platform.isAndroid
? await getExternalStorageDirectory() //FOR ANDROID
: await getApplicationDocumentsDirectory();
String newPath = ""; //FOR ios
String convertedDirectoryPath = (directory?.path).toString();
print("see the converted directory path $convertedDirectoryPath");
newPath = "$convertedDirectoryPath/konectar/files";
print("new path :$newPath");
directory = Directory(newPath);
if (!await directory.exists()) {
await directory.create(recursive: true);
}
File newFile = await file.copy('${directory.path}/$fileName');
print("new path is ${newFile.path}");
final extension = p.extension(newFile.path);
List<int> imageBytes = await newFile.readAsBytes();
Uint8List imageUint8List = Uint8List.fromList(imageBytes);
base64Image = base64Encode(imageUint8List);
// sectionItem.selectedValue!.add(base64Image);
// sectionItem.extension!.add(extension);
// sectionItem.fileName!.add(fileName);
}
}
} else {
print("not permitted");
await requestPermission(Platform.isAndroid
? Permission.manageExternalStorage
: Permission.storage);
}
}
Future<void> requestPermission(Permission permission) async {
final status = await permission.request();
setState(() {
print(status);
// _permissionStatus = status;
// print(_permissionStatus);
});
}
}

View File

@ -1,11 +1,21 @@
import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.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/neweventsmodel.dart';
import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/view/eventslist.dart';
import 'package:konectar_events/view/eventstab.dart';
@ -43,16 +53,30 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
List<int> selectedIndex = [];
bool selectedFav = false;
bool isExtended = false;
String search = "";
final ScrollController _scrollController = ScrollController();
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
AnimationController? animationController;
bool _isSearch = false;
List<String> therapeuticList = [];
static const _pageSize = 20;
String filter_startdate = "";
String filter_enddate = "";
final PagingController<int, EventsList> pagingController =
PagingController(firstPageKey: 0);
List<ConnectivityResult> connectionStatus = [ConnectivityResult.none];
final Connectivity _connectivity = Connectivity();
get developer => null;
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
@override
void dispose() {
animationController?.dispose();
pagingController.dispose();
super.dispose();
}
@ -61,18 +85,95 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
animationController = AnimationController(
duration: const Duration(milliseconds: 1000), vsync: this);
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
initConnectivity();
_connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
init();
});
pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
super.initState();
}
Future<void> initConnectivity() async {
late List<ConnectivityResult> result;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
result = await _connectivity.checkConnectivity();
} on PlatformException catch (e) {
developer.log('Couldn\'t check connectivity status', error: e);
return;
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) {
return Future.value(null);
}
return _updateConnectionStatus(result);
}
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
setState(() {
connectionStatus = result;
});
// ignore: avoid_print
print('Connectivity changed: $connectionStatus');
}
Future<void> _fetchPage(int pageKey) async {
print("DATE SELECTED :$filter_enddate,$filter_startdate");
await initConnectivity();
if (connectionStatus.toString().contains("ConnectivityResult.none")) {
try {
final newItems =
await Provider.of<EventsProvider>(context, listen: false)
.getOfflineMyEvents();
final isLastPage = newItems.length < _pageSize;
if (isLastPage) {
pagingController.appendLastPage(newItems);
} else {
final nextPageKey = pageKey + newItems.length;
pagingController.appendPage(newItems, nextPageKey);
}
} catch (error) {
pagingController.error = error;
}
} else {
try {
final newItems =
await Provider.of<EventsProvider>(context, listen: false).getEvents(
pageKey,
searchtxt: search,
startdate: filter_startdate,
enddate: filter_enddate);
// final newItems =
// await Provider.of<EventsProvider>(context, listen: false)
// .getOfflineMyEvents();
final isLastPage = newItems.length < _pageSize;
if (isLastPage) {
pagingController.appendLastPage(newItems);
} else {
final nextPageKey = pageKey + newItems.length;
pagingController.appendPage(newItems, nextPageKey);
}
} catch (error) {
pagingController.error = error;
}
}
}
init() async {
await Provider.of<EventsProvider>(context, listen: false).initFiltersData();
await Provider.of<EventsProvider>(context, listen: false).getEvents();
// await Provider.of<EventsProvider>(context, listen: false).getMyEvents(0);
await Provider.of<EventsProvider>(context, listen: false)
.getAddedSessionNotes();
//await ApiCall().dummyapi();
setState(() {});
}
@ -228,12 +329,31 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
borderRadius: BorderRadius.circular(5.0)),
child: TextField(
controller: searchtextEditingController,
onEditingComplete: () {
String txt = searchtextEditingController.text;
if (txt.length >= 2) {
search = txt;
provider.isSearch = true;
pagingController.refresh();
// await provider.OnSearch(txt);
}
if (txt.length == 0) {
provider.isSearch = false;
pagingController.refresh();
}
},
onChanged: (String txt) async {
if (txt.length >= 2) {
provider.OnSearch(txt);
search = txt;
provider.isSearch = true;
pagingController.refresh();
// await provider.OnSearch(txt);
}
if (txt.length < 2) {
await provider.onSearchReset();
if (txt.length == 0) {
provider.isSearch = false;
search = txt;
pagingController.refresh();
}
},
decoration: InputDecoration(
@ -268,6 +388,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
_isSearch = !_isSearch;
if (!_isSearch) {
searchtextEditingController.clear();
search = "";
pagingController.refresh();
}
});
},
@ -277,58 +399,58 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
))
],
),
body: Stack(
children: <Widget>[
InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: NestedScrollView(
controller: _scrollController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// color: Constants.blueColor,
// child: Column(
// children: [
// // CustomAppBar(
// // title: "Events",
// // backgroundcolor:
// // Color.fromARGB(255, 0, 71, 132),
// // ),
// // getSearchBarUI(provider),
// ],
// ),
// );
// }, childCount: 1),
// ),
SliverPersistentHeader(
pinned: true,
floating: true,
delegate: ContestTabHeader(
getFilterBarUI(provider),
),
body: Stack(children: <Widget>[
InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: NestedScrollView(
controller: _scrollController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// color: Constants.blueColor,
// child: Column(
// children: [
// // CustomAppBar(
// // title: "Events",
// // backgroundcolor:
// // Color.fromARGB(255, 0, 71, 132),
// // ),
// // getSearchBarUI(provider),
// ],
// ),
// );
// }, childCount: 1),
// ),
SliverPersistentHeader(
pinned: true,
floating: true,
delegate: ContestTabHeader(
getFilterBarUI(provider),
),
];
},
body: Container(
color: EventsConstants.bgcolor,
child: buildListView(context, provider)),
),
),
];
},
body: Container(
color: EventsConstants.bgcolor,
child: buildPaginationListView(context, provider)),
),
],
),
),
]),
),
// ),
);
// ),
// );
}
Widget getFilterBarUI(EventsProvider provider) {
@ -422,12 +544,24 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: CupertinoSwitch(
activeColor: Color.fromARGB(255, 0, 71, 132),
value: provider.isFavSeleted,
onChanged: (value) async {
onChanged: (value) {
provider.isFavSeleted = value;
if (provider.isFavSeleted) {
await provider.onSelectMy();
pagingController.refresh();
//_pagingController.
// _pagingController
// .addPageRequestListener((pageKey) {
// await _fetchPage(0);
// });
} else {
await provider.onSelectAll();
provider.isFavSeleted = false;
provider.isAllSelected = !provider.isAllSelected;
pagingController.refresh();
// _pagingController
// .addPageRequestListener((pageKey) {
// await _fetchPage(0);
// });
}
setState(() {});
},
@ -551,10 +685,15 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: TextField(
onChanged: (String txt) async {
if (txt.length >= 3) {
provider.OnSearch(txt);
search = txt;
provider.isSearch = true;
pagingController.refresh();
// await provider.OnSearch(txt);
}
if (txt.length <= 3) {
await provider.onSearchReset();
provider.isSearch = false;
pagingController.refresh();
//await provider.onSearchReset();
}
},
style: const TextStyle(
@ -591,10 +730,17 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
),
onTap: () async {
FocusScope.of(context).requestFocus(FocusNode());
if (searchtextEditingController.text.length >= 3)
provider.OnSearch(searchtextEditingController.text);
else
await provider.onSearchReset();
if (searchtextEditingController.text.length >= 3) {
search = searchtextEditingController.text;
provider.isSearch = true;
pagingController.refresh();
// await provider.OnSearch(searchtextEditingController.text);
} else {
//search = searchtextEditingController.text;
provider.isSearch = false;
pagingController.refresh();
}
// await provider.onSearchReset();
},
child: Padding(
padding: const EdgeInsets.all(16.0),
@ -769,7 +915,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
// DrawerHeader(
// child: Center(
@ -779,7 +925,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
// ),
// ),
Container(
//color: Colors.transparent,
color: EventsConstants.bgcolor,
padding: EdgeInsets.only(top: 20, left: 5.0),
),
@ -805,37 +951,29 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
style: TextStyle(fontSize: 20),
),
const Spacer(),
Align(
alignment: Alignment.topRight,
child: Container(
height: 30,
child: OutlinedButton(
onPressed: () {
print("&&&");
print(provider.selectedTherapeutic);
if (provider.selectedTherapeutic.isNotEmpty) {
provider.OnFilters();
}
// Align(
// alignment: Alignment.topRight,
// child: Container(
// height: 30,
// child: OutlinedButton(
// onPressed: () {
setState(() {
Navigator.pop(context);
});
},
child: Text(
'Apply',
style: TextStyle(
// fontFamily: "SourceSerif",
fontSize: 14,
color: Colors.white,
fontWeight: FontWeight.normal),
),
style: OutlinedButton.styleFrom(
shape: StadiumBorder(),
backgroundColor: Colors.green,
),
),
),
),
// },
// child: Text(
// 'Apply',
// style: TextStyle(
// // fontFamily: "SourceSerif",
// fontSize: 14,
// color: Colors.white,
// fontWeight: FontWeight.normal),
// ),
// style: OutlinedButton.styleFrom(
// shape: StadiumBorder(),
// backgroundColor: Colors.green,
// ),
// ),
// ),
// ),
SizedBox(
width: 8.0,
),
@ -994,22 +1132,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
],
),
// Center(
// child: SizedBox(
// width: 200,
// height: 40,
// child: ListTile(
// title: Container(
// color: Colors.blue,
// child: Center(
// child: Text(
// 'Apply',
// style: TextStyle(color: Colors.white),
// ))),
// onTap: () {},
// ),
// ),
// ),
Divider(
height: 1,
color: Colors.black,
@ -1044,72 +1166,68 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
),
],
),
// Row(
// children: [
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('City'),
// subtitle: customAutoCompletedropdown(
// ["Chicago", "Seattle", "San Deigo"]),
// onTap: () {},
// ),
// ),
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('State'),
// subtitle: customAutoCompletedropdown(
// ["California", "Illinois", "New York"]),
// onTap: () {},
// ),
// ),
// ],
// ),
// Row(
// children: [
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('Country'),
// subtitle: customAutoCompletedropdown([
// "Netherlands",
// "Switzerland",
// "United States"
// ]),
// onTap: () {},
// ),
// ),
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('Number of Attendees'),
// subtitle: buildTextFieldWidget(),
// onTap: () {},
// ),
// ),
// ],
// ),
// Row(
// children: [
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('Client Attendees'),
// subtitle: buildTextFieldWidget(),
// onTap: () {},
// ),
// ),
// SizedBox(
// width: (MediaQuery.of(context).size.width * 0.99) / 2,
// child: ListTile(
// title: Text('New Attendees'),
// subtitle: buildTextFieldWidget(),
// onTap: () {},
// ),
// ),
// ],
// ),
],
),
SizedBox(
height: 20,
),
Column(
children: [
Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
width: 200,
height: 50,
child: FloatingActionButton.extended(
backgroundColor: Colors.green,
onPressed: () {
print("&&&");
print(provider.selectedTherapeutic);
if (provider.selectedTherapeutic.isNotEmpty) {
provider.OnFilters();
}
pagingController.refresh();
setState(() {
Navigator.pop(context);
});
},
elevation: 0,
label: const Text("Apply Filters",
style: TextStyle(
color: Colors.white,
)),
),
),
),
SizedBox(
height: 10,
),
Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
width: 200,
height: 50,
child: FloatingActionButton.extended(
backgroundColor: Colors.blue,
onPressed: () {
startDatetextEditingController.clear();
endDatetextEditingController.clear();
filter_enddate = "";
filter_startdate = "";
setState(() {});
pagingController.refresh();
Navigator.pop(context);
},
elevation: 0,
label: const Text("Clear Filters",
style: TextStyle(
color: Colors.white,
)),
),
),
),
],
),
],
@ -1122,21 +1240,24 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
Widget buildDateWidget(TextEditingController controller, String hint) {
return SizedBox(
width: isTablet ? 200 : MediaQuery.of(context).size.width,
//width: isTablet ? 200 : MediaQuery.of(context).size.width,
height: isTablet ? 50 : 40,
child: TextField(
controller: controller,
//editing controller of this TextField
decoration: InputDecoration(
// border: OutlineInputBorder(),
border: OutlineInputBorder(),
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// labelStyle: const TextStyle(fontSize: 16),
suffixIcon: const Icon(Icons.calendar_today), //icon of text field
suffixIcon: const Icon(
Icons.calendar_today,
size: 16,
), //icon of text field
// labelText: "Enter Date" //label text of field
hintText: hint,
// hintText: hint,
),
readOnly: true, //set it true, so that user will not able to edit text
@ -1145,8 +1266,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
context: context,
anchorPoint: Offset(20.0, 30.0),
initialDate: DateTime.now(),
firstDate: DateTime(
2000), //DateTime.now() - not to allow to choose before today.
firstDate: DateTime
.now(), //DateTime.now() - not to allow to choose before today.
lastDate: DateTime(2101));
if (pickedDate != null) {
@ -1156,9 +1277,14 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
print(
formattedDate); //formatted date output using intl package => 2021-03-16
//you can implement different kind of Date Format here according to your requirement
if (hint == "Start Date") {
filter_startdate = formattedDate;
} else {
filter_enddate = formattedDate;
}
setState(() {
// output date to TextField value.
controller.text = formattedDate;
});
} else {
@ -1316,6 +1442,35 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
);
}
Set<int> selectedIndexes = {};
Widget buildPaginationListView(
BuildContext context, EventsProvider provider) {
return RefreshIndicator(
onRefresh: () async => pagingController.refresh(),
child: PagedListView<int, EventsList>(
pagingController: pagingController,
builderDelegate: PagedChildBuilderDelegate<EventsList>(
itemBuilder: (BuildContext context, item, int index) {
final int count = provider.eventList.length > 10
? 10
: provider.eventList.length;
final Animation<double> animation =
Tween<double>(begin: 0.0, end: 1.0).animate(CurvedAnimation(
parent: animationController!,
curve: Interval((1 / count) * index, 1.0,
curve: Curves.fastOutSlowIn)));
animationController?.forward();
return _buildlistCard(
animation: animation,
animationController: animationController!,
provider: provider,
eventsList: provider.isSearch ? item : item,
);
},
)),
);
}
Widget _buildlistCard(
{required Animation<double>? animation,
required AnimationController? animationController,
@ -1421,8 +1576,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
);
}
buildCardView(
BuildContext context, EventsList event, EventsProvider provider) {
buildCardView(BuildContext context, dynamic event, EventsProvider provider) {
double height = isTablet
? MediaQuery.of(context).size.height * 0.35
: MediaQuery.of(context).size.height * 0.65;
@ -1458,20 +1612,34 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
children: [
Align(
alignment: FractionalOffset.topLeft,
child: Text(
event.name1 ?? "",
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: isTablet ? 22 : 16,
// fontFamily: "SourceSerif",
child: RichText(
text: TextSpan(children: [
// WidgetSpan(
// child: Icon(Icons.bookmark,
// color: EventsConstants.blueColor,
// size: isTablet ? 14 : 18)
// // provider.ifOfflineExists(event.eventId!)
// // ? Icon(Icons.bookmark,
// // color: EventsConstants.blueColor,
// // size: isTablet ? 14 : 18)
// // : SizedBox.shrink(),
// ),
TextSpan(
text: event.name1 ?? "",
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: isTablet ? 22 : 16,
// fontFamily: "SourceSerif",
),
// maxLines: isTablet ? 4 : 4,
// softWrap: true,
// overflow: TextOverflow.ellipsis,
),
maxLines: isTablet ? 4 : 4,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
])),
),
SizedBox(
@ -1496,11 +1664,12 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: Icon(Icons.calendar_month, size: 16),
),
TextSpan(
text: ' ${event.start} to ${event.end}',
text:
' ${CustomDateFormatter().formatYearDate(CustomDateFormatter().convertStringToDate(event.start))} to ${CustomDateFormatter().formatYearDate(CustomDateFormatter().convertStringToDate(event.end))}',
style: TextStyle(
color: Colors.black,
//fontStyle: FontStyle.italic,
fontSize: isTablet ? 20 : 14),
fontSize: isTablet ? 20 : 12),
),
],
),
@ -1521,7 +1690,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
style: TextStyle(
color: Colors.black,
//fontStyle: FontStyle.italic,
fontSize: isTablet ? 20 : 14),
fontSize: isTablet ? 20 : 12),
),
],
),
@ -1531,101 +1701,115 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
Align(
alignment: FractionalOffset.bottomRight,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Row(
children: [
SizedBox(
width: 40,
height: 30,
child: FloatingActionButton.extended(
elevation: 1,
shape: CircleBorder(),
backgroundColor: EventsConstants.bgcolor,
onPressed: () async {
// String msg = await provider
// .addEventsToFavs(event.eventId!);
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
provider.ifOfflineExists(event.eventId!)
? Padding(
padding: EdgeInsets.only(right: 10),
child: Icon(Icons.bookmark,
color: EventsConstants.blueColor,
size: isTablet ? 14 : 18),
)
: SizedBox.shrink(),
SizedBox(
width: 40,
height: 30,
child: FloatingActionButton.extended(
elevation: 1,
shape: CircleBorder(),
backgroundColor: EventsConstants.bgcolor,
onPressed: () async {
// event.isfav = !event.isfav;
setState(() {
event.isfav = !event.isfav;
if (event.isfav) {
SnackBarWidget.displaySnackBar(
"Added to favorites!", context);
} else {
SnackBarWidget.displaySnackBar(
"Removed from favorites!", context);
}
});
if (event.isfav) {
await provider.favsEventsData(event);
} else {
await provider.delateEventsData(event);
}
},
label: AnimatedSwitcher(
duration: Duration(seconds: 1),
transitionBuilder: (Widget child,
Animation<double> animation) =>
FadeTransition(
opacity: animation,
child: SizeTransition(
child: child,
sizeFactor: animation,
axis: Axis.horizontal,
),
),
child: event.isfav
? Column(
children: [
Icon(
Icons.favorite,
color: Colors.red,
size: 14,
if (event.isfav) {
//If event is added to fav then unfollow
String msg = await provider
.removeEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar(
"Removed from My Events!", context);
} else {
String msg = await provider
.addEventsToFavs(event.eventId!);
SnackBarWidget.displaySnackBar(
"Added to My Events", context);
}
pagingController.refresh();
setState(() {});
// if (event.isfav) {
// // await provider.favsEventsData(event);
// } else {
// // await provider.delateEventsData(event);
// }
},
label: AnimatedSwitcher(
duration: Duration(seconds: 1),
transitionBuilder: (Widget child,
Animation<double> animation) =>
FadeTransition(
opacity: animation,
child: SizeTransition(
child: child,
sizeFactor: animation,
axis: Axis.horizontal,
),
],
)
: Icon(
Icons.favorite,
color: Colors.grey,
size: 14,
))),
),
SizedBox(
height: 2,
),
event.isfav
? RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(Icons.check,
color: Colors.grey[600],
size: isTablet ? 14 : 12),
),
child: event.eventUserInterest!
? Column(
children: [
Icon(
Icons.favorite,
color: Colors.red,
size: 14,
),
],
)
: Icon(
Icons.favorite,
color: Colors.grey,
size: 14,
))),
),
SizedBox(
height: 2,
),
event.eventUserInterest
? RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(Icons.check,
color: Colors.grey[600],
size: isTablet ? 14 : 10),
),
TextSpan(
text: ' Following',
style: TextStyle(
color: Colors.grey[600],
fontSize: isTablet ? 14 : 10),
),
],
),
TextSpan(
text: ' following',
style: TextStyle(
color: Colors.grey[600],
fontSize: isTablet ? 14 : 12),
),
],
),
)
: Center(
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: 'follow ',
style: TextStyle(
color: Colors.grey[600],
fontSize: isTablet ? 14 : 12),
)
: Center(
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: 'Follow ',
style: TextStyle(
color: Colors.grey[600],
fontSize: isTablet ? 14 : 10),
),
],
),
],
),
),
),
),
],
),
],
),
),

1890
lib/view/homeoffline.dart Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,23 @@
import 'dart:math';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_scatter/flutter_scatter.dart';
import 'package:konectar_events/model/affiliationsmodel.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/specialtymodel.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/viewmodel/eventsprovider.dart';
import 'package:konectar_events/viewmodel/hcpprofprovider.dart';
import 'package:konectar_events/widgets/chartline.dart';
import 'package:konectar_events/widgets/customappbar.dart';
import 'package:konectar_events/widgets/customeventsappbar.dart';
import 'package:konectar_events/widgets/flutter_hashtags.dart';
import 'package:konectar_events/widgets/piechart.dart';
import 'package:konectar_events/widgets/word_cloud.dart';
import 'package:provider/provider.dart';
import 'package:word_cloud/word_cloud_data.dart';
import 'package:word_cloud/word_cloud_view.dart';
class EventsInsights extends StatefulWidget {
//EventsList eventsdetail;
String eventid;
List<FlutterHashtag> kFlutterHashtags = [];
List<Specialty> specialtyList = [];
Affiliations affiliations;
List<Affiliations> affiliations;
EventsInsights(
{super.key,
required this.eventid,
@ -67,10 +56,14 @@ class _EventsInsightsState extends State<EventsInsights> {
final screenSize = MediaQuery.of(context).size;
final ratio = screenSize.width / (screenSize.height / 2);
List<int> affCountList = [];
for (var obj in widget.affiliations.affiliationCount) {
affCountList.add(int.parse(obj));
int maximum = 0;
if (widget.affiliations.isNotEmpty) {
for (var obj in widget.affiliations) {
affCountList.add(int.parse(obj.orgCount!));
}
maximum = affCountList.reduce(max);
}
int maximum = affCountList.reduce(max);
return Consumer<HcpProfileProvider>(
builder: (BuildContext context, provider, Widget? child) {
List<Widget> widgets = <Widget>[];
@ -121,28 +114,31 @@ class _EventsInsightsState extends State<EventsInsights> {
// height: 20,
// ),
labelWidget("Topics Discussed"),
Card(
surfaceTintColor: Colors.white,
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.all(2.0),
height: screenSize.height / 2,
width: screenSize.width,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20))),
child: Center(
child: FittedBox(
child: Scatter(
fillGaps: true,
delegate:
ArchimedeanSpiralScatterDelegate(ratio: ratio),
children: widgets,
widgets.isNotEmpty
? Card(
surfaceTintColor: Colors.white,
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.all(2.0),
height: screenSize.height / 2,
width: screenSize.width,
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(20))),
child: Center(
child: FittedBox(
child: Scatter(
fillGaps: true,
delegate: ArchimedeanSpiralScatterDelegate(
ratio: ratio),
children: widgets,
),
),
),
),
),
),
),
),
)
: SizedBox.shrink(),
SizedBox(
height: 20,
),
@ -177,37 +173,38 @@ class _EventsInsightsState extends State<EventsInsights> {
height: 20,
),
labelWidget("Speaker counts by providers"),
Card(
surfaceTintColor: Colors.white,
child: Container(
padding: EdgeInsets.all(12.0),
// margin: EdgeInsets.all(10.0),
// height: screenSize.height / 3,
width: screenSize.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20)),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(
widget.affiliations.affiliationCount.length,
(index) {
return ChartLine(
title:
widget.affiliations.affiliationNames[index],
number: int.parse(
widget.affiliations.affiliationCount[index]),
rate: int.parse(widget.affiliations
.affiliationCount[index]) ==
maximum
? 1
: int.parse(widget.affiliations
.affiliationCount[index]) /
maximum);
}),
)),
),
widget.affiliations.isNotEmpty
? Card(
surfaceTintColor: Colors.white,
child: Container(
padding: EdgeInsets.all(12.0),
// margin: EdgeInsets.all(10.0),
// height: screenSize.height / 3,
width: screenSize.width,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20)),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(
widget.affiliations.length, (index) {
return ChartLine(
title: widget.affiliations[index].orgName!,
number: int.parse(
widget.affiliations[index].orgCount!),
rate: int.parse(widget.affiliations[index]
.orgCount!) ==
maximum
? 1
: int.parse(widget.affiliations[index]
.orgCount!) /
maximum);
}),
)),
)
: SizedBox.shrink(),
SizedBox(
height: 20,
),

View File

@ -381,7 +381,7 @@ class _LoginScreenState extends State<LoginScreen> {
return isloggedout;
});
});
await SessionManager().setLoggedIn(isloggedin);
// await SessionManager().setLoggedIn(isloggedin);
// UserData userData =
// UserData(email: email, name: token, domainUrl: domain, secretkey: key);
// await provider.saveUserData(userData);

View File

@ -0,0 +1,120 @@
import 'package:flutter/material.dart';
class CareView extends StatelessWidget {
final AnimationController animationController;
const CareView({Key? key, required this.animationController})
: super(key: key);
@override
Widget build(BuildContext context) {
final _firstHalfAnimation =
Tween<Offset>(begin: Offset(1, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
));
final _secondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-1, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
final _relaxFirstHalfAnimation =
Tween<Offset>(begin: Offset(2, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
));
final _relaxSecondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-2, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
final _imageFirstHalfAnimation =
Tween<Offset>(begin: Offset(4, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
));
final _imageSecondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-4, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
return SlideTransition(
position: _firstHalfAnimation,
child: SlideTransition(
position: _secondHalfAnimation,
child: Padding(
padding: const EdgeInsets.only(bottom: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SlideTransition(
position: _relaxFirstHalfAnimation,
child: SlideTransition(
position: _relaxSecondHalfAnimation,
child: Text(
"Track Events Everywhere",
style:
TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold),
),
),
),
Padding(
padding:
EdgeInsets.only(left: 64, right: 64, bottom: 16, top: 16),
child: Text(
"Available on your phone,tablet and laptop",
textAlign: TextAlign.center,
),
),
SlideTransition(
position: _imageFirstHalfAnimation,
child: SlideTransition(
position: _imageSecondHalfAnimation,
child: Container(
constraints: BoxConstraints(maxWidth: 350, maxHeight: 250),
child: Image.asset(
'assets/introduction_animation/events3.jpg',
fit: BoxFit.contain,
),
),
),
),
],
),
),
),
);
}
}

View File

@ -0,0 +1,202 @@
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
class CenterNextButton extends StatelessWidget {
final AnimationController animationController;
final VoidCallback onNextClick;
const CenterNextButton(
{Key? key, required this.animationController, required this.onNextClick})
: super(key: key);
@override
Widget build(BuildContext context) {
final _topMoveAnimation =
Tween<Offset>(begin: Offset(0, 5), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.0,
0.2,
curve: Curves.fastOutSlowIn,
),
));
final _signUpMoveAnimation =
Tween<double>(begin: 0, end: 1.0).animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
final _loginTextMoveAnimation =
Tween<Offset>(begin: Offset(0, 5), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
return Padding(
padding:
EdgeInsets.only(bottom: 16 + MediaQuery.of(context).padding.bottom),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SlideTransition(
position: _topMoveAnimation,
child: AnimatedBuilder(
animation: animationController,
builder: (context, child) => AnimatedOpacity(
opacity: animationController.value >= 0.2 &&
animationController.value <= 0.6
? 1
: 0,
duration: Duration(milliseconds: 480),
child: _pageView(),
),
),
),
SlideTransition(
position: _topMoveAnimation,
child: AnimatedBuilder(
animation: animationController,
builder: (context, child) => Padding(
padding: EdgeInsets.only(
bottom: 38 - (38 * _signUpMoveAnimation.value)),
child: Container(
height: 58,
width: 58 + (200 * _signUpMoveAnimation.value),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8 + 32 * (1 - _signUpMoveAnimation.value)),
color: Color(0xff132137),
),
child: PageTransitionSwitcher(
duration: Duration(milliseconds: 480),
reverse: _signUpMoveAnimation.value < 0.7,
transitionBuilder: (
Widget child,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return SharedAxisTransition(
fillColor: Colors.transparent,
child: child,
animation: animation,
secondaryAnimation: secondaryAnimation,
transitionType: SharedAxisTransitionType.vertical,
);
},
child: _signUpMoveAnimation.value > 0.7
? InkWell(
key: ValueKey('Sign Up button'),
onTap: onNextClick,
child: Padding(
padding: EdgeInsets.only(left: 16.0, right: 16.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'Sign In',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
Icon(Icons.arrow_forward_rounded,
color: Colors.white),
],
),
),
)
: InkWell(
key: ValueKey('next button'),
onTap: onNextClick,
child: Padding(
padding: EdgeInsets.all(16.0),
child: Icon(Icons.arrow_forward_ios_rounded,
color: Colors.white),
),
),
),
),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 8),
child: SlideTransition(
position: _loginTextMoveAnimation,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Already have an account? ',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
fontWeight: FontWeight.normal,
),
),
Text(
'Login',
style: TextStyle(
color: Color(0xff132137),
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
),
);
}
Widget _pageView() {
int _selectedIndex = 0;
if (animationController.value >= 0.7) {
_selectedIndex = 3;
} else if (animationController.value >= 0.5) {
_selectedIndex = 2;
} else if (animationController.value >= 0.3) {
_selectedIndex = 1;
} else if (animationController.value >= 0.1) {
_selectedIndex = 0;
}
return Padding(
padding: const EdgeInsets.only(bottom: 16),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
for (var i = 0; i < 4; i++)
Padding(
padding: const EdgeInsets.all(4),
child: AnimatedContainer(
duration: Duration(milliseconds: 480),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
color: _selectedIndex == i
? Color(0xff132137)
: Color(0xffE3E4E4),
),
width: 10,
height: 10,
),
)
],
),
);
}
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,137 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/view/login.dart';
import 'package:konectar_events/view/login_components/care_view.dart';
import 'package:konectar_events/view/login_components/center_next_button.dart';
import 'package:konectar_events/view/login_components/mood_diary_vew.dart';
import 'package:konectar_events/view/login_components/relax_view.dart';
import 'package:konectar_events/view/login_components/splash_view.dart';
import 'package:konectar_events/view/login_components/top_back_skip_view.dart';
import 'package:konectar_events/view/login_components/welcome_view.dart';
import 'package:konectar_events/view/navigation_home_screen.dart';
class IntroductionAnimationScreen extends StatefulWidget {
const IntroductionAnimationScreen({Key? key}) : super(key: key);
@override
_IntroductionAnimationScreenState createState() =>
_IntroductionAnimationScreenState();
}
class _IntroductionAnimationScreenState
extends State<IntroductionAnimationScreen> with TickerProviderStateMixin {
AnimationController? _animationController;
@override
void initState() {
_animationController =
AnimationController(vsync: this, duration: Duration(seconds: 8));
_animationController?.animateTo(0.2);
super.initState();
}
@override
void dispose() {
_animationController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
print(_animationController?.value);
return Scaffold(
appBar: AppBar(
backgroundColor: EventsConstants.bgcolor,
title: Container(
// constraints: BoxConstraints(maxWidth: 350, maxHeight: 350),
child: Image.asset(
'assets/introduction_animation/introduction_image1.png',
fit: BoxFit.contain,
),
),
centerTitle: true,
),
backgroundColor: EventsConstants.bgcolor,
body: ClipRect(
child: Stack(
children: [
// SplashView(
// animationController: _animationController!,
// ),
CareView(
animationController: _animationController!,
),
RelaxView(
animationController: _animationController!,
),
CareView(
animationController: _animationController!,
),
// MoodDiaryVew(
// animationController: _animationController!,
// ),
WelcomeView(
animationController: _animationController!,
),
TopBackSkipView(
onBackClick: _onBackClick,
onSkipClick: _onSkipClick,
animationController: _animationController!,
),
CenterNextButton(
animationController: _animationController!,
onNextClick: _onNextClick,
),
],
),
),
);
}
void _onSkipClick() {
_animationController?.animateTo(0.8,
duration: Duration(milliseconds: 1200));
}
void _onBackClick() {
// if (_animationController!.value >= 0 &&
// _animationController!.value <= 0.2) {
// _animationController?.animateTo(0.0);
// } else
if (_animationController!.value > 0.2 &&
_animationController!.value <= 0.4) {
_animationController?.animateTo(0.2);
} else if (_animationController!.value > 0.4 &&
_animationController!.value <= 0.6) {
_animationController?.animateTo(0.4);
} else if (_animationController!.value > 0.6 &&
_animationController!.value <= 0.8) {
_animationController?.animateTo(0.6);
} else if (_animationController!.value > 0.8 &&
_animationController!.value <= 1.0) {
_animationController?.animateTo(0.8);
}
}
void _onNextClick() {
if (_animationController!.value >= 0 &&
_animationController!.value <= 0.2) {
_animationController?.animateTo(0.4);
} else if (_animationController!.value > 0.2 &&
_animationController!.value <= 0.4) {
_animationController?.animateTo(0.6);
} else if (_animationController!.value > 0.4 &&
_animationController!.value <= 0.6) {
_animationController?.animateTo(0.8);
} else if (_animationController!.value > 0.6 &&
_animationController!.value <= 0.8) {
_signUpClick();
}
}
void _signUpClick() {
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (context) => NavigationHomeScreen()),
);
}
}

View File

@ -0,0 +1,119 @@
import 'package:flutter/material.dart';
class MoodDiaryVew extends StatelessWidget {
final AnimationController animationController;
const MoodDiaryVew({Key? key, required this.animationController})
: super(key: key);
@override
Widget build(BuildContext context) {
final _firstHalfAnimation =
Tween<Offset>(begin: Offset(1, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
final _secondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-1, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
final _moodFirstHalfAnimation =
Tween<Offset>(begin: Offset(2, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
final _moodSecondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-2, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
final _imageFirstHalfAnimation =
Tween<Offset>(begin: Offset(4, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.4,
0.6,
curve: Curves.fastOutSlowIn,
),
));
final _imageSecondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-4, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
return SlideTransition(
position: _firstHalfAnimation,
child: SlideTransition(
position: _secondHalfAnimation,
child: Padding(
padding: const EdgeInsets.only(bottom: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Mood Dairy",
style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold),
),
SlideTransition(
position: _moodFirstHalfAnimation,
child: SlideTransition(
position: _moodSecondHalfAnimation,
child: Padding(
padding: EdgeInsets.only(
left: 64, right: 64, top: 16, bottom: 16),
child: Text(
"Lorem ipsum dolor sit amet,consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore",
textAlign: TextAlign.center,
),
),
),
),
SlideTransition(
position: _imageFirstHalfAnimation,
child: SlideTransition(
position: _imageSecondHalfAnimation,
child: Container(
constraints: BoxConstraints(maxWidth: 350, maxHeight: 250),
child: Image.asset(
'assets/introduction_animation/mood_dairy_image.png',
fit: BoxFit.contain,
),
),
),
),
],
),
),
),
);
}
}

View File

@ -0,0 +1,120 @@
import 'package:flutter/material.dart';
class RelaxView extends StatelessWidget {
final AnimationController animationController;
const RelaxView({Key? key, required this.animationController})
: super(key: key);
@override
Widget build(BuildContext context) {
final _firstHalfAnimation =
Tween<Offset>(begin: Offset(0, 1), end: Offset(0, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.0,
0.2,
curve: Curves.fastOutSlowIn,
),
),
);
final _secondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-1, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
),
);
final _textAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-2, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
),
);
final _imageAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-4, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.2,
0.4,
curve: Curves.fastOutSlowIn,
),
),
);
final _relaxAnimation =
Tween<Offset>(begin: Offset(0, -2), end: Offset(0, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.0,
0.2,
curve: Curves.fastOutSlowIn,
),
),
);
return SlideTransition(
position: _firstHalfAnimation,
child: SlideTransition(
position: _secondHalfAnimation,
child: Padding(
padding: const EdgeInsets.only(bottom: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SlideTransition(
// position: _relaxAnimation,
// child: Container(
// constraints: BoxConstraints(maxWidth: 350, maxHeight: 350),
// child: Image.asset(
// 'assets/introduction_animation/introduction_image1.png',
// fit: BoxFit.contain,
// ),
// ),
// ),
SlideTransition(
position: _relaxAnimation,
child: Text(
"There's a plan for every event ",
style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold),
),
),
SlideTransition(
position: _textAnimation,
child: Padding(
padding:
EdgeInsets.only(left: 64, right: 64, top: 16, bottom: 16),
child: Text(
"Single solution for more impactful event experience",
textAlign: TextAlign.center,
),
),
),
SlideTransition(
position: _imageAnimation,
child: Container(
constraints: BoxConstraints(maxWidth: 350, maxHeight: 250),
child: Image.asset(
'assets/introduction_animation/events3.jpg',
fit: BoxFit.contain,
),
),
),
],
),
),
),
);
}
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,105 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SplashView extends StatefulWidget {
final AnimationController animationController;
const SplashView({Key? key, required this.animationController})
: super(key: key);
@override
_SplashViewState createState() => _SplashViewState();
}
class _SplashViewState extends State<SplashView> {
@override
Widget build(BuildContext context) {
final _introductionanimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(0.0, -1.0))
.animate(CurvedAnimation(
parent: widget.animationController,
curve: Interval(
0.0,
0.2,
curve: Curves.fastOutSlowIn,
),
));
return SlideTransition(
position: _introductionanimation,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(bottom: 100.0),
child: Column(
children: [
SizedBox(
height: 40,
),
// Padding(
// padding: EdgeInsets.all(8.0),
// child: SizedBox(
// //width: MediaQuery.of(context).size.width,
// child: Image.asset(
// 'assets/introduction_animation/introduction_image1.png',
// fit: BoxFit.cover,
// ),
// ),
// ),
SizedBox(
height: 80,
),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Text(
"Track Events Everywhere",
style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold),
),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(left: 64, right: 64),
child: Text(
"Available on your phone,tablet and laptop",
textAlign: TextAlign.center,
),
),
),
SizedBox(
height: 100,
),
Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom),
child: InkWell(
onTap: () {
widget.animationController.animateTo(0.2);
},
child: Container(
height: 58,
padding: EdgeInsets.only(
left: 56.0,
right: 56.0,
top: 16,
bottom: 16,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(38.0),
color: Color(0xff132137),
),
child: Text(
"Let's begin",
style: TextStyle(
fontSize: 18,
color: Colors.white,
),
),
),
),
),
],
),
),
),
);
}
}

View File

@ -0,0 +1,81 @@
import 'package:flutter/material.dart';
class TopBackSkipView extends StatelessWidget {
final AnimationController animationController;
final VoidCallback onBackClick;
final VoidCallback onSkipClick;
const TopBackSkipView({
Key? key,
required this.onBackClick,
required this.onSkipClick,
required this.animationController,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final _animation =
Tween<Offset>(begin: Offset(0, -1), end: Offset(0.0, 0.0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.0,
0.2,
curve: Curves.fastOutSlowIn,
),
));
// final _backAnimation =
// Tween<Offset>(begin: Offset(0, 0), end: Offset(-2, 0))
// .animate(CurvedAnimation(
// parent: animationController,
// curve: Interval(
// 0.6,
// 0.8,
// curve: Curves.fastOutSlowIn,
// ),
// ));
final _skipAnimation = Tween<Offset>(begin: Offset(0, 0), end: Offset(2, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
return SlideTransition(
position: _animation,
child: Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: Container(
height: 58,
child: Padding(
padding: const EdgeInsets.only(left: 8, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// SlideTransition(
// position: _backAnimation,
// child:
IconButton(
onPressed: onBackClick,
icon: Icon(Icons.arrow_back_ios_new_rounded),
// ),
),
SlideTransition(
position: _skipAnimation,
child: IconButton(
onPressed: onSkipClick,
icon: Text('Skip'),
),
),
],
),
),
),
),
);
}
}

View File

@ -0,0 +1,97 @@
import 'package:flutter/material.dart';
class WelcomeView extends StatelessWidget {
final AnimationController animationController;
const WelcomeView({Key? key, required this.animationController})
: super(key: key);
@override
Widget build(BuildContext context) {
final _firstHalfAnimation =
Tween<Offset>(begin: Offset(1, 0), end: Offset(0, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
),
);
final _secondHalfAnimation =
Tween<Offset>(begin: Offset(0, 0), end: Offset(-1, 0)).animate(
CurvedAnimation(
parent: animationController,
curve: Interval(
0.8,
1.0,
curve: Curves.fastOutSlowIn,
),
),
);
final _welcomeFirstHalfAnimation =
Tween<Offset>(begin: Offset(2, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
final _welcomeImageAnimation =
Tween<Offset>(begin: Offset(4, 0), end: Offset(0, 0))
.animate(CurvedAnimation(
parent: animationController,
curve: Interval(
0.6,
0.8,
curve: Curves.fastOutSlowIn,
),
));
return SlideTransition(
position: _firstHalfAnimation,
child: SlideTransition(
position: _secondHalfAnimation,
child: Padding(
padding: const EdgeInsets.only(bottom: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SlideTransition(
// position: _welcomeFirstHalfAnimation,
// child: Container(
// constraints: BoxConstraints(maxWidth: 350, maxHeight: 350),
// child: Image.asset(
// 'assets/introduction_animation/introduction_image1.png',
// fit: BoxFit.contain,
// ),
// ),
// ),
SizedBox(
height: 50,
),
SlideTransition(
position: _welcomeFirstHalfAnimation,
child: Text(
"Welcome",
style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold),
),
),
Padding(
padding:
EdgeInsets.only(left: 64, right: 64, top: 16, bottom: 16),
child: Text(
"HCP Management Platform Aissel's Cutting-Edge Product Solutions",
textAlign: TextAlign.center,
),
),
],
),
),
),
);
}
}

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:konectar_events/contacts_module/ui_screen/new_contacts.dart';
import 'package:konectar_events/utils/app_theme.dart';
import 'package:konectar_events/view/helpdesk.dart';
import 'package:konectar_events/view/home.dart';
import 'package:konectar_events/widgets/drawerusercontroller.dart';
import 'package:konectar_events/widgets/home_drawer.dart';
@ -61,7 +62,7 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
break;
case DrawerIndex.FeedBack:
setState(() {
screenView = HomeScreen();
screenView = HelpDeskScreen();
});
break;
case DrawerIndex.Invite:

View File

@ -6,7 +6,16 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
import 'package:konectar_events/contacts_module/model_class/speaker.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/configprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionlistscreen.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/new_dynamicform.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/viewinteractionprovider.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/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart';
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart';
@ -16,7 +25,7 @@ import 'package:konectar_events/widgets/customdropdown.dart';
import 'package:provider/provider.dart';
class HCPProfileScreen extends StatefulWidget {
Eventsdetail eventsdetail;
SpeakersList eventsdetail;
String eventid;
String title;
HCPProfileScreen(
@ -151,8 +160,19 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
init() async {
await Provider.of<HcpProfileProvider>(context, listen: false)
.getSessionData();
await Provider.of<HcpProfileProvider>(context, listen: false)
.getCounts(widget.eventsdetail);
// await Provider.of<HcpProfileProvider>(context, listen: false)
// .getCounts(widget.eventsdetail);
await Provider.of<InteractionProvider>(context, listen: false)
.initConfigData();
await Provider.of<InteractionProvider>(context, listen: false).getRecords();
String formname = Provider.of<InteractionProvider>(context, listen: false)
.intConfigDataList[0]
.name;
await Provider.of<ViewInteractionProvider>(context, listen: false)
.getRecords(formname, hcp: widget.eventsdetail.hcpFullName);
setState(() {});
}
@ -290,7 +310,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
});
}
buildprofile(BuildContext context, Eventsdetail eventsdetail, String title) {
buildprofile(BuildContext context, SpeakersList eventsdetail, String title) {
MediaQuery.of(context).size.height * 0.35;
return Container(
@ -323,7 +343,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
SizedBox(
height: 15,
),
Text(eventsdetail.kolFullName!,
Text(eventsdetail.hcpFullName!,
style: TextStyle(
fontSize: 20,
// fontFamily: "SourceSerif",
@ -335,7 +355,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// // fontFamily: "SourceSerif",
// )),
Text(
"${eventsdetail.orgName ?? ""} ${eventsdetail.country ?? ""} ${eventsdetail.city ?? ""}",
"${eventsdetail.organization ?? ""} ${eventsdetail.countryName ?? ""} ${eventsdetail.cityName ?? ""}",
softWrap: true,
maxLines: 2,
textAlign: TextAlign.center,
@ -409,7 +429,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
));
}
Widget buildCardView(BuildContext context, Eventsdetail eventsdetail,
Widget buildCardView(BuildContext context, SpeakersList eventsdetail,
HcpProfileProvider provider) {
return Container(
// color: Constants.bgcolor,
@ -419,7 +439,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// title: eventsdetail.kolFullName!,
// eventsdetail: eventsdetail,
// ),
buildprofile(context, eventsdetail, eventsdetail.kolFullName!),
buildprofile(context, eventsdetail, eventsdetail.hcpFullName!),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Column(
@ -519,8 +539,9 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
// const Spacer(),
Center(
child: _ProfileInfoRow(items: [
ProfileInfoItem("Topic(s)", provider.totalTopics),
ProfileInfoItem("Session(s)", provider.totalSessions),
ProfileInfoItem("Topic(s)", widget.eventsdetail.topics!.length),
ProfileInfoItem(
"Session(s)", widget.eventsdetail.sessionNames!.length),
ProfileInfoItem("Note(s)", provider.totalNotes),
])),
// SizedBox(
@ -531,9 +552,9 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
);
}
Widget sessionNotes(BuildContext context, Eventsdetail eventsdetail,
Widget sessionNotes(BuildContext context, SpeakersList eventsdetail,
HcpProfileProvider provider) {
sessionList = eventsdetail.sessionName!.split(",");
sessionList = eventsdetail.sessionNames!;
return Container(
color: EventsConstants.bgcolor,
child: Column(
@ -604,13 +625,13 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
.add("${_selectedFruit} \n\n ${notesController.text}");
// });
print(
" eventid:${widget.eventid},hcp:${widget.eventsdetail.kolId}");
" eventid:${widget.eventid},hcp:${widget.eventsdetail.uniqueId}");
SessionNotesModel notesModel = SessionNotesModel(
notes: notesController.text,
addedBy: "user",
addedDate: CustomDateFormatter().formatDate(),
eventid: widget.eventid,
hcpid: widget.eventsdetail.kolId,
hcpid: widget.eventsdetail.uniqueId,
selectedSession: _selectedFruit);
print(
"${notesModel.addedBy},${notesModel.notes},${notesModel.addedDate},${notesModel.eventid},${notesModel.hcpid},${notesModel.selectedSession}");
@ -723,9 +744,9 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
);
}
Widget topicsTab(Eventsdetail eventsdetail) {
print("${eventsdetail.sessionName!.split(",").length} @@@lengtg");
List<String> sessions = eventsdetail.sessionName!.split(",");
Widget topicsTab(SpeakersList eventsdetail) {
print("${eventsdetail.sessionNames!.join(",").length} @@@lengtg");
List<String> sessions = eventsdetail.sessionNames!;
return Container(
width: double.maxFinite,
padding: EdgeInsets.only(left: 8),
@ -737,7 +758,7 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
padding: EdgeInsets.only(top: 10.0, left: 4.0),
itemCount: sessions.length,
itemBuilder: (context, index) {
List<String> topics = eventsdetail.eventTopics!.split("|");
List<String> topics = eventsdetail.topics!;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -856,25 +877,156 @@ class _HCPProfileScreenState extends State<HCPProfileScreen> {
}
Widget medicalInsights() {
return Container(
color: EventsConstants.bgcolor,
child: Center(
child: FloatingActionButton.extended(
backgroundColor: Colors.green,
onPressed: () {},
heroTag: 'medicalinsights',
elevation: 0,
label: const Text("Add Medical Insights",
style: TextStyle(
color: Colors.white,
)),
icon: const Icon(
Icons.add,
color: Colors.white,
),
return Consumer<ViewInteractionProvider>(
builder: (BuildContext context, provider, Widget? child) {
return Container(
color: EventsConstants.bgcolor,
child: Column(
children: [
SizedBox(
height: 20,
),
Center(
child: FloatingActionButton.extended(
backgroundColor: Colors.green,
onPressed: () async {
final ConfigDataProvider configDataProvider =
ConfigDataProvider();
await configDataProvider.initConfigUIDataMediccalInsight();
await Provider.of<InteractionProvider>(context, listen: false)
.initConfigData();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => InteractionScreen1(
index: 0,
form: Provider.of<InteractionProvider>(context,
listen: false)
.intConfigDataList[0]
.name,
title: "${widget.eventsdetail.hcpFullName}",
)));
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const InteractionListScreen()));
},
heroTag: 'medicalinsights',
elevation: 0,
label: const Text("Add Medical Insights",
style: TextStyle(
color: Colors.white,
)),
icon: const Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 20,
),
provider.savedList.isEmpty
? SizedBox.shrink()
: ListView.builder(
itemCount: provider.savedList.length,
shrinkWrap: true,
cacheExtent:
double.parse(provider.savedList.length.toString()),
itemBuilder: (context, index) {
return Column(
children: [
ListTile(
subtitle: Text(
'Updated on ${CustomDateFormatter().convertDateTimeToDate(provider.savedList[index].updatedTime!)}',
//style: TextStyle(fontStyle: FontStyle.italic),
),
title: Text(
provider.savedList[index].id,
),
trailing: SizedBox(
width: 100,
child: Row(children: [
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
ViewInteractionScreen1(
saveInteraction:
provider.savedList[index],
)));
},
icon: const Icon(
Icons.info_outline,
size: 24,
color: Color.fromARGB(255, 8, 39, 92),
),
),
IconButton(
onPressed: () async {
await provider.initConfigData().then({
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// EditInteractionScreen(
// saveInteraction: provider
// .savedList[index],
// )))
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
EditInteractionScreen1(
saveInteraction: provider
.savedList[index],
)))
});
},
icon: const Icon(
Icons.edit,
size: 24,
color: Color.fromARGB(255, 8, 39, 92),
),
),
// IconButton(
// onPressed: () {
// showDeleteRecordAlertDialog(
// context,
// provider.savedList[index].id,
// provider.savedList[index]);
// },
// icon: const Icon(
// Icons.delete,
// size: 24,
// color: Color.fromARGB(255, 8, 39, 92),
// ),
// ),
]),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
ViewInteractionScreen1(
saveInteraction:
provider.savedList[index],
)));
},
),
const Divider(),
],
);
}),
],
),
),
);
);
});
}
}

View File

@ -1,13 +1,19 @@
import 'dart:async';
import 'dart:math';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:konectar_events/model/affiliationsmodel.dart';
import 'package:konectar_events/model/events_list_resp_2.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/eventsoverview.dart';
import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/keywords_model.dart';
import 'package:konectar_events/model/my_events_list_model.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/scope_model.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart';
@ -21,43 +27,54 @@ class EventsProvider extends ChangeNotifier {
List<Keyword> keywordList = [];
List<Therapeutic> therapeuticList = [];
List<EventsList> eventList = [];
List<EventsListingData> neweventList = [];
List<EventsList> searchList = [];
List<EventsList> myEvents = [];
List<EventsList> offlineEvents = [];
List<Eventsdetail> eventdetailList = [];
List<Eventsdetail> srcheventdetailList = [];
List<String> selectedTherapeutic = [];
List<SessionNotesModel> addedSessionNotes = [];
List<SpeakersList> speakersList = [];
List<String> myEventids = [];
bool showCheckbox = false;
bool offlineExists = false;
int eventSessionCount = 0;
String message = "";
int speakercount = 0;
late Box<EventsList> box;
// late Box<MyEventsList> myeventsbox;
late Box<SessionNotesModel> sessionBox;
bool isAllSelected = true;
bool isFavSeleted = false;
bool isFavSeleted = true;
bool isSearch = false;
bool isSearchSpeakers = false;
List<FlutterHashtag> kFlutterHashtags = [];
List<TopicsCloudData> topics = [];
List<Specialty> specialtyList = [];
OverviewData? overviewData;
Affiliations affiliations =
Affiliations(affiliationCount: [], affiliationNames: []);
List<Affiliations> affiliations = [];
onSelectAll() async {
// isFavSeleted = false;
// isAllSelected = !isAllSelected;
eventList = await getEvents();
late StreamSubscription<List<ConnectivityResult>> connectivitySubscription;
Future<void> onSelectAll(int page) async {
isFavSeleted = false;
isAllSelected = !isAllSelected;
eventList = await getEvents(page);
notifyListeners();
}
onSelectMy() async {
// isFavSeleted = !isFavSeleted;
eventList = await getMyEventsData();
Future<void> onSelectMy() async {
isFavSeleted = !isFavSeleted;
eventList = [];
eventList = await getMyEvents(1);
notifyListeners();
}
OnSearch(String searchtxt) {
OnSearch(String searchtxt) async {
print("Searching.......");
// searchtxt = searchtxt.toLowerCase();
isSearch = true;
if (isFavSeleted) {
@ -71,25 +88,45 @@ class EventsProvider extends ChangeNotifier {
// element.country!.toLowerCase().contains(searchtxt)))
.toList();
} else {
searchList = eventList
.where((element) => element.name1!.toLowerCase().contains(searchtxt))
// element.city!.toLowerCase().contains(searchtxt) ||
// element.region!.toLowerCase().contains(searchtxt) ||
// element.country!.toLowerCase().contains(searchtxt))
.toList();
eventList =
await ApiCall().getSearchedEventsFromK2(1, "event_name", searchtxt);
// searchList = eventList
// .where((element) => element.name1!.toLowerCase().contains(searchtxt))
// // element.city!.toLowerCase().contains(searchtxt) ||
// // element.region!.toLowerCase().contains(searchtxt) ||
// // element.country!.toLowerCase().contains(searchtxt))
// .toList();
}
print("###$searchList@@@");
notifyListeners();
}
getSessionCount() {
bool ifOfflineExists(String eventid) {
if (offlineEvents.isNotEmpty) {
offlineEvents.forEach(
(element) {
if (element.eventId == eventid) {
offlineExists = true;
} else {
offlineExists = false;
}
},
);
}
return offlineExists;
}
Future<void> getSessionCount(String eventid, String event_unique_id) async {
List<String> sessions = [];
eventSessionCount = 0;
for (var obj in eventdetailList) {
sessions.addAll(obj.sessionName!.split(','));
eventSessionCount += int.parse(obj.numSess ?? "0");
Map<String, dynamic> data =
(await ApiCall().getSpeakersFromK2(0, eventid, event_unique_id));
speakercount = data["count"];
List<SpeakersList> speakersList = data["list"];
for (var obj in speakersList) {
sessions.addAll(obj.sessionNames!);
}
print("Count ${sessions.toSet().toList().length}");
print("Count2 ${sessions.toList().length}");
@ -118,9 +155,9 @@ class EventsProvider extends ChangeNotifier {
onFilterReset() async {
if (isFavSeleted) {
eventList = await getMyEventsData();
myEvents = await getMyEvents(1);
} else {
eventList = await getEvents();
eventList = await getEvents(1);
}
isSearch = false;
@ -131,9 +168,9 @@ class EventsProvider extends ChangeNotifier {
onSearchReset() async {
if (isFavSeleted) {
eventList = await getMyEventsData();
myEvents = await getMyEvents(1);
} else {
eventList = await getEvents();
eventList = await getEvents(1);
}
isSearch = false;
@ -176,16 +213,53 @@ class EventsProvider extends ChangeNotifier {
//notifyListeners();
}
Future<List<EventsList>> getEvents() async {
eventList = await getAllEventsData();
Future<List<EventsList>> getEvents(int page,
{String? searchtxt, String? startdate, String? enddate}) async {
// eventList = await getAllEventsData();
eventList.clear();
eventList = [];
offlineEvents = await getOfflineMyEvents();
eventList = isFavSeleted
? await ApiCall().getEventsFromK1(type: "2")
: await ApiCall().getEventsFromK1();
print("see the list : $neweventList");
if (eventList.isEmpty) {
eventList = (await ApiCall().getEvents())!;
// eventList = (await ApiCall().getEvents())!;
eventList = isFavSeleted
? await ApiCall().getEventsFromK1(type: "2")
: await ApiCall().getEventsFromK1();
//eventList = (await ApiCall().getStagingEvents())!;
for (var events in eventList) {
await saveEventsData(events);
}
}
if (myEventids.isNotEmpty) {
for (var events in eventList) {
if (myEventids.contains(events.eventId)) {
events.isfav = true;
}
}
}
return eventList;
//notifyListeners();
}
Future<List<EventsList>> getMyEvents(int page) async {
// eventList = await getAllEventsData();
myEvents = await ApiCall().getEventsFromK1(type: "2");
print("see the list : $myEvents");
if (myEvents.isEmpty) {
// eventList = (await ApiCall().getEvents())!;
myEvents = await ApiCall().getEventsFromK1(type: "2");
//eventList = (await ApiCall().getStagingEvents())!;
}
for (var events in myEvents) {
myEventids.add(events.eventId!);
}
return myEvents;
//notifyListeners();
}
@ -209,14 +283,50 @@ class EventsProvider extends ChangeNotifier {
}
Future<List<Eventsdetail>> getEventsDetails(String eventid) async {
eventdetailList = (await ApiCall().getLocalEventsDetail(eventid))!;
eventdetailList = (await ApiCall().getLocalEventsDetail("142682"))!;
return eventdetailList;
//notifyListeners();
}
Future<String> addEventsToFavs(String eventid) async {
message = await ApiCall().addEventsToFav(eventid);
Future<List<SpeakersList>> getSpeakersDetails(int page, String eventid,
String event_unique_id, String searchkey) async {
Map<String, dynamic> data = (await ApiCall().getSpeakersFromK2(
page, eventid, event_unique_id,
searchkey: searchkey));
// speakercount = data["count"];
speakersList = data["list"];
// getSessionCount();
return speakersList;
//notifyListeners();
}
Future<String> addEventsToFavs(String eventid) async {
message = await ApiCall().followUnfollowEvent("1", eventid);
if (myEventids.isNotEmpty) {
if (!myEventids.contains(eventid)) {
myEventids.add(eventid);
}
} else {
myEventids.add(eventid);
}
return message;
//notifyListeners();
}
Future<String> attendNotAttendEvent(String eventid, String flag) async {
message = await ApiCall().attendNotAttendEvent(flag, eventid);
return message;
//notifyListeners();
}
Future<String> removeEventsToFavs(String eventid) async {
message = await ApiCall().followUnfollowEvent("0", eventid);
if (myEventids.isNotEmpty) {
if (myEventids.contains(eventid)) {
myEventids.remove(eventid);
}
}
return message;
//notifyListeners();
}
@ -231,7 +341,9 @@ class EventsProvider extends ChangeNotifier {
box = await Hive.openBox<EventsList>('EventsListBox');
box.add(eventsData);
List<EventsList> eventsData2 = await getMyEventsData();
offlineEvents.clear();
offlineEvents = await getOfflineMyEvents();
print("OFFLINE TOTAL :${offlineEvents.length}");
notifyListeners();
}
@ -242,26 +354,11 @@ class EventsProvider extends ChangeNotifier {
(element) => element.eventId == eventsData.eventId,
);
box.putAt(index, eventsData);
List<EventsList> eventsData2 = await getMyEventsData();
// List<EventsList> eventsData2 = await getMyEventsData();
notifyListeners();
}
Future<List<EventsList>> getMyEventsData() async {
box = await Hive.openBox<EventsList>('EventsListBox');
Iterable<EventsList> data = box.values;
myEvents = data
.where(
(element) => element.isfav == true,
)
.toList();
// EventsList eventsdata = EventsList();
// for (var obj in data) {
// eventsdata = new EventsList.fromJson(obj.toJson());
// }
return myEvents;
}
Future<List<EventsList>> getAllEventsData() async {
Future<List<EventsList>> getOfflineMyEvents() async {
box = await Hive.openBox<EventsList>('EventsListBox');
Iterable<EventsList> data = box.values;
myEvents = data.toList();
@ -288,7 +385,7 @@ class EventsProvider extends ChangeNotifier {
box.clear();
}
FutureOr delateEventsData(EventsList event) async {
FutureOr delateOfflineEvent(EventsList event) async {
//DELETE
// box = await Hive.openBox<EventsList>('EventsListBox');
// List<EventsList> data = box.values.toList();
@ -303,8 +400,11 @@ class EventsProvider extends ChangeNotifier {
(element) => element.eventId == event.eventId,
);
event.isfav = false;
box.putAt(index, event);
eventList = await getMyEventsData();
// box.putAt(index, event);
box.deleteAt(index);
//eventList = await getMyEventsData();
offlineEvents.clear();
offlineEvents = await getOfflineMyEvents();
notifyListeners();
}
@ -316,9 +416,9 @@ class EventsProvider extends ChangeNotifier {
notifyListeners();
}
FutureOr getTopicsCloud(String eventid) async {
List<TopicsCloudData> topics =
(await ApiCall().getTopicsCloudData(eventid))!;
FutureOr getTopicsCloud(EventsList event) async {
List<TopicsCloudData> topics = (await ApiCall().insightsTopicsCloud(
eventid: event.eventId!, startDate: event.start!, endDate: event.end!));
// for (var events in eventList) {
// await saveEventsData(events);
// }
@ -332,14 +432,16 @@ class EventsProvider extends ChangeNotifier {
notifyListeners();
}
FutureOr getSpecialtyData(String eventid) async {
specialtyList = (await ApiCall().getSpecialty(eventid))!;
FutureOr getSpecialtyData(EventsList event) async {
specialtyList = (await ApiCall().specialtyOfSpeakers(
eventid: event.eventId!, startDate: event.start!, endDate: event.end!));
notifyListeners();
}
FutureOr getAffiliations(String eventid) async {
affiliations = (await ApiCall().getSpeakerCounts(eventid))!;
FutureOr getAffiliations(EventsList event) async {
affiliations = (await ApiCall().insightsBarChart(
eventid: event.eventId!, startDate: event.start!, endDate: event.end!));
notifyListeners();
}
@ -351,4 +453,6 @@ class EventsProvider extends ChangeNotifier {
notifyListeners();
}
//INTERNET CONNECTIVITY
}

View File

@ -4,6 +4,7 @@ import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventspeakers.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart';
import 'package:konectar_events/model/topics_cloud_model.dart';
import 'package:konectar_events/utils/apicall.dart';
@ -33,9 +34,9 @@ class HcpProfileProvider extends ChangeNotifier {
}
List<SessionNotesModel> getSessionNotesList(
String eid, Eventsdetail eventsdetail) {
String eid, SpeakersList eventsdetail) {
print("Check hcp id");
print("$eid,${eventsdetail.kolId}");
print("$eid,${eventsdetail.uniqueId}");
sessionNotesList = sessionNotesList
.where(
(element) => element.eventid == eid,
@ -50,10 +51,10 @@ class HcpProfileProvider extends ChangeNotifier {
String fname = element.hcpname!.split(" ")[0];
String lname = element.hcpname!.split(" ").last;
print("${element.hcpname}");
return fname.toLowerCase() == eventsdetail.firstName!.toLowerCase() &&
lname.toLowerCase() == eventsdetail.lastName!.toLowerCase();
return fname.toLowerCase() == eventsdetail.hcpFullName!.toLowerCase() &&
lname.toLowerCase() == eventsdetail.hcpFullName!.toLowerCase();
} else {
return element.hcpid == eventsdetail.kolId;
return element.hcpid == eventsdetail.uniqueId;
}
}).toList();
totalNotes = sessionNotesList.length;

View File

@ -0,0 +1,325 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/model/eventsdetailmodel.dart';
import 'package:konectar_events/model/eventsmodel.dart';
import 'package:konectar_events/model/keywords_model.dart';
import 'package:konectar_events/model/neweventsmodel.dart';
import 'package:konectar_events/model/scope_model.dart';
import 'package:konectar_events/model/sessionnotesmodel.dart';
import 'package:konectar_events/model/topics_cloud_model.dart';
import 'package:konectar_events/utils/apicall.dart';
import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/widgets/word_cloud.dart';
class EventsOfflineProvider extends ChangeNotifier {
List<Keyword> keywordList = [];
List<Therapeutic> therapeuticList = [];
List<EventsList> eventList = [];
List<EventsList> searchList = [];
List<EventsList> myEvents = [];
List<Eventsdetail> eventdetailList = [];
List<Eventsdetail> srcheventdetailList = [];
List<String> selectedTherapeutic = [];
List<SessionNotesModel> addedSessionNotes = [];
int eventSessionCount = 0;
String message = "";
late Box<EventsList> box;
late Box<SessionNotesModel> sessionBox;
bool isAllSelected = true;
bool isFavSeleted = false;
bool isSearch = false;
bool isSearchSpeakers = false;
List<FlutterHashtag> kFlutterHashtags = [];
List<TopicsCloudData> topics = [];
onSelectAll() async {
// isFavSeleted = false;
// isAllSelected = !isAllSelected;
eventList = await getEvents();
notifyListeners();
}
onSelectMy() async {
// isFavSeleted = !isFavSeleted;
eventList = await getMyEventsData();
notifyListeners();
}
OnSearch(String searchtxt) {
// searchtxt = searchtxt.toLowerCase();
isSearch = true;
if (isFavSeleted) {
searchList = eventList
.where((element) => element.name1!.toLowerCase().contains(searchtxt))
// (element.city != "" &&
// element.city!.toLowerCase().contains(searchtxt)) ||
// (element.region != "" &&
// element.region!.toLowerCase().contains(searchtxt)) ||
// (element.country != "" &&
// element.country!.toLowerCase().contains(searchtxt)))
.toList();
} else {
searchList = eventList
.where((element) => element.name1!.toLowerCase().contains(searchtxt))
// element.city!.toLowerCase().contains(searchtxt) ||
// element.region!.toLowerCase().contains(searchtxt) ||
// element.country!.toLowerCase().contains(searchtxt))
.toList();
}
print("###$searchList@@@");
notifyListeners();
}
getSessionCount() {
List<String> sessions = [];
eventSessionCount = 0;
for (var obj in eventdetailList) {
sessions.addAll(obj.sessionName!.split(','));
eventSessionCount += int.parse(obj.numSess ?? "0");
}
print("Count ${sessions.toSet().toList().length}");
print("Count2 ${sessions.toList().length}");
print("SEE SESSIONS ${sessions.toSet().toList()}");
eventSessionCount = sessions.toSet().toList().length;
notifyListeners();
}
OnFilters() {
isSearch = true;
if (isFavSeleted) {
searchList = myEvents
.where((element) =>
selectedTherapeutic.contains(element.therapeuticArea))
.toList();
} else {
searchList = myEvents
.where((element) =>
selectedTherapeutic.contains(element.therapeuticArea))
.toList();
}
print("###$searchList@@@");
notifyListeners();
}
onFilterReset() async {
if (isFavSeleted) {
eventList = await getMyEventsData();
} else {
eventList = await getEvents();
}
isSearch = false;
searchList.clear();
notifyListeners();
}
onSearchReset() async {
if (isFavSeleted) {
eventList = await getMyEventsData();
} else {
eventList = await getEvents();
}
isSearch = false;
searchList.clear();
notifyListeners();
}
OnSearchSpeakers(String searchtxt) {
searchtxt = searchtxt.toLowerCase();
isSearchSpeakers = true;
srcheventdetailList = eventdetailList
.where((element) =>
element.kolFullName!.toLowerCase().contains(searchtxt) ||
element.eventTopics!.toLowerCase().contains(searchtxt))
.toList();
notifyListeners();
}
onSearchSpeakersReset(String eventid) async {
eventdetailList = await getEventsDetails(eventid);
isSearchSpeakers = false;
srcheventdetailList.clear();
notifyListeners();
}
initFiltersData() async {
// keywordList = await ApiCall().getkeywords('');
therapeuticList = await ApiCall().getscopes();
notifyListeners();
}
Future<List<Keyword>> getKeywordList(String keyword) async {
keywordList = await ApiCall().getkeywords(keyword);
return keywordList;
//notifyListeners();
}
Future<List<EventsList>> getEvents() async {
eventList = await getAllEventsData();
if (eventList.isEmpty) {
eventList = (await ApiCall().getEvents())!;
for (var events in eventList) {
await saveEventsData(events);
}
}
return eventList;
//notifyListeners();
}
Future<List<SessionNotesModel>> getAddedSessionNotes() async {
addedSessionNotes = await getAllSessionNotesList();
if (addedSessionNotes.isEmpty && eventList.isNotEmpty) {
addedSessionNotes = (await ApiCall().getSessionNotes())!;
for (SessionNotesModel notes in addedSessionNotes) {
int i =
eventList.indexWhere((element) => element.name1 == notes.eventname);
if (i != -1) {
notes.eventid = eventList[i].eventId;
}
notes.addedBy = "user";
notes.addedDate = CustomDateFormatter().formatDate();
await saveSessionDataFromResp(notes);
}
}
return addedSessionNotes;
//notifyListeners();
}
Future<List<Eventsdetail>> getEventsDetails(String eventid) async {
eventdetailList = (await ApiCall().getLocalEventsDetail(eventid))!;
return eventdetailList;
//notifyListeners();
}
Future<String> addEventsToFavs(String eventid) async {
message = await ApiCall().addEventsToFav(eventid);
return message;
//notifyListeners();
}
Future<String> markAttending(String eventid) async {
message = await ApiCall().attendEvents(eventid);
return message;
//notifyListeners();
}
FutureOr saveEventsData(EventsList eventsData) async {
box = await Hive.openBox<EventsList>('EventsListBox');
box.add(eventsData);
List<EventsList> eventsData2 = await getMyEventsData();
notifyListeners();
}
FutureOr favsEventsData(EventsList eventsData) async {
box = await Hive.openBox<EventsList>('EventsListBox');
List<EventsList> data = box.values.toList();
int index = data.indexWhere(
(element) => element.eventId == eventsData.eventId,
);
box.putAt(index, eventsData);
List<EventsList> eventsData2 = await getMyEventsData();
notifyListeners();
}
Future<List<EventsList>> getMyEventsData() async {
box = await Hive.openBox<EventsList>('EventsListBox');
Iterable<EventsList> data = box.values;
myEvents = data
.where(
(element) => element.isfav == true,
)
.toList();
// EventsList eventsdata = EventsList();
// for (var obj in data) {
// eventsdata = new EventsList.fromJson(obj.toJson());
// }
return myEvents;
}
Future<List<EventsList>> getAllEventsData() async {
box = await Hive.openBox<EventsList>('EventsListBox');
Iterable<EventsList> data = box.values;
myEvents = data.toList();
// EventsList eventsdata = EventsList();
// for (var obj in data) {
// eventsdata = new EventsList.fromJson(obj.toJson());
// }
return myEvents;
}
Future<List<SessionNotesModel>> getAllSessionNotesList() async {
sessionBox = await Hive.openBox<SessionNotesModel>('SessionNotesModelBox');
Iterable<SessionNotesModel> data = sessionBox.values;
addedSessionNotes = data.toList();
// EventsList eventsdata = EventsList();
// for (var obj in data) {
// eventsdata = new EventsList.fromJson(obj.toJson());
// }
return addedSessionNotes;
}
FutureOr deleteAllEventsData() async {
box = await Hive.openBox<EventsList>('EventsListBox');
box.clear();
}
FutureOr delateEventsData(EventsList event) async {
//DELETE
// box = await Hive.openBox<EventsList>('EventsListBox');
// List<EventsList> data = box.values.toList();
// int index = data.indexWhere(
// (element) => element.eventId == eventid,
// );
// await box.deleteAt(index);
//REMOVE FROM FAVS
box = await Hive.openBox<EventsList>('EventsListBox');
List<EventsList> data = box.values.toList();
int index = data.indexWhere(
(element) => element.eventId == event.eventId,
);
event.isfav = false;
box.putAt(index, event);
eventList = await getMyEventsData();
notifyListeners();
}
FutureOr saveSessionDataFromResp(SessionNotesModel notesModel) async {
sessionBox = await Hive.openBox<SessionNotesModel>('SessionNotesModelBox');
sessionBox.add(notesModel);
notifyListeners();
}
FutureOr getTopicsCloud(String eventid) async {
List<TopicsCloudData> topics =
(await ApiCall().getTopicsCloudData(eventid))!;
// for (var events in eventList) {
// await saveEventsData(events);
// }
//notifyListeners();
kFlutterHashtags = [];
for (var topic in topics) {
kFlutterHashtags
.add(FlutterHashtag(topic.topic!, int.parse(topic.total!), false));
}
notifyListeners();
}
}

View File

@ -196,6 +196,7 @@ class _StringAutoCompleteTagsState extends State<StringAutoCompleteTags> {
width: 1.0,
),
),
//helperText: 'Enter language...',
helperStyle: const TextStyle(
color: Colors.black,

View File

@ -42,22 +42,24 @@ class _HomeDrawerState extends State<HomeDrawer> {
void setDrawerListArray() {
drawerList = <DrawerList>[
DrawerList(
index: DrawerIndex.HOME,
labelName: 'Events',
//icon: Icon(Icons.home),
),
DrawerList(
index: DrawerIndex.Help,
labelName: 'Contacts',
icon: Icon(Icons.account_circle),
// isAssetsImage: true,
// imageName: 'assets/images/supportIcon.png',
),
// DrawerList(
// index: DrawerIndex.FeedBack,
// labelName: 'FeedBack',
// icon: Icon(Icons.help),
// ),
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: 'Invite Friend',
@ -95,68 +97,64 @@ class _HomeDrawerState extends State<HomeDrawer> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AnimatedBuilder(
animation: widget.iconAnimationController!,
builder: (BuildContext context, Widget? child) {
return ScaleTransition(
scale: AlwaysStoppedAnimation<double>(1.0 -
(widget.iconAnimationController!.value) * 0.2),
child: RotationTransition(
turns: AlwaysStoppedAnimation<double>(Tween<double>(
begin: 0.0, end: 24.0)
.animate(CurvedAnimation(
parent: widget.iconAnimationController!,
curve: Curves.fastOutSlowIn))
.value /
360),
child: Container(
height: 100,
width: 100,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: AppTheme.grey.withOpacity(0.6),
offset: const Offset(2.0, 4.0),
blurRadius: 8),
],
),
child: ClipRRect(
borderRadius:
const BorderRadius.all(Radius.circular(60.0)),
child: CircleAvatar(
radius: 24,
backgroundColor: EventsConstants.blueColor,
// child: Icon(
// Icons.person,
// size: 18,
// color: Colors.white,
// ),
child: Text(
"S",
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
),
),
),
);
},
),
Padding(
padding: const EdgeInsets.only(top: 8, left: 4),
child: Text(
'Snehalatha Desai',
style: TextStyle(
fontWeight: FontWeight.w600,
color: isLightMode ? AppTheme.grey : AppTheme.white,
fontSize: 18,
),
SizedBox(
height: 30,
child: Image.asset(
"assets/images/konector_image_logo.png",
fit: BoxFit.cover,
),
),
// AnimatedBuilder(
// animation: widget.iconAnimationController!,
// builder: (BuildContext context, Widget? child) {
// return ScaleTransition(
// scale: AlwaysStoppedAnimation<double>(1.0 -
// (widget.iconAnimationController!.value) * 0.2),
// child: RotationTransition(
// turns: AlwaysStoppedAnimation<double>(Tween<double>(
// begin: 0.0, end: 24.0)
// .animate(CurvedAnimation(
// parent: widget.iconAnimationController!,
// curve: Curves.fastOutSlowIn))
// .value /
// 360),
// child: Container(
// height: 100,
// width: 100,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// boxShadow: <BoxShadow>[
// BoxShadow(
// color: AppTheme.grey.withOpacity(0.6),
// offset: const Offset(2.0, 4.0),
// blurRadius: 8),
// ],
// ),
// child: ClipRRect(
// borderRadius:
// const BorderRadius.all(Radius.circular(60.0)),
// child: CircleAvatar(
// radius: 24,
// backgroundColor: EventsConstants.blueColor,
// // child: Icon(
// // Icons.person,
// // size: 18,
// // color: Colors.white,
// // ),
// child: Text(
// "S",
// style: TextStyle(
// fontSize: 24,
// fontWeight: FontWeight.bold,
// color: Colors.white),
// ),
// ),
// ),
// ),
// ),
// );
// },
// ),
],
),
),
@ -178,6 +176,17 @@ class _HomeDrawerState extends State<HomeDrawer> {
},
),
),
Padding(
padding: const EdgeInsets.only(top: 8, left: 4),
child: Text(
'Logged in as Snehalatha Desai',
style: TextStyle(
fontWeight: FontWeight.w300,
color: isLightMode ? AppTheme.grey : AppTheme.white,
fontSize: 18,
),
),
),
Divider(
height: 1,
color: AppTheme.grey.withOpacity(0.6),

View File

@ -66,7 +66,7 @@ class CustomPieChartState extends State<CustomPieChart> {
return Indicator(
size: 10,
color: AppColors().appcolors[i],
text: widget.specialtyList[i].specialtyName,
text: widget.specialtyList[i].specialtyName!,
isSquare: true,
);
})
@ -131,7 +131,7 @@ class CustomPieChartState extends State<CustomPieChart> {
List<PieChartSectionData> showingSections(List<Specialty> specialtyList) {
double total = 0.0;
for (var obj in specialtyList) {
total += double.parse(obj.specialtyCount);
total += double.parse(obj.specialtyCount!);
}
return List.generate(specialtyList.length, (i) {
@ -141,10 +141,10 @@ class CustomPieChartState extends State<CustomPieChart> {
const shadows = [Shadow(color: Colors.black, blurRadius: 2)];
return PieChartSectionData(
color: AppColors().appcolors[i],
value: ((double.parse(specialtyList[i].specialtyCount) / total) * 100)
value: ((double.parse(specialtyList[i].specialtyCount!) / total) * 100)
.roundToDouble(),
title:
'${((double.parse(specialtyList[i].specialtyCount) / total) * 100).roundToDouble()}%',
'${((double.parse(specialtyList[i].specialtyCount!) / total) * 100).floorToDouble()}%',
radius: radius,
titleStyle: TextStyle(
fontSize: fontSize,

View File

@ -1,75 +1,134 @@
PODS:
- connectivity_plus (0.0.1):
- FlutterMacOS
- ReachabilitySwift
- device_info_plus (0.0.1):
- Flutter
- FlutterMacOS
- file_selector_macos (0.0.1):
- FlutterMacOS
- flutter_inappwebview_macos (0.0.1):
- Firebase/CoreOnly (10.25.0):
- FirebaseCore (= 10.25.0)
- Firebase/RemoteConfig (10.25.0):
- Firebase/CoreOnly
- FirebaseRemoteConfig (~> 10.25.0)
- firebase_core (2.31.0):
- Firebase/CoreOnly (~> 10.25.0)
- FlutterMacOS
- OrderedSet (~> 5.0)
- firebase_remote_config (4.4.5):
- Firebase/CoreOnly (~> 10.25.0)
- Firebase/RemoteConfig (~> 10.25.0)
- firebase_core
- FlutterMacOS
- FirebaseABTesting (10.28.0):
- FirebaseCore (~> 10.0)
- FirebaseCore (10.25.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.28.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.28.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseRemoteConfig (10.25.0):
- FirebaseABTesting (~> 10.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfigInterop (~> 10.23)
- FirebaseSharedSwift (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseRemoteConfigInterop (10.28.0)
- FirebaseSharedSwift (10.28.0)
- FlutterMacOS (1.0.0)
- OrderedSet (5.0.0)
- package_info_plus (0.0.1):
- FlutterMacOS
- GoogleUtilities/Environment (7.13.3):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- "GoogleUtilities/NSData+zlib (7.13.3)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.3)
- GoogleUtilities/UserDefaults (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- ReachabilitySwift (5.0.0)
- PromisesObjC (2.4.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
DEPENDENCIES:
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`)
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/darwin`)
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
- flutter_inappwebview_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos`)
- firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
- firebase_remote_config (from `Flutter/ephemeral/.symlinks/plugins/firebase_remote_config/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
SPEC REPOS:
trunk:
- OrderedSet
- ReachabilitySwift
- Firebase
- FirebaseABTesting
- FirebaseCore
- FirebaseCoreInternal
- FirebaseInstallations
- FirebaseRemoteConfig
- FirebaseRemoteConfigInterop
- FirebaseSharedSwift
- GoogleUtilities
- PromisesObjC
EXTERNAL SOURCES:
connectivity_plus:
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos
device_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/darwin
file_selector_macos:
:path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
flutter_inappwebview_macos:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos
firebase_core:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos
firebase_remote_config:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_remote_config/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
SPEC CHECKSUMS:
connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9
flutter_inappwebview_macos: 9600c9df9fdb346aaa8933812009f8d94304203d
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
firebase_core: fdf12e0c4349815c2e832d9dcad59fbff0ff394b
firebase_remote_config: 610707ec6f4efbf11225da2c6598e4b092962308
FirebaseABTesting: 589bc28c0ab3e5554336895a34aa262e24276665
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483
FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698
FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e
FirebaseRemoteConfig: 9f3935cefecd85d5b312192117f444957de24a75
FirebaseRemoteConfigInterop: 70d200c6956ef3b5c3592a95e824c1210682d785
FirebaseSharedSwift: 48de4aec81a6b79bb30404e5e6db43ea74848fed
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

View File

@ -41,6 +41,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.4.1"
animations:
dependency: "direct main"
description:
name: animations
sha256: d3d6dcfb218225bbe68e87ccf6378bbb2e32a94900722c5f81611dad089911cb
url: "https://pub.dev"
source: hosted
version: "2.0.11"
archive:
dependency: transitive
description:
@ -574,6 +582,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.0"
flutter_staggered_grid_view:
dependency: transitive
description:
name: flutter_staggered_grid_view
sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
flutter_svg:
dependency: "direct main"
description:
@ -768,6 +784,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.1+1"
infinite_scroll_pagination:
dependency: "direct main"
description:
name: infinite_scroll_pagination
sha256: b68bce20752fcf36c7739e60de4175494f74e99e9a69b4dd2fe3a1dd07a7f16a
url: "https://pub.dev"
source: hosted
version: "4.0.0"
info_popup:
dependency: "direct main"
description:
@ -952,6 +976,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.8"
overlay_support:
dependency: "direct main"
description:
name: overlay_support
sha256: fc39389bfd94e6985e1e13b2a88a125fc4027608485d2d4e2847afe1b2bb339c
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_config:
dependency: transitive
description:
@ -1269,6 +1301,14 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
sliver_tools:
dependency: transitive
description:
name: sliver_tools
sha256: eae28220badfb9d0559207badcbbc9ad5331aac829a88cb0964d330d2a4636a6
url: "https://pub.dev"
source: hosted
version: "0.2.12"
source_gen:
dependency: transitive
description:

View File

@ -90,7 +90,9 @@ dependencies:
cached_network_image: ^3.4.0
url_launcher: ^6.3.0
infinite_scroll_pagination: ^4.0.0
animations: ^2.0.11
overlay_support: ^2.1.0
dev_dependencies:
@ -141,6 +143,8 @@ flutter:
- assets/contact.json
- assets/section.json
- assets/images/
- assets/icon/
- assets/introduction_animation/
- assets/response.json
- shorebird.yaml
- assets/