mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 06:49:22 +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,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> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
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