Merge pull request 'updated changes' (#11) from snehalatha_dev into dev
Reviewed-on: #11
This commit is contained in:
commit
73e5211dbd
|
@ -3,68 +3,68 @@
|
|||
"api": "loadFutureEvents",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
|
||||
{
|
||||
"api": "saveUserInterestedEvent",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "saveUserAttendingEvent",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "eventOverview",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "getSpecialitiesDonutChart",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "getTopicCloudChart",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "getTopAffiliationBarChart",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "eventSpeakers",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "saveEventsTopicNote",
|
||||
"interval": 5,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "eventUserAnalytics",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "saveEventOffline",
|
||||
"interval": 0,
|
||||
"method": "POST",
|
||||
"module": "apis/v1/events"
|
||||
"module": "apis/v1/events/"
|
||||
},
|
||||
{
|
||||
"api": "contactslistapi",
|
||||
|
|
|
@ -74,6 +74,8 @@ PODS:
|
|||
- FirebaseRemoteConfigInterop (10.25.0)
|
||||
- FirebaseSharedSwift (10.25.0)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_background_service_ios (0.0.3):
|
||||
- Flutter
|
||||
- GoogleUtilities/Environment (7.13.3):
|
||||
- GoogleUtilities/Privacy
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
|
@ -120,6 +122,7 @@ DEPENDENCIES:
|
|||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_background_service_ios (from `.symlinks/plugins/flutter_background_service_ios/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- mobile_device_identifier (from `.symlinks/plugins/mobile_device_identifier/ios`)
|
||||
- open_file (from `.symlinks/plugins/open_file/ios`)
|
||||
|
@ -160,6 +163,8 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/firebase_remote_config/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_background_service_ios:
|
||||
:path: ".symlinks/plugins/flutter_background_service_ios/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
mobile_device_identifier:
|
||||
|
@ -194,6 +199,7 @@ SPEC CHECKSUMS:
|
|||
FirebaseRemoteConfigInterop: b25018791b204c0d78a90e394d6c62d9b1f22da8
|
||||
FirebaseSharedSwift: 0274086954b1b2d5fd7e829eccc587044d72a4ba
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_background_service_ios: e30e0d3ee69e4cee66272d0c78eacd48c2e94aac
|
||||
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
|
||||
image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
|
||||
JNKeychain: fb6cc9ec95959ba46cd95d0ee6f7a05e41da9f42
|
||||
|
|
|
@ -520,10 +520,11 @@ import 'contacts_module/provider_class/award_provider.dart';
|
|||
import 'firebase_options.dart';
|
||||
import 'package:flutter_background_service/flutter_background_service.dart';
|
||||
|
||||
late SharedPreferences sp;
|
||||
Future main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// startPeriodicCalls();
|
||||
|
||||
sp = await SharedPreferences.getInstance();
|
||||
await Hive.initFlutter();
|
||||
await initializeService();
|
||||
|
||||
|
|
|
@ -21,13 +21,14 @@ class HiveApiConstantsAdapter extends TypeAdapter<HiveApiConstants> {
|
|||
interval: fields[1] as int?,
|
||||
method: fields[2] as String?,
|
||||
module: fields[3] as String?,
|
||||
hivename: fields[4] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, HiveApiConstants obj) {
|
||||
writer
|
||||
..writeByte(4)
|
||||
..writeByte(5)
|
||||
..writeByte(0)
|
||||
..write(obj.functionName)
|
||||
..writeByte(1)
|
||||
|
@ -35,7 +36,9 @@ class HiveApiConstantsAdapter extends TypeAdapter<HiveApiConstants> {
|
|||
..writeByte(2)
|
||||
..write(obj.method)
|
||||
..writeByte(3)
|
||||
..write(obj.module);
|
||||
..write(obj.module)
|
||||
..writeByte(4)
|
||||
..write(obj.hivename);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'dart:io';
|
|||
import 'package:dio/dio.dart';
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:konectar_events/main.dart';
|
||||
import 'package:konectar_events/model/affiliationsmodel.dart';
|
||||
import 'package:konectar_events/model/allsessionnotesmodel.dart';
|
||||
import 'package:konectar_events/model/api_constants_model.dart';
|
||||
|
@ -30,19 +31,9 @@ import 'package:http/http.dart' as http;
|
|||
|
||||
class ApiCall {
|
||||
final dio = Dio();
|
||||
final Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
|
||||
|
||||
String token = "";
|
||||
ApiCall() {
|
||||
init();
|
||||
print("constructor");
|
||||
}
|
||||
|
||||
init() async {
|
||||
token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
}
|
||||
String token = sp.getString('token') ?? "";
|
||||
String global_url = sp.getString('url') ?? "";
|
||||
|
||||
//K1 API CALLS
|
||||
Future<dynamic> parseInfo() async {
|
||||
|
@ -140,15 +131,16 @@ class ApiCall {
|
|||
'type': type ?? 1,
|
||||
});
|
||||
// "end": DateTime(2024, 12, 14).toIso8601String(),
|
||||
token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// token = sp.getString('token') ?? "";
|
||||
// await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
print("SAVED TOKEN :${token}");
|
||||
|
||||
//http://192.168.2.130/konectar-staging/apiauths/logout/
|
||||
try {
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.eventslistapi}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.eventslistapi}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -185,12 +177,12 @@ class ApiCall {
|
|||
return client;
|
||||
};
|
||||
Response response;
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
var formData = FormData.fromMap({"eid": eventid, "flag": flag});
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.followUnfollowEvent}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.followUnfollowEvent}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -221,13 +213,13 @@ class ApiCall {
|
|||
(X509Certificate cert, String host, int port) => true;
|
||||
return client;
|
||||
};
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
Response response;
|
||||
var formData = FormData.fromMap({"eid": eventid, "flag": flag});
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.attendNotAttendEvent}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.attendNotAttendEvent}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -256,9 +248,9 @@ class ApiCall {
|
|||
required String endDate,
|
||||
required bool client,
|
||||
}) async {
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
print(
|
||||
"FORMAT_CHECK_DATE $startDate $endDate $eventid ${DateTime(2024, 12, 03).toIso8601String()}");
|
||||
Dio dio = Dio();
|
||||
|
@ -289,7 +281,7 @@ class ApiCall {
|
|||
|
||||
print("FORMDATA:${formData.toString()},$startDate,$endDate");
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.specialtyOfSpeakers}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.specialtyOfSpeakers}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -320,9 +312,9 @@ class ApiCall {
|
|||
required String startDate,
|
||||
required String endDate,
|
||||
required bool client}) async {
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
Dio dio = Dio();
|
||||
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||
(HttpClient client) {
|
||||
|
@ -350,7 +342,7 @@ class ApiCall {
|
|||
|
||||
print("FORMDATA:${formData.toString()},$startDate,$endDate");
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.insightsTopicsCloud}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.insightsTopicsCloud}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -383,9 +375,9 @@ class ApiCall {
|
|||
required String startDate,
|
||||
required String endDate,
|
||||
required bool client}) async {
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
Dio dio = Dio();
|
||||
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||
(HttpClient client) {
|
||||
|
@ -413,7 +405,7 @@ class ApiCall {
|
|||
|
||||
print("FORMDATA:${formData.toString()},$startDate,$endDate");
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.insightsBarChart}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.insightsBarChart}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -453,11 +445,11 @@ class ApiCall {
|
|||
var formData = FormData.fromMap({
|
||||
"event_id": eventid,
|
||||
});
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.eventdetailsapi}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.eventdetailsapi}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -498,11 +490,11 @@ class ApiCall {
|
|||
});
|
||||
// "sd": "2024-07-30",
|
||||
// "ed": "2024-08-03",
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.speakerslistapi}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.speakerslistapi}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -544,11 +536,11 @@ class ApiCall {
|
|||
"k_id": kid,
|
||||
});
|
||||
// "proj_kol_id": 0,
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.showEventsTopicsAndSession}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.showEventsTopicsAndSession}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -593,9 +585,9 @@ class ApiCall {
|
|||
return client;
|
||||
};
|
||||
var formData;
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
Response response;
|
||||
if (filename != "") {
|
||||
formData = FormData.fromMap({
|
||||
|
@ -618,7 +610,7 @@ class ApiCall {
|
|||
// "/Users/aissel/Library/Developer/CoreSimulator/Devices/1E435121-7E65-45C6-9E0B-411C8B9915F5/data/Containers/Data/Application/3CBC1CFF-79AD-49FA-A6E0-13D0AA2959D2/tmp/Flutter Questionaire.pdf",
|
||||
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.saveEventsTopicNote}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.saveEventsTopicNote}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -651,15 +643,15 @@ class ApiCall {
|
|||
return client;
|
||||
};
|
||||
Response response;
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
var formData = FormData.fromMap({
|
||||
"kol_events_id": eventid,
|
||||
});
|
||||
// "proj_kol_id": 0,
|
||||
response = await dio.post(
|
||||
'${EventsConstants.url}${EventsConstants.eventUserAnalytics}',
|
||||
'${global_url}${EventsConstants.moduleName}${EventsConstants.eventUserAnalytics}',
|
||||
options: Options(
|
||||
followRedirects: true,
|
||||
validateStatus: (status) => true,
|
||||
|
@ -690,9 +682,9 @@ class ApiCall {
|
|||
dynamic jsonResult =
|
||||
jsonDecode(await rootBundle.loadString("assets/api_constants.json"));
|
||||
//dynamic jsonResult = await MockApiCall().getConfigDataMedical();
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
List<ApiConstantsResponse> responseData =
|
||||
apiConstantsResponseFromJson(jsonResult);
|
||||
print('Response_data_is: $responseData');
|
||||
|
@ -775,7 +767,7 @@ class ApiCall {
|
|||
response = await dio.post(
|
||||
//'http://192.168.2.130/konectar-staging/apiauths/login',
|
||||
//'http://192.168.2.130/konectar-staging/apiauths/login/',
|
||||
'${EventsConstants.loginUrl}${EventsConstants.login}',
|
||||
'${global_url}${EventsConstants.loginmodule}${EventsConstants.login}',
|
||||
options: Options(),
|
||||
data: formData);
|
||||
if (response.statusCode == 200) {
|
||||
|
@ -800,9 +792,9 @@ class ApiCall {
|
|||
return client;
|
||||
};
|
||||
print("email : $email,device : $deviceid");
|
||||
String token = await _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getString('token') ?? "";
|
||||
});
|
||||
// String token = await _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('token') ?? "";
|
||||
// });
|
||||
Response response;
|
||||
print("url :${EventsConstants.loginUrl}${EventsConstants.logout}/");
|
||||
var formData = FormData.fromMap({
|
||||
|
@ -828,12 +820,17 @@ class ApiCall {
|
|||
// "token": token,
|
||||
// },
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print("response user LoGOUT!!!!!!!!!!!!!!!!!!!!! \n ${response.data} ");
|
||||
|
||||
VerificationResponse verificationResponse =
|
||||
verificationResponseFromJson(response.data);
|
||||
return verificationResponse;
|
||||
}
|
||||
print(response.data.toString());
|
||||
|
||||
return response.data;
|
||||
return "";
|
||||
}
|
||||
//************ K2 API CALLS ***********************************************************************************************************************************
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class EventsConstants {
|
|||
//192.0.0.2:8007 - iphone
|
||||
// 192.168.2.109:8007 - office jkqehjkq
|
||||
//K1 API~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
static const String moduleName = "apis/v1/events";
|
||||
static const String moduleName = "apis/v1/events/";
|
||||
static const String loginmodule = "apiauths";
|
||||
|
||||
static const String stagingUrl =
|
||||
|
|
|
@ -66,6 +66,8 @@ class _EventsListingScreenState extends State<EventsListingScreen>
|
|||
pagingController.addPageRequestListener((pageKey) {
|
||||
_fetchPages(pageKey, provider);
|
||||
});
|
||||
pagingController.addStatusListener(_showError);
|
||||
pagingController.error = "No Speakers";
|
||||
}
|
||||
|
||||
Future<void> _fetchPage(int pageKey) async {
|
||||
|
@ -101,7 +103,7 @@ class _EventsListingScreenState extends State<EventsListingScreen>
|
|||
pagingController.appendPage(newItems, nextPageKey);
|
||||
}
|
||||
} catch (error) {
|
||||
pagingController.error = error;
|
||||
pagingController.error = "Speakers not Available";
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
@ -110,15 +112,51 @@ class _EventsListingScreenState extends State<EventsListingScreen>
|
|||
List<EventSpeakersData> list = await provider
|
||||
.getInitialSpeakersDetails(widget.event.id!, searchkey: searchSpeaker);
|
||||
print("CHECK LENGTH ${list.length}");
|
||||
final isLastPage = pageKey + _pageSize >= list.length;
|
||||
final nextItems =
|
||||
list.skip(pageKey).take(_pageSize).toList(); // Get next batch of items
|
||||
try {
|
||||
final isLastPage = pageKey + _pageSize >= list.length;
|
||||
final nextItems = list
|
||||
.skip(pageKey)
|
||||
.take(_pageSize)
|
||||
.toList(); // Get next batch of items
|
||||
|
||||
if (isLastPage) {
|
||||
pagingController.appendLastPage(nextItems);
|
||||
} else {
|
||||
final nextPageKey = pageKey + nextItems.length;
|
||||
pagingController.appendPage(nextItems, nextPageKey);
|
||||
if (isLastPage) {
|
||||
pagingController.appendLastPage(nextItems);
|
||||
} else {
|
||||
final nextPageKey = pageKey + nextItems.length;
|
||||
pagingController.appendPage(nextItems, nextPageKey);
|
||||
}
|
||||
} catch (error) {
|
||||
pagingController.error = "Speakers not Available";
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _showError(PagingStatus status) async {
|
||||
if (status == PagingStatus.subsequentPageError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: const Text(
|
||||
'Something went wrong while fetching',
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: 'Retry',
|
||||
onPressed: () => pagingController.retryLastFailedRequest(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (status == PagingStatus.noItemsFound) {
|
||||
pagingController.error = "Speakers not available";
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: const Text(
|
||||
'Speakers not available',
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: 'Retry',
|
||||
onPressed: () => pagingController.retryLastFailedRequest(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1599,46 +1637,29 @@ class _EventsListingScreenState extends State<EventsListingScreen>
|
|||
}
|
||||
}
|
||||
|
||||
return
|
||||
// isTablet
|
||||
// ? Container(
|
||||
// margin: EdgeInsets.symmetric(vertical: 20.0),
|
||||
// height: 200.0,
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
// children: <Widget>[
|
||||
// _topicCard("Top 3 topics",
|
||||
// " 1. Hematologic Neoplasms \n 2. Antibodies, Bispecific \n 3. Multiple Myeloma"),
|
||||
// _topicCard("Speakers with most sessions",
|
||||
// " 1. James A. Davis \n 2. Sandra Cuellar \n 3. Allison Butts"),
|
||||
// _topicCard("Sponsors",
|
||||
// " 1. Amgen Inc \n 2. Bristol-Myers Squibb Company \n 3. Genmab A/S")
|
||||
// ],
|
||||
// ))
|
||||
// :
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
color: AppColors.bgcolor,
|
||||
padding: EdgeInsets.only(left: 8, right: 8),
|
||||
child: SingleChildScrollView(
|
||||
child: Expanded(
|
||||
child: Column(children: [
|
||||
SizedBox(
|
||||
height: 5,
|
||||
return (topTopics.isEmpty && topSponsors.isEmpty && topSpeakers.isEmpty)
|
||||
? Center(child: Text("Details not available!"))
|
||||
: Container(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
color: AppColors.bgcolor,
|
||||
padding: EdgeInsets.only(left: 8, right: 8),
|
||||
child: SingleChildScrollView(
|
||||
child: Expanded(
|
||||
child: Column(spacing: 3, children: [
|
||||
topTopics.isEmpty
|
||||
? SizedBox.shrink()
|
||||
: listViewTopicCard("Top 3 topics", topTopics, true),
|
||||
topSpeakers.isEmpty
|
||||
? SizedBox.shrink()
|
||||
: listViewTopicCard(
|
||||
"Speakers with most sessions", topSpeakers, true),
|
||||
topSponsors.isEmpty
|
||||
? SizedBox.shrink()
|
||||
: listViewTopicCard("Sponsors", topSponsors, true)
|
||||
]),
|
||||
),
|
||||
),
|
||||
listViewTopicCard("Top 3 topics", topTopics, true),
|
||||
SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
listViewTopicCard("Speakers with most sessions", topSpeakers, true),
|
||||
SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
listViewTopicCard("Sponsors", topSponsors, true)
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Widget _topicCard(String title, String content) {
|
||||
|
|
|
@ -96,6 +96,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||
pagingController.addPageRequestListener((pageKey) {
|
||||
_fetchPage(pageKey);
|
||||
});
|
||||
pagingController.addStatusListener(_showError);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -184,6 +185,22 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> _showError(PagingStatus status) async {
|
||||
if (status == PagingStatus.subsequentPageError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: const Text(
|
||||
'Something went wrong while fetching',
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: 'Retry',
|
||||
onPressed: () => pagingController.retryLastFailedRequest(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
init() async {
|
||||
await ApiCall().fetchApiConstants();
|
||||
await Provider.of<EventsProvider>(context, listen: false)
|
||||
|
|
|
@ -87,6 +87,7 @@ class _EventsInsightsState extends State<EventsInsights> {
|
|||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
child: Wrap(
|
||||
|
@ -139,7 +140,12 @@ class _EventsInsightsState extends State<EventsInsights> {
|
|||
color: AppColors.blueColor,
|
||||
),
|
||||
)
|
||||
: _buildCharts(provider, widgets),
|
||||
: (provider.affiliations.affiliationCount.isEmpty &&
|
||||
provider.specialtyList.isEmpty &&
|
||||
widgets.isEmpty &&
|
||||
widget.allSessionNotes.isEmpty)
|
||||
? Center(child: Text("Insights not available!"))
|
||||
: _buildCharts(provider, widgets),
|
||||
widget.allSessionNotes.isNotEmpty
|
||||
? labelWidget("Session Notes")
|
||||
: SizedBox.shrink(),
|
||||
|
|
|
@ -46,6 +46,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
late Future<bool> _login;
|
||||
late Future<bool> _logout;
|
||||
late Future<String> _verification_code;
|
||||
late Future<String> _url;
|
||||
String platform = "android";
|
||||
String? deviceId;
|
||||
final _mobileDeviceIdentifierPlugin = MobileDeviceIdentifier();
|
||||
|
@ -62,20 +63,16 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
platform = "ios";
|
||||
}
|
||||
});
|
||||
// _username = _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('username') ?? "";
|
||||
// });
|
||||
|
||||
_useremail = _prefs.then((SharedPreferences prefs) {
|
||||
emailTextController.text = prefs.getString('useremail') ?? "";
|
||||
return prefs.getString('useremail') ?? "";
|
||||
});
|
||||
// _domain = _prefs.then((SharedPreferences prefs) {
|
||||
// return prefs.getString('domain') ?? "";
|
||||
// });
|
||||
// _key = _prefs.then((SharedPreferences prefs) {
|
||||
// secretKeyTextConrtroller.text = prefs.getString('secretkey') ?? "";
|
||||
// return prefs.getString('secretkey') ?? "";
|
||||
// });
|
||||
_domain = _prefs.then((SharedPreferences prefs) {
|
||||
domainTextConrtroller.text = prefs.getString('domain') ?? "";
|
||||
return prefs.getString('domain') ?? "";
|
||||
});
|
||||
|
||||
_login = _prefs.then((SharedPreferences prefs) {
|
||||
return prefs.getBool('isloggedin') ?? false;
|
||||
});
|
||||
|
@ -270,13 +267,14 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
provider.loading = true;
|
||||
});
|
||||
print("email:${emailTextController.text}");
|
||||
String domain =
|
||||
"https://${domainTextConrtroller.text}.konectar.io/";
|
||||
print("FIRST LOGIN");
|
||||
if (!provider.showCodeField) {
|
||||
provider.email = emailTextController.text;
|
||||
// String encoded =
|
||||
// base64.encode(utf8.encode(deviceId));
|
||||
String domain =
|
||||
"https://${domainTextConrtroller.text}.konectar.io/";
|
||||
|
||||
var resp = await provider.verifyEmail(domain,
|
||||
emailTextController.text, deviceId!, platform);
|
||||
if (resp != null) {
|
||||
|
@ -303,6 +301,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
emailTextController.text,
|
||||
secretKeyTextConrtroller.text,
|
||||
deviceId!,
|
||||
domain,
|
||||
true)
|
||||
.then((value) {
|
||||
Navigator.of(context).pushReplacement(
|
||||
|
@ -318,7 +317,6 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
SnackBarWidget.displaySnackBar(
|
||||
resp.message, context,
|
||||
error: true);
|
||||
();
|
||||
}
|
||||
|
||||
provider.message = resp.message;
|
||||
|
@ -341,6 +339,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
emailTextController.text,
|
||||
secretKeyTextConrtroller.text,
|
||||
deviceId!,
|
||||
domain,
|
||||
true)
|
||||
.then((value) {
|
||||
Navigator.of(context).pushReplacement(
|
||||
|
@ -378,8 +377,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> _saveprefs(
|
||||
String token, String email, String key, String vcode, bool login) async {
|
||||
Future<void> _saveprefs(String token, String email, String key, String vcode,
|
||||
String url, bool login) async {
|
||||
final SharedPreferences prefs = await _prefs;
|
||||
final String useremail = (prefs.getString('useremail') ?? '');
|
||||
final String username = (prefs.getString('username') ?? '');
|
||||
|
@ -387,6 +386,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
final String secretkey = (prefs.getString('secretkey') ?? '');
|
||||
final String verification_code =
|
||||
(prefs.getString('verfication_code') ?? '');
|
||||
final String urlstr = (prefs.getString('url') ?? '');
|
||||
final bool isloggedin = (prefs.getBool('isloggedin') ?? false);
|
||||
final bool isloggedout = (prefs.getBool('isloggedout') ?? false);
|
||||
setState(() {
|
||||
|
@ -404,6 +404,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||
prefs.setString('deviceid', vcode).then((bool success) {
|
||||
return verification_code;
|
||||
});
|
||||
_url = prefs.setString('url', url).then((bool success) {
|
||||
return urlstr;
|
||||
});
|
||||
_login = prefs.setBool('isloggedin', login).then((bool success) {
|
||||
return isloggedin;
|
||||
});
|
||||
|
|
|
@ -82,20 +82,20 @@ class CareView extends StatelessWidget {
|
|||
// // width: MediaQuery.of(context).size.width,
|
||||
// // height: MediaQuery.of(context).size.height,
|
||||
// ),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(100),
|
||||
topLeft: Radius.circular(100)),
|
||||
color: const Color.fromARGB(255, 167, 203, 234),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
height: MediaQuery.of(context).size.height / 2,
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
),
|
||||
),
|
||||
// Align(
|
||||
// alignment: Alignment.centerRight,
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.only(
|
||||
// bottomLeft: Radius.circular(100),
|
||||
// topLeft: Radius.circular(100)),
|
||||
// color: const Color.fromARGB(255, 167, 203, 234),
|
||||
// shape: BoxShape.rectangle,
|
||||
// ),
|
||||
// height: MediaQuery.of(context).size.height / 2,
|
||||
// width: MediaQuery.of(context).size.width / 4,
|
||||
// ),
|
||||
// ),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(bottom: 100),
|
||||
child: Column(
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:konectar_events/utils/sessionmanager.dart';
|
|||
import 'package:konectar_events/view/login.dart';
|
||||
import 'package:konectar_events/viewmodel/hive_repository.dart';
|
||||
import 'package:konectar_events/viewmodel/loginprovider.dart';
|
||||
import 'package:konectar_events/widgets/snackbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
|
@ -335,16 +336,26 @@ class _HomeDrawerState extends State<HomeDrawer> {
|
|||
|
||||
void onTapped() async {
|
||||
print("device id : ${await _deviceid}");
|
||||
final resp = await ApiCall().logout(await _useremail, await _deviceid);
|
||||
dynamic resp = await ApiCall().logout(await _useremail, await _deviceid);
|
||||
print("resp:$resp");
|
||||
await SessionManager().logoutSession(false).then((value) {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
// Navigator.of(context, rootNavigator: true).pushReplacementNamed("/");
|
||||
Navigator.pushReplacement(
|
||||
if (resp.status == 1200) {
|
||||
SnackBarWidget.displaySnackBar(
|
||||
resp.message,
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => LoginScreen()),
|
||||
);
|
||||
});
|
||||
await SessionManager().logoutSession(false).then((value) {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
// Navigator.of(context, rootNavigator: true).pushReplacementNamed("/");
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => LoginScreen()),
|
||||
);
|
||||
});
|
||||
} else {
|
||||
SnackBarWidget.displaySnackBar(
|
||||
"Something went wrong..Try Again!", context,
|
||||
error: true);
|
||||
}
|
||||
}
|
||||
|
||||
Widget inkwell(DrawerList listData) {
|
||||
|
|
Loading…
Reference in New Issue