kopia lustrzana https://gitlab.com/mysocialportal/relatica
Add status load comments button
rodzic
91d1267659
commit
9d8f914df0
|
@ -2,7 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:result_monad/result_monad.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../globals.dart';
|
||||
|
@ -36,6 +36,7 @@ class _StatusControlState extends State<StatusControl> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final manager = context.watch<TimelineManager>();
|
||||
_logger.finest('Building ${item.entry.toShortString()}');
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
@ -59,7 +60,13 @@ class _StatusControlState extends State<StatusControl> {
|
|||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
buildChildComments(context),
|
||||
if (entry.parentId.isEmpty &&
|
||||
entry.engagementSummary.repliesCount > 0)
|
||||
TextButton(
|
||||
onPressed: () async => await manager.refreshPost(item.id),
|
||||
child: Text('Load Comments'),
|
||||
),
|
||||
if (item.totalChildren > 0) buildChildComments(context),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -90,9 +97,9 @@ class _StatusControlState extends State<StatusControl> {
|
|||
ElapsedDateUtils.epochSecondsToString(entry.backdatedTimestamp),
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
Text(
|
||||
item.id,
|
||||
),
|
||||
// Text(
|
||||
// item.id,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
@ -192,17 +199,6 @@ class _StatusControlState extends State<StatusControl> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (entry.parentId.isEmpty)
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
await getIt<TimelineManager>()
|
||||
.refreshPost(item.id)
|
||||
.andThenSuccessAsync((newItem) async => setState(() {}));
|
||||
},
|
||||
child: Center(
|
||||
child: Text('Load All'),
|
||||
),
|
||||
),
|
||||
Icon(Icons.subdirectory_arrow_right),
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
|
Ładowanie…
Reference in New Issue