77 lines
2.1 KiB
Dart
77 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ArticleTile extends StatelessWidget {
|
|
const ArticleTile({
|
|
Key? key,
|
|
required this.bannerUrl,
|
|
required this.title,
|
|
required this.summary,
|
|
required this.author,
|
|
required this.publishDate,
|
|
required this.readingTime,
|
|
}) : super(key: key);
|
|
|
|
final String bannerUrl;
|
|
final String title;
|
|
final String summary;
|
|
final String author;
|
|
final String publishDate;
|
|
final String readingTime;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
height: 200,
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: NetworkImage(bannerUrl),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: Theme.of(context).textTheme.headline6,
|
|
),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
summary,
|
|
style: Theme.of(context).textTheme.bodyText1,
|
|
),
|
|
const SizedBox(height: 8),
|
|
Row(
|
|
children: [
|
|
Text(
|
|
author,
|
|
style: Theme.of(context).textTheme.caption,
|
|
),
|
|
const SizedBox(width: 8),
|
|
Text(
|
|
publishDate,
|
|
style: Theme.of(context).textTheme.caption,
|
|
),
|
|
const SizedBox(width: 8),
|
|
Text(
|
|
readingTime,
|
|
style: Theme.of(context).textTheme.caption,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|