🐛 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) { itemBuilder: (context, item, index) {
return PostOwnedListEntry( return PostOwnedListEntry(
item: item, item: item,
backgroundColor:
Theme.of(context).colorScheme.surfaceContainerLow,
onTap: () async { onTap: () async {
showModalBottomSheet( showModalBottomSheet(
useRootNavigator: true, useRootNavigator: true,

View File

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

View File

@ -6,18 +6,19 @@ import 'package:solian/widgets/posts/post_item.dart';
class PostOwnedListEntry extends StatelessWidget { class PostOwnedListEntry extends StatelessWidget {
final Post item; final Post item;
final Function onTap; final Function onTap;
final Color? backgroundColor;
const PostOwnedListEntry({ const PostOwnedListEntry({
super.key, super.key,
required this.item, required this.item,
required this.onTap, required this.onTap,
this.backgroundColor,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Card( return Card(
child: InkWell( child: GestureDetector(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -28,6 +29,7 @@ class PostOwnedListEntry extends StatelessWidget {
isClickable: false, isClickable: false,
isShowReply: false, isShowReply: false,
isReactable: false, isReactable: false,
backgroundColor: backgroundColor,
).paddingSymmetric(vertical: 8), ).paddingSymmetric(vertical: 8),
], ],
), ),

View File

@ -385,6 +385,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" 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: file:
dependency: transitive dependency: transitive
description: description:
@ -736,6 +744,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.2" version: "2.3.2"
highlightable:
dependency: transitive
description:
name: highlightable
sha256: "526793e148c91977b694d75d99cd34401ea3b65efd223e7b539c76916af86ffd"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
http: http:
dependency: transitive dependency: transitive
description: description:

View File

@ -66,6 +66,7 @@ dependencies:
animations: ^2.0.11 animations: ^2.0.11
avatar_stack: ^1.2.0 avatar_stack: ^1.2.0
async: ^2.11.0 async: ^2.11.0
field_suggestion: ^0.2.5
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: