no message

parent 9773dcd7
......@@ -49,9 +49,9 @@ class Result {
String star;
List<StoreProduct> storeProduct;
List<Comment> comment;
List<Null> commentReview;
List<dynamic> commentReview;
List<OpenHour> openHour;
List<Null> image;
List<dynamic> image;
Ratings ratings;
Result({this.id, this.storeCode, this.storeName, this.storeCover, this.displayCover, this.isActive, this.storeOrder, this.customerGroupId, this.vendorId, this.createdAt, this.updatedAt, this.location, this.email, this.phone, this.mobile, this.address, this.city, this.country, this.zipCode, this.website, this.allowRoute, this.excerpt, this.detail, this.storeLogo, this.isFacilities, this.distanceWithLocation, this.star, this.storeProduct, this.comment, this.commentReview, this.openHour, this.image, this.ratings});
......@@ -155,7 +155,7 @@ class StoreProduct {
int vendorId;
String status;
int sortOrders;
Null createdAt;
dynamic createdAt;
String updatedAt;
String typeRateService;
String priceRateService;
......@@ -206,20 +206,20 @@ class Product {
String price;
String specialPrice;
String sku;
Null tax;
dynamic tax;
int quantity;
Null weight;
dynamic weight;
String visibility;
Null newsFromDate;
Null newsToDate;
Null layout;
Null theme;
dynamic newsFromDate;
dynamic newsToDate;
dynamic layout;
dynamic theme;
String duration;
Null sellingStartTime;
Null sellingEndTime;
Null redemptionStartTime;
Null redemptionEndTime;
Null availibility;
dynamic sellingStartTime;
dynamic sellingEndTime;
dynamic redemptionStartTime;
dynamic redemptionEndTime;
dynamic availibility;
String isFeatured;
String isDeal;
String hasTeam;
......@@ -353,12 +353,12 @@ class CategoryFeelverByProductId {
String displayName;
String cover;
String detail;
Null type;
dynamic type;
String status;
int sortOrder;
Null storeId;
Null vendorId;
Null createdAt;
dynamic storeId;
dynamic vendorId;
dynamic createdAt;
String updatedAt;
String visibility;
Pivot pivot;
......@@ -438,19 +438,19 @@ class Comment {
int commentItemsId;
String commentAuthor;
String commentEmail;
Null commentUrl;
dynamic commentUrl;
String commentIp;
String commentDate;
String commentContent;
String commentApproved;
String commentType;
Null commentParent;
dynamic commentParent;
String status;
int userId;
int storeId;
int vendorId;
Null createdAt;
Null updatedAt;
dynamic createdAt;
dynamic updatedAt;
int shopScore;
int flagShop;
List<Null> tagShop;
......@@ -522,7 +522,7 @@ class Comment {
class InfoCustomer {
int id;
Null prefix;
dynamic prefix;
String name;
String lastname;
String displayName;
......@@ -533,10 +533,10 @@ class InfoCustomer {
String phone;
String address;
String socialRegister;
Null socialType;
dynamic socialType;
String status;
String approved;
Null createdAt;
dynamic createdAt;
String updatedAt;
int userId;
......@@ -597,8 +597,8 @@ class OpenHour {
String halftime;
int vendorId;
int storeId;
Null createdAt;
Null updatedAt;
dynamic createdAt;
dynamic updatedAt;
OpenHour({this.id, this.name, this.code, this.dayName, this.open, this.closed, this.halftime, this.vendorId, this.storeId, this.createdAt, this.updatedAt});
......@@ -641,7 +641,7 @@ class Ratings {
String rateTb;
int rateRowId;
String isCustom;
Null customScore;
dynamic customScore;
int rateRange;
int storeId;
int vendorId;
......
import 'dart:convert';
import 'package:feelverapp/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/base/base.dart';
......@@ -23,6 +25,27 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs",
};
Future<Response<T>> homesearch(Object body) async {
var _model;
var _fail;
var result;
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/store/shop-list", this._headerApi, body)
.then((response){
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if (response.statusCode == 200){
_model = SearchhomeModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
});
return result;
}
Future<Response<T>> getprofile(Object body) async {
var _model;
var _fail;
......
......@@ -33,6 +33,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
// presenter.getid();
presenter.getprofile ();
presenter.Search();
}
......
import 'package:feelverapp/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/category/category_model.dart';
import 'package:feelverapp/model/editprofile/getprofilemodel.dart';
......@@ -32,6 +33,45 @@ class HomePresenter extends BasePresenter<HomePage> {
}
}
Search() async{
_api = Api<SearchhomeModel>();
var res = await _api.homesearch({
"keyword_shop" : "spa",
"lang" : "all",
"access" : "portal",
});
if (res.fail == null) {
print('res Success');
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "ไม่สามารถติดต่อ\nเซิร์ฟเวอร์ได้",
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () => Navigator.pop(state.context),
child: Text(
"ค้นหาใหม่อีกครั้ง",
style: TextStyle(color: Colors.white, fontSize: 20),
),
)
]).show();
}
}
getid() async {
SharedPreferences pref = await SharedPreferences.getInstance();
setState(() {uid =pref.getString('Id');});
......
......@@ -13,7 +13,7 @@ class ShopList extends StatefulWidget {
}
class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
var entries = new List<String>.generate(2, (i) => "Item $i");
var entries = new List<String>.generate(1, (i) => "Item $i");
ShoplistPresenter presenter;
......@@ -277,12 +277,12 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
child: new Text(
'Load more ...',
style: new TextStyle(
color: Colors.white,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
onPressed: () {
var nextItems = new List<String>.generate(2, (i) {
var nextItems = new List<String>.generate(1, (i) {
var itemId = i + entries.length;
return "Item $itemId";
});
......
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