loris/lib/partials/thread.dart

46 lines
1.3 KiB
Dart
Raw Normal View History

2022-07-03 13:47:24 +00:00
import 'package:flutter/material.dart';
import 'package:loris/partials/post.dart';
2022-08-01 08:29:43 +00:00
import '../business_logic/timeline/timeline.dart' as logic;
2022-08-14 18:02:42 +00:00
import '../global.dart' as global;
2022-07-03 13:47:24 +00:00
2022-08-01 08:29:43 +00:00
class Thread extends StatelessWidget {
const Thread({required this.model, Key? key}) : super(key: key);
final logic.ThreadModel model;
2022-07-03 13:47:24 +00:00
@override
Widget build(BuildContext context) {
2022-08-01 08:29:43 +00:00
List<Post> posts = [];
for (int i = 0; i < model.posts.length; i++) {
posts.add(Post(model: model.posts[i]));
}
2022-07-03 13:47:24 +00:00
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2022-07-03 20:02:57 +00:00
Padding(
padding: const EdgeInsets.all(4),
child: Container(
padding: const EdgeInsets.all(24),
2022-08-14 18:02:42 +00:00
width: (MediaQuery.of(context).size.width *
2022-08-14 20:43:36 +00:00
global.settings!.postWidth) -
2022-08-14 18:02:42 +00:00
56,
2022-08-14 20:43:36 +00:00
constraints: BoxConstraints(
maxWidth: global.settings!.maxPostWidth,
minWidth: 375,
),
2022-07-03 20:02:57 +00:00
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border:
Border.all(color: Theme.of(context).colorScheme.secondary),
borderRadius: BorderRadius.circular(8),
),
child: Column(
2022-08-01 08:29:43 +00:00
children: posts,
2022-07-03 20:02:57 +00:00
),
2022-07-03 13:47:24 +00:00
),
),
],
);
}
}