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