no message

parent 75838f19
......@@ -2,9 +2,11 @@
import 'package:feelverapp/ui/account_setting/account_setting_page.dart';
import 'package:feelverapp/ui/booking/booking_detail.dart';
import 'package:feelverapp/ui/favorite/favorite.dart';
import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/ui/login/login.dart';
import 'package:feelverapp/ui/my_reviews/my_reviews_page.dart';
import 'package:feelverapp/ui/review_shop/review_shop_page.dart';
import 'package:feelverapp/ui/shop/shop_list.dart';
import 'package:feelverapp/ui/shop/shop_main.dart';
import 'package:feelverapp/ui/splashscreen/splash_screen_page.dart';
......
class FavoriteModel {
int id;
int customerId;
dynamic sharedStatus;
dynamic sharingCode;
String createdAt;
String updatedAt;
List<WishListItem> wishListItem;
FavoriteModel(
{this.id,
this.customerId,
this.sharedStatus,
this.sharingCode,
this.createdAt,
this.updatedAt,
this.wishListItem});
FavoriteModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
customerId = json['customer_id'];
sharedStatus = json['shared_status'];
sharingCode = json['sharing_code'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
if (json['wish_list_item'] != null) {
wishListItem = new List<WishListItem>();
json['wish_list_item'].forEach((v) {
wishListItem.add(new WishListItem.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['customer_id'] = this.customerId;
data['shared_status'] = this.sharedStatus;
data['sharing_code'] = this.sharingCode;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
if (this.wishListItem != null) {
data['wish_list_item'] =
this.wishListItem.map((v) => v.toJson()).toList();
}
return data;
}
}
class WishListItem {
int id;
String detail;
int productId;
int qty;
int wishlistId;
int storeId;
int vendorId;
String createdAt;
String updatedAt;
Product product;
Store store;
WishListItem(
{this.id,
this.detail,
this.productId,
this.qty,
this.wishlistId,
this.storeId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.product,
this.store});
WishListItem.fromJson(Map<String, dynamic> json) {
id = json['id'];
detail = json['detail'];
productId = json['product_id'];
qty = json['qty'];
wishlistId = json['wishlist_id'];
storeId = json['store_id'];
vendorId = json['vendor_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
product =
json['product'] != null ? new Product.fromJson(json['product']) : null;
store = json['store'] != null ? new Store.fromJson(json['store']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['detail'] = this.detail;
data['product_id'] = this.productId;
data['qty'] = this.qty;
data['wishlist_id'] = this.wishlistId;
data['store_id'] = this.storeId;
data['vendor_id'] = this.vendorId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
if (this.product != null) {
data['product'] = this.product.toJson();
}
if (this.store != null) {
data['store'] = this.store.toJson();
}
return data;
}
}
class Product {
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;
String status;
int businessTypeId;
int businessCateId;
dynamic businessServiceId;
int attributeSetId;
int vendorId;
String allowRoute;
dynamic type;
int star;
List<Null> ratings;
Product(
{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.ratings});
Product.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'];
}
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;
return data;
}
}
class Store {
int id;
String storeCode;
String storeName;
String storeCover;
String displayCover;
String isActive;
int storeOrder;
int customerGroupId;
int vendorId;
dynamic createdAt;
String updatedAt;
String location;
String email;
String phone;
String mobile;
String address;
String city;
String country;
String zipCode;
String website;
String allowRoute;
String excerpt;
String detail;
String storeLogo;
String isFacilities;
String distanceWithLocation;
int star;
dynamic ratings;
Store(
{this.id,
this.storeCode,
this.storeName,
this.storeCover,
this.displayCover,
this.isActive,
this.storeOrder,
this.customerGroupId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.location,
this.email,
this.phone,
this.mobile,
this.address,
this.city,
this.country,
this.zipCode,
this.website,
this.allowRoute,
this.excerpt,
this.detail,
this.storeLogo,
this.isFacilities,
this.distanceWithLocation,
this.star,
this.ratings});
Store.fromJson(Map<String, dynamic> json) {
id = json['id'];
storeCode = json['store_code'];
storeName = json['store_name'];
storeCover = json['store_cover'];
displayCover = json['display_cover'];
isActive = json['is_active'];
storeOrder = json['store_order'];
customerGroupId = json['customer_group_id'];
vendorId = json['vendor_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
location = json['location'];
email = json['email'];
phone = json['phone'];
mobile = json['mobile'];
address = json['address'];
city = json['city'];
country = json['country'];
zipCode = json['zip_code'];
website = json['website'];
allowRoute = json['allow_route'];
excerpt = json['excerpt'];
detail = json['detail'];
storeLogo = json['store_logo'];
isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location'];
star = json['star'];
ratings = json['ratings'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['store_code'] = this.storeCode;
data['store_name'] = this.storeName;
data['store_cover'] = this.storeCover;
data['display_cover'] = this.displayCover;
data['is_active'] = this.isActive;
data['store_order'] = this.storeOrder;
data['customer_group_id'] = this.customerGroupId;
data['vendor_id'] = this.vendorId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['location'] = this.location;
data['email'] = this.email;
data['phone'] = this.phone;
data['mobile'] = this.mobile;
data['address'] = this.address;
data['city'] = this.city;
data['country'] = this.country;
data['zip_code'] = this.zipCode;
data['website'] = this.website;
data['allow_route'] = this.allowRoute;
data['excerpt'] = this.excerpt;
data['detail'] = this.detail;
data['store_logo'] = this.storeLogo;
data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star;
data['ratings'] = this.ratings;
return data;
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/base/base.dart';
import 'package:feelverapp/model/editprofile/getprofilemodel.dart';
import 'package:feelverapp/model/favorite/favorite_Model.dart';
import 'package:feelverapp/model/forgetpassword/forgetpassModel.dart';
......@@ -29,6 +30,26 @@ class Api<T> {
};
Future<Response<T>> favorite(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}/wish-list/listByCustomer", this._headerApi, body)
.then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){
_model = FavoriteModel.fromJson(json.decode(response.body));
}else{
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response(_model, _fail);
});
return result;
}
Future<Response<T>> shopservice(Object body) async {
var _model;
var _fail;
......
import 'package:feelverapp/ui/favorite/favorite_presenter.dart';
import 'package:feelverapp/ui/menu/menu.dart';
import 'package:feelverapp/ui/my_order_status/my_order_status.dart';
import 'package:feelverapp/util/SizeConfig.dart';
......@@ -8,10 +9,24 @@ class Favorite extends StatefulWidget {
_FavoriteState createState() => _FavoriteState();
}
class _FavoriteState extends State<Favorite> {
class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
bool checkBoxValue = false;
int a = 1;
int b = 1;
FavoritePresenter presenter;
@override
void initState() {
super.initState();
presenter = FavoritePresenter(this);
presenter.Favoriteitem();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
......@@ -20,44 +35,8 @@ class _FavoriteState extends State<Favorite> {
body: _setupView(),
bottomNavigationBar: Container(
color: Color.fromRGBO(69, 85, 79, 1),
height: SizeConfig.getHeight(120),
child: Column(
children: <Widget>[
Container(
child: Padding(
padding: const EdgeInsets.only(top: 20),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => MyOrderStatus(),
// ),
// );
},
padding: EdgeInsets.only(
left: SizeConfig.getPadding(85),
right: SizeConfig.getPadding(85),
top: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(15),
),
color: Color(0xFF3694A3),
child: Text(
'เพิ่มลงในตระกร้าของฉัน',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
),
],
),
height: SizeConfig.getHeight(100),
),
);
}
......@@ -73,317 +52,149 @@ class _FavoriteState extends State<Favorite> {
Widget containt() {
return Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(
left: 10,
right: 10,
top: 16,
bottom: 8,
),
child: Container(
alignment: FractionalOffset.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
list1(),
Divider(
color: Colors.black,
height: 40,
),
list2(),
Divider(
color: Colors.black,
height: 40,
),
],
),
),
child: Padding(
padding: const EdgeInsets.only(
left: 10,
right: 10,
top: 10,
bottom: 10,
),
child: Container(
child: ListView.builder(
itemCount: 5,
itemBuilder: (context, i) {
return list();
}),
),
),
);
}
Widget list1() {
Widget list() {
return Container(
// color: Colors.red,
margin: EdgeInsets.only(bottom: 15),
height: SizeConfig.getHeight(150),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10),
child: Image.asset(
'assets/images/demo_img.png',
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(10),
right: SizeConfig.getPadding(5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
// color: Colors.blue,
child: Row(
children: <Widget>[
Text(
'Ivory Relax and Spa',
),
Spacer(),
Checkbox(
checkColor: Color(0xFFEEAFB7),
activeColor: Colors.white,
value: checkBoxValue,
onChanged: (bool value) {
setState(() {
print(value);
checkBoxValue = value;
});
}),
],
),
),
Container(
// color: Colors.white,
child: Text('นวดเเผนไทย'),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
// color: Colors.yellow,
child: Row(
children: <Widget>[
Image.asset(
'assets/images/clock.png',
height: SizeConfig.getHeight(20),
width: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(5),
),
Text('90 นาที'),
Spacer(),
Icon(
Icons.local_offer,
color: Color(0xFFEEAFB7),
),
Text(
'฿1,599.00',
style: TextStyle(
decoration: TextDecoration.lineThrough,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
color: Color(0xFFEEAFB7),
),
),
],
child: Container(
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10),
child: presenter.favoriteModel == null
? Image.asset(
'assets/images/demo_img.png',
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
)
: Image.network(
presenter.favoriteModel.wishListItem[0].product
.cover,
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
)),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(10),
right: SizeConfig.getPadding(5),
),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
// color: Colors.orangeAccent,
child: Row(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
width: SizeConfig.getPadding(20),
height: SizeConfig.getPadding(20),
child: RaisedButton(
child: Text('-'),
padding: EdgeInsets.only(right: 0),
onPressed: () {
setState(() {
a = a - 1;
});
},
),
),
Padding(
padding: const EdgeInsets.only(right: 8, left: 8),
child: Text('$a'),
),
SizedBox(
width: SizeConfig.getPadding(20),
height: SizeConfig.getPadding(20),
child: RaisedButton(
child: Text('+'),
padding: EdgeInsets.only(right: 0),
onPressed: () {
setState(() {
a = a + 1;
});
},
),
),
Spacer(),
Text(
'฿1,200.00',
style: TextStyle(
fontSize: SizeConfig.getFontSize(20),
color: Color(0xFFFD2956),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
),
],
),
);
}
Widget list2() {
return Container(
// color: Colors.red,
height: SizeConfig.getHeight(150),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10),
child: Image.asset(
'assets/images/demo_img.png',
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(10),
right: SizeConfig.getPadding(5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
Container(
// color: Colors.blue,
child: Row(
children: <Widget>[
Text(
'Ivory Relax and Spa',
child: Row(
children: <Widget>[
Text(
'Ivory Relax and Spa',
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(15)),
),
Spacer(),
IconButton(
icon: Icon(Icons.favorite),
color: Color(0xFFDD175F),
onPressed: () {
print('delete');
},
),
],
),
),
Spacer(),
Checkbox(
checkColor: Color(0xFFEEAFB7),
activeColor: Colors.white,
value: checkBoxValue,
onChanged: (bool value) {
setState(() {
print(value);
checkBoxValue = value;
});
}),
],
),
),
Container(
Container(
// color: Colors.white,
child: Text('นวดเเผนไทย'),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
// color: Colors.yellow,
child: Row(
children: <Widget>[
Image.asset(
'assets/images/clock.png',
height: SizeConfig.getHeight(20),
width: SizeConfig.getWidth(20),
child: Text('นวดเเผนไทย',
style: TextStyle(
color: Colors.black,
)),
),
SizedBox(
width: SizeConfig.getWidth(5),
height: SizeConfig.getHeight(5),
),
Text('90 นาที'),
Spacer(),
Icon(
Icons.local_offer,
color: Color(0xFFEEAFB7),
),
Text(
'฿1,599.00',
style: TextStyle(
decoration: TextDecoration.lineThrough,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
color: Color(0xFFEEAFB7),
),
),
],
),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
// color: Colors.orangeAccent,
child: Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getPadding(20),
height: SizeConfig.getPadding(20),
child: RaisedButton(
child: Text('-'),
padding: EdgeInsets.only(right: 0),
onPressed: () {
setState(() {
b = b - 1;
});
},
Container(
// color: Colors.yellow,
child: Row(
children: <Widget>[
Image.asset(
'assets/images/clock.png',
height: SizeConfig.getHeight(20),
width: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(5),
),
Text('90 นาที'),
Spacer(),
Icon(
Icons.local_offer,
color: Color(0xFFEEAFB7),
),
Text(
'฿1,599.00',
style: TextStyle(
decoration: TextDecoration.lineThrough,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
color: Color(0xFFEEAFB7),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(right: 8, left: 8),
child: Text('$b'),
),
SizedBox(
width: SizeConfig.getPadding(20),
height: SizeConfig.getPadding(20),
child: RaisedButton(
child: Text('+'),
padding: EdgeInsets.only(right: 0),
onPressed: () {
setState(() {
b = b + 1;
});
},
),
height: SizeConfig.getHeight(5),
),
Spacer(),
Text(
'฿1,200.00',
style: TextStyle(
fontSize: SizeConfig.getFontSize(20),
color: Color(0xFFFD2956),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.bold,
Container(
// color: Colors.orangeAccent,
child: Row(
children: <Widget>[
Spacer(),
Text(
'฿1,200.00',
style: TextStyle(
fontSize: SizeConfig.getFontSize(20),
color: Color(0xFFFD2956),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
],
),
),
],
),
),
],
],
),
),
);
}
......@@ -431,38 +242,6 @@ class _FavoriteState extends State<Favorite> {
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(60),
child: Container(
child: Image.asset(
'assets/images/ic_noti.png',
height: SizeConfig.getWidth(30),
width: SizeConfig.getWidth(30),
fit: BoxFit.cover,
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(20),
child: InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
// },
child: Container(
child: Image.asset(
'assets/images/ic_userimg.png',
height: SizeConfig.getWidth(30),
width: SizeConfig.getWidth(30),
fit: BoxFit.cover,
),
),
),
),
],
),
);
......
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:flutter/material.dart';
class FavoritePresenter extends BasePresenter<Favorite> {
Api _api;
final formkey = GlobalKey<FormState>();
FavoriteModel favoriteModel;
FavoritePresenter(State<Favorite> state) : super(state);
Favoriteitem() async {
_api = Api<FavoriteModel>();
var res = await _api.favorite({
"customer_id": "224",
});
if (res.fail == null) {
setState(() {
favoriteModel = res.success;
});
} else {
print('res Fail');
}
}
}
import 'package:feelverapp/ui/ForgetPassword/forgetpassword.dart';
import 'package:feelverapp/ui/edit_profile/edit_profile.dart';
import 'package:feelverapp/ui/favorite/favorite.dart';
import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/ui/login/login.dart';
import 'package:feelverapp/ui/login/login_presenter.dart';
......@@ -125,7 +126,12 @@ class _NavDrawerState extends State<NavDrawer> with TickerProviderStateMixin {
),
),
GestureDetector(
onTap: () {},
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => Favorite()),
);
},
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(12),
......
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:feelverapp/util/rating_star.dart';
import 'package:flutter/material.dart';
class ReviewShopPage extends StatefulWidget {
@override
_ReviewShopPageState createState() => _ReviewShopPageState();
}
class _ReviewShopPageState extends State<ReviewShopPage> {
double rate1 = 0;
@override
Widget build(BuildContext context) {
SizeConfig(context);
return Scaffold(
appBar: AppBar(
backgroundColor: Color.fromRGBO(69, 85, 79, 1),
elevation: 0,
centerTitle: true,
title: Text(
'ชื่อร้านค้า',
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(20),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
body: _setupView(),
);
}
_setupView() {
return Container(
child: Column(
children: <Widget>[
texttop(),
containt(),
],
),
);
}
Widget texttop(){
return Container(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(5),
bottom: SizeConfig.getPadding(10)),
child: Row(
children: <Widget>[
Text(
'รีวิว(จากผู้ใช้บริการจริง)',
style: TextStyle(
color: Color(0xFF6AB3AA),
fontSize: SizeConfig.getFontSize(14),
),
),
Spacer(),
],
),
);
}
Widget containt(){
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(20),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(15),
left: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(20),
),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Container(
// color: Colors.green,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'4.4',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Color(0xFFD5D5D5),
),
),
SizedBox(
width: SizeConfig.getWidth(8),
),
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
SizedBox(
width: SizeConfig.getWidth(8),
),
Text(
'(221)',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Color(0xFFD5D5D5),
),
),
],
),
SizedBox(
height: SizeConfig.getHeight(35),
),
Row(
children: <Widget>[
Text(
'คุ้มค่า',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Colors.black),
),
Spacer(),
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
],
),
SizedBox(
height: SizeConfig.getHeight(15),
),
Row(
children: <Widget>[
Text(
'บรรยากาศดี',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Colors.black),
),
Spacer(),
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
],
),
SizedBox(
height: SizeConfig.getHeight(15),
),
Row(
children: <Widget>[
Text(
'บริการเยี่ยม',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Colors.black),
),
Spacer(),
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
],
),
SizedBox(
height: SizeConfig.getHeight(15),
),
Row(
children: <Widget>[
Text(
'สะอาด',
style: TextStyle(
fontSize: SizeConfig.getFontSize(16),
color: Colors.black),
),
Spacer(),
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
],
),
SizedBox(
height: SizeConfig.getHeight(15),
),
],
),
),
Divider(
color: Color(0xFF606060),
),
Container(
color: Colors.deepPurpleAccent,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.asset(
'assets/images/ic_userimg.png',
width: 55.0,
height: 55.0,
fit: BoxFit.cover,
),
),
SizedBox(
width: SizeConfig.getWidth(10),
),
Expanded(
child: Container(
color: Colors.green,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SingleChildScrollView(
child: Row(
children: <Widget>[
Text(
'Rattaya Pratumkan',
style: TextStyle(
fontSize: SizeConfig.getFontSize(20),
color: Colors.black),
),
Spacer(),
Container(
child: Icon(Icons.more_vert),
)
],
),
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Container(
// color: Colors.blue,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingStar(
isRating: true,
rate: rate1,
starSize: 20,
onChangeRate: (i) {
setState(() {
rate1 = i;
print(i);
});
},
),
],
),
),
],
),
),
),
],
),
),
Container(
color: Colors.blue,
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(
top: 10, bottom: 10, left: 2, right: 2),
child: Text(
'การบริการและบรรยากาศดีมาก มีห้องอาบน้ำพร้อมผ้าเช็ดตัว สบู่ ครีมสระผม พนักงานดูแลเอาใจใส่ และคอยแนะนำตลอดจนถึง therapist มีความเป็นมืออาชีพให้ความผ่อนคลายแก่ลูกค้า',
style: TextStyle(
fontSize: SizeConfig.getFontSize(12),
),
),
),
Row(
children: <Widget>[
RaisedButton(
color: Color(0xFF3694A3),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
onPressed: () {},
child: Text(
"บริการดีมาก",
style: TextStyle(
color: Colors.white,
),
),
),
SizedBox(
width: SizeConfig.getWidth(14),
),
RaisedButton(
color: Color(0xFF3694A3),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
onPressed: () {},
child: Padding(
padding: const EdgeInsets.only(
right: 10,
left: 10,
),
child: Text(
"คุ้มค่าดี",
style: TextStyle(
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: SizeConfig.getHeight(10),
),
],
),
),
],
),
),
);
}
}
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
......@@ -64,13 +78,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.8"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
file:
dependency: transitive
description:
......@@ -135,6 +142,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
image_cropper:
dependency: "direct main"
description:
......@@ -219,6 +233,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
dependency: transitive
description:
......@@ -254,6 +275,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
rflutter_alert:
dependency: "direct main"
description:
......@@ -399,6 +427,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
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