Commit 6bb31c96 by Mobile : Art

update

parents 15596b8b 17b588a0
......@@ -34,6 +34,8 @@ class MyApp extends StatelessWidget {
home: MainShop()
//home: EditProfile(),
);
......
class CategoryModel {
List<Result> result;
class categoryModel {
List<DATA> dATA;
CategoryModel({this.result});
categoryModel({this.dATA});
categoryModel.fromJson(Map<String, dynamic> json) {
if (json['DATA'] != null) {
dATA = new List<DATA>();
json['DATA'].forEach((v) {
dATA.add(new DATA.fromJson(v));
CategoryModel.fromJson(Map<String, dynamic> json) {
if (json['result'] != null) {
result = new List<Result>();
json['result'].forEach((v) {
result.add(new Result.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.dATA != null) {
data['DATA'] = this.dATA.map((v) => v.toJson()).toList();
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}
class DATA {
class Result {
int id;
int parentId;
String name;
......@@ -30,33 +31,34 @@ class DATA {
String displayName;
String cover;
String detail;
dynamic type;
Null type;
String status;
int sortOrder;
dynamic storeId;
dynamic vendorId;
dynamic createdAt;
Null storeId;
Null vendorId;
Null createdAt;
String updatedAt;
String visibility;
DATA(
Result(
{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.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});
DATA.fromJson(Map<String, dynamic> json) {
Result.fromJson(Map<String, dynamic> json) {
id = json['id'];
parentId = json['parent_id'];
name = json['name'];
......
......@@ -22,14 +22,14 @@ import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
import 'package:http/http.dart' as http;
class Api<T> {
final String _baseApi = "https://backend-uat.feelver.com/api";
final String _baseApi = "https://backend-uat.feelver.com/api";
final _headerApi = {
"Authorization":
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs",
};
static final String baseApi = "https://backend-uat.feelver.com/api";
Future<Response<T>> favorite(Object body) async {
var _model;
var _fail;
......@@ -44,7 +44,7 @@ class Api<T> {
}else{
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response(_model, _fail);
result = new Response<T>(_model, _fail);
});
return result;
}
......@@ -95,12 +95,12 @@ class Api<T> {
var _model;
var _fail;
var result;
print("this is body " + body.toString());
// print("this is body " + body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection(
"${this._baseApi}/customer/info", this._headerApi, body)
.then((response) {
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
// print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if (response.statusCode == 200) {
_model = GetprofileModel.fromJson(json.decode(response.body));
} else {
......@@ -220,21 +220,18 @@ class Api<T> {
return result;
}
Future<Response<T>> category(Object body) async {
Future<Response<T>> category(Object body) async {
var _model;
var _fail;
var result;
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/category", this._headerApi, body)
.then((response) {
print("ผลลัพท์ เท่ากับ55555 " "${response.body}");
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if (response.statusCode == 200) {
// Array to Map Json
Map<String, dynamic> myData = arrayToJson(response.body);
_model = categoryModel.fromJson(myData);
print('myModel ' + _model);
_model = CategoryModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
......@@ -243,6 +240,10 @@ class Api<T> {
return result;
}
Future<Response<T>> shoplist(Object body) async {
var _model;
var _fail;
......
......@@ -9,10 +9,9 @@ class Favorite extends StatefulWidget {
_FavoriteState createState() => _FavoriteState();
}
class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
class _FavoriteState extends State<Favorite> {
bool checkBoxValue = false;
FavoritePresenter presenter;
@override
......@@ -36,7 +35,6 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
bottomNavigationBar: Container(
color: Color.fromRGBO(69, 85, 79, 1),
height: SizeConfig.getHeight(100),
),
);
}
......@@ -60,17 +58,21 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
bottom: 10,
),
child: Container(
child: ListView.builder(
itemCount: 5,
child: presenter.favoriteModel == null
? Container()
: ListView.builder(
itemCount: presenter.favoriteModel.wishListItem.length,
itemBuilder: (context, i) {
return list();
return list(i);
}),
),
),
);
}
Widget list() {
Widget list(int index) {
return Container(
// color: Colors.red,
margin: EdgeInsets.only(bottom: 15),
......@@ -81,22 +83,19 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
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,
)),
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[index].product.cover,
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
),
Expanded(
child: Container(
padding: EdgeInsets.only(
......@@ -111,7 +110,7 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
child: Row(
children: <Widget>[
Text(
'Ivory Relax and Spa',
presenter.favoriteModel.wishListItem[index].product.name,
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(15)),
......@@ -132,7 +131,7 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
child: Text('นวดเเผนไทย',
style: TextStyle(
color: Colors.black,
)),
),),
),
SizedBox(
height: SizeConfig.getHeight(5),
......@@ -149,14 +148,14 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
SizedBox(
width: SizeConfig.getWidth(5),
),
Text('90 นาที'),
Text(presenter.favoriteModel.wishListItem[index].product.duration),
Spacer(),
Icon(
Icons.local_offer,
color: Color(0xFFEEAFB7),
),
Text(
'฿1,599.00',
"฿" + presenter.favoriteModel.wishListItem[index].product.specialPrice,
style: TextStyle(
decoration: TextDecoration.lineThrough,
fontSize: SizeConfig.getFontSize(16),
......@@ -176,7 +175,7 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
children: <Widget>[
Spacer(),
Text(
'฿1,200.00',
"฿" + presenter.favoriteModel.wishListItem[index].product.price,
style: TextStyle(
fontSize: SizeConfig.getFontSize(20),
color: Color(0xFFFD2956),
......@@ -193,12 +192,14 @@ class _FavoriteState extends State<Favorite> with TickerProviderStateMixin {
),
],
),
],
),
),
);
}
Widget header() {
return Container(
child: Stack(
......
......@@ -21,7 +21,7 @@ class HomePresenter extends BasePresenter<HomePage> {
GetprofileModel getmodel;
LoginModel logmodel;
categoryModel CatModel;
CategoryModel CatModel;
TextEditingController searchCtrl = TextEditingController();
SearchhomeModel searchhomeModel;
......@@ -29,19 +29,21 @@ class HomePresenter extends BasePresenter<HomePage> {
HomePresenter(State<HomePage> state) : super(state);
Listitem() async {
_api = Api<categoryModel>();
_api = Api<CategoryModel>();
var res = await _api.category({
"access_type": "portal",
"access_type": "mobile",
});
print("dddddddddddddddd");
if (res.fail == null){
// LoadingView(state.context).hide();
if (res.success != null){
setState(() {
CatModel = res.success;
print('${CatModel.dATA[0].name}');
});
} else {
......@@ -50,21 +52,24 @@ class HomePresenter extends BasePresenter<HomePage> {
}
getSearch() async{
LoadingView(state.context).show();
_api = Api<SearchhomeModel>();
var res = await _api.homesearch({
"keyword_shop" : searchCtrl.text,
"lang" : "all",
"access" : "portal",
});
print('$searchCtrl');
LoadingView(state.context).hide();
print('$searchCtrl');
if (res.fail == null) if (res.success.status) {
if (res.fail == null)
setState(() {
searchhomeModel = res.success;
category_model = res.success;
});
}else{
else{
}
......@@ -87,7 +92,7 @@ print('$searchCtrl');
setState(() {
getmodel = res.success;
});
print("Hii" + getmodel.result[0].name);
// print("Hii" + getmodel.result[0].name);
} else {
Alert(
style: AlertStyle(
......
......@@ -36,47 +36,39 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
child: Column(
children: <Widget>[
texttop(),
star(),
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 Expanded(
child: Container(
child: ListView.builder(
itemCount: 3,
itemBuilder: (context, i) {
return list();
}),
),
);
}
Widget containt(){
return Card(
Widget star() {
return Container(
// color: Colors.blue,
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(
// color: Colors.red,
padding: EdgeInsets.only(
right: SizeConfig.getPadding(15),
left: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10),
),
// color: Colors.blueGrey,
child: Column(
......@@ -229,9 +221,25 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
Divider(
color: Color(0xFF606060),
),
Container(
color: Colors.deepPurpleAccent,
child: Row(
],
),
),
);
}
Widget list() {
return Card(
child: Container(
// color: Colors.deepPurpleAccent,
margin: EdgeInsets.only(
right: SizeConfig.getPadding(20),
left: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10),
),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(50),
......@@ -247,7 +255,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
),
Expanded(
child: Container(
color: Colors.green,
// color: Colors.green,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
......@@ -295,70 +303,89 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
),
],
),
),
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,
),
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),
),
),
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,
),
Row(
children: <Widget>[
RaisedButton(
color: Color(0xFF3694A3),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
onPressed: () {},
child: Text(
"คุ้มค่าดี",
"บริการดีมาก",
style: TextStyle(
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: SizeConfig.getHeight(10),
),
],
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),
),
],
),
),
],
)),
);
}
Widget texttop() {
return Container(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(15),
bottom: SizeConfig.getPadding(5)),
child: Row(
children: <Widget>[
Text(
'รีวิว(จากผู้ใช้บริการจริง)',
style: TextStyle(
color: Color(0xFF6AB3AA),
fontSize: SizeConfig.getFontSize(14),
),
],
),
),
Spacer(),
],
),
);
}
}
......@@ -345,6 +345,24 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
fontWeight: FontWeight.w700),
),
),
Positioned(
left: SizeConfig.getPadding(280),
top: SizeConfig.getPadding(190),
child:Icon(Icons.star,color: Colors.orangeAccent,size: SizeConfig.getFontSize(18),),
),
Positioned(
left: SizeConfig.getPadding(300),
top: SizeConfig.getPadding(190),
child: Text(
"4.9",
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
),
],
),
),
......@@ -390,104 +408,8 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
fontWeight: FontWeight.w700),
),
),
Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(20),
),
Image.asset(
'assets/images/clock.png',
width: SizeConfig.getWidth(20),
height: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(10),
),
Text(
'90 นาที',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
width: SizeConfig.getWidth(30),
),
Image.asset(
'assets/images/sell.png',
width: SizeConfig.getWidth(20),
height: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(5),
),
Text(
'฿1,599.00 ',
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(238, 175, 183, 1),
fontSize: SizeConfig.getFontSize(12),
decoration: TextDecoration.lineThrough,
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
SizedBox(
width: SizeConfig.getWidth(5),
),
Text(
'฿1,599.00 ',
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(253, 41, 86, 1),
fontSize: SizeConfig.getFontSize(22),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
],
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ShopListDetail(),
),
);
},
child: Stack(
children: <Widget>[
Container(
child: Image.asset('assets/images/btn_shoplist.png'),
padding: EdgeInsets.only(
left: SizeConfig.getPadding(20),
right: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(20),
bottom: SizeConfig.getPadding(20),
),
),
Container(
alignment: Alignment.center,
child: Text(
'หยิบใส่รถเข็น',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(14),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
padding: EdgeInsets.only(
left: SizeConfig.getPadding(60),
right: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(30),
bottom: SizeConfig.getPadding(20),
),
)
],
),
)
],
),
);
......
......@@ -273,6 +273,7 @@ class _MainShopState extends State<MainShop>
},
),
],
),
),
Expanded(
......
......@@ -3,6 +3,8 @@ import 'package:feelverapp/util/SizeConfig.dart';
import 'package:feelverapp/util/rating_star.dart';
import 'package:flutter/material.dart';
import '../../service/api.dart';
class ShopServicePage extends StatefulWidget {
@override
_ShopServicePageState createState() => _ShopServicePageState();
......@@ -76,7 +78,7 @@ class _ShopServicePageState extends State<ShopServicePage>
: Image.network(
'https://backend.feelver.com/storage/' + image,
fit: BoxFit.cover,
)),
),),
),
Expanded(
flex: 5,
......
# 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:
......@@ -78,6 +64,13 @@ 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:
......@@ -142,13 +135,6 @@ 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:
......@@ -225,7 +211,7 @@ packages:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.3"
pedantic:
dependency: transitive
description:
......@@ -233,13 +219,6 @@ 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:
......@@ -275,13 +254,6 @@ 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:
......@@ -412,7 +384,7 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
version: "0.1.2+1"
vector_math:
dependency: transitive
description:
......@@ -427,13 +399,6 @@ 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