From c00a018380d284b3cf15b6edc3386c87d32eaa1c Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 4 Aug 2024 17:15:56 +0800 Subject: [PATCH] :bug: Fix draft box --- lib/screens/feed/draft_box.dart | 2 ++ lib/widgets/posts/post_item.dart | 12 +++++++++--- lib/widgets/posts/post_owned_list.dart | 6 ++++-- pubspec.lock | 16 ++++++++++++++++ pubspec.yaml | 1 + 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/lib/screens/feed/draft_box.dart b/lib/screens/feed/draft_box.dart index b8c7081..e487551 100644 --- a/lib/screens/feed/draft_box.dart +++ b/lib/screens/feed/draft_box.dart @@ -76,6 +76,8 @@ class _DraftBoxScreenState extends State { itemBuilder: (context, item, index) { return PostOwnedListEntry( item: item, + backgroundColor: + Theme.of(context).colorScheme.surfaceContainerLow, onTap: () async { showModalBottomSheet( useRootNavigator: true, diff --git a/lib/widgets/posts/post_item.dart b/lib/widgets/posts/post_item.dart index d4434ed..09883eb 100644 --- a/lib/widgets/posts/post_item.dart +++ b/lib/widgets/posts/post_item.dart @@ -164,6 +164,7 @@ class _PostItemState extends State { Widget _buildReply(BuildContext context) { return OpenContainer( + tappable: widget.isClickable, closedBuilder: (_, openContainer) => Column( children: [ Row( @@ -202,13 +203,15 @@ class _PostItemState extends State { ), closedElevation: 0, openElevation: 0, - closedColor: widget.backgroundColor ?? Theme.of(context).colorScheme.surface, + closedColor: + widget.backgroundColor ?? Theme.of(context).colorScheme.surface, openColor: Theme.of(context).colorScheme.surface, ); } Widget _buildRepost(BuildContext context) { return OpenContainer( + tappable: widget.isClickable, closedBuilder: (_, openContainer) => Column( children: [ Row( @@ -247,7 +250,8 @@ class _PostItemState extends State { ), closedElevation: 0, openElevation: 0, - closedColor: widget.backgroundColor ?? Theme.of(context).colorScheme.surface, + closedColor: + widget.backgroundColor ?? Theme.of(context).colorScheme.surface, openColor: Theme.of(context).colorScheme.surface, ); } @@ -295,6 +299,7 @@ class _PostItemState extends State { } return OpenContainer( + tappable: widget.isClickable, closedBuilder: (_, openContainer) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -377,7 +382,8 @@ class _PostItemState extends State { ), closedElevation: 0, openElevation: 0, - closedColor: widget.backgroundColor ?? Theme.of(context).colorScheme.surface, + closedColor: + widget.backgroundColor ?? Theme.of(context).colorScheme.surface, openColor: Theme.of(context).colorScheme.surface, ); } diff --git a/lib/widgets/posts/post_owned_list.dart b/lib/widgets/posts/post_owned_list.dart index b3fe37d..e208134 100644 --- a/lib/widgets/posts/post_owned_list.dart +++ b/lib/widgets/posts/post_owned_list.dart @@ -6,18 +6,19 @@ import 'package:solian/widgets/posts/post_item.dart'; class PostOwnedListEntry extends StatelessWidget { final Post item; final Function onTap; + final Color? backgroundColor; const PostOwnedListEntry({ super.key, required this.item, required this.onTap, + this.backgroundColor, }); @override Widget build(BuildContext context) { return Card( - child: InkWell( - borderRadius: const BorderRadius.all(Radius.circular(8)), + child: GestureDetector( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -28,6 +29,7 @@ class PostOwnedListEntry extends StatelessWidget { isClickable: false, isShowReply: false, isReactable: false, + backgroundColor: backgroundColor, ).paddingSymmetric(vertical: 8), ], ), diff --git a/pubspec.lock b/pubspec.lock index 5297870..a416f2f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -385,6 +385,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + field_suggestion: + dependency: "direct main" + description: + name: field_suggestion + sha256: "596362ed67a661a18e01e4f51b8b92424f333baf37cebd48cc647a4c82c858d5" + url: "https://pub.dev" + source: hosted + version: "0.2.5" file: dependency: transitive description: @@ -736,6 +744,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + highlightable: + dependency: transitive + description: + name: highlightable + sha256: "526793e148c91977b694d75d99cd34401ea3b65efd223e7b539c76916af86ffd" + url: "https://pub.dev" + source: hosted + version: "1.0.5" http: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e9a8efb..4fbb4c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -66,6 +66,7 @@ dependencies: animations: ^2.0.11 avatar_stack: ^1.2.0 async: ^2.11.0 + field_suggestion: ^0.2.5 dev_dependencies: flutter_test: