✨ Comment create, delete and update
This commit is contained in:
@ -8,6 +8,7 @@ import 'package:solian/models/post.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/screens/posts/comment_editor.dart';
|
||||
import 'package:solian/utils/service_url.dart';
|
||||
import 'package:solian/widgets/posts/item.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
@ -117,14 +118,16 @@ class CommentListHeader extends StatelessWidget {
|
||||
future: auth.isAuthorized(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData && snapshot.data == true) {
|
||||
return TextButton.icon(
|
||||
icon: const Icon(Icons.add_comment_outlined),
|
||||
label: const Text("LEAVE COMMENT"),
|
||||
return TextButton(
|
||||
onPressed: () async {
|
||||
final did =
|
||||
await router.push("posts.comments.new", extra: related);
|
||||
final did = await router.pushNamed(
|
||||
"posts.comments.editor",
|
||||
extra: CommentPostArguments(related: related),
|
||||
);
|
||||
if (did == true) paging.refresh();
|
||||
},
|
||||
style: TextButton.styleFrom(shape: const CircleBorder()),
|
||||
child: const Icon(Icons.add_comment_outlined),
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
|
@ -130,6 +130,7 @@ class AttachmentList extends StatelessWidget {
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 16 / 9,
|
||||
viewportFraction: 1,
|
||||
showIndicator: false,
|
||||
),
|
||||
items: items.map((item) {
|
||||
renderProgress++;
|
||||
|
@ -145,10 +145,13 @@ class _PostItemState extends State<PostItem> {
|
||||
child: Divider(thickness: 0.3),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: renderContent(),
|
||||
),
|
||||
renderAttachments()
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: renderAttachments(),
|
||||
)
|
||||
],
|
||||
),
|
||||
onLongPress: () {
|
||||
|
Reference in New Issue
Block a user