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'; ...@@ -15,6 +15,7 @@ import 'package:feelverapp/ui/splashscreen/splash_screen_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'ui/edit_profile/edit_profile.dart'; import 'ui/edit_profile/edit_profile.dart';
import 'ui/shop/shop_main.dart';
void main() => runApp(MyApp()); void main() => runApp(MyApp());
...@@ -33,7 +34,8 @@ class MyApp extends StatelessWidget { ...@@ -33,7 +34,8 @@ class MyApp extends StatelessWidget {
), ),
home: SplashScreenPage() home: MainShop()
......
class BookingDetailModel { class ProductModel {
bool status; bool status;
Results results; 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']; status = json['status'];
results = results =
json['results'] != null ? new Results.fromJson(json['results']) : null; json['results'] != null ? new Results.fromJson(json['results']) : null;
...@@ -57,11 +57,11 @@ class Results { ...@@ -57,11 +57,11 @@ class Results {
int status; int status;
int businessTypeId; int businessTypeId;
int businessCateId; int businessCateId;
int businessServiceId; Null businessServiceId;
int attributeSetId; int attributeSetId;
int vendorId; int vendorId;
String allowRoute; String allowRoute;
String type; Null type;
int star; int star;
List<StoresByVendorId> storesByVendorId; List<StoresByVendorId> storesByVendorId;
List<Null> images; List<Null> images;
...@@ -70,8 +70,8 @@ class Results { ...@@ -70,8 +70,8 @@ class Results {
List<Null> comments; List<Null> comments;
List<Null> commentReview; List<Null> commentReview;
int storeProductId; int storeProductId;
String typeRateService; Null typeRateService;
String priceRateService; Null priceRateService;
int productId; int productId;
int storeId; int storeId;
String storeCode; String storeCode;
...@@ -307,10 +307,10 @@ class Results { ...@@ -307,10 +307,10 @@ class Results {
// if (this.images != null) { // if (this.images != null) {
// data['images'] = this.images.map((v) => v.toJson()).toList(); // data['images'] = this.images.map((v) => v.toJson()).toList();
// } // }
// if (this.categoryByProductId != null) { if (this.categoryByProductId != null) {
// data['category_by_product_id'] = data['category_by_product_id'] =
// this.categoryByProductId.map((v) => v.toJson()).toList(); this.categoryByProductId.map((v) => v.toJson()).toList();
// } }
// if (this.ratings != null) { // if (this.ratings != null) {
// data['ratings'] = this.ratings.map((v) => v.toJson()).toList(); // data['ratings'] = this.ratings.map((v) => v.toJson()).toList();
// } // }
...@@ -371,8 +371,8 @@ class StoresByVendorId { ...@@ -371,8 +371,8 @@ class StoresByVendorId {
String storeLogo; String storeLogo;
String isFacilities; String isFacilities;
String distanceWithLocation; String distanceWithLocation;
String star; int star;
Ratings ratings; Null ratings;
StoresByVendorId( StoresByVendorId(
{this.id, {this.id,
...@@ -432,8 +432,7 @@ class StoresByVendorId { ...@@ -432,8 +432,7 @@ class StoresByVendorId {
isFacilities = json['is_facilities']; isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location']; distanceWithLocation = json['distance_with_location'];
star = json['star']; star = json['star'];
ratings = ratings = json['ratings'];
json['ratings'] != null ? new Ratings.fromJson(json['ratings']) : null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
...@@ -465,122 +464,7 @@ class StoresByVendorId { ...@@ -465,122 +464,7 @@ class StoresByVendorId {
data['is_facilities'] = this.isFacilities; data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation; data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star; data['star'] = this.star;
if (this.ratings != null) { data['ratings'] = this.ratings;
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;
return data; return data;
} }
} }
...@@ -596,8 +480,8 @@ class CategoryByProductId { ...@@ -596,8 +480,8 @@ class CategoryByProductId {
Null type; Null type;
String status; String status;
int sortOrder; int sortOrder;
int storeId; Null storeId;
int vendorId; Null vendorId;
Null createdAt; Null createdAt;
String updatedAt; String updatedAt;
String visibility; String visibility;
......
...@@ -152,7 +152,7 @@ class Product { ...@@ -152,7 +152,7 @@ class Product {
int vendorId; int vendorId;
String allowRoute; String allowRoute;
String type; String type;
int star; // int star;
List<Null> ratings; List<Null> ratings;
Product( Product(
...@@ -197,7 +197,7 @@ class Product { ...@@ -197,7 +197,7 @@ class Product {
this.vendorId, this.vendorId,
this.allowRoute, this.allowRoute,
this.type, this.type,
this.star, // this.star,
this.ratings}); this.ratings});
Product.fromJson(Map<String, dynamic> json) { Product.fromJson(Map<String, dynamic> json) {
...@@ -242,7 +242,7 @@ class Product { ...@@ -242,7 +242,7 @@ class Product {
vendorId = json['vendor_id']; vendorId = json['vendor_id'];
allowRoute = json['allow_route']; allowRoute = json['allow_route'];
type = json['type']; type = json['type'];
star = json['star']; // star = json['star'];
} }
...@@ -289,7 +289,7 @@ class Product { ...@@ -289,7 +289,7 @@ class Product {
data['vendor_id'] = this.vendorId; data['vendor_id'] = this.vendorId;
data['allow_route'] = this.allowRoute; data['allow_route'] = this.allowRoute;
data['type'] = this.type; data['type'] = this.type;
data['star'] = this.star; // data['star'] = this.star;
return data; return data;
} }
} }
...@@ -321,7 +321,7 @@ class Store { ...@@ -321,7 +321,7 @@ class Store {
String storeLogo; String storeLogo;
String isFacilities; String isFacilities;
String distanceWithLocation; String distanceWithLocation;
String star; // String star;
Ratings ratings; Ratings ratings;
Store( Store(
...@@ -351,7 +351,7 @@ class Store { ...@@ -351,7 +351,7 @@ class Store {
this.storeLogo, this.storeLogo,
this.isFacilities, this.isFacilities,
this.distanceWithLocation, this.distanceWithLocation,
this.star, // this.star,
this.ratings}); this.ratings});
Store.fromJson(Map<String, dynamic> json) { Store.fromJson(Map<String, dynamic> json) {
...@@ -381,7 +381,7 @@ class Store { ...@@ -381,7 +381,7 @@ class Store {
storeLogo = json['store_logo']; storeLogo = json['store_logo'];
isFacilities = json['is_facilities']; isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location']; distanceWithLocation = json['distance_with_location'];
star = json['star']; // star = json['star'];
ratings = ratings =
json['ratings'] != null ? new Ratings.fromJson(json['ratings']) : null; json['ratings'] != null ? new Ratings.fromJson(json['ratings']) : null;
} }
...@@ -414,7 +414,7 @@ class Store { ...@@ -414,7 +414,7 @@ class Store {
data['store_logo'] = this.storeLogo; data['store_logo'] = this.storeLogo;
data['is_facilities'] = this.isFacilities; data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation; data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star; // data['star'] = this.star;
if (this.ratings != null) { if (this.ratings != null) {
data['ratings'] = this.ratings.toJson(); data['ratings'] = this.ratings.toJson();
} }
......
...@@ -51,10 +51,10 @@ class Result { ...@@ -51,10 +51,10 @@ class Result {
int star; int star;
List<StoreProduct> storeProduct; List<StoreProduct> storeProduct;
List<Comment> comment; List<Comment> comment;
List<Null> commentReview; List<dynamic> commentReview;
List<OpenHour> openHour; List<OpenHour> openHour;
List<Image> image; List<Image> image;
Null ratings; dynamic ratings;
Result( Result(
{this.id, {this.id,
...@@ -298,7 +298,7 @@ class Product { ...@@ -298,7 +298,7 @@ class Product {
dynamic type; dynamic type;
int star; int star;
List<CategoryFeelverByProductId> categoryFeelverByProductId; List<CategoryFeelverByProductId> categoryFeelverByProductId;
List<Null> ratings; List<dynamic> ratings;
Product( Product(
{this.id, {this.id,
...@@ -576,8 +576,8 @@ class Comment { ...@@ -576,8 +576,8 @@ class Comment {
dynamic updatedAt; dynamic updatedAt;
int shopScore; int shopScore;
int flagShop; int flagShop;
List<Null> tagShop; List<dynamic> tagShop;
List<Null> productTag; List<dynamic> productTag;
bool purchased; bool purchased;
InfoCustomer infoCustomer; InfoCustomer infoCustomer;
List<CommentSub> commentSub; List<CommentSub> commentSub;
...@@ -778,8 +778,8 @@ class CommentSub { ...@@ -778,8 +778,8 @@ class CommentSub {
dynamic updatedAt; dynamic updatedAt;
int shopScore; int shopScore;
int flagShop; int flagShop;
List<Null> tagShop; List<dynamic> tagShop;
List<Null> productTag; List<dynamic> productTag;
bool purchased; bool purchased;
InfoCustomer infoCustomer; InfoCustomer infoCustomer;
...@@ -958,8 +958,8 @@ class OpenHour { ...@@ -958,8 +958,8 @@ class OpenHour {
String closed; String closed;
int vendorId; int vendorId;
int storeId; int storeId;
Null createdAt; dynamic createdAt;
Null updatedAt; dynamic updatedAt;
OpenHour( OpenHour(
{this.id, {this.id,
...@@ -1010,8 +1010,8 @@ class Image { ...@@ -1010,8 +1010,8 @@ class Image {
String detail; String detail;
String status; String status;
int vendorId; int vendorId;
Null createdAt; dynamic createdAt;
Null updatedAt; dynamic updatedAt;
String imageTb; String imageTb;
int tbId; int tbId;
......
...@@ -24,6 +24,8 @@ import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'; ...@@ -24,6 +24,8 @@ import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart';
import 'package:feelverapp/model/shopservice/shop_service_Model.dart'; import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import '../model/booking_detail/booking_detail_model.dart';
class Api<T> { class Api<T> {
final String _baseApi = "https://backend-uat.feelver.com/api"; final String _baseApi = "https://backend-uat.feelver.com/api";
...@@ -36,7 +38,10 @@ class Api<T> { ...@@ -36,7 +38,10 @@ class Api<T> {
static final String baseApi = "https://backend-uat.feelver.com/api"; 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/";
...@@ -85,10 +90,15 @@ class Api<T> { ...@@ -85,10 +90,15 @@ class Api<T> {
// (body as Map)['lang'] = allTranslations.currentLanguage; // (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/wish-list/listByCustomer", this._headerApi, body) await _httpConnection("${this._baseApi}/wish-list/listByCustomer", this._headerApi, body)
.then((response){ .then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}"); print("ผลลัพท์ เท่ากับบบบบบบบบบบบ" + "${response.body}");
if(response.statusCode == 200){ if(response.statusCode == 200 && json.decode(response.body)["message"]!="data not found"){
print("aaaa");
_model = FavoriteModel.fromJson(json.decode(response.body)); _model = FavoriteModel.fromJson(json.decode(response.body));
}else{ }else{
print("bbbb");
_fail = FailModel.fromJson(json.decode(response.body)); _fail = FailModel.fromJson(json.decode(response.body));
} }
result = new Response<T>(_model, _fail); result = new Response<T>(_model, _fail);
...@@ -103,7 +113,10 @@ class Api<T> { ...@@ -103,7 +113,10 @@ class Api<T> {
var result; var result;
print("this is body"+body.toString()); print("this is body"+body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage; // (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){ .then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}"); print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){ if(response.statusCode == 200){
...@@ -184,9 +197,33 @@ class Api<T> { ...@@ -184,9 +197,33 @@ class Api<T> {
result = new Response<T>(_model, _fail); result = new Response<T>(_model, _fail);
}); });
return result; 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 { Future<Response<T>> editProfile(Object body) async {
......
import 'package:feelverapp/ui/booking/booking_detail_presenter.dart';
import 'package:feelverapp/ui/booking/bookingform.dart'; import 'package:feelverapp/ui/booking/bookingform.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:feelverapp/util/Util.dart';
import '../splashscreen/splash_screen_page.dart';
class BookingDetail extends StatefulWidget { class BookingDetail extends StatefulWidget {
int getid;
int vendor_id;
int store_id;
BookingDetail({Key key, this.getid,this.vendor_id,this.store_id}) : super(key: key);
@override @override
_BookingDetailState createState() => _BookingDetailState(); _BookingDetailState createState() => _BookingDetailState();
} }
class _BookingDetailState extends State<BookingDetail> { class _BookingDetailState extends State<BookingDetail> {
BookingDetailtPresenter presenter;
@override
void initState() {
super.initState();
// widget.getid = 55;
// print(widget.getid);
presenter = BookingDetailtPresenter(this);
setState(() {
presenter.getid = widget.getid;
});
presenter.getDetail();
}
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView(padding: EdgeInsets.all(0), children: <Widget>[ return presenter.getmodel == null
? Container(
child: Center(
child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Colors.teal),
),
),
)
: Container(
child: ListView(
padding: EdgeInsets.all(0),
children: <Widget>[
_setupView(), _setupView(),
]); ],
),
);
} }
_setupView() { _setupView() {
...@@ -22,22 +63,30 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -22,22 +63,30 @@ class _BookingDetailState extends State<BookingDetail> {
children: <Widget>[ children: <Widget>[
Stack( Stack(
children: <Widget>[ children: <Widget>[
Image.network( presenter.getmodel.results.cover == null
'https://www.cancurreu.com/wp-content/uploads/can_curreu_hotel_ibiza_spa_tratamientos.jpg', ? Image.asset(
'assets/images/demo_img.png',
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
)
: Image.network(
presenter.getmodel.results.cover,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: SizeConfig.getHeight(450), height: SizeConfig.getHeight(450),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
], ],
), ),
Container(
presenter.getmodel.results.name == null
? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)), top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'4 ธ.ค. 2561 18:55 น.', '-',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -45,15 +94,15 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -45,15 +94,15 @@ class _BookingDetailState extends State<BookingDetail> {
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), )
Container( : Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(3), top: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(8)), bottom: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'Thai Body', presenter.getmodel.results.name,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
...@@ -69,7 +118,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -69,7 +118,7 @@ class _BookingDetailState extends State<BookingDetail> {
), ),
ImageIcon( ImageIcon(
AssetImage('assets/images/ic_fav_active.png'), AssetImage('assets/images/ic_fav_active.png'),
color: Colors.pink, color: Colors.grey,
size: SizeConfig.getFontSize(24), size: SizeConfig.getFontSize(24),
), ),
SizedBox( SizedBox(
...@@ -78,7 +127,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -78,7 +127,7 @@ class _BookingDetailState extends State<BookingDetail> {
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'70', '0',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -105,7 +154,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -105,7 +154,7 @@ class _BookingDetailState extends State<BookingDetail> {
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'70', '0',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -144,68 +193,83 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -144,68 +193,83 @@ class _BookingDetailState extends State<BookingDetail> {
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24), right: SizeConfig.getPadding(24),
), ),
), ),
Container( presenter.getmodel.results.excerpt == null
alignment: Alignment.topLeft, ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.getPadding(14),
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)), right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text( child: Text(
'A four hand massage performed by two therapists in unison, this experience coordinates a blend of Thai, Swedish, Shiatsu and Reflexology techniques using deep rhythmic movement to leave you feeling completely renewed. Top Tip: This is Khun Taras (our Group Spa Director) favourite massage. She loves it because having the sensation of two therapists working on you means your mind cant concentrate on one area and it basically just gives up! This massage almost forces you to switch your mind off. Try it and see.', '',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: SizeConfig.getFontSize(14), fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), )
Container( : Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.getPadding(24),
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)), right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text( child: Text(
'Thai Body Balance 60 นาที', Util.removeHTMLTag('${presenter.getmodel.results.excerpt}'),
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black87, color: Colors.black54,
fontSize: SizeConfig.getFontSize(20), fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
// Container(
// alignment: Alignment.topLeft,
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(24),
// left: SizeConfig.getPadding(24),
// right: SizeConfig.getPadding(24)),
// child: Text(
// 'Thai Body Balance 60 นาที',
// textAlign: TextAlign.left,
// style: TextStyle(
// color: Colors.black87,
// fontSize: SizeConfig.getFontSize(20),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
// ),
SizedBox( SizedBox(
height: SizeConfig.getHeight(10), height: SizeConfig.getHeight(16),
),
Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(24),
),
Image.asset(
'assets/images/clock.png',
width: SizeConfig.getWidth(20),
height: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(10),
),
Text(
'150 นาที',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
), ),
// Row(
// children: <Widget>[
// SizedBox(
// width: SizeConfig.getWidth(24),
// ),
// Image.asset(
// 'assets/images/clock.png',
// width: SizeConfig.getWidth(20),
// height: SizeConfig.getWidth(20),
// ),
// SizedBox(
// width: SizeConfig.getWidth(10),
// ),
// Text(
// '150 นาที',
// textAlign: TextAlign.left,
// style: TextStyle(
// color: Colors.black87,
// fontSize: SizeConfig.getFontSize(12),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
// ],
// ),
Stack( Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
...@@ -237,10 +301,27 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -237,10 +301,27 @@ class _BookingDetailState extends State<BookingDetail> {
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
), ),
Container( presenter.getmodel.results.specialPrice == null
? Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'฿199.00', '',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
)
: Container(
alignment: Alignment.topLeft,
child: Text(
presenter.getmodel.results.specialPrice,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Color.fromRGBO(255, 0, 0, 1), color: Color.fromRGBO(255, 0, 0, 1),
...@@ -255,7 +336,24 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -255,7 +336,24 @@ class _BookingDetailState extends State<BookingDetail> {
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
), ),
Container( presenter.getmodel.results.price == null
? Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text(
'',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
)
: Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(90), left: SizeConfig.getPadding(90),
...@@ -264,7 +362,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -264,7 +362,7 @@ class _BookingDetailState extends State<BookingDetail> {
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
child: Text( child: Text(
'฿599.00 ', presenter.getmodel.results.price,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black45, color: Colors.black45,
...@@ -283,8 +381,8 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -283,8 +381,8 @@ class _BookingDetailState extends State<BookingDetail> {
width: SizeConfig.getWidth(100), width: SizeConfig.getWidth(100),
height: SizeConfig.getHeight(45), height: SizeConfig.getHeight(45),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(0),
color:Color.fromRGBO(69, 85, 79, 1), color: Color.fromRGBO(238, 175, 183, 1),
), ),
child: Container( child: Container(
padding: EdgeInsets.only(top: SizeConfig.getPadding(6)), padding: EdgeInsets.only(top: SizeConfig.getPadding(6)),
...@@ -299,12 +397,8 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -299,12 +397,8 @@ class _BookingDetailState extends State<BookingDetail> {
), ),
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
height: SizeConfig.getHeight(30), height: SizeConfig.getHeight(30),
), ),
......
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'; ...@@ -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/ui/my_order_status/my_order_status.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Favorite extends StatefulWidget { class Favorite extends StatefulWidget {
@override @override
_FavoriteState createState() => _FavoriteState(); _FavoriteState createState() => _FavoriteState();
} }
...@@ -24,8 +22,6 @@ class _FavoriteState extends State<Favorite> { ...@@ -24,8 +22,6 @@ class _FavoriteState extends State<Favorite> {
presenter = FavoritePresenter(this); presenter = FavoritePresenter(this);
presenter.Favoriteitem(); presenter.Favoriteitem();
} }
@override @override
...@@ -76,7 +72,9 @@ class _FavoriteState extends State<Favorite> { ...@@ -76,7 +72,9 @@ class _FavoriteState extends State<Favorite> {
); );
} }
Widget list(int index,) { Widget list(
int index,
) {
return Container( return Container(
// color: Colors.red, // color: Colors.red,
margin: EdgeInsets.only(bottom: 15), margin: EdgeInsets.only(bottom: 15),
...@@ -112,21 +110,29 @@ class _FavoriteState extends State<Favorite> { ...@@ -112,21 +110,29 @@ class _FavoriteState extends State<Favorite> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
// width: MediaQuery.of(context).size.width,
// color: Colors.blue, // color: Colors.blue,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Expanded(
presenter.favoriteModel.wishListItem[index]
.product.name, child: Container(
child: Text(
presenter.favoriteModel.wishListItem[index].product.name,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: SizeConfig.getFontSize(15)), fontSize: SizeConfig.getFontSize(15)),
maxLines: 2,
), ),
Spacer(), ),
),
// Spacer(),
IconButton( IconButton(
onPressed: () { onPressed: () {
print('delete'); print('delete');
presenter.Deletefavoriteitem( presenter.favoriteModel.wishListItem[index].id.toString()); presenter.Deletefavoriteitem(presenter
.favoriteModel.wishListItem[index].id
.toString());
}, },
icon: Icon(Icons.favorite), icon: Icon(Icons.favorite),
color: Color(0xFFDD175F), color: Color(0xFFDD175F),
......
...@@ -3,6 +3,7 @@ import 'package:feelverapp/model/favorite/favorite_Model.dart'; ...@@ -3,6 +3,7 @@ import 'package:feelverapp/model/favorite/favorite_Model.dart';
import 'package:feelverapp/service/api.dart'; import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart'; import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/favorite/favorite.dart'; import 'package:feelverapp/ui/favorite/favorite.dart';
import 'package:feelverapp/util/Accout_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class FavoritePresenter extends BasePresenter<Favorite> { class FavoritePresenter extends BasePresenter<Favorite> {
...@@ -14,9 +15,13 @@ class FavoritePresenter extends BasePresenter<Favorite> { ...@@ -14,9 +15,13 @@ class FavoritePresenter extends BasePresenter<Favorite> {
FavoritePresenter(State<Favorite> state) : super(state); FavoritePresenter(State<Favorite> state) : super(state);
Favoriteitem() async { Favoriteitem() async {
var _id = await AccountUtil.getID();
print(_id);
print("555555555555");
_api = Api<FavoriteModel>(); _api = Api<FavoriteModel>();
var res = await _api.favorite({ var res = await _api.favorite({
"customer_id": "224", "customer_id": _id,
}); });
if (res.fail == null) { if (res.fail == null) {
......
...@@ -19,7 +19,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -19,7 +19,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
presenter = ReviewshopPresenter(this); presenter = ReviewshopPresenter(this);
presenter.Commentlist(); presenter.Commentlist();
} }
@override @override
...@@ -27,7 +26,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -27,7 +26,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
...@@ -44,7 +42,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -44,7 +42,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
body: _setupView(), body: _setupView(),
); );
...@@ -65,10 +62,15 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -65,10 +62,15 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
Widget containt() { Widget containt() {
return Expanded( return Expanded(
child: Container( child: Container(
child: presenter.reviewShopModel == null ? Container():ListView.builder( child: presenter.reviewShopModel == null
? Container()
: ListView.builder(
itemCount: presenter.reviewShopModel.result[0].comment.length, itemCount: presenter.reviewShopModel.result[0].comment.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
return list(presenter.reviewShopModel.result[i].comment[i].infoCustomer.name); print(presenter.reviewShopModel.result[0].comment[i].infoCustomer.name);
return list(
presenter.reviewShopModel.result[0].comment[i].infoCustomer.name,
);
}), }),
), ),
); );
...@@ -246,7 +248,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -246,7 +248,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
); );
} }
Widget list(String name,) { Widget list(String name) {
return Card( return Card(
child: Container( child: Container(
// color: Colors.deepPurpleAccent, // color: Colors.deepPurpleAccent,
...@@ -278,8 +280,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -278,8 +280,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SingleChildScrollView( Row(
child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(
name, name,
...@@ -293,7 +294,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -293,7 +294,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
) )
], ],
), ),
),
SizedBox( SizedBox(
height: SizeConfig.getHeight(5), height: SizeConfig.getHeight(5),
), ),
......
...@@ -8,15 +8,23 @@ import 'package:feelverapp/util/Util.dart'; ...@@ -8,15 +8,23 @@ import 'package:feelverapp/util/Util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../splashscreen/splash_screen_page.dart';
import 'shop_list_detail.dart';
class ShopNearbyPlacesPage extends StatefulWidget { class ShopNearbyPlacesPage extends StatefulWidget {
@override @override
_ShopNearbyPlacesPageState createState() => _ShopNearbyPlacesPageState(); _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>['พญาไทย', 'บางเขน', 'เกษตร']; final List<String> place = <String>['พญาไทย', 'บางเขน', 'เกษตร'];
class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerProviderStateMixin { class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>
with TickerProviderStateMixin {
ShopNearByPlacePresenter presenter; ShopNearByPlacePresenter presenter;
@override @override
...@@ -31,6 +39,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -31,6 +39,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
...@@ -47,8 +56,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -47,8 +56,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
top: SizeConfig.getPadding(15), top: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(10), bottom: SizeConfig.getPadding(10),
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24) right: SizeConfig.getPadding(24)),
),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
...@@ -105,7 +113,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -105,7 +113,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
backgroundColor:Color.fromRGBO(69, 85, 79, 1), backgroundColor: Color.fromRGBO(69, 85, 79, 1),
shape: StadiumBorder( shape: StadiumBorder(
side: BorderSide(color: Colors.white), side: BorderSide(color: Colors.white),
), ),
...@@ -122,7 +130,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -122,7 +130,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
backgroundColor:Color.fromRGBO(69, 85, 79, 1), backgroundColor: Color.fromRGBO(69, 85, 79, 1),
shape: StadiumBorder( shape: StadiumBorder(
side: BorderSide(color: Colors.white), side: BorderSide(color: Colors.white),
), ),
...@@ -164,7 +172,6 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -164,7 +172,6 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
print("selected"); print("selected");
}, },
), ),
], ],
), ),
), ),
...@@ -202,19 +209,30 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -202,19 +209,30 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
presenter.getmodel.results.data[i].updatedAt, presenter.getmodel.results.data[i].updatedAt,
presenter.getmodel.results.data[i].distanceWithLocation presenter.getmodel.results.data[i].distanceWithLocation
.toString()); .toString());
} }),
),
); );
} }
Widget _nearByItem(String title, String detail, String img, String address, Widget _nearByItem(String title, String detail, String img, String address,
String latlng, String date_time, String distanceWithLocation) { String latlng, String date_time, String distanceWithLocation) {
return InkWell(
return Card( onTap: () {
setState(() {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => ShopListDetail(
// id: id,
),
),
);
});
},
child: Card(
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: SizeConfig.getPadding(0), right: SizeConfig.getPadding(0),
left: SizeConfig.getPadding(0), left: SizeConfig.getPadding(0),
top: SizeConfig.getPadding(10), top: SizeConfig.getPadding(50),
bottom: SizeConfig.getPadding(10)), bottom: SizeConfig.getPadding(10)),
child: Container( child: Container(
// color: Colors.red, // color: Colors.red,
...@@ -237,7 +255,8 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -237,7 +255,8 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
: Image.network( : Image.network(
Api.baseApiforimage + img, Api.baseApiforimage + img,
fit: BoxFit.cover, fit: BoxFit.cover,
),), ),
),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
...@@ -316,18 +335,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -316,18 +335,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
SizedBox( SizedBox(
width: 5, width: 5,
), ),
], ],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox( SizedBox(
height: SizeConfig.getHeight(5), height: SizeConfig.getHeight(5),
), ),
], ],
), ),
), ),
...@@ -340,7 +355,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP ...@@ -340,7 +355,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
], ],
), ),
), ),
),
); );
} }
} }
...@@ -10,11 +10,16 @@ import 'dart:math'; ...@@ -10,11 +10,16 @@ import 'dart:math';
class MainShop extends StatefulWidget { class MainShop extends StatefulWidget {
int getid;
int vendor_id;
int store_id;
MainShop({Key key, this.title,this.getid,this.vendor_id,this.store_id}) : super(key: key);
MainShop({Key key, this.title}) : super(key: key);
final String title; final String title;
@override @override
_MainShopState createState() => _MainShopState(); _MainShopState createState() => _MainShopState();
} }
...@@ -174,7 +179,7 @@ class _MainShopState extends State<MainShop> ...@@ -174,7 +179,7 @@ class _MainShopState extends State<MainShop>
controller: _controller, controller: _controller,
children: <Widget>[ children: <Widget>[
Container( Container(
child: BookingDetail(), child: BookingDetail(getid: widget.getid,vendor_id: widget.vendor_id,store_id: widget.store_id,),
// child: getlist(), // child: getlist(),
//width: 20, //width: 20,
), ),
......
import 'package:feelverapp/ui/shop/shop_service_presenter.dart'; import 'package:feelverapp/ui/shop/shop_service_presenter.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:feelverapp/util/rating_star.dart'; import 'package:feelverapp/util/rating_star.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../service/api.dart'; import '../../service/api.dart';
import '../booking/booking_detail.dart';
import 'shop_main.dart';
class ShopServicePage extends StatefulWidget { class ShopServicePage extends StatefulWidget {
@override @override
...@@ -43,15 +46,37 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -43,15 +46,37 @@ class _ShopServicePageState extends State<ShopServicePage>
presenter.serviceModel.data[i].cover, presenter.serviceModel.data[i].cover,
presenter.serviceModel.data[i].price, presenter.serviceModel.data[i].price,
presenter.serviceModel.data[i].duration, presenter.serviceModel.data[i].duration,
presenter.serviceModel.data[i].specialPrice == null ? "" : presenter.serviceModel.data[i].specialPrice, presenter.serviceModel.data[i].id,
presenter.serviceModel.data[i].specialPrice == null
? ""
: presenter.serviceModel.data[i].specialPrice,
presenter.serviceModel.data[i].vendorId,
presenter.serviceModel.data[i].storeId,
); );
}) },
),
); );
} }
Widget myCard(String title, String image, String price, String time, String special_price) { Widget myCard(String title, String image, String price, String time, int id,
return Card( String special_price , int vendor_id,int store_id) {
return InkWell(
onTap: () {
setState(
() {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => MainShop(
getid: id,vendor_id: vendor_id,store_id: store_id,
),
),
);
},
);
},
child: Card(
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: SizeConfig.getPadding(16), right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16), left: SizeConfig.getPadding(16),
...@@ -78,7 +103,8 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -78,7 +103,8 @@ class _ShopServicePageState extends State<ShopServicePage>
: Image.network( : Image.network(
Api.baseApiforimage + image, Api.baseApiforimage + image,
fit: BoxFit.cover, fit: BoxFit.cover,
),), ),
),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
...@@ -198,7 +224,8 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -198,7 +224,8 @@ class _ShopServicePageState extends State<ShopServicePage>
), ),
Container( Container(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
RatingStar( RatingStar(
isRating: true, isRating: true,
...@@ -226,6 +253,7 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -226,6 +253,7 @@ class _ShopServicePageState extends State<ShopServicePage>
], ],
), ),
), ),
),
); );
} }
} }
...@@ -14,11 +14,11 @@ class ShopServicePresenter extends BasePresenter<ShopServicePage> { ...@@ -14,11 +14,11 @@ class ShopServicePresenter extends BasePresenter<ShopServicePage> {
Servicelistitem() async { Servicelistitem() async {
_api = Api<shopserviceModel>(); _api = Api<shopserviceModel>();
var res = await _api.shopservice({ var res = await _api.shopservice({
"vendor_id": "16", "vendor_id": "9",
"store_id": "406", "store_id": "284",
"is_paginate": "1", "is_paginate": "1",
"per_page": "8", "per_page": "1",
"v": "2", "v": "1",
}); });
if (res.fail == null) { if (res.fail == null) {
......
...@@ -162,7 +162,7 @@ packages: ...@@ -162,7 +162,7 @@ packages:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.7+4" version: "0.6.7+6"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
...@@ -281,14 +281,14 @@ packages: ...@@ -281,14 +281,14 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.8" version: "0.5.10"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.2+1" version: "0.0.2+2"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
......
...@@ -14,7 +14,7 @@ description: A new Flutter project. ...@@ -14,7 +14,7 @@ description: A new Flutter project.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.2.0 <3.0.0"
dependencies: dependencies:
flutter: 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