feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -54,7 +54,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -80,13 +80,13 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
state.feedBlogPostList[widget.index].author.authorProfileIcon,
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.feedBlogPostList[widget.index].author.authorName,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Colors.black87,
fontWeight: FontWeight.w500,
@@ -96,7 +96,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
const SizedBox(height: 4),
Text(
'${calculateDifference(state.feedBlogPostList[widget.index].createdAt)} в ${state.feedBlogPostList[widget.index].createdAt.hour.toString().padLeft(2, '0')}:${state.feedBlogPostList[widget.index].createdAt.minute.toString().padLeft(2, '0')}',
style: TextStyle(
style: const TextStyle(
height: 1,
color: Colors.black45,
fontSize: 14,
@@ -117,19 +117,19 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
),
),
if (state.feedBlogPostList[widget.index].title.isNotEmpty || state.feedBlogPostList[widget.index].description.isNotEmpty)
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
state.feedBlogPostList[widget.index].title,
style: TextStyle(
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
if (state.feedBlogPostList[widget.index].title.isNotEmpty && state.feedBlogPostList[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.feedBlogPostList[widget.index].title.isNotEmpty && state.feedBlogPostList[widget.index].description.isNotEmpty) const SizedBox(height: 8),
if (state.feedBlogPostList[widget.index].description.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
@@ -157,28 +157,28 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
),
),
),
if (state.feedBlogPostList[widget.index].title.isNotEmpty || state.feedBlogPostList[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.feedBlogPostList[widget.index].title.isNotEmpty || state.feedBlogPostList[widget.index].description.isNotEmpty) const SizedBox(height: 8),
GestureDetector(
onTap: () {
context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(
imageUrls: [baseUrl + '/storage/' + state.feedBlogPostList[widget.index].image],
imageUrls: ['$baseUrl/storage/${state.feedBlogPostList[widget.index].image}'],
index: 0,
),
);
},
child: Hero(
tag: baseUrl + '/storage/' + state.feedBlogPostList[widget.index].image,
tag: '$baseUrl/storage/${state.feedBlogPostList[widget.index].image}',
child: CachedNetworkImage(
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
imageUrl: baseUrl + '/storage/' + state.feedBlogPostList[widget.index].image,
errorWidget: (context, str, object) => SizedBox.shrink(),
imageUrl: '$baseUrl/storage/${state.feedBlogPostList[widget.index].image}',
errorWidget: (context, str, object) => const SizedBox.shrink(),
),
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -197,10 +197,11 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
isLiked
? await context.read<FeedCubit>().likePost(state.feedBlogPostList[widget.index].id)
: await context.read<FeedCubit>().unlikedPost(state.feedBlogPostList[widget.index].id);
if (!context.mounted) return;
await context.read<FeedCubit>().loadFeedBlogPostList();
},
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
'assets/icons/comment.svg',
@@ -217,7 +218,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
extra: state.feedBlogPostList[widget.index],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 20,
@@ -229,19 +230,19 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/blog_post/' + state.feedBlogPostList[widget.index].id.toString(),
'$baseUrl/ru/blog_post/${state.feedBlogPostList[widget.index].id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
},
),
Spacer(),
const Spacer(),
Icon(
Icons.visibility_rounded,
size: 16,
color: appTheme.gray500,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
state.feedBlogPostList[widget.index].totalViews.toString(),
style: TextStyle(
@@ -253,7 +254,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
],
),
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
),
),

View File

@@ -23,9 +23,9 @@ class BlogPosts extends StatelessWidget {
return false;
},
child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 8),
shrinkWrap: true,
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
if (index == state.feedBlogPostList.length) {
return const Loader();
@@ -33,7 +33,7 @@ class BlogPosts extends StatelessWidget {
return BlogPostWidget(index: index);
},
separatorBuilder: (context, index) {
return SizedBox(height: 8);
return const SizedBox(height: 8);
},
itemCount: state.isLoading ? state.feedBlogPostList.length + 1 : state.feedBlogPostList.length,
),

