kopia lustrzana https://gitlab.com/mysocialportal/relatica
62 wiersze
1.8 KiB
Dart
62 wiersze
1.8 KiB
Dart
![]() |
import 'package:cached_network_image/cached_network_image.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_portal/models/timeline_entry.dart';
|
||
|
|
||
|
import '../../globals.dart';
|
||
|
import '../../models/connection.dart';
|
||
|
import '../../services/connections_manager.dart';
|
||
|
import '../../utils/dateutils.dart';
|
||
|
import '../padding.dart';
|
||
|
|
||
|
class StatusHeaderControl extends StatelessWidget {
|
||
|
final TimelineEntry entry;
|
||
|
|
||
|
const StatusHeaderControl({super.key, required this.entry});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
final author = getIt<ConnectionsManager>()
|
||
|
.getById(entry.authorId)
|
||
|
.getValueOrElse(() => Connection());
|
||
|
return Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
children: [
|
||
|
CachedNetworkImage(
|
||
|
imageUrl: author.avatarUrl.toString(),
|
||
|
width: 32.0,
|
||
|
),
|
||
|
const HorizontalPadding(),
|
||
|
Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
children: [
|
||
|
Text(
|
||
|
author.name,
|
||
|
style: Theme.of(context).textTheme.bodyText1,
|
||
|
),
|
||
|
Row(
|
||
|
children: [
|
||
|
Text(
|
||
|
ElapsedDateUtils.epochSecondsToString(
|
||
|
entry.backdatedTimestamp),
|
||
|
style: Theme.of(context).textTheme.caption,
|
||
|
),
|
||
|
const HorizontalPadding(),
|
||
|
Icon(
|
||
|
entry.isPublic ? Icons.public : Icons.lock,
|
||
|
color: Theme.of(context).hintColor,
|
||
|
size: Theme.of(context).textTheme.caption?.fontSize,
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
Text(
|
||
|
entry.id,
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
}
|
||
|
}
|