Commit 19e72f08 by Mobile : Jetrin Phuekkaew (N'new)

Merge branch 'develop' of https://gitlab.2fellows.com/art/feelver into develop

# Conflicts:
#	lib/ui/shop/shop_main.dart
parents b611d647 19c7959c
......@@ -15,6 +15,7 @@ import 'package:feelverapp/ui/splashscreen/splash_screen_page.dart';
import 'package:flutter/material.dart';
import 'ui/edit_profile/edit_profile.dart';
import 'ui/shop/shop_main.dart';
void main() => runApp(MyApp());
......@@ -33,7 +34,8 @@ class MyApp extends StatelessWidget {
),
home: SplashScreenPage()
home: MainShop()
......
class BookingDetailModel {
class ProductModel {
bool status;
Results results;
BookingDetailModel({this.status, this.results});
ProductModel({this.status, this.results});
BookingDetailModel.fromJson(Map<String, dynamic> json) {
ProductModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
results =
json['results'] != null ? new Results.fromJson(json['results']) : null;
......@@ -57,11 +57,11 @@ class Results {
int status;
int businessTypeId;
int businessCateId;
int businessServiceId;
Null businessServiceId;
int attributeSetId;
int vendorId;
String allowRoute;
String type;
Null type;
int star;
List<StoresByVendorId> storesByVendorId;
List<Null> images;
......@@ -70,8 +70,8 @@ class Results {
List<Null> comments;
List<Null> commentReview;
int storeProductId;
String typeRateService;
String priceRateService;
Null typeRateService;
Null priceRateService;
int productId;
int storeId;
String storeCode;
......@@ -307,10 +307,10 @@ class Results {
// if (this.images != null) {
// data['images'] = this.images.map((v) => v.toJson()).toList();
// }
// if (this.categoryByProductId != null) {
// data['category_by_product_id'] =
// this.categoryByProductId.map((v) => v.toJson()).toList();
// }
if (this.categoryByProductId != null) {
data['category_by_product_id'] =
this.categoryByProductId.map((v) => v.toJson()).toList();
}
// if (this.ratings != null) {
// data['ratings'] = this.ratings.map((v) => v.toJson()).toList();
// }
......@@ -371,8 +371,8 @@ class StoresByVendorId {
String storeLogo;
String isFacilities;
String distanceWithLocation;
String star;
Ratings ratings;
int star;
Null ratings;
StoresByVendorId(
{this.id,
......@@ -432,8 +432,7 @@ class StoresByVendorId {
isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location'];
star = json['star'];
ratings =
json['ratings'] != null ? new Ratings.fromJson(json['ratings']) : null;
ratings = json['ratings'];
}
Map<String, dynamic> toJson() {
......@@ -465,122 +464,7 @@ class StoresByVendorId {
data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star;
if (this.ratings != null) {
data['ratings'] = this.ratings.toJson();
}
return data;
}
}
class Ratings {
int id;
String title;
String rateType;
String rateCate;
String rateTb;
int rateRowId;
String isCustom;
Null customScore;
int rateRange;
int storeId;
int vendorId;
String createdAt;
String updatedAt;
List<RatingScore> ratingScore;
Ratings(
{this.id,
this.title,
this.rateType,
this.rateCate,
this.rateTb,
this.rateRowId,
this.isCustom,
this.customScore,
this.rateRange,
this.storeId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.ratingScore});
Ratings.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
rateType = json['rate_type'];
rateCate = json['rate_cate'];
rateTb = json['rate_tb'];
rateRowId = json['rate_row_id'];
isCustom = json['is_custom'];
customScore = json['custom_score'];
rateRange = json['rate_range'];
storeId = json['store_id'];
vendorId = json['vendor_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
if (json['rating_score'] != null) {
ratingScore = new List<RatingScore>();
json['rating_score'].forEach((v) {
ratingScore.add(new RatingScore.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['rate_type'] = this.rateType;
data['rate_cate'] = this.rateCate;
data['rate_tb'] = this.rateTb;
data['rate_row_id'] = this.rateRowId;
data['is_custom'] = this.isCustom;
data['custom_score'] = this.customScore;
data['rate_range'] = this.rateRange;
data['store_id'] = this.storeId;
data['vendor_id'] = this.vendorId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
if (this.ratingScore != null) {
data['rating_score'] = this.ratingScore.map((v) => v.toJson()).toList();
}
return data;
}
}
class RatingScore {
int id;
int ratingId;
String ratingScore;
String createdAt;
String updatedAt;
int customerId;
RatingScore(
{this.id,
this.ratingId,
this.ratingScore,
this.createdAt,
this.updatedAt,
this.customerId});
RatingScore.fromJson(Map<String, dynamic> json) {
id = json['id'];
ratingId = json['rating_id'];
ratingScore = json['rating_score'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
customerId = json['customer_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['rating_id'] = this.ratingId;
data['rating_score'] = this.ratingScore;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['customer_id'] = this.customerId;
data['ratings'] = this.ratings;
return data;
}
}
......@@ -596,8 +480,8 @@ class CategoryByProductId {
Null type;
String status;
int sortOrder;
int storeId;
int vendorId;
Null storeId;
Null vendorId;
Null createdAt;
String updatedAt;
String visibility;
......
......@@ -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;
......
......@@ -24,6 +24,8 @@ import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart';
import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
import 'package:http/http.dart' as http;
import '../model/booking_detail/booking_detail_model.dart';
class Api<T> {
final String _baseApi = "https://backend-uat.feelver.com/api";
......@@ -36,9 +38,12 @@ class Api<T> {
static final String baseApi = "https://backend-uat.feelver.com/api";
static final String baseApiforimage = "https://backend-uat.feelver.com/api/storage/";
static final String baseApiforimage = "https://backend.feelver.com/storage/";
Future<Response<T>> reviewshop(Object body) async {
var _model;
......@@ -85,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);
......@@ -103,7 +113,10 @@ class Api<T> {
var result;
print("this is body"+body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/product/getListsProductFormat?vendor_id=16&store_id=406&is_paginate=1&per_page=8&v=2", this._headerApi, null)
await _httpConnection("${this._baseApi}/product/getListsProductFormat?vendor_id=9&store_id=284&is_paginate=1&per_page=1&v=1", this._headerApi, null)
.then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){
......@@ -184,11 +197,35 @@ class Api<T> {
result = new Response<T>(_model, _fail);
});
return result;
// await _httpConnection(
// "${this._baseApi}product/getListsStoreFormat", this._headerApi, body)
}
Future<Response<T>> getProductDetail(Object body) async{
var _model;
var _fail;
var result;
print("this is body " + body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await http.get(Uri.encodeFull("https://backend.feelver.com/api/product/1000?store_id=284&vendor_id=9"), headers: this._headerApi ).then((response) {
print("ผลลัพ เท่ากับบบบ2 " + "${response.body}");
print("statusCode=${response.statusCode}");
if (response.statusCode == 200) {
print("INif");
_model = ProductModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
print("return");
result = new Response<T>(_model, _fail);
});
return result;
}
Future<Response<T>> editProfile(Object body) async {
var _model;
var _fail;
......
import 'package:feelverapp/model/nearme/nearme_list_model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/util/Accout_util.dart';
import 'package:flutter/material.dart';
import 'package:rflutter_alert/rflutter_alert.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:feelverapp/ui/booking/booking_detail.dart';
import '../../model/booking_detail/booking_detail_model.dart';
class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
final formkey = GlobalKey<FormState>();
Api _api;
String type = '3';
int getid;
int vendor_id;
int store_id;
ProductModel getmodel;
BookingDetailtPresenter(State<BookingDetail> state) : super(state);
getDetail() async {
print(getid);
print(store_id);
print(vendor_id);
_api = Api<ProductModel>();
var res = await _api.getProductDetail({});
if (res.fail == null) {
if (res.success.status) {
setState(
() {
print("AAAA :${res.success}");
getmodel = res.success;
},
);
}
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "ไม่พบข้อมูล",
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();
}
}
// getnearme() async {
// _api = Api<NearMeListModel>();
//
// var res = await _api.getNearList({});
// print("Hii" + getmodel[0].storeName);
// print("Hii2" + res.success);
//
// if (res.fail == null) {
// setState(() {
// NearMeListModel model = res.success;
//
//// getmodel = 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();
// }
// }
}
......@@ -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),
),
......
......@@ -8,15 +8,23 @@ import 'package:feelverapp/util/Util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../splashscreen/splash_screen_page.dart';
import 'shop_list_detail.dart';
class ShopNearbyPlacesPage extends StatefulWidget {
@override
_ShopNearbyPlacesPageState createState() => _ShopNearbyPlacesPageState();
}
final List<String> detail = <String>['SPA Cenvaree @ centara Grand Centralworld', 'SPA Cenvaree @ centara Grand Centralworld', 'SPA Cenvaree @ centara Grand Centralworld'];
final List<String> detail = <String>[
'SPA Cenvaree @ centara Grand Centralworld',
'SPA Cenvaree @ centara Grand Centralworld',
'SPA Cenvaree @ centara Grand Centralworld'
];
final List<String> place = <String>['พญาไทย', 'บางเขน', 'เกษตร'];
class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerProviderStateMixin {
class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>
with TickerProviderStateMixin {
ShopNearByPlacePresenter presenter;
@override
......@@ -31,6 +39,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
SizeConfig(context);
......@@ -44,11 +53,10 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
Container(
// color: Colors.blue,
padding: EdgeInsets.only(
top: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(10),
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)
),
top: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(10),
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
......@@ -105,7 +113,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
backgroundColor:Color.fromRGBO(69, 85, 79, 1),
backgroundColor: Color.fromRGBO(69, 85, 79, 1),
shape: StadiumBorder(
side: BorderSide(color: Colors.white),
),
......@@ -122,7 +130,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
backgroundColor:Color.fromRGBO(69, 85, 79, 1),
backgroundColor: Color.fromRGBO(69, 85, 79, 1),
shape: StadiumBorder(
side: BorderSide(color: Colors.white),
),
......@@ -164,7 +172,6 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
print("selected");
},
),
],
),
),
......@@ -179,42 +186,53 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
print(presenter.getmodel);
return presenter.getmodel == null
? Container(
child: Center(
child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Colors.teal),
)))
child: Center(
child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Colors.teal),
)))
: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(80),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10),
),
child: ListView.builder(
itemCount: presenter.getmodel.results.data.length,
itemBuilder: (context, i) {
return _nearByItem(
presenter.getmodel.results.data[i].storeName,
presenter.getmodel.results.data[i].detail,
presenter.getmodel.results.data[i].storeLogo,
presenter.getmodel.results.data[i].address,
presenter.getmodel.results.data[i].location,
presenter.getmodel.results.data[i].updatedAt,
presenter.getmodel.results.data[i].distanceWithLocation
.toString());
}
),
);
padding: EdgeInsets.only(
top: SizeConfig.getPadding(80),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10),
),
child: ListView.builder(
itemCount: presenter.getmodel.results.data.length,
itemBuilder: (context, i) {
return _nearByItem(
presenter.getmodel.results.data[i].storeName,
presenter.getmodel.results.data[i].detail,
presenter.getmodel.results.data[i].storeLogo,
presenter.getmodel.results.data[i].address,
presenter.getmodel.results.data[i].location,
presenter.getmodel.results.data[i].updatedAt,
presenter.getmodel.results.data[i].distanceWithLocation
.toString());
}),
);
}
Widget _nearByItem(String title, String detail, String img, String address,
String latlng, String date_time, String distanceWithLocation) {
return Card(
return InkWell(
onTap: () {
setState(() {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => ShopListDetail(
// id: id,
),
),
);
});
},
child: Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(0),
left: SizeConfig.getPadding(0),
top: SizeConfig.getPadding(10),
top: SizeConfig.getPadding(50),
bottom: SizeConfig.getPadding(10)),
child: Container(
// color: Colors.red,
......@@ -231,13 +249,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
height: SizeConfig.getHeight(250),
child: presenter.getmodel == null
? Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
)
"assets/images/demo_img.png",
fit: BoxFit.cover,
)
: Image.network(
Api.baseApiforimage + img,
fit: BoxFit.cover,
),),
Api.baseApiforimage + img,
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 5,
......@@ -316,18 +335,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
SizedBox(
width: 5,
),
],
),
SizedBox(
height: 10,
),
SizedBox(
height: SizeConfig.getHeight(5),
),
],
),
),
......@@ -340,7 +355,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
],
),
),
);
),
);
}
}
......@@ -10,11 +10,16 @@ import 'dart:math';
class MainShop extends StatefulWidget {
MainShop({Key key, this.title}) : super(key: key);
int getid;
int vendor_id;
int store_id;
MainShop({Key key, this.title,this.getid,this.vendor_id,this.store_id}) : super(key: key);
final String title;
@override
_MainShopState createState() => _MainShopState();
}
......@@ -174,7 +179,7 @@ class _MainShopState extends State<MainShop>
controller: _controller,
children: <Widget>[
Container(
child: BookingDetail(),
child: BookingDetail(getid: widget.getid,vendor_id: widget.vendor_id,store_id: widget.store_id,),
// child: getlist(),
//width: 20,
),
......
......@@ -14,11 +14,11 @@ class ShopServicePresenter extends BasePresenter<ShopServicePage> {
Servicelistitem() async {
_api = Api<shopserviceModel>();
var res = await _api.shopservice({
"vendor_id": "16",
"store_id": "406",
"vendor_id": "9",
"store_id": "284",
"is_paginate": "1",
"per_page": "8",
"v": "2",
"per_page": "1",
"v": "1",
});
if (res.fail == null) {
......
......@@ -162,7 +162,7 @@ packages:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.7+4"
version: "0.6.7+6"
image_picker_platform_interface:
dependency: transitive
description:
......@@ -281,14 +281,14 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.8"
version: "0.5.10"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+1"
version: "0.0.2+2"
shared_preferences_macos:
dependency: transitive
description:
......
......@@ -14,7 +14,7 @@ description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.2.0 <3.0.0"
dependencies:
flutter:
......
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