Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.11 KB | None | 0 0
  1. class CollectionApp extends StatefulWidget {
  2. @override
  3. _CollectionAppState createState() => _CollectionAppState();
  4. }
  5.  
  6. class _CollectionAppState extends State<CollectionApp> {
  7. final List<Notification> notifications = [];
  8.  
  9. var json = [
  10. {
  11. "pk_i_id": "1",
  12. "fk_i_user_id": null,
  13. "fk_i_category_id": "9",
  14. "dt_pub_date": "2020-01-11 20:57:21",
  15. "dt_mod_date": "2020-01-11 21:07:54",
  16. "f_price": null,
  17. "i_price": null,
  18. "fk_c_currency_code": null,
  19. "s_contact_name": "Example author",
  20. "s_contact_email": "osclass@example.com",
  21. "s_ip": "::1",
  22. "b_premium": "0",
  23. "b_enabled": "1",
  24. "b_active": "1",
  25. "b_spam": "0",
  26. "s_secret": "fc26tUeX",
  27. "b_show_email": "0",
  28. "dt_expiration": "9999-12-31 23:59:59",
  29. "fk_i_item_id": "1",
  30. "fk_c_locale_code": "en_US",
  31. "s_title": "Example Ad",
  32. "s_description": "Description of the example ad. Insert here some usefull description of your ad.",
  33. "fk_c_country_code": null,
  34. "s_country": "Example country",
  35. "s_address": "",
  36. "s_zip": null,
  37. "fk_i_region_id": null,
  38. "s_region": "Example region",
  39. "fk_i_city_id": null,
  40. "s_city": "Example city",
  41. "fk_i_city_area_id": null,
  42. "s_city_area": "",
  43. "d_coord_lat": null,
  44. "d_coord_long": null,
  45. "resources": [
  46. {
  47. "id": "4",
  48. "extension": "jpg",
  49. "path": "oc-content/uploads/0/"
  50. },
  51. {
  52. "id": "5",
  53. "extension": "jpg",
  54. "path": "oc-content/uploads/0/"
  55. }
  56. ]
  57. },
  58. {
  59. "pk_i_id": "2",
  60. "fk_i_user_id": "1",
  61. "fk_i_category_id": "19",
  62. "dt_pub_date": "2020-01-11 21:04:21",
  63. "dt_mod_date": "2020-01-11 21:06:21",
  64. "f_price": null,
  65. "i_price": "255870000",
  66. "fk_c_currency_code": "USD",
  67. "s_contact_name": "Aftab",
  68. "s_contact_email": "jobbazar@gmail.com",
  69. "s_ip": "::1",
  70. "b_premium": "0",
  71. "b_enabled": "1",
  72. "b_active": "1",
  73. "b_spam": "0",
  74. "s_secret": "Zu0jbN0s",
  75. "b_show_email": "0",
  76. "dt_expiration": "9999-12-31 23:59:59",
  77. "fk_i_item_id": "2",
  78. "fk_c_locale_code": "en_US",
  79. "s_title": "iPhone 10 Great Condition",
  80. "s_description": "iPhone 10 Great Condition, this is my used phone that I want to get rid of. The phone is in a good working condition. ",
  81. "fk_c_country_code": null,
  82. "s_country": "",
  83. "s_address": "2678 Elderberry Dr, Okemos MI 48864",
  84. "s_zip": null,
  85. "fk_i_region_id": null,
  86. "s_region": "Greater Lansing",
  87. "fk_i_city_id": null,
  88. "s_city": "Okemos",
  89. "fk_i_city_area_id": null,
  90. "s_city_area": "Okemos",
  91. "d_coord_lat": null,
  92. "d_coord_long": null,
  93. "resources": [
  94. {
  95. "id": "1",
  96. "extension": "jpg",
  97. "path": "oc-content/uploads/0/"
  98. },
  99. {
  100. "id": "2",
  101. "extension": "jpg",
  102. "path": "oc-content/uploads/0/"
  103. },
  104. {
  105. "id": "3",
  106. "extension": "png",
  107. "path": "oc-content/uploads/0/"
  108. }
  109. ]
  110. }
  111. ];
  112.  
  113. void initState() {
  114. super.initState();
  115. }
  116.  
  117. @override
  118. Widget build(BuildContext context) {
  119. return MaterialApp(
  120. debugShowCheckedModeBanner: false,
  121. theme: ThemeData(
  122. primaryColor: Theme.of(context).primaryColor,
  123. ),
  124. home: Scaffold(
  125. body: ListView.builder(
  126. shrinkWrap: true,
  127. itemCount: json.length,
  128. itemBuilder: (context, index) {
  129. print(json[index]);
  130. return Container(
  131. decoration: BoxDecoration(boxShadow: [
  132. BoxShadow(
  133. color: Colors.grey,
  134. blurRadius: 8.0, // has the effect of softening the shadow
  135. spreadRadius: 2.0, // has the effect of extending the shadow
  136. offset: Offset(
  137. 6.0, // horizontal, move right 10
  138. 6.0, // vertical, move down 10
  139. ),
  140. )
  141. ]),
  142. margin: const EdgeInsets.only(bottom: 20.0),
  143. child: Card(
  144. shape: RoundedRectangleBorder(
  145. borderRadius: BorderRadius.circular(10.0),
  146. ),
  147. color: Colors.green,
  148. semanticContainer: true,
  149. clipBehavior: Clip.antiAliasWithSaveLayer,
  150. child: Row(
  151. children: <Widget>[
  152. Expanded(
  153. child: Container(
  154. decoration: BoxDecoration(
  155. color: Colors.green,
  156. ),
  157. child: Column(
  158. children: <Widget>[
  159. Padding(
  160. padding: const EdgeInsets.all(4.0),
  161. child: Align(
  162. alignment: Alignment.centerLeft,
  163. child: Text(json[index]["s_contact_name"], style: TextStyle(color: Colors.white, fontSize: 15.0)),
  164. ),
  165. ),
  166. Padding(
  167. padding: const EdgeInsets.all(4.0),
  168. child: Align(
  169. alignment: Alignment.centerLeft,
  170. child: Text(json[index]["s_contact_email"], style: TextStyle(color: Colors.white, fontSize: 13.0)),
  171. ),
  172. ),
  173. Padding(
  174. padding: const EdgeInsets.all(4.0),
  175. child: Align(
  176. alignment: Alignment.centerLeft,
  177. child: Text(json[index]["s_secret"], style: TextStyle(color: Colors.white, fontSize: 13.0)),
  178. ),
  179. ),
  180. ],
  181. ),
  182. )
  183. ),
  184. ],
  185. ),
  186. ),
  187. );
  188. }
  189. ),
  190. )
  191. );
  192. }
  193. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement