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

2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
  1. import 'package:flutter/material.dart';
  2. import 'package:repositories/app_api_domain/models/post_model.dart';
  3. import 'package:sonnat/core/extensions/context_extension.dart';
  4. import 'package:sonnat/core/utils/app_constants.dart';
  5. import 'package:sonnat/core/utils/app_utils.dart';
  6. class PostItemWidget extends StatelessWidget {
  7. final PostModel post;
  8. const PostItemWidget({super.key, required this.post});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(
  12. padding: EdgeInsets.symmetric(
  13. horizontal: context.width * 11 / AppConstants.instance.appWidth,
  14. vertical: context.width * 11 / AppConstants.instance.appWidth,
  15. ),
  16. decoration: BoxDecoration(
  17. color: const Color(0xffffffff),
  18. borderRadius: BorderRadius.circular(16),
  19. ),
  20. margin: EdgeInsets.only(
  21. left: context.width * 26 / AppConstants.instance.appWidth,
  22. right: context.width * 26 / AppConstants.instance.appWidth,
  23. bottom: context.height * 21 / AppConstants.instance.appHeight,
  24. ),
  25. child: Column(
  26. crossAxisAlignment: CrossAxisAlignment.start,
  27. children: [
  28. Container(
  29. height: context.height * 174 / AppConstants.instance.appHeight,
  30. decoration: BoxDecoration(
  31. borderRadius: const BorderRadius.only(
  32. topLeft: Radius.circular(16),
  33. topRight: Radius.circular(16),
  34. ),
  35. image: DecorationImage(
  36. image: NetworkImage(post.thumbnail!),
  37. fit: BoxFit.cover,
  38. ),
  39. ),
  40. ),
  41. SizedBox(height: context.height * 14 / AppConstants.instance.appHeight),
  42. Text(
  43. post.title,
  44. style: const TextStyle(
  45. color: Color(0xff222D4E),
  46. fontSize: 16,
  47. fontWeight: FontWeight.bold,
  48. ),
  49. ),
  50. SizedBox(height: context.height * 8 / AppConstants.instance.appHeight),
  51. Text(
  52. post.summary,
  53. style: const TextStyle(
  54. color: Color(0xff8990A1),
  55. fontSize: 13,
  56. ),
  57. textAlign: TextAlign.justify,
  58. ),
  59. SizedBox(height: context.height * 30 / AppConstants.instance.appHeight),
  60. Align(
  61. alignment: AlignmentDirectional.centerEnd,
  62. child: Text(
  63. post.publishDate,
  64. style: const TextStyle(
  65. color: Color(0xff8D95AB),
  66. fontSize: 11,
  67. fontWeight: FontWeight.bold,
  68. ),
  69. ),
  70. ),
  71. SizedBox(height: context.height * 7 / AppConstants.instance.appHeight),
  72. ],
  73. ),
  74. );
  75. }
  76. }