Sonnat Project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

79 lines
2.7 KiB

import 'package:flutter/material.dart';
import 'package:repositories/app_api_domain/models/post_model.dart';
import 'package:sonnat/core/extensions/context_extension.dart';
import 'package:sonnat/core/utils/app_constants.dart';
import 'package:sonnat/core/utils/app_utils.dart';
class PostItemWidget extends StatelessWidget {
final PostModel post;
const PostItemWidget({super.key, required this.post});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: context.width * 11 / AppConstants.instance.appWidth,
vertical: context.width * 11 / AppConstants.instance.appWidth,
),
decoration: BoxDecoration(
color: const Color(0xffffffff),
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.only(
left: context.width * 26 / AppConstants.instance.appWidth,
right: context.width * 26 / AppConstants.instance.appWidth,
bottom: context.height * 21 / AppConstants.instance.appHeight,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: context.height * 174 / AppConstants.instance.appHeight,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
image: DecorationImage(
image: NetworkImage(post.thumbnail!),
fit: BoxFit.cover,
),
),
),
SizedBox(height: context.height * 14 / AppConstants.instance.appHeight),
Text(
post.title,
style: const TextStyle(
color: Color(0xff222D4E),
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: context.height * 8 / AppConstants.instance.appHeight),
Text(
post.summary,
style: const TextStyle(
color: Color(0xff8990A1),
fontSize: 13,
),
textAlign: TextAlign.justify,
),
SizedBox(height: context.height * 30 / AppConstants.instance.appHeight),
Align(
alignment: AlignmentDirectional.centerEnd,
child: Text(
post.publishDate,
style: const TextStyle(
color: Color(0xff8D95AB),
fontSize: 11,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: context.height * 7 / AppConstants.instance.appHeight),
],
),
);
}
}