snehalatha_dev #10

Merged
snehalathad merged 3 commits from snehalatha_dev into dev 2024-12-19 05:58:25 +00:00
8 changed files with 276 additions and 256 deletions
Showing only changes of commit 5185b13694 - Show all commits

View File

@ -3,68 +3,68 @@
"api": "loadFutureEvents",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "saveUserInterestedEvent",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "saveUserAttendingEvent",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "eventOverview",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "getSpecialitiesDonutChart",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "getTopicCloudChart",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "getTopAffiliationBarChart",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "eventSpeakers",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "saveEventsTopicNote",
"interval": 5,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "eventUserAnalytics",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "saveEventOffline",
"interval": 0,
"method": "POST",
"module": "eventapis"
"module": "apis/v1/events"
},
{
"api": "contactslistapi",

View File

@ -202,19 +202,7 @@ Future main() async {
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: [
@ -260,41 +248,39 @@ Future main() async {
create: (_) => HiveDataRepository(
Hive.box<InteractionConfigData>('InteractionConfigDataBox'))),
],
child:
// SafeArea(
// top: true,
// child:
MaterialApp(
theme: ThemeData(
//fontFamily: "SourceSerif",
),
debugShowCheckedModeBanner: false,
title: 'Dynamic Links Example',
initialRoute: '/',
routes: <String, WidgetBuilder>{
'/': (BuildContext context) => FutureBuilder<bool>(
future: SessionManager().isLoggedIn(),
builder: (context, snapshot) {
print("Data_is : $snapshot");
if (snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
final isLoggedIn = snapshot.data ?? false;
print("isLoggedIn_is : $isLoggedIn");
print("secret : $secretkey");
return isLoggedIn
? NavigationHomeScreen()
: IntroductionAnimationScreen();
}
},
), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
// '/details': (BuildContext context) => const HomeScreen(),
},
child: SafeArea(
top: true,
child: MaterialApp(
theme: ThemeData(
//fontFamily: "SourceSerif",
),
debugShowCheckedModeBanner: false,
title: 'Dynamic Links Example',
initialRoute: '/',
routes: <String, WidgetBuilder>{
'/': (BuildContext context) => FutureBuilder<bool>(
future: SessionManager().isLoggedIn(),
builder: (context, snapshot) {
print("Data_is : $snapshot");
if (snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
final isLoggedIn = snapshot.data ?? false;
print("isLoggedIn_is : $isLoggedIn");
print("secret : $secretkey");
return isLoggedIn
? NavigationHomeScreen()
: IntroductionAnimationScreen();
}
},
), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
// '/details': (BuildContext context) => const HomeScreen(),
},
),
),
),
// ),
);
});
}

View File

