Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class HomeScreen extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- centerTitle: true,
- backgroundColor: Colors.black87,
- title: Text("Webtoon"),
- ),
- body: HomeBody(),
- );
- }
- }
- class HomeBody extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Container(
- padding: EdgeInsets.all(20),
- child: Column(
- children: <Widget>[
- Text(
- "Daftar Komik",
- style: TextStyle(
- color: Colors.black87,
- fontSize: 16,
- ),
- ),
- ListWebtoon()
- ],
- )
- );
- }
- }
- class ListWebtoon extends StatelessWidget {
- List<String> titleList = [
- "Stranger From Hell",
- "Orange Marmalade",
- "Bastard"
- ];
- List<String> descriptionList = [
- "Menggambarkan suasana kosan yang mencekam",
- "Kisah cinta antara siswa remaja",
- "Sang psiko kembali beraksi dan meneror siapapun"
- ];
- @override
- Widget build(BuildContext context) {
- return Container(
- child: ListView.builder(
- itemCount: titleList.length,
- shrinkWrap: true,
- physics: NeverScrollableScrollPhysics(),
- itemBuilder: (context, int index) {
- return ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: Container(
- margin: EdgeInsets.only(top: 20),
- color: Colors.pink[50],
- width: MediaQuery.of(context).size.width - 50,
- height: 120,
- child: Row(
- children: <Widget>[
- ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: Container(
- width: 90,
- height: 90,
- child: Image.asset("images/image${index+1}.png", fit: BoxFit.cover),
- ),
- ),
- Padding(
- padding: EdgeInsets.only(left: 10, top: 10),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- titleList[index],
- style: TextStyle(
- color: Colors.black87,
- fontSize: 20,
- fontWeight: FontWeight.bold
- ),
- ),
- Padding(
- padding: EdgeInsets.only(top: 10),
- child: Container(
- width: MediaQuery.of(context).size.width / 2,
- child: Text(
- descriptionList[index],
- style: TextStyle(
- color: Colors.black54,
- fontSize: 17,
- ),
- ),
- ),
- )
- ],
- ),
- )
- ],
- ),
- ),
- );
- },
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement