1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 06:49:22 +00:00

Create post container

This commit is contained in:
Pierre HUBERT 2020-05-16 09:10:09 +02:00
parent 7f1130aca8
commit fbe22c5031
2 changed files with 44 additions and 17 deletions

View File

@ -16,6 +16,7 @@ import 'package:comunic/ui/widgets/account_image_widget.dart';
import 'package:comunic/ui/widgets/countdown_widget.dart';
import 'package:comunic/ui/widgets/like_widget.dart';
import 'package:comunic/ui/widgets/network_image_widget.dart';
import 'package:comunic/ui/widgets/post_container_widget.dart';
import 'package:comunic/ui/widgets/survey_widget.dart';
import 'package:comunic/ui/widgets/text_widget.dart';
import 'package:comunic/utils/date_utils.dart';
@ -229,7 +230,8 @@ class _PostTileState extends State<PostTile> {
@override
Widget build(BuildContext context) {
return Card(
return PostContainer(
child: Card(
elevation: 1.0,
child: Column(
children: <Widget>[
@ -248,6 +250,7 @@ class _PostTileState extends State<PostTile> {
),
],
),
),
);
}

View File

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
/// Here is a widget used to contain a post
///
/// @author Pierre Hubert
class PostContainer extends StatelessWidget {
final Widget child;
const PostContainer({Key key, @required this.child})
: assert(child != null),
super(key: key);
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.center,
child: ConstrainedBox(
constraints: BoxConstraints.loose(Size.fromWidth(500)),
child: child,
),
);
}
}