@ -33,9 +33,18 @@ class ApiCall {
final dio = Dio();
final Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
late Future<String> _token;
String newtoken =
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZWNyZXRlVG9rZW4iOiJiYjNmOTZmYmI5Y2U3ZjA2ZTliOTlkMzRiMGM3YjZkZTBlNjBmYWYzYmM1NDFhZjY0MGQ5ZjAzMGRlNzMxOWM4ZTAwZWNkMCIsImlhdCI6MTczNDM0OTUwNywiZXhwIjoxNzM0MzUxMzA3fQ.nN5XtgmWHVGGdyLEdICY6jTmlg1070rGFwsdyOd4CYY";
String token = "";
ApiCall() {
init();
print("constructor");
}
init() async {
token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
}
//K1 API CALLS
Future<dynamic> parseInfo() async {
Dio dio = Dio();
@ -118,41 +127,42 @@ class ApiCall {
Future<List<EventsList>> getEventsFromK1({int? type}) async {
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
return client;
};
// (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
// (HttpClient client) {
// client.badCertificateCallback =
// (X509Certificate cert, String host, int port) => true;
// return client;
// };
Response response;
String date = "2024-12-17";
var formData =
FormData.fromMap({"start": date, "order_by": 7, 'type': type ?? 1});
// "end": DateTime(2024, 12, 14).toIso8601String(),
_token = _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
String date = "2024-12-12";
var formData = FormData.fromMap({
"start": "2024-12-16",
"order_by": 7,
'type': type ?? 1,
});
print("SAVED TOKEN :${await _token}");
// "end": DateTime(2024, 12, 14).toIso8601String(),
print("SAVED TOKEN :${token}");
//http://192.168.2.130/konectar-staging/apiauths/logout/
try {
// dio.options.contentType = Headers.multipartFormDataContentType;
// dio.options.baseUrl = "https://cardio-staging.konectar.io/";
// dio.options.headers["Authorization"] = "Bearer ${newtoken}";
response = await dio.post(
'https://cardio-staging.konectar.io/apis/v1/events/loadFutureEvents/',
'${EventsConstants.url}${EventsConstants.eventslistapi}',
options: Options(
contentType: "multipart/form-data",
followRedirects: false,
// will not throw errors
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer ${newtoken}',
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("RESPONSE");
print(response.data.toString());
print("RESPONSE ${dio.options.headers}");
print(response);
Map<String, dynamic> jsondata = json.decode(response.data);
EventsData eventresponse = EventsData.fromJson(jsondata);
@ -174,13 +184,24 @@ class ApiCall {
return client;
};
Response response;
var formData = FormData.fromMap(
{"user_email": "vinodh@aissel.com", "eid": eventid, "flag": flag});
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}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eid": eventid,
"flag": flag,
},
@ -199,14 +220,25 @@ class ApiCall {
(X509Certificate cert, String host, int port) => true;
return client;
};
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
Response response;
var formData = FormData.fromMap(
{"user_email": "vinodh@aissel.com", "eid": eventid, "flag": flag});
var formData = FormData.fromMap({"eid": eventid, "flag": flag});
response = await dio.post(
'${EventsConstants.url}${EventsConstants.attendNotAttendEvent}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
queryParameters: {
"user_email": "vinodh@aissel.com",
"eid": eventid,
"flag": flag,
},
@ -223,6 +255,9 @@ class ApiCall {
required String endDate,
required bool client,
}) async {
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();
@ -237,7 +272,6 @@ class ApiCall {
var formData;
if (client) {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -246,7 +280,6 @@ class ApiCall {
});
} else {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -256,7 +289,17 @@ class ApiCall {
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.url}${EventsConstants.specialtyOfSpeakers}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
@ -276,6 +319,9 @@ class ApiCall {
required String startDate,
required String endDate,
required bool client}) async {
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
@ -287,7 +333,6 @@ class ApiCall {
var formData;
if (client) {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -296,7 +341,6 @@ class ApiCall {
});
} else {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -306,7 +350,17 @@ class ApiCall {
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.url}${EventsConstants.insightsTopicsCloud}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
@ -328,6 +382,9 @@ class ApiCall {
required String startDate,
required String endDate,
required bool client}) async {
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
Dio dio = Dio();
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) {
@ -339,7 +396,6 @@ class ApiCall {
var formData;
if (client) {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -348,7 +404,6 @@ class ApiCall {
});
} else {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"eventId": eventid,
"sd": startDate,
"ed": endDate,
@ -358,7 +413,17 @@ class ApiCall {
print("FORMDATA:${formData.toString()},$startDate,$endDate");
response = await dio.post(
'${EventsConstants.url}${EventsConstants.insightsBarChart}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("response SPECIALTY SPEAKERS here!!!!!!!!!!!!!!!!!!!!! ");
@ -385,14 +450,25 @@ class ApiCall {
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"event_id": eventid,
});
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
response = await dio.post(
'${EventsConstants.url}${EventsConstants.eventdetailsapi}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
queryParameters: {
"user_email": "vinodh@aissel.com",
"event_id": eventid,
},
data: formData);
@ -416,17 +492,28 @@ class ApiCall {
};
Response response;
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"event_id": eventid,
"project_id": 1,
});
// "sd": "2024-07-30",
// "ed": "2024-08-03",
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
response = await dio.post(
'${EventsConstants.url}${EventsConstants.speakerslistapi}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
queryParameters: {
"user_email": "vinodh@aissel.com",
"event_id": eventid,
},
data: formData);
@ -451,15 +538,27 @@ class ApiCall {
Response response;
print("formdata : eventid:$eventid kolid:$kolid kid:$kid");
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"event_id": eventid,
"kol_id": kolid,
"k_id": kid,
});
// "proj_kol_id": 0,
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
response = await dio.post(
'${EventsConstants.url}${EventsConstants.showEventsTopicsAndSession}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
queryParameters: {
"user_email": "vinodh@aissel.com",
"event_id": eventid,
@ -493,10 +592,12 @@ class ApiCall {
return client;
};
var formData;
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
Response response;
if (filename != "") {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"kol_events_id": eventid,
"kol_id": kolid,
"event_attendees_id": event_attendees_id,
@ -506,7 +607,6 @@ class ApiCall {
});
} else {
formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"kol_events_id": eventid,
"kol_id": kolid,
"event_attendees_id": event_attendees_id,
@ -518,7 +618,17 @@ class ApiCall {
response = await dio.post(
'${EventsConstants.url}${EventsConstants.saveEventsTopicNote}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("response user ADDSESSION here!!!!!!!!!!!!!!!!!!!!! ");
print(response.data.toString());
@ -540,15 +650,26 @@ class ApiCall {
return client;
};
Response response;
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
var formData = FormData.fromMap({
"user_email": "vinodh@aissel.com",
"kol_events_id": eventid,
});
// "proj_kol_id": 0,
response = await dio.post(
'${EventsConstants.url}${EventsConstants.eventUserAnalytics}',
options: Options(),
options: Options(
followRedirects: true,
validateStatus: (status) => true,
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData);
print("response user ALLSESSIONNOTES here!!!!!!!!!!!!!!!!!!!!! ");
List<AllSessionNotesResponse> data = [];
@ -568,7 +689,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') ?? "";
});
List<ApiConstantsResponse> responseData =
apiConstantsResponseFromJson(jsonResult);
print('Response_data_is: $responseData');
@ -611,7 +734,9 @@ class ApiCall {
});
try {
response = await dio.post(
'${url}${EventsConstants.loginmodule}/${EventsConstants.getVerificationCode}',
'http://192.168.2.130/konectar-staging/apiauths/getVerificationCode/',
//'https://cardio-staging.konectar.io/apiauths/getVerificationCode/',
//'${url}${EventsConstants.loginmodule}/${EventsConstants.getVerificationCode}',
options: Options(),
data: formData);
if (response.statusCode == 200) {
@ -645,8 +770,11 @@ class ApiCall {
"verification_code": code,
"email_id": email,
});
print("LOGIN : API http://192.168.2.130/konectar-staging/apiauths/login");
response = await dio.post(
'${EventsConstants.loginUrl}${EventsConstants.login}',
//'http://192.168.2.130/konectar-staging/apiauths/login',
'http://192.168.2.130/konectar-staging/apiauths/login/',
// '${EventsConstants.loginUrl}${EventsConstants.login}',
options: Options(),
data: formData);
if (response.statusCode == 200) {
@ -671,7 +799,7 @@ class ApiCall {
return client;
};
print("email : $email,device : $deviceid");
_token = _prefs.then((SharedPreferences prefs) {
String token = await _prefs.then((SharedPreferences prefs) {
return prefs.getString('token') ?? "";
});
Response response;
@ -681,13 +809,19 @@ class ApiCall {
"device_id": deviceid,
});
response = await dio.post(
'${EventsConstants.loginUrl}${EventsConstants.logout}',
'http://192.168.2.130/konectar-staging/apiauths/logout/',
// '${EventsConstants.loginUrl}${EventsConstants.logout}',
options: Options(
contentType: "application/x-www-form-urlencoded",
followRedirects: false,
// will not throw errors
followRedirects: true,
validateStatus: (status) => true,
headers: {"Authorization": "Bearer $_token"}),
preserveHeaderCase: true,
headers: {
'Authorization': 'Bearer $token',
"Content-Type":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*',
"Accept":
'application/json, application/x-www-form-urlencoded, multipart/form-data, */*'
}),
data: formData,
// queryParameters: {
// "token": token,

View File

@ -26,10 +26,10 @@ class EventsConstants {
static const String stagingUrl =
"https://cardio-staging.konectar.io/$moduleName/";
static const String url = stagingUrl;
static const String url = devUrl;
static const String devUrl =
"http://192.168.2.130/konectar-sandbox/$moduleName/";
"http://192.168.2.130/konectar-staging/$moduleName/";
static const String loginUrl =
"https://cardio-staging.konectar.io/$loginmodule/";

View File

@ -183,6 +183,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
}
init() async {
await ApiCall().fetchApiConstants();
await Provider.of<EventsProvider>(context, listen: false)
.initConfigModules();
// await Provider.of<EventsProvider>(context, listen: false).initFiltersData();

View File

@ -94,7 +94,7 @@ class _LoginScreenState extends State<LoginScreen> {
if (!mounted) return;
deviceId = _deviceId;
deviceId = "device123456789hhuuww";
print("DEVICE ID########################## :$deviceId");
}
@ -140,50 +140,8 @@ class _LoginScreenState extends State<LoginScreen> {
List<Widget> _buildBody(Orientation orientation, LoginProvider provider) {
return [
// Expanded(
// flex: 1,
// child: Container(
// width: orientation == Orientation.portrait
// ? double.infinity
// : MediaQuery.of(context).size.height * 0.45,
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// colors: [
// Color.fromARGB(255, 8, 39, 92),
// Color.fromARGB(255, 11, 60, 144),
// Color.fromARGB(255, 26, 64, 129),
// ],
// )),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// // SizedBox(
// // width: isTablet ? 160 : 80,
// // height: isTablet ? 160 : 80,
// // child: CircleAvatar(
// // backgroundColor: const Color.fromARGB(255, 126, 134, 147),
// // child: Icon(
// // Icons.person,
// // size: isTablet ? 120 : 60,
// // ),
// // ),
// // ),
// // const SizedBox(
// // height: 20,
// // ),
// Text(
// 'Welcome, you are almost there!',
// style: TextStyle(
// fontSize: isTablet ? 22 : 18, color: Colors.white),
// )
// ],
// ),
// ),
// ),
SizedBox(
height: 10,
height: 40,
),
SvgPicture.asset(
"assets/images/konectar_logo.svg",
@ -193,29 +151,9 @@ class _LoginScreenState extends State<LoginScreen> {
flex: 2,
child: Center(
child: Container(
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// colors: [
// Color.fromARGB(255, 126, 134, 147),
// Color.fromARGB(255, 193, 198, 209),
// Color.fromARGB(255, 214, 217, 223),
// ],
// )),
padding: EdgeInsets.symmetric(
horizontal: 30,
vertical: orientation == Orientation.portrait ? 20 : 0),
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// colors: [
// Color.fromARGB(255, 126, 134, 147),
// Color.fromARGB(255, 193, 198, 209),
// Color.fromARGB(255, 214, 217, 223),
// ],
// )),
child: _buildform(provider),
),
),
@ -287,8 +225,8 @@ class _LoginScreenState extends State<LoginScreen> {
labelStyle: TextStyle(fontSize: isTablet ? 18.0 : 16),
labelText: "Domain",
hintStyle: TextStyle(fontSize: isTablet ? 18.0 : 16),
prefix: Text("https://"),
suffix: Text(".io/"),
prefix: Text("https:// "),
suffix: Text(" .konectar.io/"),
hintText: "Enter your Domain"),
),
),
@ -331,35 +269,13 @@ class _LoginScreenState extends State<LoginScreen> {
provider.loading = true;
});
print("email:${emailTextController.text}");
// if (await _logout) {
// print("LOGOUT");
// provider.code = secretKeyTextConrtroller.text;
// Map<String, dynamic> resp = await provider.verifyCode(
// emailTextController.text, secretKeyTextConrtroller.text);
// if (resp["code"] == "1200") {
// provider.loading = false;
// provider.showCodeField = false;
// provider.showMessage = true;
// _displaySnackBar("You have logged in successfully");
// _saveprefs(resp["token"], emailTextController.text,
// secretKeyTextConrtroller.text, true)
// .then((value) {
// Navigator.of(context).pushReplacement(
// MaterialPageRoute(
// builder: (context) => NavigationHomeScreen()),
// );
// });
// } else {
// provider.message = resp["message"];
// }
// } else {
print("FIRST LOGIN");
if (!provider.showCodeField) {
provider.email = emailTextController.text;
// String encoded =
// base64.encode(utf8.encode(deviceId));
String domain =
"https://${domainTextConrtroller.text}.io/";
"https://${domainTextConrtroller.text}.konectar.io/";
var resp = await provider.verifyEmail(domain,
emailTextController.text, deviceId!, platform);
if (resp != null) {
@ -439,50 +355,24 @@ class _LoginScreenState extends State<LoginScreen> {
secretKeyTextConrtroller.text = provider.code!;
});
}
// }
//_joinMeeting(roomText.text, "demo meet2");
// _saveprefs(
// emailTextController.text,
// true)
// .then((value) {
// Navigator.of(context).pushReplacement(
// MaterialPageRoute(
// builder: (context) => FirebaseExample(
// title: secretKeyTextConrtroller.text,
// )),
// );
// }
// );
} else {
_displaySnackBar(textFieldsValidation(provider));
}
},
// onPressed: () async {
// await ApiCall().fetchApiConstants().then(
// (value) {
// Navigator.of(context).pushReplacement(
// MaterialPageRoute(
// builder: (context) => NavigationHomeScreen()),
// );
// },
// );
// },
textColor: Colors.white,
fontsize: isTablet ? 22 : 18,
title: provider.showCodeField ? "Verify" : "Sign In"),
title: provider.showCodeField ? "Verify Code" : "Sign In"),
),
SizedBox(
height: 10,
),
provider.showMessage
? Text(provider.message!)
: provider.loading
? Center(child: CircularProgressIndicator())
: SizedBox.shrink(),
Center(
child: provider.showMessage
? Text(provider.message!)
: provider.loading
? Center(child: CircularProgressIndicator())
: SizedBox.shrink(),
),
]),
);
}
@ -520,16 +410,11 @@ class _LoginScreenState extends State<LoginScreen> {
return isloggedout;
});
});
// await SessionManager().setLoggedIn(isloggedin);
// UserData userData =
// UserData(email: email, name: token, domainUrl: domain, secretkey: key);
// await provider.saveUserData(userData);
}
_displaySnackBar(String msg) {
final snackBar = SnackBar(content: Text(msg));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
}
String textFieldsValidation(LoginProvider provider) {

View File

@ -82,6 +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,
),
),
Container(
padding: const EdgeInsets.only(bottom: 100),
child: Column(

View File

@ -204,7 +204,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
child: ListView.builder(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(0.0),
itemCount: drawerList?.length,
itemCount: drawerList?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return inkwell(drawerList![index]);
},