🐛 Fix draft box

This commit is contained in:
LittleSheep 2024-08-04 17:15:56 +08:00
parent 53b3cac4ca
commit c00a018380
5 changed files with 32 additions and 5 deletions

View File

@ -76,6 +76,8 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
itemBuilder: (context, item, index) {
return PostOwnedListEntry(
item: item,
backgroundColor:
Theme.of(context).colorScheme.surfaceContainerLow,
onTap: () async {
showModalBottomSheet(
useRootNavigator: true,

View File

@ -164,6 +164,7 @@ class _PostItemState extends State<PostItem> {
Widget _buildReply(BuildContext context) {
return OpenContainer(
tappable: widget.isClickable,
closedBuilder: (_, openContainer) => Column(
children: [
Row(
@ -202,13 +203,15 @@ class _PostItemState extends State<PostItem> {
),
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<PostItem> {
),
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<PostItem> {
}
return OpenContainer(
tappable: widget.isClickable,
closedBuilder: (_, openContainer) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -377,7 +382,8 @@ class _PostItemState extends State<PostItem> {
),
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,
);
}

View File

@ -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),
],
),

View File

@ -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:

View File

@ -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: