Merge branch 'main' into splash
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -244,9 +244,9 @@ Widget ActiveCallsTab() {
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(
|
||||
() => PlayerWidget(),
|
||||
);
|
||||
Get.to(() => PlayerWidget(), arguments: {
|
||||
"video_url": "",
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
height: 200.h,
|
||||
|
||||
@@ -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
@@ -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 &&
|
||||
|
||||
24
lib/view/Sidemenu/ContentByte/read_pdf.dart
Normal file
24
lib/view/Sidemenu/ContentByte/read_pdf.dart
Normal 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',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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'),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
)))
|
||||
),
|
||||
]),
|
||||
)))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user