@@ -176,7 +176,7 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
.last;
|
||||
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: 750.h),
|
||||
constraints: BoxConstraints(minHeight: 820.h),
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 600.h,
|
||||
@@ -220,7 +220,6 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
width: 1.w,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.r),
|
||||
|
||||
),
|
||||
child: Center(
|
||||
child: text12w400_FCFCFC("Coach")),
|
||||
@@ -339,8 +338,6 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
const Spacer(),
|
||||
countersHelper
|
||||
@@ -372,37 +369,36 @@ class _NormalCardTileState extends State<NormalCardTile> {
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
bool result = await Get.toNamed(RouteName.postdetailsScreen,
|
||||
arguments: {
|
||||
'postId': widget.commonObj.id,
|
||||
'tagsList': widget.tags,
|
||||
'created_at': widget.createAt,
|
||||
'commonObj': widget.commonObj,
|
||||
'fromWhichTab': widget.forWhichTab,
|
||||
'reactions': widget.reactions,
|
||||
'selectedReactions': widget.selectedReactions,
|
||||
'currentIndex': widget.currentIndex
|
||||
});
|
||||
if (result) {
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 360,
|
||||
width: double.infinity,
|
||||
child: CachedNetworkImage(
|
||||
cacheKey: imgUrl,
|
||||
imageUrl: widget.commonObj.image!,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => const Center(
|
||||
child:
|
||||
CircularProgressIndicator()), // Optional: shows a loading indicator while the image is loading
|
||||
errorWidget: (context, url, error) => const Center(
|
||||
child: Icon(Icons
|
||||
.error)), // Optional: shows an error icon if the image fails to load
|
||||
),
|
||||
)),
|
||||
onTap: () async {
|
||||
bool result = await Get.toNamed(RouteName.postdetailsScreen,
|
||||
arguments: {
|
||||
'postId': widget.commonObj.id,
|
||||
'tagsList': widget.tags,
|
||||
'created_at': widget.createAt,
|
||||
'commonObj': widget.commonObj,
|
||||
'fromWhichTab': widget.forWhichTab,
|
||||
'reactions': widget.reactions,
|
||||
'selectedReactions': widget.selectedReactions,
|
||||
'currentIndex': widget.currentIndex
|
||||
});
|
||||
if (result) {
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 360,
|
||||
width: double.infinity,
|
||||
child: Image.network(
|
||||
widget.commonObj.image!,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Center(
|
||||
child: Icon(Icons.error),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
|
||||
@@ -70,7 +70,6 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// Get.toNamed(RouteName.mainscreen,arguments: 0);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
await Getuserdetails().Getuser().then((value) {
|
||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
|
||||
@@ -20,6 +20,7 @@ class LoginAPI {
|
||||
if (response.data['status'] == 'success') {
|
||||
LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||
await prefs.setString('access-token', loginObj.data!.accessToken!);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
await prefs.setString(
|
||||
'fullname', loginObj.data?.userData?.fullName ?? "");
|
||||
await prefs.setString(
|
||||
@@ -81,6 +82,7 @@ class LoginAPI {
|
||||
.postApi(data, ApiUrls.googlelogin, optionalpar: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
await prefs.setString('access-token', response.data['data']['token']);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||
return ResponseData<dynamic>(
|
||||
"go-to-signin-via-oauth", ResponseStatus.SUCCESS,
|
||||
@@ -100,13 +102,13 @@ class LoginAPI {
|
||||
.postApi(data, ApiUrls.applelogin, optionalpar: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
await prefs.setString('access-token', response.data['data']['token']);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||
arguments: {"email": emailReceived});
|
||||
return ResponseData<dynamic>(
|
||||
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
||||
} else {
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
await Getuserdetails().Getuser().then((value) {
|
||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
@@ -120,7 +122,7 @@ class LoginAPI {
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
}
|
||||
} else {
|
||||
Get.toNamed(RouteName.mainscreen,arguments: 0);
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 0);
|
||||
}
|
||||
});
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
@@ -138,6 +140,7 @@ class LoginAPI {
|
||||
.postApi(data, ApiUrls.facebooklogin, optionalpar: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
await prefs.setString('access-token', response.data['data']['token']);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||
arguments: {"email": emailReceived});
|
||||
@@ -145,7 +148,7 @@ class LoginAPI {
|
||||
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
||||
} else {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
await Communityallgetmethod().getLikeicons();
|
||||
|
||||
await Getuserdetails().Getuser().then((value) {
|
||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
@@ -159,7 +162,7 @@ class LoginAPI {
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
}
|
||||
} else {
|
||||
Get.toNamed(RouteName.mainscreen,arguments: 0);
|
||||
Get.toNamed(RouteName.mainscreen, arguments: 0);
|
||||
}
|
||||
});
|
||||
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
|
||||
|
||||
@@ -332,7 +332,6 @@ class _FeedTabState extends State<FeedTab> {
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
log("TRUE");
|
||||
setValues();
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
@@ -420,7 +419,6 @@ class _FeedTabState extends State<FeedTab> {
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
log("FALSE");
|
||||
setValues();
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
@@ -494,7 +492,6 @@ class _FeedTabState extends State<FeedTab> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class PopularTab extends StatefulWidget {
|
||||
const PopularTab({super.key});
|
||||
|
||||
@@ -536,15 +533,11 @@ class _PopularTabState extends State<PopularTab> {
|
||||
}
|
||||
}
|
||||
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
if (_isDataInitialized) {
|
||||
if (mounted) {
|
||||
_setModel();
|
||||
countersHelper.setListsPopular();
|
||||
await _fetchIcons();
|
||||
|
||||
_isDataInitialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +638,7 @@ class _PopularTabState extends State<PopularTab> {
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
),
|
||||
popularpostobj!.data.isEmpty
|
||||
commonobjmodel!.data.isEmpty
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
@@ -95,34 +95,36 @@ class _TagdetailScreenState extends State<TagdetailScreen> {
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Popular',
|
||||
),
|
||||
Tab(
|
||||
text: 'Latest',
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 670.h,
|
||||
child: TabBarView(
|
||||
children: [
|
||||
PopularTab(id: tagsid),
|
||||
// cyclelatestTab(),
|
||||
LatestTab(id: tagsid)
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(children: [
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
const CommonTabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Popular',
|
||||
),
|
||||
Tab(
|
||||
text: 'Latest',
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
PopularTab(id: tagsid),
|
||||
// cyclelatestTab(),
|
||||
LatestTab(id: tagsid)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
])
|
||||
),
|
||||
),
|
||||
]))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -171,18 +173,15 @@ class _PopularTabState extends State<PopularTab> {
|
||||
}
|
||||
}
|
||||
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_setModel();
|
||||
countersHelper.setListsPopular();
|
||||
_fetchIcons();
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
setState(() {});
|
||||
});
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
@@ -402,8 +401,6 @@ class _LatestTabState extends State<LatestTab> {
|
||||
}
|
||||
}
|
||||
|
||||
bool _isDataInitialized = true;
|
||||
|
||||
Future<void> setValues() async {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -411,9 +408,9 @@ class _LatestTabState extends State<LatestTab> {
|
||||
countersHelper.setListsPopular();
|
||||
_fetchIcons();
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
// }
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
|
||||
@@ -783,15 +783,14 @@ class _PostsTabState extends State<PostsTab> {
|
||||
}
|
||||
|
||||
Future<void> setValues() async {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_setModel();
|
||||
countersHelper.setListsPopular();
|
||||
_fetchIcons();
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
setState(() {});
|
||||
});
|
||||
});
|
||||
//if (mounted) {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
_sortTags(index) {
|
||||
|
||||
Reference in New Issue
Block a user