Commit 19c7959c by Mobile : Art

update

parents db3a7fcf 7ca4e2f2
......@@ -152,7 +152,7 @@ class Product {
int vendorId;
String allowRoute;
String type;
int star;
// int star;
List<Null> ratings;
Product(
......@@ -197,7 +197,7 @@ class Product {
this.vendorId,
this.allowRoute,
this.type,
this.star,
// this.star,
this.ratings});
Product.fromJson(Map<String, dynamic> json) {
......@@ -242,7 +242,7 @@ class Product {
vendorId = json['vendor_id'];
allowRoute = json['allow_route'];
type = json['type'];
star = json['star'];
// star = json['star'];
}
......@@ -289,7 +289,7 @@ class Product {
data['vendor_id'] = this.vendorId;
data['allow_route'] = this.allowRoute;
data['type'] = this.type;
data['star'] = this.star;
// data['star'] = this.star;
return data;
}
}
......@@ -321,7 +321,7 @@ class Store {
String storeLogo;
String isFacilities;
String distanceWithLocation;
String star;
// String star;
Ratings ratings;
Store(
......@@ -351,7 +351,7 @@ class Store {
this.storeLogo,
this.isFacilities,
this.distanceWithLocation,
this.star,
// this.star,
this.ratings});
Store.fromJson(Map<String, dynamic> json) {
......@@ -381,7 +381,7 @@ class Store {
storeLogo = json['store_logo'];
isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location'];
star = json['star'];
// star = json['star'];
ratings =
json['ratings'] != null ? new Ratings.fromJson(json['ratings']) : null;
}
......@@ -414,7 +414,7 @@ class Store {
data['store_logo'] = this.storeLogo;
data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star;
// data['star'] = this.star;
if (this.ratings != null) {
data['ratings'] = this.ratings.toJson();
}
......
......@@ -51,10 +51,10 @@ class Result {
int star;
List<StoreProduct> storeProduct;
List<Comment> comment;
List<Null> commentReview;
List<dynamic> commentReview;
List<OpenHour> openHour;
List<Image> image;
Null ratings;
dynamic ratings;
Result(
{this.id,
......@@ -298,7 +298,7 @@ class Product {
dynamic type;
int star;
List<CategoryFeelverByProductId> categoryFeelverByProductId;
List<Null> ratings;
List<dynamic> ratings;
Product(
{this.id,
......@@ -576,8 +576,8 @@ class Comment {
dynamic updatedAt;
int shopScore;
int flagShop;
List<Null> tagShop;
List<Null> productTag;
List<dynamic> tagShop;
List<dynamic> productTag;
bool purchased;
InfoCustomer infoCustomer;
List<CommentSub> commentSub;
......@@ -778,8 +778,8 @@ class CommentSub {
dynamic updatedAt;
int shopScore;
int flagShop;
List<Null> tagShop;
List<Null> productTag;
List<dynamic> tagShop;
List<dynamic> productTag;
bool purchased;
InfoCustomer infoCustomer;
......@@ -958,8 +958,8 @@ class OpenHour {
String closed;
int vendorId;
int storeId;
Null createdAt;
Null updatedAt;
dynamic createdAt;
dynamic updatedAt;
OpenHour(
{this.id,
......@@ -1010,8 +1010,8 @@ class Image {
String detail;
String status;
int vendorId;
Null createdAt;
Null updatedAt;
dynamic createdAt;
dynamic updatedAt;
String imageTb;
int tbId;
......
......@@ -38,9 +38,12 @@ class Api<T> {
static final String baseApi = "https://backend-uat.feelver.com/api";
static final String baseApiforimage = "https://backend.feelver.com/storage/";
Future<Response<T>> reviewshop(Object body) async {
var _model;
......@@ -87,10 +90,15 @@ class Api<T> {
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/wish-list/listByCustomer", this._headerApi, body)
.then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){
_model = FavoriteModel.fromJson(json.decode(response.body));
print("ผลลัพท์ เท่ากับบบบบบบบบบบบ" + "${response.body}");
if(response.statusCode == 200 && json.decode(response.body)["message"]!="data not found"){
print("aaaa");
_model = FavoriteModel.fromJson(json.decode(response.body));
}else{
print("bbbb");
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
......
......@@ -98,7 +98,7 @@ class _BookingDetailState extends State<BookingDetail> {
: Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(8),
top: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text(
......
......@@ -4,11 +4,9 @@ import 'package:feelverapp/ui/menu/menu.dart';
import 'package:feelverapp/ui/my_order_status/my_order_status.dart';
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Favorite extends StatefulWidget {
@override
_FavoriteState createState() => _FavoriteState();
}
......@@ -24,8 +22,6 @@ class _FavoriteState extends State<Favorite> {
presenter = FavoritePresenter(this);
presenter.Favoriteitem();
}
@override
......@@ -76,7 +72,9 @@ class _FavoriteState extends State<Favorite> {
);
}
Widget list(int index,) {
Widget list(
int index,
) {
return Container(
// color: Colors.red,
margin: EdgeInsets.only(bottom: 15),
......@@ -112,21 +110,29 @@ class _FavoriteState extends State<Favorite> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
// width: MediaQuery.of(context).size.width,
// color: Colors.blue,
child: Row(
children: <Widget>[
Text(
presenter.favoriteModel.wishListItem[index]
.product.name,
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(15)),
Expanded(
child: Container(
child: Text(
presenter.favoriteModel.wishListItem[index].product.name,
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(15)),
maxLines: 2,
),
Spacer(),
),
),
// Spacer(),
IconButton(
onPressed: () {
print('delete');
presenter.Deletefavoriteitem( presenter.favoriteModel.wishListItem[index].id.toString());
presenter.Deletefavoriteitem(presenter
.favoriteModel.wishListItem[index].id
.toString());
},
icon: Icon(Icons.favorite),
color: Color(0xFFDD175F),
......
......@@ -3,6 +3,7 @@ import 'package:feelverapp/model/favorite/favorite_Model.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/favorite/favorite.dart';
import 'package:feelverapp/util/Accout_util.dart';
import 'package:flutter/material.dart';
class FavoritePresenter extends BasePresenter<Favorite> {
......@@ -14,9 +15,13 @@ class FavoritePresenter extends BasePresenter<Favorite> {
FavoritePresenter(State<Favorite> state) : super(state);
Favoriteitem() async {
var _id = await AccountUtil.getID();
print(_id);
print("555555555555");
_api = Api<FavoriteModel>();
var res = await _api.favorite({
"customer_id": "224",
"customer_id": _id,
});
if (res.fail == null) {
......
......@@ -19,7 +19,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
presenter = ReviewshopPresenter(this);
presenter.Commentlist();
}
@override
......@@ -27,7 +26,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
super.dispose();
}
@override
Widget build(BuildContext context) {
SizeConfig(context);
......@@ -44,7 +42,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
body: _setupView(),
);
......@@ -65,11 +62,16 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
Widget containt() {
return Expanded(
child: Container(
child: presenter.reviewShopModel == null ? Container():ListView.builder(
itemCount: presenter.reviewShopModel.result[0].comment.length,
itemBuilder: (context, i) {
return list(presenter.reviewShopModel.result[i].comment[i].infoCustomer.name);
}),
child: presenter.reviewShopModel == null
? Container()
: ListView.builder(
itemCount: presenter.reviewShopModel.result[0].comment.length,
itemBuilder: (context, i) {
print(presenter.reviewShopModel.result[0].comment[i].infoCustomer.name);
return list(
presenter.reviewShopModel.result[0].comment[i].infoCustomer.name,
);
}),
),
);
}
......@@ -246,15 +248,15 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
);
}
Widget list(String name,) {
Widget list(String name) {
return Card(
child: Container(
// color: Colors.deepPurpleAccent,
margin: EdgeInsets.only(
right: SizeConfig.getPadding(20),
left: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10),
right: SizeConfig.getPadding(20),
left: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10),
),
child: Column(
children: <Widget>[
......@@ -278,8 +280,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SingleChildScrollView(
child: Row(
Row(
children: <Widget>[
Text(
name,
......@@ -293,7 +294,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
)
],
),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment