diff --git a/lib/core/theme/app_decoration.dart b/lib/core/theme/app_decoration.dart index eb2c4372..528abdfb 100644 --- a/lib/core/theme/app_decoration.dart +++ b/lib/core/theme/app_decoration.dart @@ -25,7 +25,7 @@ class AppDecoration { ); static BoxDecoration get fillDeepOrange => BoxDecoration( - color: appTheme.deepOrange900.withOpacity(0.8), + color: appTheme.deepOrange900.withValues(alpha: 0.8), ); static BoxDecoration get fillGray => BoxDecoration( @@ -41,7 +41,7 @@ class AppDecoration { ); static BoxDecoration get fillGreenA => BoxDecoration( - color: appTheme.greenA700.withOpacity(0.8), + color: appTheme.greenA700.withValues(alpha: 0.8), ); static BoxDecoration get fillPrimary => BoxDecoration( @@ -77,7 +77,7 @@ class BorderRadiusStyle { color: appTheme.whiteA700, boxShadow: [ BoxShadow( - color: appTheme.black900.withOpacity(0.15), + color: appTheme.black900.withValues(alpha: 0.15), spreadRadius: 2, blurRadius: 2, offset: Offset( diff --git a/lib/core/theme/theme_helper.dart b/lib/core/theme/theme_helper.dart index ab7d7377..615e33df 100644 --- a/lib/core/theme/theme_helper.dart +++ b/lib/core/theme/theme_helper.dart @@ -175,7 +175,7 @@ class PrimaryColors { Color get lightGray => Color(0xFFCECECE); - Color get transparentBlue => Color(0xFF2F80ED).withOpacity(0.1); + Color get transparentBlue => Color(0xFF2F80ED).withValues(alpha: 0.1); Color get lightGray0 => Color(0xFFF6F6F6); @@ -185,7 +185,7 @@ class PrimaryColors { Color get red => Color(0xFFCD4141); - Color get transparentBlack => Color(0xFF1313264).withOpacity(0.3); + Color get transparentBlack => Color(0xFF1313264).withValues(alpha: 0.3); } PrimaryColors get appTheme => ThemeHelper().themeColor(); diff --git a/lib/core/widgets/main_background_bouble.dart b/lib/core/widgets/main_background_bouble.dart index a901ecad..0f1a9fe9 100644 --- a/lib/core/widgets/main_background_bouble.dart +++ b/lib/core/widgets/main_background_bouble.dart @@ -23,7 +23,7 @@ class MainBackgroundBouble extends StatelessWidget { boxShadow: enableShadow ? [ BoxShadow( - color: Color(0x00000000).withOpacity(0.2), + color: Color(0x00000000).withValues(alpha: 0.2), spreadRadius: 0, blurRadius: 32, offset: Offset(0, 0), diff --git a/lib/features/blog_post/presentation/pages/blog_post_screen.dart b/lib/features/blog_post/presentation/pages/blog_post_screen.dart index 3f88ece9..ddb4ddc5 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -69,7 +69,7 @@ class _BlogPostScreenState extends State { color: Colors.white, border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), @@ -293,9 +293,9 @@ class _BlogPostScreenState extends State { _iconButton( icon: Icons.favorite_border_rounded, text: totalLikes.toString(), - iconColor: isLiked ? Colors.red.withOpacity(0.8) : null, - backgroundColor: isLiked ? Colors.red.withOpacity(0.1) : null, - textColor: isLiked ? Colors.red.withOpacity(0.8) : null, + iconColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, + backgroundColor: isLiked ? Colors.red.withValues(alpha: 0.1) : null, + textColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, onTap: () async { setState(() { isLiked = !isLiked; @@ -338,7 +338,7 @@ class _BlogPostScreenState extends State { width: MediaQuery.of(context).size.width - 32, height: 0.4, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.2), + color: Colors.black.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(16), ), ), diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index d43411cb..0a6d1b5a 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -184,7 +184,7 @@ class _ChatScreenState extends State { decoration: BoxDecoration( border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index 79e3269a..8ef43e8b 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -116,7 +116,7 @@ class ChatBubbleWidget extends StatelessWidget { child: Text( DateTime.parse(sendTime).format('hh:mm'), style: TextStyle( - color: isCurrentUser ? Colors.white.withOpacity(0.4) : Color(0xFF323F4B).withOpacity(0.4), + color: isCurrentUser ? Colors.white.withValues(alpha: 0.4) : Color(0xFF323F4B).withValues(alpha: 0.4), height: 1, fontSize: 10, ), diff --git a/lib/features/consultant/become_consultant/presentation/pages/additional_settings_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/additional_settings_screen.dart index da799a5e..c7049bff 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/additional_settings_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/additional_settings_screen.dart @@ -94,7 +94,7 @@ class _AdditionalSettingsScreenState extends State { ), trailing: CupertinoSwitch( value: value, - activeColor: appTheme.blueA400, + activeTrackColor: appTheme.blueA400, onChanged: (_) { onTap(); }, diff --git a/lib/features/create_diet/presentation/diet_preview_screen.dart b/lib/features/create_diet/presentation/diet_preview_screen.dart index 4680f763..f06c247e 100644 --- a/lib/features/create_diet/presentation/diet_preview_screen.dart +++ b/lib/features/create_diet/presentation/diet_preview_screen.dart @@ -66,7 +66,7 @@ class _DietPreviewScreenState extends State { color: Colors.white, border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 405e39b0..1ce56fb5 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -109,7 +109,7 @@ class _AboutDietScreenState extends State { color: Colors.white, border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), diff --git a/lib/features/diets/presentation/widgets/expandable_text.dart b/lib/features/diets/presentation/widgets/expandable_text.dart index c2decf4c..ca4b51ad 100644 --- a/lib/features/diets/presentation/widgets/expandable_text.dart +++ b/lib/features/diets/presentation/widgets/expandable_text.dart @@ -55,8 +55,8 @@ class _ExpandableTextState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Colors.white.withOpacity(0.0), - Colors.white.withOpacity(0.6), + Colors.white.withValues(alpha: 0.0), + Colors.white.withValues(alpha: 0.6), Colors.white, ], ), diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index be4cdcf7..4cb5c767 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -90,7 +90,8 @@ class _BlogPostWidgetState extends State { ], ), const Spacer(), - if (!(state.feedBlogPostList[widget.index].author.isEntitySubscribedByMe ?? false) && !state.feedBlogPostList[widget.index].author.authorIsMe) + if (!(state.feedBlogPostList[widget.index].author.isEntitySubscribedByMe ?? false) && + !state.feedBlogPostList[widget.index].author.authorIsMe) SubscribeButtonWidget( slug: state.feedBlogPostList[widget.index].author.authorSlug, ), @@ -167,9 +168,9 @@ class _BlogPostWidgetState extends State { FeedIconButton( icon: isLiked ? Icons.favorite_rounded : Icons.favorite_border_rounded, text: totalLikes.toString(), - iconColor: isLiked ? Colors.red.withOpacity(0.8) : null, - backgroundColor: isLiked ? Colors.red.withOpacity(0.1) : null, - textColor: isLiked ? Colors.red.withOpacity(0.8) : null, + iconColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, + backgroundColor: isLiked ? Colors.red.withValues(alpha: 0.1) : null, + textColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, onTap: () async { setState(() { isLiked = !isLiked; diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index caf9c4ad..ac4ea977 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -50,7 +50,7 @@ class _CommentsWidgetState extends State { return Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( - color: widget.replyId == comment.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, + color: widget.replyId == comment.id ? appTheme.blueA400.withValues(alpha: 0.1) : Colors.white, borderRadius: BorderRadius.circular(16), ), child: Padding( diff --git a/lib/features/feed/presentation/widgets/plan_widget.dart b/lib/features/feed/presentation/widgets/plan_widget.dart index 5d844029..4b06166a 100644 --- a/lib/features/feed/presentation/widgets/plan_widget.dart +++ b/lib/features/feed/presentation/widgets/plan_widget.dart @@ -60,7 +60,7 @@ class PlanWidget extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.8), + color: Colors.white.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(16), ), child: Row( @@ -89,7 +89,7 @@ class PlanWidget extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.8), + color: Colors.white.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(16), ), child: Row( @@ -147,7 +147,7 @@ class PlanWidget extends StatelessWidget { return Container( padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.8), + color: Colors.white.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(16), ), height: 32, diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index b1cf23aa..eb4b065f 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -104,9 +104,9 @@ class _RecipesWidgetState extends State { FeedIconButton( icon: true ? Icons.favorite_rounded : Icons.favorite_border_rounded, text: widget.recipes.likesCount.toString(), - iconColor: true ? Colors.red.withOpacity(0.8) : null, - backgroundColor: true ? Colors.red.withOpacity(0.1) : null, - textColor: true ? Colors.red.withOpacity(0.8) : null, + iconColor: true ? Colors.red.withValues(alpha: 0.8) : null, + backgroundColor: true ? Colors.red.withValues(alpha: 0.1) : null, + textColor: true ? Colors.red.withValues(alpha: 0.8) : null, onTap: () async { // setState(() { // isLiked = !isLiked; diff --git a/lib/features/plans/presentation/pages/about_plan_screen.dart b/lib/features/plans/presentation/pages/about_plan_screen.dart index 1f2aa1cf..d49db1b0 100644 --- a/lib/features/plans/presentation/pages/about_plan_screen.dart +++ b/lib/features/plans/presentation/pages/about_plan_screen.dart @@ -107,7 +107,7 @@ class _AboutPlanScreenState extends State { color: Colors.white, border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 9c0f18ad..e227e113 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -811,7 +811,7 @@ class _ProfileScreenState extends State { child: Text( text, style: TextStyle( - color: Colors.black.withOpacity(0.4), + color: Colors.black.withValues(alpha: 0.4), height: 1, ), ), @@ -1044,7 +1044,7 @@ class _ProfileScreenState extends State { padding: EdgeInsets.all(8), width: (MediaQuery.of(context).size.width - 40) / 2, decoration: BoxDecoration( - color: appTheme.blueA400.withOpacity(0.1), + color: appTheme.blueA400.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(16), ), child: Text( @@ -1150,7 +1150,7 @@ class _ProfileScreenState extends State { _choiceIntervalChipWidget(int index) { return ChoiceChip( - selectedColor: Colors.grey.withOpacity(0.1), + selectedColor: Colors.grey.withValues(alpha: 0.1), pressElevation: 0, showCheckmark: false, side: BorderSide.none, diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index f116ccf5..82130c54 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -154,9 +154,9 @@ class _CircumferenceChartWidgetState extends State { labelStyle: TextStyle( color: Colors.grey, ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)), axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withValues(alpha: 0.3), width: 0.4, ), ), @@ -309,7 +309,7 @@ class _CircumferenceChartWidgetState extends State { borderColor: seriesColor1, gradient: LinearGradient( colors: [ - seriesColor1.withOpacity(0.14), + seriesColor1.withValues(alpha: 0.14), Colors.transparent, ], begin: Alignment.topCenter, @@ -334,7 +334,7 @@ class _CircumferenceChartWidgetState extends State { borderColor: seriesColor2, gradient: LinearGradient( colors: [ - seriesColor2.withOpacity(0.14), + seriesColor2.withValues(alpha: 0.14), Colors.transparent, ], begin: Alignment.topCenter, @@ -359,7 +359,7 @@ class _CircumferenceChartWidgetState extends State { borderColor: seriesColor3, gradient: LinearGradient( colors: [ - seriesColor3.withOpacity(0.14), + seriesColor3.withValues(alpha: 0.14), Colors.transparent, ], begin: Alignment.topCenter, diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index d7264772..14dc3dee 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -22,14 +22,14 @@ class ImtChartWidget extends StatelessWidget { child: Row( children: [ if (weightPoints.length > 0) - Text( - '${weightPoints.last.bmi.toStringAsFixed(2)}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, + Text( + '${weightPoints.last.bmi.toStringAsFixed(2)}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), ), - ), if (weightPoints.length > 1) weightPoints.last.bmi > weightPoints[weightPoints.length - 2].bmi ? Icon( @@ -66,9 +66,9 @@ class ImtChartWidget extends StatelessWidget { labelStyle: TextStyle( color: Colors.grey, ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)), axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withValues(alpha: 0.3), width: 0.4, ), ), @@ -99,7 +99,7 @@ class ImtChartWidget extends StatelessWidget { borderColor: appTheme.blueA400, gradient: LinearGradient( colors: [ - appTheme.blueA400.withOpacity(0.14), + appTheme.blueA400.withValues(alpha: 0.14), Colors.transparent, ], begin: Alignment.topCenter, diff --git a/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart b/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart index 6fcb4f40..a448ed10 100644 --- a/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart +++ b/lib/features/profile/presentation/widgets/profile_blog_post_widget.dart @@ -166,9 +166,9 @@ class _ProfileBlogPostWidgetState extends State { FeedIconButton( icon: isLiked ? Icons.favorite_rounded : Icons.favorite_border_rounded, text: totalLikes.toString(), - iconColor: isLiked ? Colors.red.withOpacity(0.8) : null, - backgroundColor: isLiked ? Colors.red.withOpacity(0.1) : null, - textColor: isLiked ? Colors.red.withOpacity(0.8) : null, + iconColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, + backgroundColor: isLiked ? Colors.red.withValues(alpha: 0.1) : null, + textColor: isLiked ? Colors.red.withValues(alpha: 0.8) : null, onTap: () async { setState(() { isLiked = !isLiked; @@ -178,9 +178,9 @@ class _ProfileBlogPostWidgetState extends State { ? await context.read().likePost(state.blogPosts[widget.index].id) : await context.read().unlikedPost(state.blogPosts[widget.index].id); await widget.profileCubit.updateFeedBlogPostList( - state.blogPosts[widget.index], - isLiked ? false : true, - ); + state.blogPosts[widget.index], + isLiked ? false : true, + ); }, ), SizedBox(width: 8), diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index 3cdfd930..082befe0 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -59,12 +59,12 @@ class _WeightChartWidgetState extends State { ? Icon( Icons.arrow_drop_up, size: 40, - color: Colors.grey.withOpacity(0.4), + color: Colors.grey.withValues(alpha: 0.4), ) : Icon( Icons.arrow_drop_down, size: 40, - color: Colors.grey.withOpacity(0.4), + color: Colors.grey.withValues(alpha: 0.4), ), ], ), @@ -93,9 +93,9 @@ class _WeightChartWidgetState extends State { labelStyle: TextStyle( color: Colors.grey, ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)), axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withValues(alpha: 0.3), width: 0.4, ), ), @@ -227,7 +227,7 @@ class _WeightChartWidgetState extends State { borderColor: appTheme.blueA400, gradient: LinearGradient( colors: [ - appTheme.blueA400.withOpacity(0.14), + appTheme.blueA400.withValues(alpha: 0.14), Colors.transparent, ], begin: Alignment.topCenter, diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index 20162eca..e5749b7d 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -55,7 +55,7 @@ class _AboutRecipesScreenState extends State { color: Colors.white, border: Border( top: BorderSide( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), ), ), diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index cccb16b7..af2e9387 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -216,7 +216,7 @@ class _SettingsScreenState extends State { title: 'Уведомление о новых обновлениях', trailing: CupertinoSwitch( value: updatesNotificationsSwitchState, - activeColor: appTheme.blueA400, + activeTrackColor: appTheme.blueA400, onChanged: (newValue) { setState(() { updatesNotificationsSwitchState = newValue; @@ -245,7 +245,7 @@ class _SettingsScreenState extends State { title: 'Напоминание о заполнении дневника', trailing: CupertinoSwitch( value: fillDiaryNotificationsSwitchState, - activeColor: appTheme.blueA400, + activeTrackColor: appTheme.blueA400, onChanged: (newValue) { setState(() { fillDiaryNotificationsSwitchState = newValue; @@ -274,7 +274,7 @@ class _SettingsScreenState extends State { title: 'Указывать “настроение” в заполнение дневника', trailing: CupertinoSwitch( value: moodSwitchState, - activeColor: appTheme.blueA400, + activeTrackColor: appTheme.blueA400, onChanged: (newValue) { setState(() { moodSwitchState = newValue; @@ -303,7 +303,7 @@ class _SettingsScreenState extends State { title: 'Указывать “отход ко сну” в заполнение дневника', trailing: CupertinoSwitch( value: bedTimeSwitchState, - activeColor: appTheme.blueA400, + activeTrackColor: appTheme.blueA400, onChanged: (newValue) { setState(() { bedTimeSwitchState = newValue;