Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
967 B
2
Indexable
Never
import 'package:flutter/material.dart';
import 'package:news_app/article.dart';

class ArticleDetailPage extends StatelessWidget {
  static const routeName = '/article_detail';
  final Article article;
  const ArticleDetailPage({super.key, required this.article});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(article.title),),
      body: SingleChildScrollView(child: Column(
        children: [
          Image.network(article.urlToImage),
          Text(article.description),
          const Divider(color: Colors.grey,),
          Text(
            article.title,
            style: const TextStyle(
              color: Colors.black,
              fontWeight: FontWeight.bold,
              fontSize: 24,
            ),
          ),
          const Divider(color: Colors.grey),
          Text('Date : ${article.publishedAt}'),
          
        ],
      )),
    );
  }
}