mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-12-24 11:58:51 +00:00
Create post container
This commit is contained in:
parent
7f1130aca8
commit
fbe22c5031
@ -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,24 +230,26 @@ class _PostTileState extends State<PostTile> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
elevation: 1.0,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_buildHeaderRow(),
|
||||
_buildContentRow(),
|
||||
_buildButtonsArea(),
|
||||
],
|
||||
return PostContainer(
|
||||
child: Card(
|
||||
elevation: 1.0,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_buildHeaderRow(),
|
||||
_buildContentRow(),
|
||||
_buildButtonsArea(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: widget.post.hasComments ? _buildComments() : null,
|
||||
),
|
||||
],
|
||||
Container(
|
||||
child: widget.post.hasComments ? _buildComments() : null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
24
lib/ui/widgets/post_container_widget.dart
Normal file
24
lib/ui/widgets/post_container_widget.dart
Normal 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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user