Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:bencana/post.dart';
- import 'package:bencana/utilities.dart';
- import 'package:cached_network_image/cached_network_image.dart';
- class DetailPage extends StatefulWidget {
- final Post post;
- DetailPage(this.post);
- @override
- _DetailPageState createState() => _DetailPageState();
- }
- class _DetailPageState extends State<DetailPage> {
- Utilities util;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text('Detail'),
- ),
- body: Container(
- child: Column(
- children: <Widget>[
- Center(
- child: CachedNetworkImage(
- placeholder: (context, url) => CircularProgressIndicator(),
- errorWidget: (context, url, error) => Icon(Icons.error),
- imageUrl: widget.post.photo,
- height: 240.0,
- width: double.infinity,
- fit: BoxFit.fitWidth,
- ),
- ),
- Card(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(
- left: 16.0,
- right: 16.0,
- top: 10.0,
- bottom: 10.0,
- ),
- child: Row(
- children: <Widget>[
- Text(
- widget.post.title,
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 18.0,
- ),
- ),
- Expanded(
- child: SizedBox(),
- ),
- // Text(
- // util.convertTimestamp(
- // post.timestamp,
- // ),
- // style: TextStyle(
- // fontSize: 14.0,
- // color: Colors.grey,
- // ),
- // ),
- ],
- ),
- ),
- Padding(
- padding: const EdgeInsets.only(
- left: 16.0,
- right: 16.0,
- bottom: 10.0,
- ),
- child: Text(
- widget.post.content,
- style: TextStyle(
- fontSize: 14.0,
- color: Colors.grey,
- ),
- ),
- ),
- SizedBox(
- height: 20,
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
Add Comment
Please, Sign In to add comment