Skip to content

Commit

Permalink
Categories working, all products working, apis according to cities
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay-KB committed Apr 29, 2020
1 parent f8af2d4 commit 4b5aa00
Show file tree
Hide file tree
Showing 30 changed files with 1,216 additions and 387 deletions.
Binary file added gogrocy/assets/images/no_products.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 0 additions & 24 deletions gogrocy/lib/core/models/Bill.dart

This file was deleted.

50 changes: 0 additions & 50 deletions gogrocy/lib/core/models/Detail.dart

This file was deleted.

67 changes: 2 additions & 65 deletions gogrocy/lib/core/models/Orders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class Orders {

class Result {
List<Bills> bills;
List<Address> address;

Result({this.bills, this.address});
Result({this.bills});

Result.fromJson(Map<String, dynamic> json) {
if (json['bills'] != null) {
Expand All @@ -33,22 +32,13 @@ class Result {
bills.add(new Bills.fromJson(v));
});
}
if (json['address'] != null) {
address = new List<Address>();
json['address'].forEach((v) {
address.add(new Address.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.bills != null) {
data['bills'] = this.bills.map((v) => v.toJson()).toList();
}
if (this.address != null) {
data['address'] = this.address.map((v) => v.toJson()).toList();
}
return data;
}
}
Expand Down Expand Up @@ -138,57 +128,4 @@ class Details {
data['order_date'] = this.orderDate;
return data;
}
}

class Address {
String addressId;
String receiver;
String userId;
String contact;
String locality;
String city;
String state;
String zip;
String country;
String isPrimary;

Address(
{this.addressId,
this.receiver,
this.userId,
this.contact,
this.locality,
this.city,
this.state,
this.zip,
this.country,
this.isPrimary});

Address.fromJson(Map<String, dynamic> json) {
addressId = json['address_id'];
receiver = json['receiver'];
userId = json['user_id'];
contact = json['contact'];
locality = json['locality'];
city = json['city'];
state = json['state'];
zip = json['zip'];
country = json['country'];
isPrimary = json['is_primary'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['address_id'] = this.addressId;
data['receiver'] = this.receiver;
data['user_id'] = this.userId;
data['contact'] = this.contact;
data['locality'] = this.locality;
data['city'] = this.city;
data['state'] = this.state;
data['zip'] = this.zip;
data['country'] = this.country;
data['is_primary'] = this.isPrimary;
return data;
}
}
}
70 changes: 70 additions & 0 deletions gogrocy/lib/core/models/ProductsByCity.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class ProductsByCity {
bool empty;
List<Result> result;

ProductsByCity({this.empty, this.result});

ProductsByCity.fromJson(Map<String, dynamic> json) {
empty = json['empty'];
if (json['result'] != null) {
result = new List<Result>();
json['result'].forEach((v) {
result.add(new Result.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['empty'] = this.empty;
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}

class Result {
String id;
String name;
String price;
String quantity;
String unit;
String description;
String image;
String category;

Result(
{this.id,
this.name,
this.price,
this.quantity,
this.unit,
this.description,
this.image,
this.category});

Result.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
price = json['price'];
quantity = json['quantity'];
unit = json['unit'];
description = json['description'];
image = json['image'];
category = json['category'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['price'] = this.price;
data['quantity'] = this.quantity;
data['unit'] = this.unit;
data['description'] = this.description;
data['image'] = this.image;
data['category'] = this.category;
return data;
}
}
27 changes: 0 additions & 27 deletions gogrocy/lib/core/models/Result.dart

This file was deleted.

8 changes: 8 additions & 0 deletions gogrocy/lib/core/models/category_product_list_arguments.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:gogrocy/core/models/ProductsByCity.dart';

class CategoryProductListArgument{
String categoryTitle;
String categoryId;

CategoryProductListArgument(this.categoryTitle,this.categoryId);
}
10 changes: 10 additions & 0 deletions gogrocy/lib/core/models/order_details_arguments.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:gogrocy/core/models/Orders.dart';

class OrderDetailsArguments{
Orders orders;
int index;

OrderDetailsArguments({this.orders,this.index});


}
Loading

0 comments on commit 4b5aa00

Please sign in to comment.