Merge branch 'main' into splash

This commit is contained in:
Raj
2024-04-12 19:35:33 +05:30
committed by GitHub
16 changed files with 1279 additions and 624 deletions

View File

@@ -0,0 +1,3 @@
<svg width="21" height="23" viewBox="0 0 21 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.62441 0.0674686C3.23992 0.193018 2.69065 0.726599 2.45524 1.18171C2.21199 1.66821 2.13353 2.44504 2.27477 3.03355C2.36893 3.43373 2.36893 3.44158 2.13353 3.68483C1.73334 4.10855 1.54502 4.57936 1.50579 5.24633C1.49009 5.58374 1.51363 6.01531 1.56071 6.21933C1.64703 6.57243 1.64703 6.58813 1.40378 6.82353C1.06637 7.16879 0.885892 7.56113 0.791731 8.12609C0.713263 8.61259 0.776037 9.32665 0.932972 9.60913C0.995746 9.72683 0.956513 9.78961 0.728956 9.97008C0.313078 10.3075 0.124756 10.794 0.124756 11.5473C0.124756 12.2849 0.313078 12.7871 0.76819 13.2579C1.37239 13.8935 1.41162 13.9013 3.86766 13.9248C5.06037 13.9405 6.04121 13.9641 6.04121 13.9876C6.04121 14.0112 5.9549 14.1916 5.85289 14.3957C5.5861 14.9214 5.27223 15.9572 5.13099 16.7811C5.03683 17.3147 5.01329 17.9189 5.03683 19.2606C5.06037 21.0262 5.06037 21.0497 5.28008 21.4891C5.53117 21.9992 5.98629 22.4464 6.48848 22.6661C6.77096 22.7917 6.96713 22.8152 7.44578 22.7917C8.14415 22.7603 8.49725 22.6112 8.95236 22.1561C9.36039 21.7402 9.45455 21.5519 10.1058 19.8021C10.8042 17.9032 11.1495 17.3068 12.044 16.4123C12.5854 15.8708 12.9385 15.5962 13.5584 15.2431L14.3666 14.7801L14.657 15.0626C15.1984 15.5805 15.2455 15.5884 17.317 15.5884C19.3415 15.5884 19.5847 15.5413 19.9849 15.1097C20.4165 14.6389 20.4008 14.8665 20.4008 7.91423V1.48773L20.2203 1.14248C20.1183 0.954155 19.8829 0.687365 19.7024 0.561817L19.365 0.326414L17.4347 0.302872C15.2298 0.279331 15.0179 0.318567 14.5706 0.836452L14.3117 1.14248L13.0248 0.750139C10.5766 0.0203896 10.6551 0.0282364 7.06129 0.00469589C4.91913 -0.0109978 3.79704 0.0125427 3.62441 0.0674686ZM18.753 7.89854V13.8621H17.3013H15.8497V7.89854V1.935H17.3013H18.753V7.89854Z" fill="#E33838"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,3 @@
<svg width="21" height="24" viewBox="0 0 21 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.5313 0.0310001C12.0919 0.101622 11.472 0.470417 11.1973 0.831369C10.907 1.21586 10.805 1.45126 10.2086 3.04416C9.48673 4.96661 9.16502 5.53158 8.27833 6.41826C7.73691 6.95969 7.37595 7.23433 6.76391 7.58743L5.95569 8.05039L5.66536 7.76791C5.12393 7.25002 5.06901 7.24217 3.021 7.24217C1.35749 7.24217 1.13778 7.25787 0.878837 7.39126C0.510039 7.57958 0.274637 7.83068 0.117701 8.19948C0.0156935 8.45842 0 9.29802 0 14.9163V21.335L0.204016 21.7508C0.337411 22.0176 0.525733 22.2373 0.729749 22.3707L1.04362 22.5826L2.97392 22.6061C5.17101 22.6297 5.38288 22.5904 5.83014 22.0725L6.08124 21.7744L7.76829 22.2687C10.2322 22.9906 10.4362 23.0142 13.6769 23.0142C15.5523 23.0142 16.5174 22.9828 16.7293 22.92C17.153 22.7945 17.7023 22.2923 17.9455 21.8058C18.1888 21.3193 18.2673 20.5424 18.126 19.9539C18.0319 19.5537 18.0319 19.5459 18.2673 19.3026C18.6674 18.8789 18.8558 18.4081 18.895 17.7411C18.9107 17.4037 18.8872 16.98 18.8401 16.7838C18.7538 16.4464 18.7616 16.4229 18.997 16.1718C19.6326 15.4891 19.8288 14.3827 19.4757 13.449C19.4207 13.2842 19.4521 13.19 19.7032 12.8683C20.4408 11.8875 20.3702 10.4201 19.5541 9.57266C18.9499 8.93707 18.9107 8.92923 16.4547 8.90569C14.799 8.88999 14.2811 8.8586 14.3125 8.78798C14.6264 8.08962 14.9402 7.22648 15.0815 6.65367C15.2463 6.01023 15.2619 5.76698 15.2619 3.86806V1.78867L15.0422 1.34141C14.5636 0.36841 13.6063 -0.133781 12.5313 0.0310001ZM4.55112 14.932V20.8955H3.09947H1.64782V14.932V8.96846H3.09947H4.55112V14.932Z" fill="#34C759"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -38,6 +38,7 @@ class ApiUrls {
//FAQ API
static String faqApi = "${base}getFaq";
static String faqLikeDislikeApi = "${base}userFaqLikeDislike";
//RISK PROFILE API
static String getRiskProfileQuestionAnswerApi = "${base}riskProfileQueAns";

View File

@@ -1,11 +1,176 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:just_audio/just_audio.dart';
import 'package:traderscircuit/model/ContentBytesModel/content_bytes_categories_model.dart';
import 'package:traderscircuit/model/ContentBytesModel/content_bytes_model.dart';
import '../view/Sidemenu/ContentByte/ContentBytes.dart';
class ContentBytesController extends GetxController {
ContentBytesCategoriesModel contentBytesCategoriesModel =
ContentBytesCategoriesModel();
ContentBytesModel contentBytesModel = ContentBytesModel();
int filterId = 0;
RxBool isApiCalling = true.obs;
RxBool isAudioSeekBarVisible = false.obs;
RxInt indexForAudios = 0.obs;
RxBool titlePlaying = false.obs;
RxList<bool>? titlePlayingList = <bool>[].obs;
final progressNotifier = ValueNotifier<ProgressBarState>(
ProgressBarState(
current: Duration.zero,
buffered: Duration.zero,
total: Duration.zero,
),
);
final buttonNotifier = ValueNotifier<ButtonState>(ButtonState.paused);
late AudioPlayer _audioPlayer;
void getAudio() => _audioPlayer;
void init(index) async {
_audioPlayer = AudioPlayer();
try {
await _audioPlayer.setUrl(
//contentBytesModel.data!.audio![index].file ??
'https://ghantalele.com/uploads/files/data-78/38825/Besharam%20Rang_192(Ghantalele.com).mp3');
// await _audioPlayer.setAsset(url);
} on PlayerException catch (e) {
print("Error code: ${e.code}");
// iOS/macOS: maps to NSError.localizedDescription
// Android: maps to ExoPlaybackException.getMessage()
// Web/Linux: a generic message
// Windows: MediaPlayerError.message
print("Error message: ${e.message}");
}
//Catching errors during playback (e.g. lost network connection)
_audioPlayer.playbackEventStream.listen((event) {},
onError: (Object e, StackTrace st) {
if (e is PlayerException) {
print('Error code: ${e.code}');
print('Error message: ${e.message}');
} else {
print('An error occurred: $e');
}
});
_audioPlayer.playerStateStream.listen((playerState) {
final isPlaying = playerState.playing;
final processingState = playerState.processingState;
if (!isPlaying) {
buttonNotifier.value = ButtonState.paused;
} else if (processingState != ProcessingState.completed) {
buttonNotifier.value = ButtonState.playing;
} else {
_playNextTrack();
// _audioPlayer.seek(Duration.zero);
// _audioPlayer.pause();
}
});
_audioPlayer.positionStream.listen((position) {
final oldState = progressNotifier.value;
progressNotifier.value = ProgressBarState(
current: position,
buffered: oldState.buffered,
total: oldState.total,
);
});
_audioPlayer.bufferedPositionStream.listen((bufferedPosition) {
final oldState = progressNotifier.value;
progressNotifier.value = ProgressBarState(
current: oldState.current,
buffered: bufferedPosition,
total: oldState.total,
);
});
_audioPlayer.durationStream.listen((totalDuration) {
final oldState = progressNotifier.value;
progressNotifier.value = ProgressBarState(
current: oldState.current,
buffered: oldState.buffered,
total: totalDuration ?? Duration.zero,
);
});
}
void _playNextTrack() {
// Determine the index of the next track (you need to implement this logic)
int nextIndex = getNextTrackIndex();
if (nextIndex != -1) {
// Play the next track
updateTitlePlaying(nextIndex);
if (isPlaying()) {
stop();
}
init(nextIndex);
play(nextIndex);
} else {
_audioPlayer.seek(Duration.zero);
_audioPlayer.pause();
}
}
int getNextTrackIndex() {
if (indexForAudios.value == contentBytesModel.data!.audio!.length - 1) {
return -1;
} else {
return indexForAudios.value + 1;
}
// You need to implement this logic based on your playlist structure
// For example, if you have a list of tracks, return the index of the next track
// If there is no next track, return -1
// This logic depends on how you manage your playlist
// Example: return currentTrackIndex + 1;
}
void play(index) {
_audioPlayer.play();
isAudioSeekBarVisible.value = false;
isAudioSeekBarVisible.value = true;
indexForAudios.value = index;
}
void pause() {
_audioPlayer.pause();
}
void seek(Duration position) {
_audioPlayer.seek(position);
}
void stop() {
_audioPlayer.stop();
}
bool isPlaying() {
return _audioPlayer.playing;
}
addTitles() {
titlePlayingList = List<bool>.generate(
contentBytesModel.data!.audio!.length,
(index) => false,
).obs;
}
void updateTitlePlaying(int index) {
// Check if the index is within valid range
if (index >= 0 && index < titlePlayingList!.length) {
// Set all values to false
titlePlayingList!.assignAll(List.generate(
titlePlayingList!.length,
(index) => false,
));
// Set the specified index to true
titlePlayingList![index] = true;
}
}
}

View File

@@ -64,7 +64,10 @@ class NetworkApiServices extends BaseApiServices {
}
@override
Future<ResponseData> postApi(data, String url, {bool isAuth = false}) async {
Future<ResponseData> postApi(
data,
String url,
) async {
if (kDebugMode) {
print("data >>> $data");
print("api url is >>> $url");

View File

@@ -1,3 +1,5 @@
import 'package:get/get.dart';
class FAQModel {
String? status;
int? statusCode;
@@ -97,6 +99,7 @@ class FaqQueAns {
String? deletedAt;
String? createdAt;
String? updatedAt;
List<UserLikes>? userLikes;
FaqQueAns(
{this.id,
@@ -108,7 +111,8 @@ class FaqQueAns {
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt});
this.updatedAt,
this.userLikes});
FaqQueAns.fromJson(Map<String, dynamic> json) {
id = json['id'];
@@ -121,6 +125,12 @@ class FaqQueAns {
deletedAt = json['deleted_at'] ?? "";
createdAt = json['created_at'];
updatedAt = json['updated_at'];
if (json['user_likes'] != null) {
userLikes = <UserLikes>[];
json['user_likes'].forEach((v) {
userLikes!.add(UserLikes.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
@@ -133,6 +143,53 @@ class FaqQueAns {
data['created_by'] = createdBy;
data['modified_by'] = modifiedBy;
data['deleted_at'] = deletedAt;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
if (userLikes != null) {
data['user_likes'] = userLikes!.map((v) => v.toJson()).toList();
}
return data;
}
}
class UserLikes {
int? id;
int? userId;
int? faqId;
int? status; //RxInt? status;
String? isActive;
String? createdAt;
String? updatedAt;
UserLikes(
{this.id,
this.userId,
this.faqId,
this.status,
this.isActive,
this.createdAt,
this.updatedAt});
UserLikes.fromJson(Map<String, dynamic> json) {
id = json['id'];
userId = json['user_id'];
faqId = json['faq_id'];
status = (json['status']); // RxInt(json['status']);
isActive = json['is_active'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['user_id'] = userId;
data['faq_id'] = faqId;
data['status'] = status;
data['is_active'] = isActive;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
return data;

View File

@@ -244,9 +244,9 @@ Widget ActiveCallsTab() {
children: [
InkWell(
onTap: () {
Get.to(
() => PlayerWidget(),
);
Get.to(() => PlayerWidget(), arguments: {
"video_url": "",
});
},
child: Container(
height: 200.h,

View File

@@ -194,9 +194,9 @@ class _ShortTradeState extends State<ShortTrade> {
children: [
InkWell(
onTap: () {
Get.to(
() => PlayerWidget(),
);
Get.to(() => PlayerWidget(), arguments: {
"video_url": "",
});
},
child: Container(
height: 200.h,

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,9 @@ class PlayerWidget extends StatefulWidget {
class _PlayerWidgetState extends State<PlayerWidget> {
late VideoPlayerController videoPlayerController;
late ChewieController chewieController;
var videoUrl = Get.arguments["video_url"];
var videoUrl = Get.arguments["video_url"] == ""
? "https://player.vimeo.com/progressive_redirect/playback/930595309/rendition/360p/file.mp4?loc=external&signature=55ffa7ff72b807e1b3830cd6d308b092d4b1f82baadf6c20e7c235cd9a33bcdf"
: Get.arguments["video_url"];
@override
void initState() {
_initializePlayer();
@@ -41,6 +43,13 @@ class _PlayerWidgetState extends State<PlayerWidget> {
looping: false);
}
@override
void dispose() {
videoPlayerController.dispose();
chewieController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return videoPlayerController != null &&

View File

@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
class ReadPDF extends StatelessWidget {
ReadPDF({
super.key,
required this.title,
required this.pdfUrfl,
});
String? title;
String? pdfUrfl;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title!),
),
body: SfPdfViewer.network(
'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
),
);
}
}

View File

@@ -1,7 +1,10 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:traderscircuit/Utils/Common/CommonAppBar.dart';
import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart';
import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart';
@@ -11,6 +14,8 @@ import 'package:traderscircuit/model/FAQModel/faq_model.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/FaqApi/faq_api.dart';
Rx<FAQModel> faqModel = FAQModel().obs;
class FaqScreen extends StatefulWidget {
const FaqScreen({super.key});
@@ -22,23 +27,29 @@ class _FaqScreenState extends State<FaqScreen> {
List<String> categoryList = [];
RxBool isLoading = true.obs;
FAQModel faqModel = FAQModel();
@override
void initState() {
getData();
FAQApi().getFAQData().then((value) {
faqModel = FAQModel.fromJson(value.data);
for (var a in faqModel.data!) {
faqModel.value = FAQModel.fromJson(value.data);
for (var a in faqModel.value.data!) {
categoryList.add(a.categoryName!);
}
isExpandedList = RxList.generate(
faqModel.data![selectedIndex.value].faqQueAns!.length,
faqModel.value.data![selectedIndex.value].faqQueAns!.length,
(index) => index == 0);
isLoading.value = false;
});
super.initState();
}
String? token;
getData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('accessToken');
}
final selectedIndex = 0.obs;
late RxList<bool> isExpandedList;
@@ -95,6 +106,7 @@ class _FaqScreenState extends State<FaqScreen> {
selectedIndex.value = index;
isExpandedList = RxList.generate(
faqModel
.value
.data![selectedIndex.value]
.faqQueAns!
.length,
@@ -114,16 +126,33 @@ class _FaqScreenState extends State<FaqScreen> {
Obx(() {
return Column(
children: List.generate(
faqModel.data![selectedIndex.value]
.faqQueAns!.length, (index) {
faqModel
.value
.data![selectedIndex.value]
.faqQueAns!
.length, (index) {
return customExpandableItem(
index: index,
selectedIndex: selectedIndex.value,
faqModel1: faqModel.value,
isExpanded: isExpandedList[index],
title: faqModel.data![selectedIndex.value]
.faqQueAns![index].faqQuestion!,
content: faqModel.data![selectedIndex.value]
.faqQueAns![index].faqAnswer!,
title: faqModel
.value
.data![selectedIndex.value]
.faqQueAns![index]
.faqQuestion!,
content: faqModel
.value
.data![selectedIndex.value]
.faqQueAns![index]
.faqAnswer!,
toggleExpansion: () =>
toggleExpansion(index),
faqId: faqModel
.value
.data![selectedIndex.value]
.faqQueAns![index]
.id!,
);
}));
}),
@@ -144,13 +173,21 @@ class _FaqScreenState extends State<FaqScreen> {
borderRadius: BorderRadius.circular(5),
color: const Color(0XFF3F0502),
border: Border.all(color: const Color(0xFF9A0000), width: 1)),
child: Center(child: text16W500(text)),
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: FittedBox(child: text16W500(text)),
)),
)
: commonGlassContainer(
width: 136.w,
height: 38.h,
borderradius: 5,
customWidget: Center(child: text16W400(text)),
customWidget: Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 9),
child: FittedBox(child: text16W400(text)),
)),
);
});
}
@@ -171,6 +208,10 @@ class _FaqScreenState extends State<FaqScreen> {
required String title,
required String content,
required VoidCallback toggleExpansion,
required int faqId,
required FAQModel faqModel1,
required int selectedIndex,
required int index,
}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -230,58 +271,125 @@ class _FaqScreenState extends State<FaqScreen> {
child: Text(
content,
style: TextStyle(
color: Color(0xFFFFFFFF),
color: const Color(0xFFFFFFFF),
fontFamily: 'hiragino',
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
),
),
),
sizedBoxHeight(12.h),
commonGlassContainer(
width: double.infinity,
height: 65.h,
borderradius: 8,
customWidget: Padding(
padding: EdgeInsets.only(right: 8.w, left: 13.w),
child: Center(
child: Row(children: [
Text(
'Was this answer helpful?',
style: TextStyle(
fontFamily: 'hiragino',
fontSize: 16.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
const Spacer(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
text16W500('Yes'),
sizedBoxWidth(2.w),
SvgPicture.asset(
'assets/images/svg/thumbs-up.svg'),
sizedBoxWidth(8.w),
text16W500('No'),
sizedBoxWidth(2.w),
Column(
mainAxisAlignment: MainAxisAlignment.center,
token == null || token!.isEmpty
? const SizedBox()
: sizedBoxHeight(12.h),
token == null || token!.isEmpty
? const SizedBox()
: commonGlassContainer(
width: double.infinity,
height: 65.h,
borderradius: 8,
customWidget: Padding(
padding: EdgeInsets.only(right: 8.w, left: 13.w),
child: Center(
child: Row(children: [
Text(
'Was this answer helpful?',
style: TextStyle(
fontFamily: 'hiragino',
fontSize: 16.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
const Spacer(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
sizedBoxHeight(5.h),
SvgPicture.asset(
'assets/images/svg/thumbs-down.svg'),
InkWell(
onTap: () {
FAQApi()
.updaeFAQLikeDisklikeData(faqId, 1)
.then((value) {
FAQApi().getFAQData().then((value) {
faqModel.value =
FAQModel.fromJson(value.data);
setState(() {});
});
});
},
child: Row(
children: [
text16W500('Yes'),
sizedBoxWidth(2.w),
(faqModel
.value
.data![selectedIndex]
.faqQueAns![index]
.userLikes!
.isNotEmpty &&
faqModel
.value
.data![selectedIndex]
.faqQueAns![index]
.userLikes![0]
.status! ==
1)
? SvgPicture.asset(
'assets/images/svg/filled_thumb_up.svg')
: SvgPicture.asset(
'assets/images/svg/thumbs-up.svg'),
],
),
),
sizedBoxWidth(8.w),
InkWell(
onTap: () {
FAQApi()
.updaeFAQLikeDisklikeData(faqId, 0)
.then((value) {
FAQApi().getFAQData().then((value) {
faqModel.value =
FAQModel.fromJson(value.data);
});
});
},
child: Row(
children: [
text16W500('No'),
sizedBoxWidth(2.w),
Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
sizedBoxHeight(5.h),
(faqModel
.value
.data![selectedIndex]
.faqQueAns![index]
.userLikes!
.isNotEmpty &&
faqModel
.value
.data![
selectedIndex]
.faqQueAns![index]
.userLikes![0]
.status! ==
0)
? SvgPicture.asset(
'assets/images/svg/filled_thumb_down.svg')
: SvgPicture.asset(
'assets/images/svg/thumbs-down.svg'),
],
)
],
),
)
],
)
],
)
]),
)))
),
]),
)))
],
),
),

View File

@@ -9,6 +9,8 @@ import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:traderscircuit/resources/routes/route_name.dart';
import '../../Utils/Common/noInternet.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@@ -44,52 +46,55 @@ class _SplashScreenState extends State<SplashScreen>
void initState() {
super.initState();
checkInternet();
log(_connectionStatus.toString());
Future.delayed(Duration(seconds: 2), () async {
Get.toNamed(RouteName.sliderscreen1);
// if (_connectionStatus == ConnectivityResult.none) {
// var result = await Get.to(NoInternet());
// if (result != null && result) {
// Timer(const Duration(seconds: 1), () async {
// SharedPreferences prefs = await SharedPreferences.getInstance();
// token = prefs.getString('token');
// myusername = prefs.getString('name');
// phonenumber = prefs.getString('contact_number');
// OnBoard = prefs.getBool('OnBoard') ?? false;
// if (OnBoard == false) {
// Get.toNamed(RouteName.sliderscreen1);
// } else {
// if (token == null || token!.isEmpty) {
// Get.offAndToNamed(RouteName.loginScreen);
// } else {
// GetProfile().GetProfileAPI().then((value) {
// Get.toNamed(RouteName.mainScreen, arguments: 0);
// });
// }
// }
// });
// }
// } else {
// Timer(const Duration(seconds: 2), () async {
// SharedPreferences prefs = await SharedPreferences.getInstance();
// token = prefs.getString('token');
// myusername = prefs.getString('name');
// phonenumber = prefs.getString('contact_number');
// OnBoard = prefs.getBool('OnBoard') ?? false;
// if (OnBoard == false) {
// Get.toNamed(RouteName.sliderscreen1);
// } else {
// if (token == null || token!.isEmpty) {
// Get.offAndToNamed(RouteName.loginScreen);
// } else {
// GetProfile().GetProfileAPI().then((value) {
// Get.toNamed(RouteName.mainScreen, arguments: 0);
// });
// }
// }
// });
// }
Future.delayed(Duration(seconds: 2), () async {
if (_connectionStatus == ConnectivityResult.none) {
var result = await Get.to(NoInternet());
if (result != null && result) {
Timer(const Duration(seconds: 1), () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var token = prefs.getString('accessToken');
// myusername = prefs.getString('name');
// phonenumber = prefs.getString('contact_number');
// OnBoard = prefs.getBool('OnBoard') ?? false;
// if (OnBoard == false) {
// Get.toNamed(RouteName.sliderscreen1);
// }
// else {
if (token == null || token!.isEmpty) {
Get.offAndToNamed(RouteName.loginscreen);
} else {
// GetProfile().GetProfileAPI().then((value) {
// Get.toNamed(RouteName.mainScreen, arguments: 0);
// });
Get.toNamed(RouteName.mainscreen);
}
// }
});
}
} else {
Timer(const Duration(seconds: 2), () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var token = prefs.getString('accessToken');
// myusername = prefs.getString('name');
// phonenumber = prefs.getString('contact_number');
// OnBoard = prefs.getBool('OnBoard') ?? false;
// if (OnBoard == false) {
// Get.toNamed(RouteName.sliderscreen1);
// }
// else {
if (token == null || token!.isEmpty) {
Get.offAndToNamed(RouteName.loginscreen);
} else {
// GetProfile().GetProfileAPI().then((value) {
// Get.toNamed(RouteName.mainScreen, arguments: 0);
// });
Get.toNamed(RouteName.mainscreen);
}
// }
});
}
});
// for scaleTansition
_scaleController = AnimationController(
@@ -131,7 +136,8 @@ class _SplashScreenState extends State<SplashScreen>
scale: _scaleAnimation,
child: Text(
"Traders Circuit",
style: TextStyle(fontFamily: 'hiragino',
style: TextStyle(
fontFamily: 'hiragino',
fontSize: 50,
fontWeight: FontWeight.w600,
color: Colors.white),

View File

@@ -3,10 +3,15 @@ import 'dart:developer';
import '../../Utils/api_urls.dart';
import '../../Utils/base_manager.dart';
import '../../data/network/network_api_services.dart';
import 'package:shared_preferences/shared_preferences.dart';
class FAQApi {
Future<ResponseData<dynamic>> getFAQData() async {
final response = await NetworkApiServices().getApi(
SharedPreferences prefs = await SharedPreferences.getInstance();
String? token = prefs.getString('accessToken');
final response = await NetworkApiServices().postApi(
token == null || token.isEmpty ? {} : {"token": token},
ApiUrls.faqApi,
);
log(response.data.toString());
@@ -22,4 +27,27 @@ class FAQApi {
}
return response;
}
Future<ResponseData<dynamic>> updaeFAQLikeDisklikeData(
int faqId, int status) async {
final response = await NetworkApiServices().postApi(
{
"faq_id": faqId,
"status": status,
},
ApiUrls.faqLikeDislikeApi,
);
log(response.data.toString());
if (response.status == ResponseStatus.SUCCESS) {
Map<String, dynamic> responseData =
Map<String, dynamic>.from(response.data);
if (responseData['status'] == "success") {
return response;
} else {
return ResponseData<dynamic>(
responseData['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -33,6 +33,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
audio_session:
dependency: transitive
description:
name: audio_session
sha256: a49af9981eec5d7cd73b37bacb6ee73f8143a6a9f9bd5b6021e6c346b9b6cf4e
url: "https://pub.dev"
source: hosted
version: "0.1.19"
audio_video_progress_bar:
dependency: "direct main"
description:
name: audio_video_progress_bar
sha256: ccc7d7b83d2a16c52d4a7fb332faabd1baa053fb0e4c16815aefd3945ab33b81
url: "https://pub.dev"
source: hosted
version: "2.0.2"
boolean_selector:
dependency: transitive
description:
@@ -161,6 +177,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.10"
device_info_plus:
dependency: transitive
description:
name: device_info_plus
sha256: f52ab3b76b36ede4d135aab80194df8925b553686f0fa12226b4e2d658e45903
url: "https://pub.dev"
source: hosted
version: "8.2.2"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
url: "https://pub.dev"
source: hosted
version: "7.0.0"
dio:
dependency: "direct main"
description:
@@ -404,10 +436,10 @@ packages:
dependency: transitive
description:
name: http
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "0.13.6"
http_parser:
dependency: transitive
description:
@@ -420,26 +452,26 @@ packages:
dependency: "direct main"
description:
name: image_cropper
sha256: f4bad5ed2dfff5a7ce0dfbad545b46a945c702bb6182a921488ef01ba7693111
sha256: "542c3453109d16bcc388e43ae2276044d2cd6a6d20c68bdcff2c94ab9363ea15"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
version: "4.0.1"
image_cropper_for_web:
dependency: transitive
description:
name: image_cropper_for_web
sha256: "865d798b5c9d826f1185b32e5d0018c4183ddb77b7b82a931e1a06aa3b74974e"
sha256: "89c936aa772a35b69ca67b78049ae9fa163a4fb8da2f6dee3893db8883fb49d2"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "2.0.0"
image_cropper_platform_interface:
dependency: transitive
description:
name: image_cropper_platform_interface
sha256: ee160d686422272aa306125f3b6fb1c1894d9b87a5e20ed33fa008e7285da11e
sha256: b232175c132b2f7ede3e1f101652bcd635cb4079a77c6dded8e6d32e6578d685
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
@@ -516,10 +548,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
version: "0.18.1"
js:
dependency: transitive
description:
@@ -528,6 +560,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
just_audio:
dependency: "direct main"
description:
name: just_audio
sha256: b7cb6bbf3750caa924d03f432ba401ec300fd90936b3f73a9b33d58b1e96286b
url: "https://pub.dev"
source: hosted
version: "0.9.37"
just_audio_platform_interface:
dependency: transitive
description:
name: just_audio_platform_interface
sha256: c3dee0014248c97c91fe6299edb73dc4d6c6930a2f4f713579cd692d9e47f4a1
url: "https://pub.dev"
source: hosted
version: "4.2.2"
just_audio_web:
dependency: transitive
description:
name: just_audio_web
sha256: "134356b0fe3d898293102b33b5fd618831ffdc72bb7a1b726140abdf22772b70"
url: "https://pub.dev"
source: hosted
version: "0.4.9"
lints:
dependency: transitive
description:
@@ -540,10 +596,10 @@ packages:
dependency: "direct main"
description:
name: local_auth
sha256: "280421b416b32de31405b0a25c3bd42dfcef2538dfbb20c03019e02a5ed55ed0"
sha256: "27679ed8e0d7daab2357db6bb7076359e083a56b295c0c59723845301da6aed9"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.1.8"
local_auth_android:
dependency: transitive
description:
@@ -552,14 +608,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.37"
local_auth_darwin:
local_auth_ios:
dependency: transitive
description:
name: local_auth_darwin
sha256: "33381a15b0de2279523eca694089393bb146baebdce72a404555d03174ebc1e9"
name: local_auth_ios
sha256: eb283b530029b334698918f1e282d4483737cbca972ff21b9193be3d6de8e2b8
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.1.6"
local_auth_platform_interface:
dependency: transitive
description:
@@ -869,14 +925,6 @@ 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:
@@ -917,6 +965,62 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
syncfusion_flutter_core:
dependency: transitive
description:
name: syncfusion_flutter_core
sha256: "8db8f55c77f56968681447d3837c10f27a9e861e238a898fda116c7531def979"
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_flutter_pdf:
dependency: transitive
description:
name: syncfusion_flutter_pdf
sha256: e97daea47f9ac4cf25cc8fc11a0475580ad9c592056d9c2bdc809c73e276decf
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_flutter_pdfviewer:
dependency: "direct main"
description:
name: syncfusion_flutter_pdfviewer
sha256: fdd2ff565cd42247b8e86e26304329bae924fdfe8ddc1f4a3a264916f6c1ff1f
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_pdfviewer_macos:
dependency: transitive
description:
name: syncfusion_pdfviewer_macos
sha256: "8cc925cae532c0fa17e849165796d962107f45b86e66ee334dcaabf6b7305c82"
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_pdfviewer_platform_interface:
dependency: transitive
description:
name: syncfusion_pdfviewer_platform_interface
sha256: "08039ecdb8f79454fb367c6bf5a833846a666039415d2b5d76a7e59a5b3ff710"
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_pdfviewer_web:
dependency: transitive
description:
name: syncfusion_pdfviewer_web
sha256: "8e5ed0d313a1aa3869e4f2e8d079bc9bfa37ce79d91be7bb328e456f37b7995f"
url: "https://pub.dev"
source: hosted
version: "21.2.10"
syncfusion_pdfviewer_windows:
dependency: transitive
description:
name: syncfusion_pdfviewer_windows
sha256: "3e93f281135fb0562f7e6c343d2db741cf3cbd78c5b04884eef9af414408bc77"
url: "https://pub.dev"
source: hosted
version: "21.2.10"
synchronized:
dependency: transitive
description:
@@ -949,6 +1053,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
url_launcher:
dependency: transitive
description:
name: url_launcher
sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c
url: "https://pub.dev"
source: hosted
version: "6.2.4"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
url: "https://pub.dev"
source: hosted
version: "6.3.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
url_launcher_linux:
dependency: transitive
description:
@@ -957,6 +1085,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
@@ -985,10 +1121,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f"
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
url: "https://pub.dev"
source: hosted
version: "4.2.2"
version: "3.0.7"
vector_graphics:
dependency: transitive
description:
@@ -1143,5 +1279,7 @@ packages:
source: hosted
version: "6.3.0"
sdks:
dart: ">=3.2.3 <4.0.0"
flutter: ">=3.16.6"

View File

@@ -28,7 +28,7 @@ dependencies:
gap: ^3.0.1
image_picker: ^1.0.7
dotted_border: ^2.1.0
image_cropper: ^5.0.1
image_cropper:
file_picker: any
lottie: ^2.7.0
chewie: ^1.5.0
@@ -40,11 +40,13 @@ dependencies:
dio: ^5.1.2
expansion_tile_group: ^1.2.4
local_auth: ^2.2.0
local_auth:
scgateway_flutter_plugin: ^2.3.1
async: ^2.4.1
just_audio: ^0.9.37
audio_video_progress_bar: ^2.0.2
syncfusion_flutter_pdfviewer:
dev_dependencies:
flutter_test: