Skip to content

Commit

Permalink
updated to version 1.0.1+29
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Jan 3, 2023
1 parent ae13f40 commit 531c0cc
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 192 deletions.
6 changes: 3 additions & 3 deletions lib/constants/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ abstract class ColorValues {
static const Color darkSubtitle2TextColor =
Color.fromARGB(255, 124, 124, 124);

static const Color lightBgColor = Color.fromARGB(255, 250, 250, 250);
static const Color lightDialogColor = Color.fromARGB(255, 236, 236, 236);
static const Color lightBgColor = Color.fromARGB(255, 252, 252, 252);
static const Color lightDialogColor = Color.fromARGB(255, 232, 232, 232);
static const Color darkBgColor = Color.fromARGB(255, 18, 18, 30);
static const Color darkDialogColor = Color.fromARGB(255, 40, 40, 50);

static const Color lightShadowColor = Color.fromARGB(255, 0, 0, 0);
static const Color darkShadowColor = Color.fromARGB(255, 200, 200, 200);
static const Color darkShadowColor = Color.fromARGB(255, 150, 150, 150);

static const primaryGrad = LinearGradient(
colors: [primaryColor, primaryLightColor],
Expand Down
8 changes: 5 additions & 3 deletions lib/global_widgets/count_widget.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:social_media_app/constants/colors.dart';
import 'package:social_media_app/constants/dimens.dart';
import 'package:social_media_app/constants/styles.dart';

Expand Down Expand Up @@ -42,14 +41,17 @@ class NxCountWidget extends StatelessWidget {
children: [
Text(
value,
style: valueStyle ?? AppStyles.style16Bold,
style: valueStyle ??
AppStyles.style16Bold.copyWith(
color: Theme.of(context).textTheme.bodyText1!.color,
),
),
Dimens.boxHeight4,
Text(
title,
style: titleStyle ??
AppStyles.style13Normal.copyWith(
color: ColorValues.grayColor,
color: Theme.of(context).textTheme.subtitle2!.color,
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/home/controllers/profile_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class ProfileController extends GetxController {
final response = await _apiProvider.getUserPosts(
_auth.token,
_profileDetails.value.user!.id,
limit: 16,
limit: 12,
);

if (response.isSuccessful) {
Expand Down Expand Up @@ -284,7 +284,7 @@ class ProfileController extends GetxController {
_auth.token,
_profileDetails.value.user!.id,
page: page,
limit: 16,
limit: 12,
);

if (response.isSuccessful) {
Expand Down
72 changes: 13 additions & 59 deletions lib/modules/home/views/widgets/post_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import 'package:social_media_app/global_widgets/elevated_card.dart';
import 'package:social_media_app/global_widgets/expandable_text_widget.dart';
import 'package:social_media_app/global_widgets/get_time_ago_refresh_widget/get_time_ago_widget.dart';
import 'package:social_media_app/global_widgets/primary_icon_btn.dart';
import 'package:social_media_app/global_widgets/primary_text_btn.dart';
import 'package:social_media_app/global_widgets/video_player_widget.dart';
import 'package:social_media_app/helpers/get_time_ago_msg.dart';
import 'package:social_media_app/modules/home/controllers/post_controller.dart';
import 'package:social_media_app/modules/home/controllers/profile_controller.dart';
import 'package:social_media_app/modules/home/controllers/trending_post_controller.dart';
import 'package:social_media_app/modules/home/views/widgets/post_view_widget.dart';
import 'package:social_media_app/modules/post/controllers/post_details_controller.dart';
import 'package:social_media_app/modules/post/views/widgets/poll_option_widget.dart';
import 'package:social_media_app/routes/route_management.dart';
import 'package:social_media_app/utils/utility.dart';
Expand All @@ -37,6 +39,9 @@ class PostWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
assert(controller is PostDetailsController ||
controller is PostController ||
controller is TrendingPostController);
return NxElevatedCard(
margin: Dimens.edgeInsets8_0,
borderRadius: Dimens.four,
Expand Down Expand Up @@ -440,7 +445,13 @@ class PostWidget extends StatelessWidget {
ListTile(
onTap: () {
AppUtility.closeBottomSheet();
_showDeletePostOptions();
AppUtility.showDeleteDialog(
context,
() async {
AppUtility.closeDialog();
controller?.deletePost(post.id!);
},
);
},
leading: Icon(
Icons.delete,
Expand Down Expand Up @@ -484,61 +495,4 @@ class PostWidget extends StatelessWidget {
),
],
);

Future<void> _showDeletePostOptions() async {
AppUtility.showSimpleDialog(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Dimens.boxHeight8,
Padding(
padding: Dimens.edgeInsets0_16,
child: Text(
StringValues.delete,
style: AppStyles.style20Bold,
),
),
Dimens.boxHeight8,
Padding(
padding: Dimens.edgeInsets0_16,
child: Text(
StringValues.deleteConfirmationText,
style: AppStyles.style14Normal,
),
),
Dimens.boxHeight8,
Padding(
padding: Dimens.edgeInsets0_16,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
NxTextButton(
label: StringValues.no,
labelStyle: AppStyles.style16Bold.copyWith(
color: ColorValues.errorColor,
),
onTap: AppUtility.closeDialog,
padding: Dimens.edgeInsets8,
),
Dimens.boxWidth16,
NxTextButton(
label: StringValues.yes,
labelStyle: AppStyles.style16Bold.copyWith(
color: ColorValues.successColor,
),
onTap: () async {
AppUtility.closeDialog();
controller?.deletePost(post.id!);
},
padding: Dimens.edgeInsets8,
),
],
),
),
Dimens.boxHeight8,
],
),
);
}
}
63 changes: 32 additions & 31 deletions lib/modules/post/views/widgets/comment_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class CommentWidget extends StatelessWidget {
children: [
_buildCommentHead(context),
_buildCommentBody(context),
_buildCommentFooter(context),
//_buildCommentFooter(context),
Dimens.boxHeight8,
],
),
);
Expand Down Expand Up @@ -164,36 +165,36 @@ class CommentWidget extends StatelessWidget {
);
}

Widget _buildCommentFooter(BuildContext context) => Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
/// Like Button
GestureDetector(
onTap: () => {},
child: Padding(
padding: Dimens.edgeInsets8,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.favorite_outline,
size: Dimens.twenty,
color: Theme.of(context).textTheme.subtitle1!.color),
Dimens.boxWidth2,
Text(
'${0}'.toCountingFormat(),
style: AppStyles.style13Normal.copyWith(
color: Theme.of(context).textTheme.subtitle1!.color,
),
),
],
),
),
),
],
);
// Widget _buildCommentFooter(BuildContext context) => Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// /// Like Button
// GestureDetector(
// onTap: () => {},
// child: Padding(
// padding: Dimens.edgeInsets8,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// Icon(Icons.favorite_outline,
// size: Dimens.twenty,
// color: Theme.of(context).textTheme.subtitle1!.color),
// Dimens.boxWidth2,
// Text(
// '${0}'.toCountingFormat(),
// style: AppStyles.style13Normal.copyWith(
// color: Theme.of(context).textTheme.subtitle1!.color,
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// );

