Merge branch 'main' into deepLinks

This commit is contained in:
Username1548
2025-07-02 19:06:04 +07:00
13 changed files with 39 additions and 34 deletions

View File

@@ -242,7 +242,7 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
if (blogPostState.blogPostModel?.description.isNotEmpty ?? false)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Html(data: blogPostState.blogPostModel?.description, style: {"*": Style(color: Colors.black87)}),
child: Html(data: blogPostState.blogPostModel?.description.replaceAll('\n', '<br>'), style: {"*": Style(color: Colors.black87)}),
),
const SizedBox(height: 8),
if (blogPostState.blogPostModel?.image.isNotEmpty ?? false)

View File

@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:eatvio_app/core/app_router.dart';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/firebase_api.dart';
import 'package:eatvio_app/core/locator_service.dart';
@@ -170,7 +171,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
// Show AlertDialog with error description
if (context.mounted) {
showDialog(
context: context,
context: AppRouter.navigatorKey.currentContext!,
builder: (context) => AlertDialog(
title: const Text('Test Failed'),
content: SingleChildScrollView(child: Text(result.error ?? 'No error details.')),
@@ -192,7 +193,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
// Show AlertDialog with error description
if (context.mounted) {
showDialog(
context: context,
context: AppRouter.navigatorKey.currentContext!,
builder: (context) => AlertDialog(
title: const Text('Test Failed'),
content: SingleChildScrollView(child: Text('$e\n$stack')),

View File

@@ -156,9 +156,9 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Html(
data: state.feedBlogPostList[widget.index].description.length > 200
data: (state.feedBlogPostList[widget.index].description.length > 200
? state.feedBlogPostList[widget.index].description.substring(0, 200)
: state.feedBlogPostList[widget.index].description,
: state.feedBlogPostList[widget.index].description).replaceAll('\n', '<br>'),
style: {
"*": Style(
fontSize: FontSize(16),

View File

@@ -131,7 +131,7 @@ class _DietsWidgetState extends State<DietsWidget> {
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).replaceAll('\n', '<br>')}...' : widget.diet.details.replaceAll('\n', '<br>'),
style: {
"*": Style(
margin: Margins.zero,

View File

@@ -137,7 +137,7 @@ class _PlanWidgetState extends State<PlanWidget> {
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).replaceAll('\n', '<br>')}...' : widget.plan.details.replaceAll('\n', '<br>'),
style: {
"*": Style(
margin: Margins.zero,

View File

@@ -164,7 +164,9 @@ class _RecipesWidgetState extends State<RecipesWidget> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Html(
data: widget.recipe.description.length > 200 ? widget.recipe.description.substring(0, 200) : widget.recipe.description,
data: widget.recipe.description.length > 200
? widget.recipe.description.substring(0, 200).replaceAll('\n', '<br>')
: widget.recipe.description.replaceAll('\n', '<br>'),
style: {
"*": Style(
color: appTheme.black,

View File

@@ -89,7 +89,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
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).replaceAll('\n', '<br>')}...' : widget.diet.details.replaceAll('\n', '<br>'),
style: {
"*": Style(
margin: Margins.zero,

View File

@@ -87,7 +87,7 @@ class _MyPlanWidgetState extends State<MyPlanWidget> {
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).replaceAll('\n', '<br>')}...' : widget.plan.details.replaceAll('\n', '<br>'),
style: {
"*": Style(
margin: Margins.zero,

View File

@@ -128,8 +128,8 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Html(
data: state.blogPosts[widget.index].description.length > 200
? state.blogPosts[widget.index].description.substring(0, 200)
: state.blogPosts[widget.index].description,
? state.blogPosts[widget.index].description.substring(0, 200).replaceAll('\n', '<br>')
: state.blogPosts[widget.index].description.replaceAll('\n', '<br>'),
style: {
"*": Style(
fontSize: FontSize(16),

View File

@@ -111,7 +111,9 @@ class _MyRecipeWidgetState extends State<MyRecipeWidget> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Html(
data: widget.recipe.description.length > 200 ? '${widget.recipe.description.substring(0, 200)}...' : widget.recipe.description,
data: widget.recipe.description.length > 200
? '${widget.recipe.description.substring(0, 200).replaceAll('\n', '<br>')}...'
: widget.recipe.description.replaceAll('\n', '<br>'),
style: {
"*": Style(
margin: Margins.zero,