loris/lib/partials/thread.dart

40 lines
1.2 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-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),
width: MediaQuery.of(context).size.width / 1.2,
constraints: const BoxConstraints(maxWidth: 1000, minWidth: 375),
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
),
),
],
);
}
}