void _showHeaderOptionBottomSheet(BuildContext context) =>
AppUtility.showBottomSheet(
Expand Down
72 changes: 13 additions & 59 deletions lib/modules/post/views/widgets/post_details_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import 'package:social_media_app/global_widgets/cached_network_image.dart';
import 'package:social_media_app/global_widgets/elevated_card.dart';
import 'package:social_media_app/global_widgets/expandable_text_widget.dart';
import 'package:social_media_app/global_widgets/primary_icon_btn.dart';
import 'package:social_media_app/global_widgets/primary_text_btn.dart';
import 'package:social_media_app/global_widgets/video_player_widget.dart';
import 'package:social_media_app/modules/home/controllers/post_controller.dart';
import 'package:social_media_app/modules/home/controllers/profile_controller.dart';
import 'package:social_media_app/modules/home/controllers/trending_post_controller.dart';
import 'package:social_media_app/modules/home/views/widgets/post_view_widget.dart';
import 'package:social_media_app/modules/post/controllers/post_details_controller.dart';
import 'package:social_media_app/modules/post/views/widgets/poll_option_widget.dart';
import 'package:social_media_app/routes/route_management.dart';
import 'package:social_media_app/utils/utility.dart';
Expand All @@ -35,6 +37,9 @@ class PostDetailsWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
assert(controller is PostDetailsController ||
controller is PostController ||
controller is TrendingPostController);
return NxElevatedCard(
margin: Dimens.edgeInsets8_0,
borderRadius: Dimens.four,
Expand Down Expand Up @@ -518,7 +523,13 @@ class PostDetailsWidget extends StatelessWidget {
ListTile(
onTap: () {
AppUtility.closeBottomSheet();
_showDeletePostOptions();
AppUtility.showDeleteDialog(
context,
() async {
AppUtility.closeDialog();
controller?.deletePost(post.id!);
},
);
},
leading: Icon(
Icons.delete,
Expand Down Expand Up @@ -562,61 +573,4 @@ class PostDetailsWidget extends StatelessWidget {
),
],
);

Future<void> _showDeletePostOptions() async {
AppUtility.showSimpleDialog(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Dimens.boxHeight8,
Padding(
padding: Dimens.edgeInsets0_16,
child: Text(
'Delete',
style: AppStyles.style18Bold,
),
),
Dimens.dividerWithHeight,
Padding(
padding: Dimens.edgeInsets0_16,
child: Text(
StringValues.deleteConfirmationText,
style: AppStyles.style14Normal,
),
),
Dimens.boxHeight8,
Padding(
padding: Dimens.edgeInsets0_16,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
NxTextButton(
label: StringValues.no,
labelStyle: AppStyles.style16Bold.copyWith(
color: ColorValues.errorColor,
),
onTap: AppUtility.closeDialog,
padding: Dimens.edgeInsets8,
),
Dimens.boxWidth16,
NxTextButton(
label: StringValues.yes,
labelStyle: AppStyles.style16Bold.copyWith(
color: ColorValues.successColor,
),
onTap: () async {
AppUtility.closeDialog();
controller?.deletePost(post.id!);
},
padding: Dimens.edgeInsets8,
),
],
),
),
Dimens.boxHeight8,
],
),
);
}
}
Loading

0 comments on commit 531c0cc

Please sign in to comment.