diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..52edd0e --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "580254405290", + "project_id": "tradercircuit-b5744", + "storage_bucket": "tradercircuit-b5744.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:580254405290:android:77f13f510048b79e10b6d3", + "android_client_info": { + "package_name": "com.example.traderscircuit" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDA19anPZQE9wwK0Lbr-KMoa-dfIanZrlU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..26ef972 --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyDcB4KjuddPkpnWwqutw_4TlfKaOTZIXa0 + GCM_SENDER_ID + 580254405290 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.traderscircuit + PROJECT_ID + tradercircuit-b5744 + STORAGE_BUCKET + tradercircuit-b5744.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:580254405290:ios:94435ecb64979c4a10b6d3 + + \ No newline at end of file diff --git a/ios/firebase_app_id_file.json b/ios/firebase_app_id_file.json new file mode 100644 index 0000000..7969e23 --- /dev/null +++ b/ios/firebase_app_id_file.json @@ -0,0 +1,7 @@ +{ + "file_generated_by": "FlutterFire CLI", + "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", + "GOOGLE_APP_ID": "1:580254405290:ios:94435ecb64979c4a10b6d3", + "FIREBASE_PROJECT_ID": "tradercircuit-b5744", + "GCM_SENDER_ID": "580254405290" +} \ No newline at end of file diff --git a/lib/Utils/Common/FilePicker.dart b/lib/Utils/Common/FilePicker.dart index 94930db..11d00a0 100644 --- a/lib/Utils/Common/FilePicker.dart +++ b/lib/Utils/Common/FilePicker.dart @@ -2,11 +2,12 @@ import 'dart:io'; import 'package:file_picker/file_picker.dart'; import 'package:get/get.dart'; -import 'package:traderscircuit/Utils/Dialogs.dart'; import 'package:path/path.dart' as path; import 'package:traderscircuit/controller/contact_us_controller.dart'; +import '../utils.dart'; + class FilePickerMethod { ContactUsController contactUsController = Get.put(ContactUsController()); String extractFileName(String filePath) { @@ -29,7 +30,7 @@ class FilePickerMethod { if (result != null) { if (contactUsController.attachmentFileList.length + result.count > 3) { - utils.showToast("Can Select Max 3 Files"); + Utils.showToast("Can Select Max 3 Files"); return null; } else { return result.paths.map((path) => File(path!)).toList(); diff --git a/lib/Utils/Dialogs.dart b/lib/Utils/Dialogs.dart deleted file mode 100644 index 6cc75b5..0000000 --- a/lib/Utils/Dialogs.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; -import 'package:get/get.dart'; - -class utils { - static showToast(String? msg) { - if (msg != null && msg != "null" && msg.isNotEmpty) { - Fluttertoast.showToast(msg: msg); - } - } - - static loader() { - Get.dialog( - Dialog( - elevation: 0, - backgroundColor: Colors.transparent, - child: WillPopScope( - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CircularProgressIndicator( - color: Color(0xffc18948), - ), - ], - ), - ), - onWillPop: () async => false), - ), - barrierDismissible: false, - ); - } -} diff --git a/lib/Utils/api_urls.dart b/lib/Utils/api_urls.dart new file mode 100644 index 0000000..c5ee233 --- /dev/null +++ b/lib/Utils/api_urls.dart @@ -0,0 +1,16 @@ +class ApiUrls { + //Base URL + static const base = "http://192.168.50.117/Trader_circuit/api/"; + + // About API + static String aboutUsApi = "${base}aboutUs"; + + // Privacy Policy API + static String privacyPolicyApi = "${base}privacyPolicy"; + + //Terms and Condition API + static String termsConditionApi = "${base}termsAndCondition"; + + //FAQ API + static String faqApi = "${base}getFaq"; +} diff --git a/lib/Utils/base_manager.dart b/lib/Utils/base_manager.dart new file mode 100644 index 0000000..a8bae41 --- /dev/null +++ b/lib/Utils/base_manager.dart @@ -0,0 +1,18 @@ +class ResponseData { + ResponseData(this.message, this.status, {this.data}); + + final T? data; + final String message; + final ResponseStatus status; + + @override + String toString() => message; +} + +enum ResponseStatus { + SUCCESS, + + FAILED, + + PRIVATE, +} diff --git a/lib/Utils/utils.dart b/lib/Utils/utils.dart new file mode 100644 index 0000000..f4a7b1a --- /dev/null +++ b/lib/Utils/utils.dart @@ -0,0 +1,64 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:get/get.dart' as getx; + +class Utils { + static Future networkImageToMultipartFile( + String imageUrl) async { + Dio dio = Dio(); + + Response response = await dio.get(imageUrl, + options: Options(responseType: ResponseType.bytes)); + + MultipartFile multipartFile = MultipartFile.fromBytes( + response.data!, + filename: imageUrl.substring(imageUrl.lastIndexOf("/") + 1), + ); + + return multipartFile; + } + + static Future assetImageToMultipartFile( + String assetImagePath, String fileName) async { + ByteData assetByteData = await rootBundle.load(assetImagePath); + List assetBytes = assetByteData.buffer.asUint8List(); + + MultipartFile file = MultipartFile.fromBytes( + assetBytes, + filename: fileName, + ); + + return file; + } + + static showToast(String? msg) { + if (msg != null && msg != "null" && msg.isNotEmpty) { + Fluttertoast.showToast( + msg: msg, + toastLength: Toast.LENGTH_LONG, + ); + } + } + + static loader() { + getx.Get.dialog( + Dialog( + elevation: 0, + backgroundColor: Colors.transparent, + child: WillPopScope( + child: const Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator( + color: Color(0xFF9A0000), + ), + ], + ), + onWillPop: () async => false), + ), + barrierDismissible: false, + ); + } +} diff --git a/lib/data/network/base_api_services.dart b/lib/data/network/base_api_services.dart new file mode 100644 index 0000000..65480a0 --- /dev/null +++ b/lib/data/network/base_api_services.dart @@ -0,0 +1,5 @@ +abstract class BaseApiServices { + Future getApi(String url); + Future postApi(var data, String url); + Future deleteApi(String url, var data); +} diff --git a/lib/data/network/network_api_services.dart b/lib/data/network/network_api_services.dart new file mode 100644 index 0000000..1427fdd --- /dev/null +++ b/lib/data/network/network_api_services.dart @@ -0,0 +1,158 @@ +import 'dart:developer'; + +import 'package:flutter/foundation.dart'; + +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:dio/dio.dart'; +import 'package:traderscircuit/Utils/utils.dart'; + +import '../../Utils/base_manager.dart'; +import 'base_api_services.dart'; + +class NetworkApiServices extends BaseApiServices { + Dio dio = Dio(); + + @override + Future getApi(String url) async { + if (kDebugMode) { + print("api url is >>> $url"); + } + Response response; + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('token').toString(); + log(token); + try { + response = await dio.get( + url, + // options: Options(headers: { + // 'authorization': "Bearer $token", + + // // "device-id": deviceId + // }) + ); + + if (response.statusCode == 200) { + return ResponseData( + "success", + data: response.data, + ResponseStatus.SUCCESS, + ); + } else { + try { + return ResponseData( + response.data['message'].toString(), ResponseStatus.FAILED); + } catch (_) { + return ResponseData( + response.statusMessage!, ResponseStatus.FAILED); + } + } + } on Exception catch (e) { + if (e is DioException) { + if (e.response == null) { + // Get.to(() => const ErrorScreen()); + } else {} + } + return ResponseData( + 'Oops something Went Wrong', ResponseStatus.FAILED); + } + } + + @override + Future postApi(data, String url) async { + if (kDebugMode) { + print("data >>> $data"); + print("api url is >>> $url"); + } + Response response; + + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('token'); + try { + response = await dio.post(url, + data: data, + options: (token == null || token == "") + ? Options( + headers: { + "Authorization": + "Basic KzIkcVBiSlIzNncmaGUoalMmV0R6ZkpqdEVoSlVLVXA6dCRCZHEmSnQmc3Y0eUdqY0VVcTg5aEVZZHVSalhIMnU=", + }, + ) + : Options(headers: { + "Authorization": "Bearer $token", + //'access-token': token, + })); + } on Exception catch (e) { + if (e is DioException) { + log(e.response.toString()); + if (e.response == null) { + // Get.to(() => const ErrorScreen()); + } + } + return ResponseData( + 'Oops something Went Wrong', ResponseStatus.FAILED); + } + + if (response.statusCode == 200) { + return ResponseData("success", ResponseStatus.SUCCESS, + data: response.data); + } else if (response.statusCode == 203) { + print(response.data); + return ResponseData("validation", ResponseStatus.PRIVATE, + data: response.data); + } else if (response.statusCode == 202) { + print(response.data); + return ResponseData("success", ResponseStatus.PRIVATE, + data: response.data); + } else { + try { + return ResponseData( + response.data['message'].toString(), ResponseStatus.FAILED); + } catch (_) { + return ResponseData( + response.statusMessage!, ResponseStatus.FAILED); + } + } + } + + @override + Future deleteApi(String url, data) async { + if (kDebugMode) { + print("api url is >>> $url"); + } + Response response; + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('token').toString(); + log(token); + try { + response = await dio.delete(url, + data: data, + options: Options(headers: { + 'authorization': "Bearer $token", + + // "device-id": deviceId + })); + } on Exception catch (_) { + return ResponseData( + 'Oops something Went Wrong', ResponseStatus.FAILED); + } + if (response.statusCode == 200) { + return ResponseData( + "success", + data: response.data, + ResponseStatus.SUCCESS, + ); + } else if (response.statusCode == 203) { + Utils.showToast(response.data["message"]); + return ResponseData("validation", ResponseStatus.PRIVATE, + data: response.data); + } else { + try { + return ResponseData( + response.data['message'].toString(), ResponseStatus.FAILED); + } catch (_) { + return ResponseData( + response.statusMessage!, ResponseStatus.FAILED); + } + } + } +} diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..d0ae85f --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,68 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyDA19anPZQE9wwK0Lbr-KMoa-dfIanZrlU', + appId: '1:580254405290:android:77f13f510048b79e10b6d3', + messagingSenderId: '580254405290', + projectId: 'tradercircuit-b5744', + storageBucket: 'tradercircuit-b5744.appspot.com', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyDcB4KjuddPkpnWwqutw_4TlfKaOTZIXa0', + appId: '1:580254405290:ios:94435ecb64979c4a10b6d3', + messagingSenderId: '580254405290', + projectId: 'tradercircuit-b5744', + storageBucket: 'tradercircuit-b5744.appspot.com', + iosBundleId: 'com.example.traderscircuit', + ); +} diff --git a/lib/main.dart b/lib/main.dart index 7dec722..85af04a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,12 +6,25 @@ import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:traderscircuit/firebase_options.dart'; import 'package:traderscircuit/resources/routes/route_name.dart'; +import 'package:firebase_core/firebase_core.dart'; import 'package:traderscircuit/resources/routes/routes.dart'; +import 'package:onesignal_flutter/onesignal_flutter.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); + + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); SharedPreferences prefs = await SharedPreferences.getInstance(); + OneSignal.shared.setAppId("af55bb59-5ce9-4d95-92b8-e30d9ed06a73"); + OneSignal.shared.promptUserForPushNotificationPermission(); + OneSignal.shared + .setSubscriptionObserver((OSSubscriptionStateChanges changes) async { + await prefs.setString('playerId', changes.to.userId!); + }); // GlobalVariables globalVariables = GlobalVariables(); //token = prefs.getString('token'); // OnBoard = prefs.getBool("OnBoard"); diff --git a/lib/model/AboutUsModel/about_us_model.dart b/lib/model/AboutUsModel/about_us_model.dart new file mode 100644 index 0000000..c1f682f --- /dev/null +++ b/lib/model/AboutUsModel/about_us_model.dart @@ -0,0 +1,75 @@ +class AboutUsModel { + String? status; + int? statusCode; + String? message; + Data? data; + + AboutUsModel({this.status, this.statusCode, this.message, this.data}); + + AboutUsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + int? type; + String? content; + String? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + Data( + {this.id, + this.type, + this.content, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + Data.fromJson(Map json) { + id = json['id']; + type = json['type']; + content = json['content']; + isActive = json['is_active']; + createdBy = json['created_by'] ?? ""; + modifiedBy = json['modified_by'] ?? ""; + deletedAt = json['deleted_at'] ?? ""; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['type'] = type; + data['content'] = content; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + return data; + } +} diff --git a/lib/model/FAQModel/faq_model.dart b/lib/model/FAQModel/faq_model.dart new file mode 100644 index 0000000..6e7b938 --- /dev/null +++ b/lib/model/FAQModel/faq_model.dart @@ -0,0 +1,140 @@ +class FAQModel { + String? status; + int? statusCode; + String? message; + List? data; + + FAQModel({this.status, this.statusCode, this.message, this.data}); + + FAQModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? categoryName; + String? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + List? faqQueAns; + + Data( + {this.id, + this.categoryName, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt, + this.faqQueAns}); + + Data.fromJson(Map json) { + id = json['id']; + categoryName = json['category_name']; + isActive = json['is_active']; + createdBy = json['created_by'] ?? ""; + modifiedBy = json['modified_by'] ?? ""; + deletedAt = json['deleted_at'] ?? ""; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + if (json['faq_que_ans'] != null) { + faqQueAns = []; + json['faq_que_ans'].forEach((v) { + faqQueAns!.add(FaqQueAns.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['category_name'] = categoryName; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + if (faqQueAns != null) { + data['faq_que_ans'] = faqQueAns!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class FaqQueAns { + int? id; + int? faqMasterId; + String? faqQuestion; + String? faqAnswer; + String? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + FaqQueAns( + {this.id, + this.faqMasterId, + this.faqQuestion, + this.faqAnswer, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + FaqQueAns.fromJson(Map json) { + id = json['id']; + faqMasterId = json['faq_master_id']; + faqQuestion = json['faq_question']; + faqAnswer = json['faq_answer']; + isActive = json['is_active']; + createdBy = json['created_by'] ?? ""; + modifiedBy = json['modified_by'] ?? ""; + deletedAt = json['deleted_at'] ?? ""; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['faq_master_id'] = faqMasterId; + data['faq_question'] = faqQuestion; + data['faq_answer'] = faqAnswer; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + return data; + } +} diff --git a/lib/model/PrivacyPolicyModel/privacy_policy_model.dart b/lib/model/PrivacyPolicyModel/privacy_policy_model.dart new file mode 100644 index 0000000..7d481d8 --- /dev/null +++ b/lib/model/PrivacyPolicyModel/privacy_policy_model.dart @@ -0,0 +1,75 @@ +class PrivacyPolicyModel { + String? status; + int? statusCode; + String? message; + Data? data; + + PrivacyPolicyModel({this.status, this.statusCode, this.message, this.data}); + + PrivacyPolicyModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + int? type; + String? content; + String? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + Data( + {this.id, + this.type, + this.content, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + Data.fromJson(Map json) { + id = json['id']; + type = json['type']; + content = json['content']; + isActive = json['is_active']; + createdBy = json['created_by'] ?? ""; + modifiedBy = json['modified_by'] ?? ""; + deletedAt = json['deleted_at'] ?? ""; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['type'] = type; + data['content'] = content; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + return data; + } +} diff --git a/lib/model/TermsConditionModel/terms_condition_model.dart b/lib/model/TermsConditionModel/terms_condition_model.dart new file mode 100644 index 0000000..c4544ef --- /dev/null +++ b/lib/model/TermsConditionModel/terms_condition_model.dart @@ -0,0 +1,76 @@ +class TermsAndConditionModel { + String? status; + int? statusCode; + String? message; + Data? data; + + TermsAndConditionModel( + {this.status, this.statusCode, this.message, this.data}); + + TermsAndConditionModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + int? type; + String? content; + String? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + Data( + {this.id, + this.type, + this.content, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + Data.fromJson(Map json) { + id = json['id']; + type = json['type']; + content = json['content']; + isActive = json['is_active']; + createdBy = json['created_by'] ?? ""; + modifiedBy = json['modified_by'] ?? ""; + deletedAt = json['deleted_at'] ?? ""; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['type'] = type; + data['content'] = content; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + return data; + } +} diff --git a/lib/view/Sidemenu/AboutUs.dart b/lib/view/Sidemenu/AboutUs.dart index 26e5795..dd1d71c 100644 --- a/lib/view/Sidemenu/AboutUs.dart +++ b/lib/view/Sidemenu/AboutUs.dart @@ -1,8 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:traderscircuit/Utils/Common/CommonAppbar.dart'; import 'package:traderscircuit/Utils/text.dart'; +import 'package:traderscircuit/model/AboutUsModel/about_us_model.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/AboutApi/about_api.dart'; class AboutUs extends StatefulWidget { const AboutUs({super.key}); @@ -12,44 +15,65 @@ class AboutUs extends StatefulWidget { } class _AboutUsState extends State { + RxBool isLoading = true.obs; + AboutUsModel aboutUsModel = AboutUsModel(); + + @override + void initState() { + AboutUsApi().getAboutUsData().then((value) { + aboutUsModel = AboutUsModel.fromJson(value.data); + isLoading.value = false; + }); + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "About Us", ), backgroundColor: Colors.black, extendBody: true, - body: Stack( - children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack( - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: ListView( - physics: BouncingScrollPhysics(), - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - // CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]), - SizedBox( - height: 10.h, + body: Obx( + () => Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + isLoading.value + ? const Center( + child: CircularProgressIndicator( + color: Color(0xFF9A0000), ), - text16W400( - """Lorem ipsum dolor sit amet, conse consectetur adipiscing elit, sed do euio eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ulla ullamco laboris nisi ut aliquip ex ea It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. \n\ncommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui \n\nofficia deserunt mollit anim id est laborum. cupidatat non proident, sunt in culpa qui commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."""), + ) + : Stack( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: ListView( + physics: const BouncingScrollPhysics(), + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, - SizedBox( - height: 10.h, - ), - ], - ), - ), - ], - ), - ], + children: [ + // CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]), + SizedBox( + height: 10.h, + ), + text16W400( + aboutUsModel.data!.content!, + ), + SizedBox( + height: 10.h, + ), + ], + ), + ), + ], + ), + ], + ), ), ); } diff --git a/lib/view/Sidemenu/FaqScreen.dart b/lib/view/Sidemenu/FaqScreen.dart index 5ddff85..0532b1c 100644 --- a/lib/view/Sidemenu/FaqScreen.dart +++ b/lib/view/Sidemenu/FaqScreen.dart @@ -7,7 +7,9 @@ import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart'; import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart'; import 'package:traderscircuit/Utils/Common/sized_box.dart'; import 'package:traderscircuit/Utils/text.dart'; +import 'package:traderscircuit/model/FAQModel/faq_model.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/FaqApi/faq_api.dart'; class FaqScreen extends StatefulWidget { const FaqScreen({super.key}); @@ -17,157 +19,119 @@ class FaqScreen extends StatefulWidget { } class _FaqScreenState extends State { - List containerTexts = [ - "Subscriptions", - "Investments", - "App features" - ]; + List categoryList = []; + + RxBool isLoading = true.obs; + FAQModel faqModel = FAQModel(); - final selectedIndex = 0.obs; - late RxList isExpandedList; @override void initState() { - isExpandedList = RxList.generate(Faqcard.length, (index) => index == 0); + FAQApi().getFAQData().then((value) { + faqModel = FAQModel.fromJson(value.data); + for (var a in faqModel.data!) { + categoryList.add(a.categoryName!); + } + isExpandedList = RxList.generate( + faqModel.data![selectedIndex.value].faqQueAns!.length, + (index) => index == 0); + isLoading.value = false; + }); super.initState(); } - List> Faqcard = [ - { - 'title': 'How to create new account?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - { - 'title': 'What is Traders Circuits ?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - { - 'title': 'What is Traders Circuits ?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - { - 'title': 'What is Traders Circuits ?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - { - 'title': 'What is Traders Circuits ?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - ]; - - List> Faqcard2 = [ - { - 'title': 'How to create new account?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - { - 'title': 'What is Traders Circuits ?', - 'content': - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", - }, - ]; + final selectedIndex = 0.obs; + late RxList isExpandedList; @override Widget build(BuildContext context) { return Scaffold( - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), backgroundColor: Colors.black, extendBody: true, - body: Stack(children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack(children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: ListView(physics: BouncingScrollPhysics(), children: [ - text25W600('FAQ'), - sizedBoxHeight(20), - CustomTextFormField1( - hintText: 'Search Chats', - leadingIcon: Container( - height: 20, - width: 20, - child: Center( - child: SvgPicture.asset( - 'assets/images/svg/search-svgrepo-com.svg', - ), - ), + body: Obx( + () => Stack(children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + isLoading.value + ? const Center( + child: CircularProgressIndicator( + color: Color(0xFF9A0000), ), - ), - sizedBoxHeight(20.h), - SizedBox( - height: 60, - width: double.infinity, - // color: Colors.amber, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemCount: containerTexts.length, - itemBuilder: (context, index) { - return GestureDetector( - onTap: () { - selectedIndex.value = index; - }, - child: Row( - children: [ - topContainer(containerTexts[index], index), - sizedBoxWidth(10.w) - ], - ), - ); - }), - ), - sizedBoxHeight(20.h), - Obx(() { - return selectedIndex == 0 - ? Column( - children: List.generate(Faqcard.length, (index) { - return customExpandableItem( - isExpanded: isExpandedList[index], - title: Faqcard[index]['title']!, - content: Faqcard[index]['content']!, - toggleExpansion: () => toggleExpansion(index), - ); - })) - : Column( - children: List.generate(Faqcard2.length, (index) { - return customExpandableItem( - isExpanded: isExpandedList[index], - title: Faqcard2[index]['title']!, - content: Faqcard2[index]['content']!, - toggleExpansion: () => toggleExpansion(index), - ); - })); - }), - - // ListView.builder( - // shrinkWrap: true, - // itemCount: Faqcard.length, - // itemBuilder: (BuildContext context, int index) { - // return Obx( - // () { - // return customExpandableItem( - // isExpanded: isExpandedList[index], - // title: Faqcard[index]['title']!, - // content: Faqcard[index]['content']!, - // toggleExpansion: () => toggleExpansion(index), - // ); - // }, - // ); - // }, - // ), - - sizedBoxHeight(30.h), - ])) - ]) - ])); + ) + : Stack(children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: ListView( + physics: const BouncingScrollPhysics(), + children: [ + text25W600('FAQ'), + sizedBoxHeight(20), + CustomTextFormField1( + hintText: 'Search Chats', + leadingIcon: SizedBox( + height: 20, + width: 20, + child: Center( + child: SvgPicture.asset( + 'assets/images/svg/search-svgrepo-com.svg', + ), + ), + ), + ), + sizedBoxHeight(20.h), + SizedBox( + height: 60, + width: double.infinity, + // color: Colors.amber, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + itemCount: categoryList.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + selectedIndex.value = index; + isExpandedList = RxList.generate( + faqModel + .data![selectedIndex.value] + .faqQueAns! + .length, + (index) => index == 0); + }, + child: Row( + children: [ + topContainer( + categoryList[index], index), + sizedBoxWidth(10.w) + ], + ), + ); + }), + ), + sizedBoxHeight(20.h), + Obx(() { + return Column( + children: List.generate( + faqModel.data![selectedIndex.value] + .faqQueAns!.length, (index) { + return customExpandableItem( + isExpanded: isExpandedList[index], + title: faqModel.data![selectedIndex.value] + .faqQueAns![index].faqQuestion!, + content: faqModel.data![selectedIndex.value] + .faqQueAns![index].faqAnswer!, + toggleExpansion: () => + toggleExpansion(index), + ); + })); + }), + sizedBoxHeight(30.h), + ])) + ]) + ]), + )); } Widget topContainer(String text, int index) { @@ -178,8 +142,8 @@ class _FaqScreenState extends State { width: 136.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), - color: Color(0XFF3F0502), - border: Border.all(color: Color(0xFF9A0000), width: 1)), + color: const Color(0XFF3F0502), + border: Border.all(color: const Color(0xFF9A0000), width: 1)), child: Center(child: text16W500(text)), ) : commonGlassContainer( @@ -231,7 +195,7 @@ class _FaqScreenState extends State { color: Colors.white, ), ), - Spacer(), + const Spacer(), Icon( isExpanded ? Icons.keyboard_arrow_up_outlined @@ -258,15 +222,19 @@ class _FaqScreenState extends State { bottomRight: Radius.circular(8.r), ), color: Colors.black, - border: Border.all(color: Color(0xFF3A3A3A), width: 0.5)), + border: + Border.all(color: const Color(0xFF3A3A3A), width: 0.5)), child: Padding( padding: EdgeInsets.only( top: 11.h, left: 14.w, bottom: 25.h, right: 28.w), child: Text( content, style: TextStyle( + color: Color(0xFFFFFFFF), fontFamily: 'hiragino', + + fontSize: 14.sp, fontWeight: FontWeight.w400, ), @@ -291,7 +259,7 @@ class _FaqScreenState extends State { color: Colors.white, ), ), - Spacer(), + const Spacer(), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ diff --git a/lib/view/Sidemenu/PrivacyPolicy.dart b/lib/view/Sidemenu/PrivacyPolicy.dart index a41470c..ffb16f5 100644 --- a/lib/view/Sidemenu/PrivacyPolicy.dart +++ b/lib/view/Sidemenu/PrivacyPolicy.dart @@ -1,8 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:traderscircuit/Utils/Common/CommonAppbar.dart'; import 'package:traderscircuit/Utils/text.dart'; +import 'package:traderscircuit/model/PrivacyPolicyModel/privacy_policy_model.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/PrivacyPolicyApi/privacy_poilcy_api.dart'; class PrivacyPolicy extends StatefulWidget { const PrivacyPolicy({super.key}); @@ -12,44 +15,61 @@ class PrivacyPolicy extends StatefulWidget { } class _PrivacyPolicyState extends State { + RxBool isLoading = true.obs; + PrivacyPolicyModel privacyPolicyModel = PrivacyPolicyModel(); + + @override + void initState() { + PrivacyPolicyApi().getPrivacyPolicyData().then((value) { + privacyPolicyModel = PrivacyPolicyModel.fromJson(value.data); + isLoading.value = false; + }); + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Privacy Policy", ), backgroundColor: Colors.black, extendBody: true, - body: Stack( - children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack( - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: ListView( - physics: BouncingScrollPhysics(), - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - // CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]), - SizedBox( - height: 10.h, + body: Obx( + () => Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + isLoading.value + ? const Center( + child: CircularProgressIndicator( + color: Color(0xFF9A0000), ), - text16W400( - """Lorem ipsum dolor sit amet, conse consectetur adipiscing elit, sed do euio eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ulla ullamco laboris nisi ut aliquip ex ea It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. \n\ncommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui \n\nofficia deserunt mollit anim id est laborum. cupidatat non proident, sunt in culpa qui commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."""), - - SizedBox( - height: 10.h, - ), - ], - ), - ), - ], - ), - ], + ) + : Stack( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: ListView( + physics: const BouncingScrollPhysics(), + children: [ + SizedBox( + height: 10.h, + ), + text16W400( + privacyPolicyModel.data!.content!, + ), + SizedBox( + height: 10.h, + ), + ], + ), + ), + ], + ), + ], + ), ), ); } diff --git a/lib/view/Sidemenu/TermsAndCondition.dart b/lib/view/Sidemenu/TermsAndCondition.dart index 92e8dc9..9d980d2 100644 --- a/lib/view/Sidemenu/TermsAndCondition.dart +++ b/lib/view/Sidemenu/TermsAndCondition.dart @@ -1,9 +1,11 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:traderscircuit/Utils/Common/CommonAppbar.dart'; import 'package:traderscircuit/Utils/text.dart'; +import 'package:traderscircuit/model/TermsConditionModel/terms_condition_model.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/TermsAndConditionApi/terms_condition_api.dart'; class TermsAndConditions extends StatefulWidget { const TermsAndConditions({super.key}); @@ -13,44 +15,65 @@ class TermsAndConditions extends StatefulWidget { } class _TermsAndConditionsState extends State { + RxBool isLoading = true.obs; + TermsAndConditionModel termsAndConditionModel = TermsAndConditionModel(); + + @override + void initState() { + TermsAndConditionApi().getTermsAndConditionData().then((value) { + termsAndConditionModel = TermsAndConditionModel.fromJson(value.data); + isLoading.value = false; + }); + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Terms & Conditions", ), backgroundColor: Colors.black, extendBody: true, - body: Stack( - children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack( - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: ListView( - physics: BouncingScrollPhysics(), - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - // CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]), - SizedBox( - height: 10.h, + body: Obx( + () => Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + isLoading.value + ? const Center( + child: CircularProgressIndicator( + color: Color(0xFF9A0000), ), - text16W400( - """Lorem ipsum dolor sit amet, conse consectetur adipiscing elit, sed do euio eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ulla ullamco laboris nisi ut aliquip ex ea It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. \n\ncommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui \n\nofficia deserunt mollit anim id est laborum. cupidatat non proident, sunt in culpa qui commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla velit pariatur. Excepteur sint occaecat velit cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."""), + ) + : Stack( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: ListView( + physics: const BouncingScrollPhysics(), + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, - SizedBox( - height: 10.h, - ), - ], - ), - ), - ], - ), - ], + children: [ + // CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]), + SizedBox( + height: 10.h, + ), + text16W400( + termsAndConditionModel.data!.content!, + ), + SizedBox( + height: 10.h, + ), + ], + ), + ), + ], + ), + ], + ), ), ); } diff --git a/lib/view/login/Kyc.dart b/lib/view/login/Kyc.dart index f318221..aea9845 100644 --- a/lib/view/login/Kyc.dart +++ b/lib/view/login/Kyc.dart @@ -29,6 +29,8 @@ class _KycState extends State { Color secondaryColor = Colors.grey.shade800; KYCController kycController = Get.put(KYCController()); + TextEditingController panController = TextEditingController(); + TextEditingController addharController = TextEditingController(); // DateTime timebackPressed = DateTime.now(); @@ -358,6 +360,18 @@ class _KycState extends State { SizedBox( height: 30.h, ), + Row( + children: [ + text18W400("Pan Card"), + ], + ), + SizedBox( + height: 15.h, + ), + const CustomTextFormField(), + SizedBox( + height: 15.h, + ), Row( children: [ text18W400("Aadhar Number"), diff --git a/lib/view_model/AboutApi/about_api.dart b/lib/view_model/AboutApi/about_api.dart new file mode 100644 index 0000000..838c9b6 --- /dev/null +++ b/lib/view_model/AboutApi/about_api.dart @@ -0,0 +1,25 @@ +import 'dart:developer'; + +import '../../Utils/api_urls.dart'; +import '../../Utils/base_manager.dart'; +import '../../data/network/network_api_services.dart'; + +class AboutUsApi { + Future> getAboutUsData() async { + final response = await NetworkApiServices().getApi( + ApiUrls.aboutUsApi, + ); + log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/lib/view_model/FaqApi/faq_api.dart b/lib/view_model/FaqApi/faq_api.dart new file mode 100644 index 0000000..4fc4a4e --- /dev/null +++ b/lib/view_model/FaqApi/faq_api.dart @@ -0,0 +1,25 @@ +import 'dart:developer'; + +import '../../Utils/api_urls.dart'; +import '../../Utils/base_manager.dart'; +import '../../data/network/network_api_services.dart'; + +class FAQApi { + Future> getFAQData() async { + final response = await NetworkApiServices().getApi( + ApiUrls.faqApi, + ); + log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/lib/view_model/PrivacyPolicyApi/privacy_poilcy_api.dart b/lib/view_model/PrivacyPolicyApi/privacy_poilcy_api.dart new file mode 100644 index 0000000..b71a1a1 --- /dev/null +++ b/lib/view_model/PrivacyPolicyApi/privacy_poilcy_api.dart @@ -0,0 +1,25 @@ +import 'dart:developer'; + +import '../../Utils/api_urls.dart'; +import '../../Utils/base_manager.dart'; +import '../../data/network/network_api_services.dart'; + +class PrivacyPolicyApi { + Future> getPrivacyPolicyData() async { + final response = await NetworkApiServices().getApi( + ApiUrls.privacyPolicyApi, + ); + log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/lib/view_model/TermsAndConditionApi/terms_condition_api.dart b/lib/view_model/TermsAndConditionApi/terms_condition_api.dart new file mode 100644 index 0000000..1398f29 --- /dev/null +++ b/lib/view_model/TermsAndConditionApi/terms_condition_api.dart @@ -0,0 +1,25 @@ +import 'dart:developer'; + +import '../../Utils/api_urls.dart'; +import '../../Utils/base_manager.dart'; +import '../../data/network/network_api_services.dart'; + +class TermsAndConditionApi { + Future> getTermsAndConditionData() async { + final response = await NetworkApiServices().getApi( + ApiUrls.termsConditionApi, + ); + log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/pubspec.lock b/pubspec.lock index 40d38af..ba2db02 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -41,6 +41,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "28ea9690a8207179c319965c13cd8df184d5ee721ae2ce60f398ced1219cea1f" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: "9e90e78ae72caa874a323d78fa6301b3fb8fa7ea76a8f96dc5b5bf79f283bf2f" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "42a835caa27c220d1294311ac409a43361088625a4f23c820b006dd9bffb3316" + url: "https://pub.dev" + source: hosted + version: "1.1.1" characters: dependency: transitive description: @@ -69,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.2" connectivity_plus: dependency: "direct main" description: @@ -101,10 +125,10 @@ packages: dependency: transitive description: name: cross_file - sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.dev" source: hosted - version: "0.3.3+8" + version: "0.3.3+7" crypto: dependency: transitive description: @@ -137,6 +161,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.10" + dio: + dependency: "direct main" + description: + name: dio + sha256: "0978e9a3e45305a80a7210dbeaf79d6ee8bee33f70c8e542dc654c952070217f" + url: "https://pub.dev" + source: hosted + version: "5.4.2+1" dotted_border: dependency: "direct main" description: @@ -153,6 +185,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.9" + expansion_tile_group: + dependency: "direct main" + description: + name: expansion_tile_group + sha256: "6918433891481c7d98cbc604d7b4c93509986e8134d52940853301ad6fbff404" + url: "https://pub.dev" + source: hosted + version: "1.2.4" fake_async: dependency: transitive description: @@ -217,27 +257,45 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.3+1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb" + url: "https://pub.dev" + source: hosted + version: "2.24.2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 + url: "https://pub.dev" + source: hosted + version: "5.0.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_branch_sdk: + + flutter_cache_manager: dependency: transitive description: - name: flutter_branch_sdk - sha256: "3850097e5c70d89db235fb160e92eac5928f4206ab167b0d83c7e4e50b1357f8" + name: flutter_cache_manager + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" url: "https://pub.dev" source: hosted - version: "7.1.0" - flutter_isolate: - dependency: transitive - description: - name: flutter_isolate - sha256: "994ddec596da4ca12ca52154fd59404077584643eb7e3f1008a55fda9fe0b76b" - url: "https://pub.dev" - source: hosted - version: "2.0.4" + version: "3.3.1" + flutter_lints: dependency: "direct dev" description: @@ -332,10 +390,10 @@ packages: dependency: transitive description: name: http - sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.1.0" http_parser: dependency: transitive description: @@ -484,10 +542,10 @@ packages: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" mime: dependency: transitive description: @@ -512,6 +570,40 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + onesignal_flutter: + dependency: "direct main" + description: + name: onesignal_flutter + sha256: "29d2ac76d9e4821d98d754f3785db99d4dbfd69f96f7997a387582bef9d0daa5" + url: "https://pub.dev" + source: hosted + version: "3.5.3" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.dev" + source: hosted + version: "4.2.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: dependency: transitive description: @@ -632,22 +724,16 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.2" - share_plus: + + rxdart: dependency: transitive description: - name: share_plus - sha256: b1f15232d41e9701ab2f04181f21610c36c83a12ae426b79b4bd011c567934b1 + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" url: "https://pub.dev" source: hosted - version: "6.3.4" - share_plus_platform_interface: - dependency: transitive - description: - name: share_plus_platform_interface - sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496" - url: "https://pub.dev" - source: hosted - version: "3.4.0" + version: "0.27.7" + shared_preferences: dependency: "direct main" description: @@ -717,22 +803,46 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 + url: "https://pub.dev" + source: hosted + version: "2.3.2" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" + url: "https://pub.dev" + source: hosted + version: "2.5.3" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -741,6 +851,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" term_glyph: dependency: transitive description: @@ -753,10 +871,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.6.0" typed_data: dependency: transitive description: @@ -765,46 +883,17 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 - url: "https://pub.dev" - source: hosted - version: "3.1.1" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b - url: "https://pub.dev" - source: hosted - version: "2.2.3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 - url: "https://pub.dev" - source: hosted - version: "3.1.1" + uuid: dependency: transitive description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + + sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f" url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "4.2.2" + vector_graphics: dependency: transitive description: @@ -857,10 +946,10 @@ packages: dependency: transitive description: name: video_player_avfoundation - sha256: "309e3962795e761be010869bae65c0b0e45b5230c5cee1bec72197ca7db040ed" + sha256: bc923884640d6dc403050586eb40713cdb8d1d84e6886d8aca50ab04c59124c2 url: "https://pub.dev" source: hosted - version: "2.5.6" + version: "2.5.2" video_player_platform_interface: dependency: transitive description: @@ -930,10 +1019,10 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.1.4-beta" win32: dependency: transitive description: @@ -959,5 +1048,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 67a703c..8173376 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,8 +33,12 @@ dependencies: lottie: ^2.7.0 chewie: ^1.5.0 video_player: ^2.5.2 - + onesignal_flutter: ^3.5.1 + cached_network_image: ^3.3.1 + firebase_core: + dio: ^5.1.2 + expansion_tile_group: ^1.2.4 dev_dependencies: flutter_test: