Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CollectionApp extends StatefulWidget {
- @override
- _CollectionAppState createState() => _CollectionAppState();
- }
- class _CollectionAppState extends State<CollectionApp> {
- final List<Notification> notifications = [];
- var json = [
- {
- "pk_i_id": "1",
- "fk_i_user_id": null,
- "fk_i_category_id": "9",
- "dt_pub_date": "2020-01-11 20:57:21",
- "dt_mod_date": "2020-01-11 21:07:54",
- "f_price": null,
- "i_price": null,
- "fk_c_currency_code": null,
- "s_contact_name": "Example author",
- "s_contact_email": "osclass@example.com",
- "s_ip": "::1",
- "b_premium": "0",
- "b_enabled": "1",
- "b_active": "1",
- "b_spam": "0",
- "s_secret": "fc26tUeX",
- "b_show_email": "0",
- "dt_expiration": "9999-12-31 23:59:59",
- "fk_i_item_id": "1",
- "fk_c_locale_code": "en_US",
- "s_title": "Example Ad",
- "s_description": "Description of the example ad. Insert here some usefull description of your ad.",
- "fk_c_country_code": null,
- "s_country": "Example country",
- "s_address": "",
- "s_zip": null,
- "fk_i_region_id": null,
- "s_region": "Example region",
- "fk_i_city_id": null,
- "s_city": "Example city",
- "fk_i_city_area_id": null,
- "s_city_area": "",
- "d_coord_lat": null,
- "d_coord_long": null,
- "resources": [
- {
- "id": "4",
- "extension": "jpg",
- "path": "oc-content/uploads/0/"
- },
- {
- "id": "5",
- "extension": "jpg",
- "path": "oc-content/uploads/0/"
- }
- ]
- },
- {
- "pk_i_id": "2",
- "fk_i_user_id": "1",
- "fk_i_category_id": "19",
- "dt_pub_date": "2020-01-11 21:04:21",
- "dt_mod_date": "2020-01-11 21:06:21",
- "f_price": null,
- "i_price": "255870000",
- "fk_c_currency_code": "USD",
- "s_contact_name": "Aftab",
- "s_contact_email": "jobbazar@gmail.com",
- "s_ip": "::1",
- "b_premium": "0",
- "b_enabled": "1",
- "b_active": "1",
- "b_spam": "0",
- "s_secret": "Zu0jbN0s",
- "b_show_email": "0",
- "dt_expiration": "9999-12-31 23:59:59",
- "fk_i_item_id": "2",
- "fk_c_locale_code": "en_US",
- "s_title": "iPhone 10 Great Condition",
- "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. ",
- "fk_c_country_code": null,
- "s_country": "",
- "s_address": "2678 Elderberry Dr, Okemos MI 48864",
- "s_zip": null,
- "fk_i_region_id": null,
- "s_region": "Greater Lansing",
- "fk_i_city_id": null,
- "s_city": "Okemos",
- "fk_i_city_area_id": null,
- "s_city_area": "Okemos",
- "d_coord_lat": null,
- "d_coord_long": null,
- "resources": [
- {
- "id": "1",
- "extension": "jpg",
- "path": "oc-content/uploads/0/"
- },
- {
- "id": "2",
- "extension": "jpg",
- "path": "oc-content/uploads/0/"
- },
- {
- "id": "3",
- "extension": "png",
- "path": "oc-content/uploads/0/"
- }
- ]
- }
- ];
- void initState() {
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- debugShowCheckedModeBanner: false,
- theme: ThemeData(
- primaryColor: Theme.of(context).primaryColor,
- ),
- home: Scaffold(
- body: ListView.builder(
- shrinkWrap: true,
- itemCount: json.length,
- itemBuilder: (context, index) {
- print(json[index]);
- return Container(
- decoration: BoxDecoration(boxShadow: [
- BoxShadow(
- color: Colors.grey,
- blurRadius: 8.0, // has the effect of softening the shadow
- spreadRadius: 2.0, // has the effect of extending the shadow
- offset: Offset(
- 6.0, // horizontal, move right 10
- 6.0, // vertical, move down 10
- ),
- )
- ]),
- margin: const EdgeInsets.only(bottom: 20.0),
- child: Card(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),
- color: Colors.green,
- semanticContainer: true,
- clipBehavior: Clip.antiAliasWithSaveLayer,
- child: Row(
- children: <Widget>[
- Expanded(
- child: Container(
- decoration: BoxDecoration(
- color: Colors.green,
- ),
- child: Column(
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.all(4.0),
- child: Align(
- alignment: Alignment.centerLeft,
- child: Text(json[index]["s_contact_name"], style: TextStyle(color: Colors.white, fontSize: 15.0)),
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(4.0),
- child: Align(
- alignment: Alignment.centerLeft,
- child: Text(json[index]["s_contact_email"], style: TextStyle(color: Colors.white, fontSize: 13.0)),
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(4.0),
- child: Align(
- alignment: Alignment.centerLeft,
- child: Text(json[index]["s_secret"], style: TextStyle(color: Colors.white, fontSize: 13.0)),
- ),
- ),
- ],
- ),
- )
- ),
- ],
- ),
- ),
- );
- }
- ),
- )
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement