no message

parent e208a766
class shopserviceModel {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
String nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
shopserviceModel(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
shopserviceModel.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class Data {
int id;
String urlCode;
String name;
String cover;
String excerpt;
String detail;
String price;
String specialPrice;
String sku;
dynamic tax;
int quantity;
dynamic weight;
String visibility;
dynamic newsFromDate;
dynamic newsToDate;
dynamic layout;
dynamic theme;
String duration;
dynamic sellingStartTime;
dynamic sellingEndTime;
dynamic redemptionStartTime;
dynamic redemptionEndTime;
dynamic availibility;
String isFeatured;
String isDeal;
String hasTeam;
String offpeak;
String reviewStatus;
String relatedStatus;
String upSellsStatus;
String crossSellsStatus;
String allowGiftMessage;
String stockStatus;
int status;
int businessTypeId;
int businessCateId;
int businessServiceId;
int attributeSetId;
int vendorId;
String allowRoute;
String type;
int star;
List<CategoryByProductId> categoryByProductId;
List<Null> ratings;
int storeProductId;
String typeRateService;
String priceRateService;
int productId;
int storeId;
String storeCode;
String storeName;
String location;
int storeStatus;
int vendorStatus;
String latitude;
String longitude;
Null popular;
Data(
{this.id,
this.urlCode,
this.name,
this.cover,
this.excerpt,
this.detail,
this.price,
this.specialPrice,
this.sku,
this.tax,
this.quantity,
this.weight,
this.visibility,
this.newsFromDate,
this.newsToDate,
this.layout,
this.theme,
this.duration,
this.sellingStartTime,
this.sellingEndTime,
this.redemptionStartTime,
this.redemptionEndTime,
this.availibility,
this.isFeatured,
this.isDeal,
this.hasTeam,
this.offpeak,
this.reviewStatus,
this.relatedStatus,
this.upSellsStatus,
this.crossSellsStatus,
this.allowGiftMessage,
this.stockStatus,
this.status,
this.businessTypeId,
this.businessCateId,
this.businessServiceId,
this.attributeSetId,
this.vendorId,
this.allowRoute,
this.type,
this.star,
this.categoryByProductId,
this.ratings,
this.storeProductId,
this.typeRateService,
this.priceRateService,
this.productId,
this.storeId,
this.storeCode,
this.storeName,
this.location,
this.storeStatus,
this.vendorStatus,
this.latitude,
this.longitude,
this.popular});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
urlCode = json['url_code'];
name = json['name'];
cover = json['cover'];
excerpt = json['excerpt'];
detail = json['detail'];
price = json['price'];
specialPrice = json['special_price'];
sku = json['sku'];
tax = json['tax'];
quantity = json['quantity'];
weight = json['weight'];
visibility = json['visibility'];
newsFromDate = json['news_from_date'];
newsToDate = json['news_to_date'];
layout = json['layout'];
theme = json['theme'];
duration = json['duration'];
sellingStartTime = json['selling_start_time'];
sellingEndTime = json['selling_end_time'];
redemptionStartTime = json['redemption_start_time'];
redemptionEndTime = json['redemption_end_time'];
availibility = json['availibility'];
isFeatured = json['is_featured'];
isDeal = json['is_deal'];
hasTeam = json['has_team'];
offpeak = json['offpeak'];
reviewStatus = json['review_status'];
relatedStatus = json['related_status'];
upSellsStatus = json['up_sells_status'];
crossSellsStatus = json['cross_sells_status'];
allowGiftMessage = json['allow_gift_message'];
stockStatus = json['stock_status'];
status = json['status'];
businessTypeId = json['business_type_id'];
businessCateId = json['business_cate_id'];
businessServiceId = json['business_service_id'];
attributeSetId = json['attribute_set_id'];
vendorId = json['vendor_id'];
allowRoute = json['allow_route'];
type = json['type'];
star = json['star'];
if (json['category_by_product_id'] != null) {
categoryByProductId = new List<CategoryByProductId>();
json['category_by_product_id'].forEach((v) {
categoryByProductId.add(new CategoryByProductId.fromJson(v));
});
}
storeProductId = json['store_product_id'];
typeRateService = json['type_rate_service'];
priceRateService = json['price_rate_service'];
productId = json['product_id'];
storeId = json['store_id'];
storeCode = json['store_code'];
storeName = json['store_name'];
location = json['location'];
storeStatus = json['store_status'];
vendorStatus = json['vendor_status'];
latitude = json['latitude'];
longitude = json['longitude'];
popular = json['popular'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['url_code'] = this.urlCode;
data['name'] = this.name;
data['cover'] = this.cover;
data['excerpt'] = this.excerpt;
data['detail'] = this.detail;
data['price'] = this.price;
data['special_price'] = this.specialPrice;
data['sku'] = this.sku;
data['tax'] = this.tax;
data['quantity'] = this.quantity;
data['weight'] = this.weight;
data['visibility'] = this.visibility;
data['news_from_date'] = this.newsFromDate;
data['news_to_date'] = this.newsToDate;
data['layout'] = this.layout;
data['theme'] = this.theme;
data['duration'] = this.duration;
data['selling_start_time'] = this.sellingStartTime;
data['selling_end_time'] = this.sellingEndTime;
data['redemption_start_time'] = this.redemptionStartTime;
data['redemption_end_time'] = this.redemptionEndTime;
data['availibility'] = this.availibility;
data['is_featured'] = this.isFeatured;
data['is_deal'] = this.isDeal;
data['has_team'] = this.hasTeam;
data['offpeak'] = this.offpeak;
data['review_status'] = this.reviewStatus;
data['related_status'] = this.relatedStatus;
data['up_sells_status'] = this.upSellsStatus;
data['cross_sells_status'] = this.crossSellsStatus;
data['allow_gift_message'] = this.allowGiftMessage;
data['stock_status'] = this.stockStatus;
data['status'] = this.status;
data['business_type_id'] = this.businessTypeId;
data['business_cate_id'] = this.businessCateId;
data['business_service_id'] = this.businessServiceId;
data['attribute_set_id'] = this.attributeSetId;
data['vendor_id'] = this.vendorId;
data['allow_route'] = this.allowRoute;
data['type'] = this.type;
data['star'] = this.star;
if (this.categoryByProductId != null) {
data['category_by_product_id'] =
this.categoryByProductId.map((v) => v.toJson()).toList();
}
data['store_product_id'] = this.storeProductId;
data['type_rate_service'] = this.typeRateService;
data['price_rate_service'] = this.priceRateService;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['store_code'] = this.storeCode;
data['store_name'] = this.storeName;
data['location'] = this.location;
data['store_status'] = this.storeStatus;
data['vendor_status'] = this.vendorStatus;
data['latitude'] = this.latitude;
data['longitude'] = this.longitude;
data['popular'] = this.popular;
return data;
}
}
class CategoryByProductId {
int id;
int parentId;
String name;
String code;
String displayName;
String cover;
String detail;
Null type;
String status;
int sortOrder;
int storeId;
int vendorId;
Null createdAt;
String updatedAt;
String visibility;
Pivot pivot;
CategoryByProductId(
{this.id,
this.parentId,
this.name,
this.code,
this.displayName,
this.cover,
this.detail,
this.type,
this.status,
this.sortOrder,
this.storeId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.visibility,
this.pivot});
CategoryByProductId.fromJson(Map<String, dynamic> json) {
id = json['id'];
parentId = json['parent_id'];
name = json['name'];
code = json['code'];
displayName = json['display_name'];
cover = json['cover'];
detail = json['detail'];
type = json['type'];
status = json['status'];
sortOrder = json['sort_order'];
storeId = json['store_id'];
vendorId = json['vendor_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
visibility = json['visibility'];
pivot = json['pivot'] != null ? new Pivot.fromJson(json['pivot']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['parent_id'] = this.parentId;
data['name'] = this.name;
data['code'] = this.code;
data['display_name'] = this.displayName;
data['cover'] = this.cover;
data['detail'] = this.detail;
data['type'] = this.type;
data['status'] = this.status;
data['sort_order'] = this.sortOrder;
data['store_id'] = this.storeId;
data['vendor_id'] = this.vendorId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['visibility'] = this.visibility;
if (this.pivot != null) {
data['pivot'] = this.pivot.toJson();
}
return data;
}
}
class Pivot {
int productId;
int categoryId;
String createdAt;
String updatedAt;
Pivot({this.productId, this.categoryId, this.createdAt, this.updatedAt});
Pivot.fromJson(Map<String, dynamic> json) {
productId = json['product_id'];
categoryId = json['category_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['product_id'] = this.productId;
data['category_id'] = this.categoryId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
return data;
}
}
...@@ -16,6 +16,7 @@ import 'package:feelverapp/model/register/register_model.dart'; ...@@ -16,6 +16,7 @@ import 'package:feelverapp/model/register/register_model.dart';
import 'package:feelverapp/model/category/category_model.dart'; import 'package:feelverapp/model/category/category_model.dart';
import 'package:feelverapp/model/shoplist/shoplist_Model.dart'; import 'package:feelverapp/model/shoplist/shoplist_Model.dart';
import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'; 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 'package:http/http.dart' as http;
class Api<T> { class Api<T> {
...@@ -26,6 +27,28 @@ class Api<T> { ...@@ -26,6 +27,28 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs",
}; };
Future<Response<T>> shopservice(Object body) async {
var _model;
var _fail;
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)
.then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){
_model = shopserviceModel.fromJson(json.decode(response.body));
}else{
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
});
return result;
}
Future<Response<T>> homesearch(Object body) async { Future<Response<T>> homesearch(Object body) async {
var _model; var _model;
var _fail; var _fail;
......
...@@ -35,7 +35,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin { ...@@ -35,7 +35,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
// presenter.getid(); // presenter.getid();
presenter.getprofile(); presenter.getprofile();
presenter.getSearch(widget.search); presenter.getSearch();
} }
@override @override
...@@ -294,17 +294,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin { ...@@ -294,17 +294,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill, fit: BoxFit.fill,
) )
: Image.network( : Image.network(
presenter.CatModel.dATA[0].cover, presenter.CatModel.dATA[index].cover,
height: SizeConfig.getWidth(130), height: SizeConfig.getWidth(130),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
fit: BoxFit.fill, fit: BoxFit.cover,
), ),
presenter.CatModel.dATA[index].name, presenter.CatModel.dATA[index].name,
'', '',
ShopList(), ShopList(),
), ),
SizedBox( SizedBox(
height: 30, height: 20,
), ),
], ],
), ),
...@@ -340,7 +340,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin { ...@@ -340,7 +340,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: SizeConfig.getFontSize(30), fontSize: SizeConfig.getFontSize(30),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
...@@ -384,10 +384,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin { ...@@ -384,10 +384,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
), ),
prefixIcon: IconButton( prefixIcon: IconButton(
onPressed: () { onPressed: () {
Navigator.push( presenter.getSearch();
context,
MaterialPageRoute(builder: (context) => ShopList()),
);
}, },
icon: Icon(Icons.search, color: Colors.grey)), icon: Icon(Icons.search, color: Colors.grey)),
filled: true, filled: true,
......
...@@ -47,7 +47,7 @@ class HomePresenter extends BasePresenter<HomePage> { ...@@ -47,7 +47,7 @@ class HomePresenter extends BasePresenter<HomePage> {
} }
} }
getSearch(String search) async{ getSearch() async{
_api = Api<SearchhomeModel>(); _api = Api<SearchhomeModel>();
var res = await _api.homesearch({ var res = await _api.homesearch({
"keyword_shop" : searchCtrl.text, "keyword_shop" : searchCtrl.text,
......
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/material.dart'; import 'package:flutter/material.dart';
...@@ -7,30 +8,53 @@ class ShopServicePage extends StatefulWidget { ...@@ -7,30 +8,53 @@ class ShopServicePage extends StatefulWidget {
_ShopServicePageState createState() => _ShopServicePageState(); _ShopServicePageState createState() => _ShopServicePageState();
} }
class _ShopServicePageState extends State<ShopServicePage> { class _ShopServicePageState extends State<ShopServicePage>
with TickerProviderStateMixin {
double rate1 = 0; double rate1 = 0;
double rate2 = 0;
double rate3 = 0; ShopServicePresenter presenter;
double rate4 = 0;
double rate5 = 0; @override
void initState() {
super.initState();
presenter = ShopServicePresenter(this);
presenter.Servicelistitem();
}
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
return Container( return Container(
child: ListView( child: presenter.serviceModel == null
children: <Widget>[ ? Container()
Card1(), : ListView.builder(
Card2(), itemCount: presenter.serviceModel.data.length,
Card3(), itemBuilder: (context, i) {
Card4(), return myCard(
Card5(), presenter.serviceModel.data[i].name,
], presenter.serviceModel.data[i].cover,
), presenter.serviceModel.data[i].price,
); presenter.serviceModel.data[i].duration,
presenter.serviceModel.data[i].specialPrice == null ? "" : presenter.serviceModel.data[i].specialPrice,
);
})
// ListView(
// children: <Widget>[
// myCard();
//
// ],
// ),
);
} }
Widget Card1() { Widget myCard(String title, String image, String price, String time, String special_price) {
return Card( return Card(
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: SizeConfig.getPadding(16), right: SizeConfig.getPadding(16),
...@@ -38,6 +62,7 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -38,6 +62,7 @@ class _ShopServicePageState extends State<ShopServicePage> {
top: SizeConfig.getPadding(10), top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)), bottom: SizeConfig.getPadding(10)),
child: Container( child: Container(
// color: Colors.red,
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20), margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey, // color: Colors.blueGrey,
child: Column( child: Column(
...@@ -48,19 +73,23 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -48,19 +73,23 @@ class _ShopServicePageState extends State<ShopServicePage> {
flex: 3, flex: 3,
child: Container( child: Container(
// color: Colors.blue, // color: Colors.blue,
height: SizeConfig.getHeight(250), height: SizeConfig.getHeight(250),
child: Image.asset( child: presenter.serviceModel == null
"assets/images/demo_img.png", ? Image.asset(
fit: BoxFit.cover, "assets/images/demo_img.png",
), fit: BoxFit.cover,
), )
: Image.network(
image,
fit: BoxFit.cover,
)),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.only(left: 15), margin: EdgeInsets.only(left: 15),
// color: Colors.yellow, // color: Colors.yellow,
height: SizeConfig.getHeight(250), height: SizeConfig.getHeight(260),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
...@@ -71,7 +100,7 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -71,7 +100,7 @@ class _ShopServicePageState extends State<ShopServicePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
"Thai Body Balance", title,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: SizeConfig.getFontSize(18), fontSize: SizeConfig.getFontSize(18),
...@@ -133,7 +162,7 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -133,7 +162,7 @@ class _ShopServicePageState extends State<ShopServicePage> {
width: 5, width: 5,
), ),
Text( Text(
"150 Min", time,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: SizeConfig.getFontSize(13), fontSize: SizeConfig.getFontSize(13),
...@@ -149,7 +178,7 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -149,7 +178,7 @@ class _ShopServicePageState extends State<ShopServicePage> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Text( Text(
"฿599.0", special_price,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.getFontSize(12), fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
...@@ -159,7 +188,7 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -159,7 +188,7 @@ class _ShopServicePageState extends State<ShopServicePage> {
width: 15, width: 15,
), ),
Text( Text(
"฿199.00", "฿" + price,
style: TextStyle( style: TextStyle(
color: Colors.red, color: Colors.red,
fontSize: SizeConfig.getFontSize(18), fontSize: SizeConfig.getFontSize(18),
...@@ -203,700 +232,4 @@ class _ShopServicePageState extends State<ShopServicePage> { ...@@ -203,700 +232,4 @@ class _ShopServicePageState extends State<ShopServicePage> {
), ),
); );
} }
Widget Card2() {
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(250),
child: Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(250),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Thai Body Balance",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
height: 5,
),
Text(
"SPA Cenvaree @ Centara Grand CentralWorld Bangkok",
style: TextStyle(
color: Color(0xff969696),
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
),
Container(
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.topLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pin_drop.png',
height: 20,
width: 20,
),
SizedBox(
width: 5,
),
Text(
"พญาไท กรุงเทพฯ",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.access_time,
color: Color(0xffEEAFB7),
),
SizedBox(
width: 5,
),
Text(
"150 Min",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
"฿599.0",
style: TextStyle(
fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough,
),
),
SizedBox(
width: 15,
),
Text(
"฿199.00",
style: TextStyle(
color: Colors.red,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingStar(
isRating: true,
rate: rate2,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate2 = i;
print(i);
});
},
),
],
),
),
],
),
),
],
),
),
),
],
),
],
),
),
);
}
Widget Card3() {
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(250),
child: Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(250),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Thai Body Balance",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
height: 5,
),
Text(
"SPA Cenvaree @ Centara Grand CentralWorld Bangkok",
style: TextStyle(
color: Color(0xff969696),
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
),
Container(
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.topLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pin_drop.png',
height: 20,
width: 20,
),
SizedBox(
width: 5,
),
Text(
"พญาไท กรุงเทพฯ",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.access_time,
color: Color(0xffEEAFB7),
),
SizedBox(
width: 5,
),
Text(
"150 Min",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
"฿599.0",
style: TextStyle(
fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough,
),
),
SizedBox(
width: 15,
),
Text(
"฿199.00",
style: TextStyle(
color: Colors.red,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingStar(
isRating: true,
rate: rate3,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate3 = i;
print(i);
});
},
),
],
),
),
],
),
),
],
),
),
),
],
),
],
),
),
);
}
Widget Card4() {
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(250),
child: Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(250),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Thai Body Balance",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
height: 5,
),
Text(
"SPA Cenvaree @ Centara Grand CentralWorld Bangkok",
style: TextStyle(
color: Color(0xff969696),
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
),
Container(
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.topLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pin_drop.png',
height: 20,
width: 20,
),
SizedBox(
width: 5,
),
Text(
"พญาไท กรุงเทพฯ",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.access_time,
color: Color(0xffEEAFB7),
),
SizedBox(
width: 5,
),
Text(
"150 Min",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
"฿599.0",
style: TextStyle(
fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough,
),
),
SizedBox(
width: 15,
),
Text(
"฿199.00",
style: TextStyle(
color: Colors.red,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingStar(
isRating: true,
rate: rate4,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate4 = i;
print(i);
});
},
),
],
),
),
],
),
),
],
),
),
),
],
),
],
),
),
);
}
Widget Card5() {
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(250),
child: Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(250),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Thai Body Balance",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
height: 5,
),
Text(
"SPA Cenvaree @ Centara Grand CentralWorld Bangkok",
style: TextStyle(
color: Color(0xff969696),
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
),
Container(
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.topLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pin_drop.png',
height: 20,
width: 20,
),
SizedBox(
width: 5,
),
Text(
"พญาไท กรุงเทพฯ",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.access_time,
color: Color(0xffEEAFB7),
),
SizedBox(
width: 5,
),
Text(
"150 Min",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),
),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
"฿599.0",
style: TextStyle(
fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough,
),
),
SizedBox(
width: 15,
),
Text(
"฿199.00",
style: TextStyle(
color: Colors.red,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingStar(
isRating: true,
rate: rate5,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate5 = i;
print(i);
});
},
),
],
),
),
],
),
),
],
),
),
),
],
),
],
),
),
);
}
} }
import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/shop/shop_service.dart';
import 'package:flutter/material.dart';
class ShopServicePresenter extends BasePresenter<ShopServicePage> {
Api _api;
final formkey = GlobalKey<FormState>();
shopserviceModel serviceModel;
ShopServicePresenter(State<ShopServicePage> state) : super(state);
Servicelistitem() async {
_api = Api<shopserviceModel>();
var res = await _api.shopservice({
"vendor_id": "16",
"store_id": "406",
"is_paginate": "1",
"per_page": "8",
"v": "2",
});
if (res.fail == null) {
setState(() {
serviceModel = res.success;
print("sssssssssssss");
print('${serviceModel.data[0].name}');
});
} else {
print('res Fail');
}
}
}
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