feat: 图文动态详情页&评论渲染

This commit is contained in:
guozhigq
2023-06-27 12:23:20 +08:00
parent 532ad52c17
commit bc8be693a8
20 changed files with 863 additions and 478 deletions

View File

@ -1,10 +1,15 @@
// 操作栏
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:pilipala/models/dynamics/result.dart';
import 'package:pilipala/pages/dynamics/index.dart';
final DynamicsController _dynamicsController = Get.put(DynamicsController());
Widget action(item, context) {
ModuleStatModel stat = item.modules.moduleStat;
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
@ -14,14 +19,22 @@ Widget action(item, context) {
FontAwesomeIcons.shareFromSquare,
size: 16,
),
style: TextButton.styleFrom(
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
foregroundColor: Theme.of(context).colorScheme.outline,
),
label: Text(stat.forward!.count ?? '转发'),
),
TextButton.icon(
onPressed: () {},
onPressed: () => _dynamicsController.pushDetail(item, 1),
icon: const Icon(
FontAwesomeIcons.comment,
size: 16,
),
style: TextButton.styleFrom(
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
foregroundColor: Theme.of(context).colorScheme.outline,
),
label: Text(stat.comment!.count ?? '评论'),
),
TextButton.icon(
@ -30,6 +43,10 @@ Widget action(item, context) {
FontAwesomeIcons.thumbsUp,
size: 16,
),
style: TextButton.styleFrom(
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
foregroundColor: Theme.of(context).colorScheme.outline,
),
label: Text(stat.like!.count ?? '点赞'),
)
],