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(
......
import 'package:feelverapp/model/category/category_model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/ui/home/home_presenter.dart';
import 'package:feelverapp/ui/login/login.dart';
import 'package:feelverapp/ui/menu/menu.dart';
......@@ -24,7 +26,7 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
bool search=false;
TabController _tabController;
HomePresenter presenter;
......@@ -36,10 +38,11 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter.Listitem();
// presenter.getid();
// presenter.getprofile();
presenter.getprofile();
//print("nenwenwenwew"+presenter.CatModel.dATA[0].cover,);
// presenter.getSearch();
// presenter.getSearch();
}
@override
......@@ -53,7 +56,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
SizeConfig(context);
return Scaffold(
return
Scaffold(
body: _setupView(),
bottomNavigationBar: Container(
color: Color.fromRGBO(69, 85, 79, 1),
......@@ -186,7 +191,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
}
_setupView() {
return Column(
return Column(
children: <Widget>[
Stack(
children: <Widget>[
......@@ -264,13 +270,48 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(20),
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginPage()),
);
},
child: presenter.getmodel == null
? Container()
: Container(
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(SizeConfig.getWidth(56))),
child: Image.network(
presenter.getmodel.result[0].image,
fit: BoxFit.contain,
width: SizeConfig.getWidth(30),
height: SizeConfig.getWidth(30),
),
),
),
),
),
_searchField(),
],
),
Expanded(
),SizedBox(height: 20,),
presenter.CatModel==null? Container(
child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
),
): search?_getlist():Expanded(
child: Container(
child: presenter.CatModel == null ? Container() : ListView.builder(
itemCount: presenter.CatModel.dATA[0].name.length,
child: ListView.builder(
itemCount: presenter.CatModel.result.length,
itemBuilder: (context, i) {
return list(i);
}),
......@@ -283,12 +324,12 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
list(int index) {
return Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10),
),
//color: Colors.orange,
// padding: EdgeInsets.only(
// // top: SizeConfig.getPadding(16),
// // bottom: SizeConfig.getPadding(10),
// ),
child: Column(
children: <Widget>[
_listItem(
......@@ -300,12 +341,12 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
)
: Image.network(
presenter.CatModel.dATA[index].cover,
height: SizeConfig.getWidth(130),
presenter.CatModel.result[index].cover,
height: SizeConfig.getHeight(130),
width: MediaQuery.of(context).size.width,
fit: BoxFit.cover,
),
presenter.CatModel.dATA[index].name,
presenter.CatModel.result[index].name,
'',
ShopList(),
),
......@@ -317,19 +358,167 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
);
}
Widget _shopItem(String title, String image, String address, String detail) {
return Card(
child: Column(
children: <Widget>[
Container(
height: SizeConfig.getHeight(270),
child: Stack(
children: <Widget>[
presenter.searchhomeModel == null
? Image.network(
'https://image.freepik.com/free-photo/girl-massage-spa-salon_110955-422.jpg',
height: SizeConfig.getWidth(180),
width: MediaQuery.of(context).size.width,
fit: BoxFit.cover,
)
: Image.network(
"https://backend-uat.feelver.com/storage/"+ image,
height: SizeConfig.getWidth(180),
width: MediaQuery.of(context).size.width,
fit: BoxFit.cover,
),
Positioned(
right: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(16),
child: ImageIcon(
AssetImage('assets/images/ic_fav_list.png'),
color: Colors.white,
size: SizeConfig.getFontSize(30),
),
),
Positioned(
left: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(165),
child: Image.asset(
'assets/images/pin_list.png',
width: SizeConfig.getWidth(50),
height: SizeConfig.getWidth(50),
),
),
Positioned(
left: SizeConfig.getPadding(75),
top: SizeConfig.getPadding(190),
child: Text(
title,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
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),
),
),
],
),
),
Container(
padding: EdgeInsets.only(
bottom:SizeConfig.getPadding(14),
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)),
alignment: Alignment.topLeft,
child: presenter.searchhomeModel == null
? Text(
"",
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
)
: Text(
address,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(10),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
SizedBox(height: 10,)
],
),
);
}
_getlist() {
return Expanded(
child: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(16),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10),
),
child: presenter.searchhomeModel == null
? Container()
: ListView.builder(
itemCount: presenter.searchhomeModel.thTH[0].storeCode.length,
itemBuilder: (context, i) {
// new RaisedButton(
// child: new Text(
// 'Load more ...',
// style: new TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.bold,
// ),
// ),
// onPressed: () {
// var nextItems = new List<String>.generate(2, (i) {
// var itemId = i + presenter.shopModel.dATA[i].storeName.length;
// return "Item $itemId";
// });
// setState(() {
// entries.addAll(nextItems);
// });
// });
return _shopItem(
presenter.searchhomeModel.thTH[i].storeName,
presenter.searchhomeModel.thTH[i].storeCover,
presenter.searchhomeModel.thTH[i].address,
presenter.searchhomeModel.thTH[i].detail == null ? "" : presenter.searchhomeModel.thTH[i].detail,);
}),
),
);
}
Widget _listItem(Image img, String title, String view, Widget page) {
return GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => page,
),
);
presenter.getSearch();
setState(() {
search=true;
});
},
child: Container(
margin: EdgeInsets.all(
SizeConfig.getPadding(24),
margin: EdgeInsets.only(
bottom: 8,
left: SizeConfig.getPadding(15),
right: SizeConfig.getPadding(15),
),
width: MediaQuery.of(context).size.width,
child: Stack(
......@@ -338,6 +527,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
width: MediaQuery.of(context).size.width,
child: img,
),
Container(
margin: const EdgeInsets.only(top: 10.0,left: 14),
height: SizeConfig.getHeight(110),
width:SizeConfig.getWidth(320),
decoration: BoxDecoration(
color: Colors.transparent,//remove color to make it transpatent
border: Border.all(
style: BorderStyle.solid,
width: 2,
color: Colors.white)),
),
Container(
alignment: Alignment.center,
padding: EdgeInsets.only(
......@@ -388,10 +588,22 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
const Radius.circular(30.0),
),
),
suffixIcon: IconButton(
onPressed: () {
presenter.searchCtrl.clear();
},
icon: Icon(Icons.clear, color: presenter.searchCtrl==null?Colors.transparent:Colors.black)),
prefixIcon: IconButton(
onPressed: () {
presenter.getSearch();
setState(() {
search=true;
print(search);
});
presenter.getSearch();
},
icon: Icon(Icons.search, color: Colors.grey)),
filled: true,
hintText: 'ค้นหาแบบละเอียด',
......
......@@ -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(),
],
),
);
}
}
......@@ -12,7 +12,8 @@ class ShopNearbyPlacesPage extends StatefulWidget {
_ShopNearbyPlacesPageState createState() => _ShopNearbyPlacesPageState();
}
final List<String> entries = <String>['A', 'B', 'C'];
final List<String> detail = <String>['SPA Cenvaree @ centara Grand Centralworld', 'SPA Cenvaree @ centara Grand Centralworld', 'SPA Cenvaree @ centara Grand Centralworld'];
final List<String> place = <String>['พญาไทย', 'บางเขน', 'เกษตร'];
class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerProviderStateMixin {
ShopNearByPlacePresenter presenter;
......@@ -162,6 +163,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
print("selected");
},
),
],
),
),
......@@ -182,7 +184,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
)))
: Container(
padding: EdgeInsets.only(
top: SizeConfig.getPadding(140),
top: SizeConfig.getPadding(80),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10),
......@@ -199,135 +201,145 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
presenter.getmodel.results.data[i].updatedAt,
presenter.getmodel.results.data[i].distanceWithLocation
.toString());
},
}
),
);
}
Widget _nearByItem(String title, String detail, String img, String address,
String latlng, String date_time, String distanceWithLocation) {
return InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => NearmeDetail(
store_name: title,
img_url: 'https://backend.feelver.com/storage/' + img,
detail: Util.removeHTMLTag('${detail}'),
address: address,
latlng: latlng,
date_time: date_time,
distanceWithLocation: distanceWithLocation + ' Km. ',
),
),
);
},
child: Card(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(16),
),
Expanded(
child: Image.network(
'https://backend.feelver.com/storage/' + img,
// width: SizeConfig.getWidth(50),
height: SizeConfig.getHeight(160),
fit: BoxFit.fitHeight,
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
return Card(
margin: EdgeInsets.only(
right: SizeConfig.getPadding(0),
left: SizeConfig.getPadding(0),
top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(10)),
child: Container(
// color: Colors.red,
margin: EdgeInsets.only(right: 15, left: 15, bottom: 20, top: 20),
// color: Colors.blueGrey,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
child: Text(
title,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
padding: EdgeInsets.only(
top: SizeConfig.getPadding(30),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(0)),
),
// Container(
// child: Text(
// '',
// textAlign: TextAlign.left,
// style: TextStyle(
// color: Colors.black54,
// fontSize: SizeConfig.getFontSize(12),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
//// alignment: Alignment.topLeft,
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(0),
// left: SizeConfig.getPadding(16),
// bottom: SizeConfig.getPadding(4)),
// ),
// SizedBox(
// height: 8,
// ),
Container(
child: Text(
Util.removeHTMLTag('${detail}'),
textAlign: TextAlign.left,
maxLines: 3,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
// alignment: Alignment.topLeft,
padding: EdgeInsets.only(
top: SizeConfig.getPadding(8),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(8),
bottom: SizeConfig.getPadding(8)),
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(250),
child: presenter.getmodel == null
? Image.asset(
"assets/images/demo_img.png",
fit: BoxFit.cover,
)
: Image.network(
'https://backend.feelver.com/storage/' + img,
fit: BoxFit.cover,
),),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(260),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
title,
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,
),
],
),
SizedBox(
height: 10,
),
SizedBox(
height: SizeConfig.getHeight(5),
),
Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(16),
),
ImageIcon(
AssetImage('assets/images/pin_drop.png'),
color: Colors.black54,
size: SizeConfig.getFontSize(16),
),
SizedBox(
width: SizeConfig.getWidth(4),
),
Text(
distanceWithLocation + ' Km.',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getFontSize(12),
color: Colors.black54,
),
),
],
),
SizedBox(
height: SizeConfig.getWidth(10),
],
),
),
],
),
),
),
],
),
),
],
],
),
),
),
);
);
}
}
......@@ -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