diff --git a/packages/flutter_timeline_view/lib/src/config/timeline_paddings.dart b/packages/flutter_timeline_view/lib/src/config/timeline_paddings.dart index b3dc27f..39fc5ac 100644 --- a/packages/flutter_timeline_view/lib/src/config/timeline_paddings.dart +++ b/packages/flutter_timeline_view/lib/src/config/timeline_paddings.dart @@ -3,9 +3,10 @@ import 'package:flutter/material.dart'; /// This class contains the paddings used in the timeline options class TimelinePaddingOptions { const TimelinePaddingOptions({ - this.mainPadding = const EdgeInsets.only(left: 32, top: 20, right: 32), + this.mainPadding = + const EdgeInsets.only(left: 32, top: 20, right: 32, bottom: 40), this.postPadding = - const EdgeInsets.only(left: 12.0, top: 6, right: 12.0, bottom: 8), + const EdgeInsets.only(left: 12.0, top: 12, right: 12.0, bottom: 8), this.postOverviewButtonBottomPadding = 30.0, this.categoryButtonTextPadding, }); diff --git a/packages/flutter_timeline_view/lib/src/screens/timeline_post_creation_screen.dart b/packages/flutter_timeline_view/lib/src/screens/timeline_post_creation_screen.dart index df3c1df..98ded87 100644 --- a/packages/flutter_timeline_view/lib/src/screens/timeline_post_creation_screen.dart +++ b/packages/flutter_timeline_view/lib/src/screens/timeline_post_creation_screen.dart @@ -177,7 +177,6 @@ class _TimelinePostCreationScreenState const SizedBox( height: 16, ), - // input field for the content Text( widget.options.translations.uploadImage, style: theme.textTheme.titleMedium, @@ -186,7 +185,6 @@ class _TimelinePostCreationScreenState widget.options.translations.uploadImageDescription, style: theme.textTheme.bodySmall, ), - // image picker field const SizedBox( height: 8, ), @@ -194,7 +192,6 @@ class _TimelinePostCreationScreenState children: [ GestureDetector( onTap: () async { - // open a dialog to choose between camera and gallery var result = await showModalBottomSheet( context: context, builder: (context) => Container( diff --git a/packages/flutter_timeline_view/lib/src/screens/timeline_post_overview_screen.dart b/packages/flutter_timeline_view/lib/src/screens/timeline_post_overview_screen.dart index df34fc4..df34bb1 100644 --- a/packages/flutter_timeline_view/lib/src/screens/timeline_post_overview_screen.dart +++ b/packages/flutter_timeline_view/lib/src/screens/timeline_post_overview_screen.dart @@ -20,6 +20,7 @@ class TimelinePostOverviewScreen extends StatelessWidget { @override Widget build(BuildContext context) { + var theme = Theme.of(context); // the timelinePost.category is a key so we need to get the category object var timelineCategoryName = options.categoriesOptions.categoriesBuilder ?.call(context) @@ -55,7 +56,7 @@ class TimelinePostOverviewScreen extends StatelessWidget { buttonText, enabled: true, ) ?? - ElevatedButton( + FilledButton( style: ButtonStyle( backgroundColor: WidgetStatePropertyAll(Theme.of(context).primaryColor), @@ -64,14 +65,10 @@ class TimelinePostOverviewScreen extends StatelessWidget { onPostSubmit(timelinePost); }, child: Padding( - padding: const EdgeInsets.all(12.0), + padding: const EdgeInsets.all(8), child: Text( buttonText, - style: const TextStyle( - color: Colors.white, - fontSize: 20, - fontWeight: FontWeight.w800, - ), + style: theme.textTheme.displayLarge, ), ), ), diff --git a/packages/flutter_timeline_view/lib/src/screens/timeline_post_screen.dart b/packages/flutter_timeline_view/lib/src/screens/timeline_post_screen.dart index 3fbc855..466c0e7 100644 --- a/packages/flutter_timeline_view/lib/src/screens/timeline_post_screen.dart +++ b/packages/flutter_timeline_view/lib/src/screens/timeline_post_screen.dart @@ -364,13 +364,17 @@ class _TimelinePostScreenState extends State { ], ), const SizedBox(height: 8), - Text( - '${post.likes} ${widget.options.translations.likesTitle}', - style: widget - .options.theme.textStyles.postLikeTitleAndAmount ?? - theme.textTheme.titleSmall - ?.copyWith(color: Colors.black), - ), + if (widget.isOverviewScreen != null + ? !widget.isOverviewScreen! + : false) ...[ + Text( + '${post.likes} ${widget.options.translations.likesTitle}', + style: widget.options.theme.textStyles + .postLikeTitleAndAmount ?? + theme.textTheme.titleSmall + ?.copyWith(color: Colors.black), + ), + ], Text.rich( TextSpan( text: widget.options.nameBuilder?.call(post.creator) ?? @@ -385,42 +389,15 @@ class _TimelinePostScreenState extends State { text: post.title, style: widget.options.theme.textStyles.postTitleStyle ?? - theme.textTheme.titleSmall!.copyWith( - color: Colors.black, - fontWeight: FontWeight.w500, - ), + theme.textTheme.bodySmall, ), ], ), ), const SizedBox(height: 20), - Html( - data: post.content, - style: { - 'body': Style( - padding: HtmlPaddings.zero, - margin: Margins.zero, - fontFamily: theme.textTheme.titleSmall?.fontFamily, - ), - '#': Style( - maxLines: 3, - textOverflow: TextOverflow.ellipsis, - padding: HtmlPaddings.zero, - margin: Margins.zero, - ), - 'H1': Style( - padding: HtmlPaddings.zero, - margin: Margins.zero, - ), - 'H2': Style( - padding: HtmlPaddings.zero, - margin: Margins.zero, - ), - 'H3': Style( - padding: HtmlPaddings.zero, - margin: Margins.zero, - ), - }, + Text( + post.content, + style: theme.textTheme.bodySmall, ), const SizedBox(height: 4), Text( @@ -428,7 +405,10 @@ class _TimelinePostScreenState extends State { style: theme.textTheme.labelSmall, ), const SizedBox(height: 16), - if (post.reactionEnabled) ...[ + // ignore: avoid_bool_literals_in_conditional_expressions + if (post.reactionEnabled || widget.isOverviewScreen != null + ? !widget.isOverviewScreen! + : false) ...[ Text( widget.options.translations.commentsTitleOnPost, style: theme.textTheme.titleSmall! diff --git a/packages/flutter_timeline_view/lib/src/widgets/category_selector.dart b/packages/flutter_timeline_view/lib/src/widgets/category_selector.dart index e1c58f6..17d6eba 100644 --- a/packages/flutter_timeline_view/lib/src/widgets/category_selector.dart +++ b/packages/flutter_timeline_view/lib/src/widgets/category_selector.dart @@ -33,7 +33,7 @@ class _CategorySelectorState extends State { return SingleChildScrollView( scrollDirection: Axis.horizontal, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), + padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( children: [ SizedBox(