View File

@@ -17,21 +17,21 @@ class ChipGroup extends StatelessWidget {
return Align(
alignment: Alignment.centerLeft,
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal,
child: Row(
children: [
...List.generate(
5,
(index) => Padding(
padding: EdgeInsets.only(right: 8.0),
padding: const EdgeInsets.only(right: 8.0),
child: ChoiceChipWidget(
index: index,
selectedChipIndex: selectedChipIndex,
chipsLabelList: chipsLabelList,
onSelected: (bool selected) {
setSelectedChipIndex(index);
FocusScope.of(context).requestFocus(new FocusNode());
FocusScope.of(context).requestFocus(FocusNode());
},
),
),

View File

@@ -34,13 +34,13 @@ class _CommentsWidgetState extends State<CommentsWidget> {
children: [
for (int i = 0; i < widget.comment.data.length; i++) ...[
_comment(s, widget.comment.data[i]),
if (widget.comment.data[i].childrenComments.isNotEmpty) SizedBox(height: 8),
if (widget.comment.data[i].childrenComments.isNotEmpty) const SizedBox(height: 8),
for (int j = 0; j < widget.comment.data[i].childrenComments.length; j++)
Padding(
padding: EdgeInsets.only(left: 40),
padding: const EdgeInsets.only(left: 40),
child: _comment(s, widget.comment.data[i].childrenComments[j], 16, true),
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
],
);
@@ -62,7 +62,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
foregroundImage: NetworkImage(comment.authorProfileIcon),
radius: radius,
),
SizedBox(width: 8),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
@@ -76,7 +76,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 4),
const SizedBox(height: 4),
SizedBox(
width: isChild ? MediaQuery.of(context).size.width * 0.72 : MediaQuery.of(context).size.width * 0.8,
child: Text(
@@ -89,7 +89,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
),
),
),
SizedBox(height: 4),
const SizedBox(height: 4),
Row(
children: [
Text(
@@ -101,7 +101,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 16),
const SizedBox(width: 16),
if (!isChild)
GestureDetector(
onTap: () {

View File

@@ -32,10 +32,10 @@ class ConsultantWidget extends StatelessWidget {
},
borderRadius: BorderRadius.circular(20),
child: Ink(
padding: EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFFF6F6F6),
color: const Color(0xFFF6F6F6),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -47,7 +47,7 @@ class ConsultantWidget extends StatelessWidget {
Row(
children: [
Ink(
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8),
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
@@ -71,7 +71,7 @@ class ConsultantWidget extends StatelessWidget {
children: [
Text(
consultant.name,
style: TextStyle(
style: const TextStyle(
height: 1,
fontWeight: FontWeight.w500,
fontSize: 15,
@@ -93,7 +93,7 @@ class ConsultantWidget extends StatelessWidget {
],
),
Ink(
padding: EdgeInsets.all(6),
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.white,
@@ -105,7 +105,7 @@ class ConsultantWidget extends StatelessWidget {
],
),
const SizedBox(height: 8),
Text('description'),
const Text('description'),
if (consultant.badges.isNotEmpty) const SizedBox(height: 8),
_badges(consultant.badges, context),
],
@@ -122,12 +122,12 @@ class ConsultantWidget extends StatelessWidget {
for (int i = 0; i < badges.length; i++) ...[
badges[i].image.contains('svg')
? SvgPicture.network(
baseUrl + '/storage/' + badges[i].image,
'$baseUrl/storage/${badges[i].image}',
width: 28,
height: 28,
)
: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + badges[i].image,
imageUrl: '$baseUrl/storage/${badges[i].image}',
),
i < badges.length - 1 ? const SizedBox(width: 8) : const SizedBox.shrink(),
],

View File

@@ -24,14 +24,14 @@ class Consultants extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 16),
padding: const EdgeInsets.symmetric(vertical: 16),
shrinkWrap: true,
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
return ConsultantWidget(consultant: state.consultantsList[index]);
},
separatorBuilder: (context, index) {
return SizedBox(height: 12);
return const SizedBox(height: 12);
},
itemCount: state.consultantsList.length,
),

View File

@@ -25,55 +25,55 @@ class DietFilterBottomSheet extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Center(child: BottomSheetHandlerBar()),
SizedBox(height: 16),
const SizedBox(height: 12),
const Center(child: BottomSheetHandlerBar()),
const SizedBox(height: 16),
Text(
s.order,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 12),
const SizedBox(height: 12),
SortingDropDownFilter(
dietsCubit: dietsCubit,
myDietsCubit: myDietsCubit,
),
SizedBox(
const SizedBox(
height: 16,
),
CustomDivider(),
SizedBox(
const CustomDivider(),
const SizedBox(
height: 16,
),
Text(
s.diet_type,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 12,
),
TypeChoiceFilterWidget(
dietsCubit: dietsCubit,
myDietsCubit: myDietsCubit,
),
SizedBox(
const SizedBox(
height: 16,
),
CustomDivider(),
SizedBox(
const CustomDivider(),
const SizedBox(
height: 16,
),
Text(
s.time,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 12,
),
DurationChoiceFilterWidget(
dietCubit: dietsCubit,
myDietsCubit: myDietsCubit,
),
SizedBox(
const SizedBox(
height: 24,
),
],

View File

@@ -28,21 +28,21 @@ class Diets extends StatelessWidget {
} else {
return Stack(
children: [
SizedBox.expand(),
const SizedBox.expand(),
NotificationListener<ScrollNotification>(
onNotification: (notification) {
loadNewContent(notification, context.read<DietsCubit>().loadNextPage);
return false;
},
child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 8),
shrinkWrap: true,
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
return DietsWidget(diet: state.dietsList[index], index: index);
},
separatorBuilder: (context, index) {
return SizedBox(height: 8);
return const SizedBox(height: 8);
},
itemCount: state.dietsList.length,
),

View File

@@ -52,9 +52,9 @@ class _DietsWidgetState extends State<DietsWidget> {
Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
child: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + widget.diet.image,
imageUrl: '$baseUrl/storage/${widget.diet.image}',
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
),
@@ -71,7 +71,7 @@ class _DietsWidgetState extends State<DietsWidget> {
},
color: appTheme.whiteA700,
isFavorite: widget.diet.isFavorite,
borderRadius: BorderRadius.vertical(bottom: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(12)),
width: 40,
height: 44,
size: 19,
@@ -91,7 +91,7 @@ class _DietsWidgetState extends State<DietsWidget> {
),
],
),
SizedBox(height: 12),
const SizedBox(height: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -103,13 +103,13 @@ class _DietsWidgetState extends State<DietsWidget> {
),
),
if (widget.diet.details.isNotEmpty) ...[
SizedBox(
const SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Html(
data: widget.diet.details.length > 200 ? widget.diet.details.substring(0, 200) + '...' : widget.diet.details,
data: widget.diet.details.length > 200 ? '${widget.diet.details.substring(0, 200)}...' : widget.diet.details,
style: {
"*": Style(
margin: Margins.zero,
@@ -136,7 +136,7 @@ class _DietsWidgetState extends State<DietsWidget> {
await context.read<DietsCubit>().likeDiet(widget.diet.id, widget.index);
},
),
SizedBox(
const SizedBox(
width: 12,
),
FeedIconButton(
@@ -145,7 +145,7 @@ class _DietsWidgetState extends State<DietsWidget> {
onTap: () =>
GoRouter.of(context).pushNamed('aboutDietScreen', extra: {'diet': widget.diet, 'index': widget.index, 'navigateToComments': true}),
),
SizedBox(
const SizedBox(
width: 12,
),
FeedIconButton(
@@ -154,7 +154,7 @@ class _DietsWidgetState extends State<DietsWidget> {
final box = context.findRenderObject() as RenderBox?;
final result = await Share.shareUri(
Uri.parse(
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
'$baseUrl/ru/diet/${widget.diet.id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
@@ -165,7 +165,7 @@ class _DietsWidgetState extends State<DietsWidget> {
}
},
),
Spacer(),
const Spacer(),
FeedIconButton(
svgIcon: SvgPicture.asset('assets/icons/eye2.svg'),
text: widget.diet.totalViews.toString(),
@@ -174,7 +174,7 @@ class _DietsWidgetState extends State<DietsWidget> {
],
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
],
),
),

View File

@@ -31,9 +31,9 @@ class _DurationChoiceFilterWidgetState extends State<DurationChoiceFilterWidget>
super.didChangeDependencies();
if (chipsLabelList.isEmpty) {
chipsLabelList.add(s.all);
durationValues.forEach((element) {
chipsLabelList.add('${element} ${getDayForm(element, s)}');
});
for (var element in durationValues) {
chipsLabelList.add('$element ${getDayForm(element, s)}');
}
}
}

View File

@@ -19,11 +19,11 @@ class FilterBadge extends StatelessWidget {
);
},
child: Container(
padding: EdgeInsets.only(left: 20, top: 12, bottom: 12, right: 24),
padding: const EdgeInsets.only(left: 20, top: 12, bottom: 12, right: 24),
width: 70,
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.horizontal(left: Radius.circular(100)),
borderRadius: const BorderRadius.horizontal(left: Radius.circular(100)),
),
child: SvgPicture.asset(
'assets/icons/filter2.svg',

View File

@@ -56,9 +56,9 @@ class _PlanWidgetState extends State<PlanWidget> {
Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
child: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + widget.plan.image,
imageUrl: '$baseUrl/storage/${widget.plan.image}',
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
),
@@ -75,7 +75,7 @@ class _PlanWidgetState extends State<PlanWidget> {
},
color: appTheme.whiteA700,
isFavorite: widget.plan.isFavorite,
borderRadius: BorderRadius.vertical(bottom: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(12)),
width: 40,
height: 44,
size: 19,
@@ -95,7 +95,7 @@ class _PlanWidgetState extends State<PlanWidget> {
),
],
),
SizedBox(height: 12),
const SizedBox(height: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -107,13 +107,13 @@ class _PlanWidgetState extends State<PlanWidget> {
),
),
if (widget.plan.details.isNotEmpty) ...[
SizedBox(
const SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Html(
data: widget.plan.details.length > 200 ? widget.plan.details.substring(0, 200) + '...' : widget.plan.details,
data: widget.plan.details.length > 200 ? '${widget.plan.details.substring(0, 200)}...' : widget.plan.details,
style: {
"*": Style(
margin: Margins.zero,
@@ -127,7 +127,7 @@ class _PlanWidgetState extends State<PlanWidget> {
],
],
),
SizedBox(height: 16),
const SizedBox(height: 16),
GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed(
@@ -160,7 +160,7 @@ class _PlanWidgetState extends State<PlanWidget> {
InfoBouble(
radius: 12,
backgroundColor: appTheme.gray50,
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 10),
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 10),
children: [
Text(
'${widget.plan.author.authorPlaceInRating}-й в рейтинге',
@@ -170,12 +170,12 @@ class _PlanWidgetState extends State<PlanWidget> {
),
],
),
Spacer(),
const Spacer(),
Text(
'${widget.plan.packetsCount == 1 ? widget.plan.packet1Options?.price : '${s.from} ${widget.plan.minPriceOfOptions.toStringAsFixed(0)}'}₽',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.greenA700),
),
SizedBox(width: 16),
const SizedBox(width: 16),
],
),
title: Padding(
@@ -190,7 +190,7 @@ class _PlanWidgetState extends State<PlanWidget> {
),
),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.only(
left: 16,
@@ -206,7 +206,7 @@ class _PlanWidgetState extends State<PlanWidget> {
await context.read<PlansCubit>().likePlan(widget.plan.slug, widget.index);
},
),
SizedBox(
const SizedBox(
width: 12,
),
FeedIconButton(
@@ -215,7 +215,7 @@ class _PlanWidgetState extends State<PlanWidget> {
onTap: () =>
GoRouter.of(context).pushNamed('aboutPlanScreen', extra: {'plan': widget.plan, 'index': widget.index, 'navigateToComments': true}),
),
SizedBox(
const SizedBox(
width: 12,
),
FeedIconButton(
@@ -224,7 +224,7 @@ class _PlanWidgetState extends State<PlanWidget> {
final box = context.findRenderObject() as RenderBox?;
final result = await Share.shareUri(
Uri.parse(
baseUrl + '/ru/diet/' + widget.plan.id.toString(),
'$baseUrl/ru/diet/${widget.plan.id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
@@ -235,7 +235,7 @@ class _PlanWidgetState extends State<PlanWidget> {
}
},
),
Spacer(),
const Spacer(),
FeedIconButton(
svgIcon: SvgPicture.asset('assets/icons/eye2.svg'),
text: widget.plan.totalViews.toString(),
@@ -244,7 +244,7 @@ class _PlanWidgetState extends State<PlanWidget> {
],
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
],
),
),

View File

@@ -28,16 +28,16 @@ class Plans extends StatelessWidget {
}
return Stack(
children: [
SizedBox.expand(),
const SizedBox.expand(),
NotificationListener<ScrollNotification>(
onNotification: (notification) {
loadNewContent(notification, context.read<PlansCubit>().loadNextPage);
return false;
},
child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 8),
shrinkWrap: true,
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
return PlanWidget(
plan: state.plans[index],
@@ -45,7 +45,7 @@ class Plans extends StatelessWidget {
);
},
separatorBuilder: (context, index) {
return SizedBox(height: 8);
return const SizedBox(height: 8);
},
itemCount: state.plans.length,
),

View File

@@ -24,50 +24,50 @@ class PlansFilterBottomSheet extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Center(child: BottomSheetHandlerBar()),
SizedBox(height: 12),
const SizedBox(height: 12),
const Center(child: BottomSheetHandlerBar()),
const SizedBox(height: 12),
Text(
s.price,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 12),
const SizedBox(height: 12),
PriceChoiceFilterWidget(plansCubit: plansCubit, myPlansCubit: myPlansCubit,),
SizedBox(height: 16),
CustomDivider(),
SizedBox(
const SizedBox(height: 16),
const CustomDivider(),
const SizedBox(
height: 16,
),
Text(
s.time,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 12,
),
DurationChoiceFilterWidget(
plansCubit: plansCubit,
myPlansCubit: myPlansCubit,
),
SizedBox(
const SizedBox(
height: 16,
),
CustomDivider(),
SizedBox(
const CustomDivider(),
const SizedBox(
height: 16,
),
Text(
s.plan_type,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 12,
),
TypeChoiceFilterWidget(
plansCubit: plansCubit,
myPlansCubit: myPlansCubit,
),
SizedBox(
const SizedBox(
height: 24,
),
],

View File

@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class PriceChoiceFilterWidget extends StatefulWidget {
PriceChoiceFilterWidget({
const PriceChoiceFilterWidget({
super.key,
required this.plansCubit,
this.myPlansCubit,
@@ -94,7 +94,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
final price = int.tryParse(value.replaceAll('₽', ''));
if (price == null) {
EasyDebounce.cancel('changeMinPriceFilter');
minPriceController.value = TextEditingValue(
minPriceController.value = const TextEditingValue(
text: '₽',
selection: TextSelection.collapsed(offset: 0),
);
@@ -122,7 +122,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
prevMinPrice = price;
EasyDebounce.debounce(
'changeMinPriceFilter',
Duration(seconds: 2),
const Duration(seconds: 2),
() => widget.myPlansCubit?.changePriceFilter(
price,
maxPriceFilter ?? maxPlanPrice,
@@ -132,14 +132,14 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
},
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: CustomTextFormField(
onChanged: (value) {
final price = int.tryParse(value.replaceAll('₽', ''));
if (price == null) {
EasyDebounce.cancel('changeMaxPriceFilter');
maxPriceController.value = TextEditingValue(
maxPriceController.value = const TextEditingValue(
text: '₽',
selection: TextSelection.collapsed(offset: 0),
);
@@ -167,7 +167,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
prevMaxPrice = price;
EasyDebounce.debounce(
'changeMaxPriceFilter',
Duration(seconds: 2),
const Duration(seconds: 2),
() => widget.myPlansCubit?.changePriceFilter(
minPriceFilter ?? minPlanPrice,
price,
@@ -181,7 +181,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
),
],
),
SizedBox(height: 12),
const SizedBox(height: 12),
Theme(
data: Theme.of(context).copyWith(
sliderTheme: SliderThemeData(
@@ -230,7 +230,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
final price = int.tryParse(value.replaceAll('₽', ''));
if (price == null) {
EasyDebounce.cancel('changeMinPriceFilter');
minPriceController.value = TextEditingValue(
minPriceController.value = const TextEditingValue(
text: '₽',
selection: TextSelection.collapsed(offset: 0),
);
@@ -258,7 +258,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
prevMinPrice = price;
EasyDebounce.debounce(
'changeMinPriceFilter',
Duration(seconds: 2),
const Duration(seconds: 2),
() => widget.plansCubit?.changePriceFilter(
price,
state.filterState.priceFilter.$2 ?? state.maxPlanPrice,
@@ -268,14 +268,14 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
},
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: CustomTextFormField(
onChanged: (value) {
final price = int.tryParse(value.replaceAll('₽', ''));
if (price == null) {
EasyDebounce.cancel('changeMaxPriceFilter');
maxPriceController.value = TextEditingValue(
maxPriceController.value = const TextEditingValue(
text: '₽',
selection: TextSelection.collapsed(offset: 0),
);
@@ -303,7 +303,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
prevMaxPrice = price;
EasyDebounce.debounce(
'changeMaxPriceFilter',
Duration(seconds: 2),
const Duration(seconds: 2),
() => widget.plansCubit?.changePriceFilter(
state.filterState.priceFilter.$1 ?? state.minPlanPrice,
price,
@@ -317,7 +317,7 @@ class _PriceChoiceFilterWidgetState extends State<PriceChoiceFilterWidget> {
),
],
),
SizedBox(height: 12),
const SizedBox(height: 12),
Theme(
data: Theme.of(context).copyWith(
sliderTheme: SliderThemeData(

View File

@@ -36,9 +36,9 @@ class Recipes extends StatelessWidget {
return false;
},
child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 8),
shrinkWrap: true,
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
return RecipesWidget(
recipe: state.recipesList[index],
@@ -46,7 +46,7 @@ class Recipes extends StatelessWidget {
);
},
separatorBuilder: (context, index) {
return SizedBox(height: 8);
return const SizedBox(height: 8);
},
itemCount: state.recipesList.length,
),

View File

@@ -71,9 +71,9 @@ class _RecipesWidgetState extends State<RecipesWidget> {
Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
child: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + widget.recipe.image,
imageUrl: '$baseUrl/storage/${widget.recipe.image}',
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
),
@@ -85,10 +85,10 @@ class _RecipesWidgetState extends State<RecipesWidget> {
runSpacing: 8,
children: [
_iconButton('assets/icons/clock.svg', timeTitle),
SizedBox(width: 8),
const SizedBox(width: 8),
_iconButton('assets/icons/steps.svg', '${widget.recipe.steps?.length ?? 0} ${getStepForm(widget.recipe.steps?.length ?? 0)}'),
SizedBox(width: 8),
_iconButton('assets/icons/calories.svg', widget.recipe.calories.toStringAsFixed(0) + ' ккал'),
const SizedBox(width: 8),
_iconButton('assets/icons/calories.svg', '${widget.recipe.calories.toStringAsFixed(0)} ккал'),
],
),
),
@@ -104,7 +104,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
},
color: appTheme.whiteA700,
isFavorite: isFavorite,
borderRadius: BorderRadius.vertical(bottom: Radius.circular(12)),
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(12)),
width: 40,
height: 44,
size: 19,
@@ -112,7 +112,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
),
],
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
@@ -121,13 +121,13 @@ class _RecipesWidgetState extends State<RecipesWidget> {
),
),
if (widget.recipe.videoUrl != null && widget.recipe.videoUrl!.isNotEmpty) ...[
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.only(left: 15),
child: Row(
children: [
SvgPicture.asset('assets/icons/play_icon.svg', width: 16, height: 16),
SizedBox(width: 8),
const SizedBox(width: 8),
Text(
s.there_is_a_video,
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
@@ -136,7 +136,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
),
),
],
SizedBox(height: 12),
const SizedBox(height: 12),
if (widget.recipe.description.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
@@ -165,7 +165,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
),
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -180,7 +180,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
await context.read<RecipesCubit>().likeRecipe(widget.recipe.slug, widget.index);
},
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
icon: Icons.chat_bubble_outline,
text: widget.recipe.commentsCount.toString(),
@@ -193,7 +193,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
},
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 15,
@@ -205,19 +205,19 @@ class _RecipesWidgetState extends State<RecipesWidget> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/blog_post/' + widget.recipe.id.toString(),
'$baseUrl/ru/blog_post/${widget.recipe.id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
},
),
Spacer(),
const Spacer(),
Icon(
Icons.visibility_rounded,
size: 16,
color: appTheme.gray500,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
widget.recipe.viewsCount.toString(),
style: TextStyle(
@@ -229,7 +229,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
],
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
],
),
),
@@ -240,7 +240,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
_iconButton(String iconPath, [String? text]) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
color: appTheme.whiteA700,
borderRadius: BorderRadius.circular(16),
@@ -252,11 +252,11 @@ class _RecipesWidgetState extends State<RecipesWidget> {
SvgPicture.asset(
iconPath,
),
if (text != null) SizedBox(width: 8),
if (text != null) const SizedBox(width: 8),
if (text != null)
Text(
text,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.w500,

View File

@@ -44,11 +44,11 @@ class _SortingDropDownFilterState extends State<SortingDropDownFilter> {
items: sortingTypes
.mapIndexed(
(index, value) => DropdownMenuItem(
value: sortingTypes[index],
child: Text(
sortingTypes[index],
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
value: sortingTypes[index],
),
)
.toList(),
@@ -74,11 +74,11 @@ class _SortingDropDownFilterState extends State<SortingDropDownFilter> {
items: sortingTypes
.mapIndexed(
(index, value) => DropdownMenuItem(
value: sortingTypes[index],
child: Text(
sortingTypes[index],
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
value: sortingTypes[index],
),
)
.toList(),

View File

@@ -22,7 +22,7 @@ class _SubscribeButtonWidgetState extends State<SubscribeButtonWidget> {
Widget build(BuildContext context) {
return AnimatedOpacity(
opacity: isSubscribe ? 0 : 1,
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
child: InkWell(
onTap: () async {
try {
@@ -38,12 +38,12 @@ class _SubscribeButtonWidgetState extends State<SubscribeButtonWidget> {
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: appTheme.gray200,
),
child: Text(
child: const Text(
'Подписаться',
style: TextStyle(
fontSize: 13,

View File

@@ -24,7 +24,7 @@ class _TagsModalWidgetState extends State<TagsModalWidget> {
bloc: widget.recipesCubit,
builder: (BuildContext context, RecipesState state) {
return Container(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
width: MediaQuery.of(context).size.width,
child: Wrap(
spacing: 8,