194 lines
7.2 KiB
Dart
194 lines
7.2 KiB
Dart
// ignore_for_file: prefer_const_literals_to_create_immutables
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_html/flutter_html.dart';
|
|
import 'package:get/get.dart';
|
|
import '../../components/appbar.dart';
|
|
import '../../theme.dart';
|
|
|
|
class BlogDetails extends StatelessWidget {
|
|
BlogDetails({
|
|
required this.articleId,
|
|
required this.tages,
|
|
required this.imageUpload,
|
|
required this.description,
|
|
required this.formattedtime,
|
|
});
|
|
|
|
// SearchModel? searchArticle;
|
|
String? tages;
|
|
String? imageUpload;
|
|
int? articleId;
|
|
String? description;
|
|
String? formattedtime;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// var updatedAtTime = articles.updatedAt;
|
|
// DateTime updatedAt = DateTime.parse(updatedAtTime!);
|
|
// Duration difference = DateTime.now().difference(updatedAt);
|
|
// String formattedDifference = DateFormat().add_Hm().format(updatedAt);
|
|
|
|
// for (var i = 0; i < searchArticle!.result!.length; i++) {
|
|
// tages = searchArticle!.result![i].tags;
|
|
// imageUpload = searchArticle!.result![i].imageUpload;
|
|
// articleId = searchArticle!.result![i].id;
|
|
// }
|
|
|
|
return Scaffold(
|
|
backgroundColor: ColorConstants.kBlack,
|
|
appBar: PreferredSize(
|
|
preferredSize: const Size.fromHeight(60),
|
|
child: CustomAppBars(titleHead: 'Blog'),
|
|
),
|
|
body: Column(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
child: Row(
|
|
children: [
|
|
Text(
|
|
tages ?? "",
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
color: ColorConstants.kWhite,
|
|
fontFamily: 'SFPRO',
|
|
),
|
|
),
|
|
Spacer(),
|
|
Text(
|
|
formattedtime ?? "",
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
color: ColorConstants.kWhite,
|
|
fontFamily: 'SFPRO',
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
Container(
|
|
height: 300,
|
|
child: Image.network(
|
|
imageUpload!,
|
|
// 'assets/image/blog/philosophyCard.jpg',
|
|
// height: 400,
|
|
width: Get.size.width,
|
|
fit: BoxFit.fill,
|
|
),
|
|
),
|
|
const SizedBox(height: 30),
|
|
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: [Html(data: description)],
|
|
),
|
|
),
|
|
)
|
|
// Expanded(
|
|
// child: Padding(
|
|
// padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
// child: ListView.builder(
|
|
// shrinkWrap: true,
|
|
// itemCount: 8,
|
|
// itemBuilder: (context, index) {
|
|
// if (index == 7) {
|
|
// return Padding(
|
|
// padding: const EdgeInsets.only(bottom: 20.0),
|
|
// child: Row(
|
|
// children: [
|
|
// InkWell(
|
|
// onTap: () {
|
|
// print('Previous');
|
|
// },
|
|
// child: Row(
|
|
// children: [
|
|
// Icon(
|
|
// Icons.keyboard_arrow_left_rounded,
|
|
// size: 25,
|
|
// color: ColorConstants.kPrimaryColor,
|
|
// ),
|
|
// SizedBox(width: 8),
|
|
// Text(
|
|
// 'Previous',
|
|
// style: TextStyle(
|
|
// fontSize: 16,
|
|
// color: ColorConstants.kPrimaryColor),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// Spacer(),
|
|
// InkWell(
|
|
// onTap: () {
|
|
// print('Next');
|
|
// },
|
|
// child: Row(
|
|
// children: [
|
|
// Text(
|
|
// 'Next',
|
|
// style: TextStyle(
|
|
// fontSize: 16,
|
|
// color: ColorConstants.kPrimaryColor),
|
|
// ),
|
|
// SizedBox(width: 8),
|
|
// Icon(
|
|
// Icons.keyboard_arrow_right_rounded,
|
|
// size: 25,
|
|
// color: ColorConstants.kPrimaryColor,
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }
|
|
// return Padding(
|
|
// padding: const EdgeInsets.only(bottom: 22.0),
|
|
// child: Row(
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// Container(
|
|
// decoration: const BoxDecoration(
|
|
// color: ColorConstants.kPrimaryColor,
|
|
// shape: BoxShape.circle,
|
|
// ),
|
|
// child: Padding(
|
|
// padding: const EdgeInsets.all(8.0),
|
|
// child: Text(
|
|
// '${index + 1}',
|
|
// style: const TextStyle(
|
|
// fontSize: 16,
|
|
// color: ColorConstants.kBlack,
|
|
// fontFamily: 'SFPRO',
|
|
// fontWeight: FontWeight.w800,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// const SizedBox(width: 10),
|
|
// Expanded(
|
|
// child: Text(
|
|
// 'The next time you find yourself continuously running things over in your mind, take note of how it affects your mood.',
|
|
// style: TextStyle(
|
|
// fontSize: 14,
|
|
// color: Color(0xffD9D9D9),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }),
|
|
// ),
|
|
// ),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|