Advertisement
Guest User

home

a guest
Oct 16th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class HomeScreen extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. return Scaffold(
  7. appBar: AppBar(
  8. centerTitle: true,
  9. backgroundColor: Colors.black87,
  10. title: Text("Webtoon"),
  11. ),
  12. body: HomeBody(),
  13. );
  14. }
  15. }
  16.  
  17. class HomeBody extends StatelessWidget {
  18. @override
  19. Widget build(BuildContext context) {
  20. return Container(
  21. padding: EdgeInsets.all(20),
  22. child: Column(
  23. children: <Widget>[
  24. Text(
  25. "Daftar Komik",
  26. style: TextStyle(
  27. color: Colors.black87,
  28. fontSize: 16,
  29. ),
  30. ),
  31.  
  32. ListWebtoon()
  33. ],
  34. )
  35. );
  36. }
  37. }
  38.  
  39.  
  40. class ListWebtoon extends StatelessWidget {
  41. List<String> titleList = [
  42. "Stranger From Hell",
  43. "Orange Marmalade",
  44. "Bastard"
  45. ];
  46.  
  47. List<String> descriptionList = [
  48. "Menggambarkan suasana kosan yang mencekam",
  49. "Kisah cinta antara siswa remaja",
  50. "Sang psiko kembali beraksi dan meneror siapapun"
  51. ];
  52.  
  53. @override
  54. Widget build(BuildContext context) {
  55. return Container(
  56. child: ListView.builder(
  57. itemCount: titleList.length,
  58. shrinkWrap: true,
  59. physics: NeverScrollableScrollPhysics(),
  60. itemBuilder: (context, int index) {
  61. return ClipRRect(
  62. borderRadius: BorderRadius.circular(8),
  63. child: Container(
  64. margin: EdgeInsets.only(top: 20),
  65. color: Colors.pink[50],
  66. width: MediaQuery.of(context).size.width - 50,
  67. height: 120,
  68. child: Row(
  69. children: <Widget>[
  70. ClipRRect(
  71. borderRadius: BorderRadius.circular(8),
  72. child: Container(
  73. width: 90,
  74. height: 90,
  75. child: Image.asset("images/image${index+1}.png", fit: BoxFit.cover),
  76. ),
  77. ),
  78.  
  79. Padding(
  80. padding: EdgeInsets.only(left: 10, top: 10),
  81. child: Column(
  82. crossAxisAlignment: CrossAxisAlignment.start,
  83. children: <Widget>[
  84. Text(
  85. titleList[index],
  86. style: TextStyle(
  87. color: Colors.black87,
  88. fontSize: 20,
  89. fontWeight: FontWeight.bold
  90. ),
  91. ),
  92.  
  93. Padding(
  94. padding: EdgeInsets.only(top: 10),
  95. child: Container(
  96. width: MediaQuery.of(context).size.width / 2,
  97. child: Text(
  98. descriptionList[index],
  99. style: TextStyle(
  100. color: Colors.black54,
  101. fontSize: 17,
  102. ),
  103. ),
  104. ),
  105. )
  106. ],
  107. ),
  108. )
  109. ],
  110. ),
  111. ),
  112. );
  113. },
  114. ),
  115. );
  116. }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement