Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
feelver
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2F-ART
feelver
Commits
b27b01e9
Commit
b27b01e9
authored
Aug 21, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.2fellows.com/art/feelver
into develop
# Conflicts: # lib/main.dart # lib/service/api.dart
parents
e3282036
486f6e83
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1730 additions
and
638 deletions
+1730
-638
ios/Flutter/.last_build_id
+2
-2
lib/main.dart
+3
-1
lib/model/booking_detail/booking_detail_model.dart
+690
-0
lib/model/category/category_model.dart
+20
-17
lib/service/api.dart
+14
-9
lib/ui/booking/booking_detail.dart
+9
-23
lib/ui/home/home.dart
+287
-46
lib/ui/home/home_presenter.dart
+12
-8
lib/ui/nearme/near_me_list.dart
+2
-1
lib/ui/shop/shop_Nearby_places.dart
+240
-99
lib/ui/shop/shop_list.dart
+20
-98
lib/ui/shop/shop_list_detail.dart
+94
-194
lib/ui/shop/shop_main.dart
+214
-129
lib/ui/shop/shop_service.dart
+2
-8
lib/ui/shop/shoplistdetail_presenter.dart
+12
-3
lib/ui/shop/show_Nearby_places_presenter.dart
+109
-0
No files found.
ios/Flutter/.last_build_id
View file @
b27b01e9
65bf9efbfad64e1b5e4b50eeaed8247f
\ No newline at end of file
13553ffa98d5b0aaa390f5899ef7a33e
\ No newline at end of file
lib/main.dart
View file @
b27b01e9
...
...
@@ -8,6 +8,7 @@ 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_list_detail.dart'
;
import
'package:feelverapp/ui/shop/shop_main.dart'
;
import
'package:feelverapp/ui/splashscreen/splash_screen_page.dart'
;
...
...
@@ -32,8 +33,9 @@ class MyApp extends StatelessWidget {
),
home:
SplashScreenPage
()
home:
Favorite
()
//home: EditProfile(),
...
...
lib/model/booking_detail/booking_detail_model.dart
0 → 100644
View file @
b27b01e9
class
BookingDetailModel
{
bool
status
;
Results
results
;
BookingDetailModel
({
this
.
status
,
this
.
results
});
BookingDetailModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
status
=
json
[
'status'
];
results
=
json
[
'results'
]
!=
null
?
new
Results
.
fromJson
(
json
[
'results'
])
:
null
;
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'status'
]
=
this
.
status
;
if
(
this
.
results
!=
null
)
{
data
[
'results'
]
=
this
.
results
.
toJson
();
}
return
data
;
}
}
class
Results
{
int
id
;
String
urlCode
;
String
name
;
String
cover
;
String
excerpt
;
String
detail
;
String
price
;
String
specialPrice
;
String
sku
;
Null
tax
;
int
quantity
;
Null
weight
;
String
visibility
;
Null
newsFromDate
;
Null
newsToDate
;
Null
layout
;
Null
theme
;
String
duration
;
Null
sellingStartTime
;
Null
sellingEndTime
;
Null
redemptionStartTime
;
Null
redemptionEndTime
;
Null
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
<
StoresByVendorId
>
storesByVendorId
;
List
<
Null
>
images
;
List
<
CategoryByProductId
>
categoryByProductId
;
List
<
Null
>
ratings
;
List
<
Null
>
comments
;
List
<
Null
>
commentReview
;
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
;
List
<
Null
>
promotions
;
List
<
Null
>
wishList
;
Results
(
{
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
.
storesByVendorId
,
this
.
images
,
this
.
categoryByProductId
,
this
.
ratings
,
this
.
comments
,
this
.
commentReview
,
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
,
this
.
promotions
,
this
.
wishList
});
Results
.
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
[
'stores_by_vendor_id'
]
!=
null
)
{
storesByVendorId
=
new
List
<
StoresByVendorId
>();
json
[
'stores_by_vendor_id'
].
forEach
((
v
)
{
storesByVendorId
.
add
(
new
StoresByVendorId
.
fromJson
(
v
));
});
}
// if (json['images'] != null) {
// images = new List<Null>();
// json['images'].forEach((v) {
// images.add(new Null.fromJson(v));
// });
// }
if
(
json
[
'category_by_product_id'
]
!=
null
)
{
categoryByProductId
=
new
List
<
CategoryByProductId
>();
json
[
'category_by_product_id'
].
forEach
((
v
)
{
categoryByProductId
.
add
(
new
CategoryByProductId
.
fromJson
(
v
));
});
}
// if (json['ratings'] != null) {
// ratings = new List<Null>();
// json['ratings'].forEach((v) {
// ratings.add(new Null.fromJson(v));
// });
// }
// if (json['comments'] != null) {
// comments = new List<Null>();
// json['comments'].forEach((v) {
// comments.add(new Null.fromJson(v));
// });
// }
// if (json['comment_review'] != null) {
// commentReview = new List<Null>();
// json['comment_review'].forEach((v) {
// commentReview.add(new Null.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'
];
// if (json['promotions'] != null) {
// promotions = new List<Null>();
// json['promotions'].forEach((v) {
// promotions.add(new Null.fromJson(v));
// });
// }
// if (json['wishList'] != null) {
// wishList = new List<Null>();
// json['wishList'].forEach((v) {
// wishList.add(new Null.fromJson(v));
// });
// }
}
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
.
storesByVendorId
!=
null
)
{
data
[
'stores_by_vendor_id'
]
=
this
.
storesByVendorId
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
// if (this.images != null) {
// data['images'] = this.images.map((v) => v.toJson()).toList();
// }
// if (this.categoryByProductId != null) {
// data['category_by_product_id'] =
// this.categoryByProductId.map((v) => v.toJson()).toList();
// }
// if (this.ratings != null) {
// data['ratings'] = this.ratings.map((v) => v.toJson()).toList();
// }
// if (this.comments != null) {
// data['comments'] = this.comments.map((v) => v.toJson()).toList();
// }
// if (this.commentReview != null) {
// data['comment_review'] =
// this.commentReview.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
;
// if (this.promotions != null) {
// data['promotions'] = this.promotions.map((v) => v.toJson()).toList();
// }
// if (this.wishList != null) {
// data['wishList'] = this.wishList.map((v) => v.toJson()).toList();
// }
return
data
;
}
}
class
StoresByVendorId
{
int
id
;
String
storeCode
;
String
storeName
;
String
storeCover
;
String
displayCover
;
String
isActive
;
int
storeOrder
;
int
customerGroupId
;
int
vendorId
;
Null
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
;
String
star
;
Ratings
ratings
;
StoresByVendorId
(
{
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
});
StoresByVendorId
.
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'
]
!=
null
?
new
Ratings
.
fromJson
(
json
[
'ratings'
])
:
null
;
}
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
;
if
(
this
.
ratings
!=
null
)
{
data
[
'ratings'
]
=
this
.
ratings
.
toJson
();
}
return
data
;
}
}
class
Ratings
{
int
id
;
String
title
;
String
rateType
;
String
rateCate
;
String
rateTb
;
int
rateRowId
;
String
isCustom
;
Null
customScore
;
int
rateRange
;
int
storeId
;
int
vendorId
;
String
createdAt
;
String
updatedAt
;
List
<
RatingScore
>
ratingScore
;
Ratings
(
{
this
.
id
,
this
.
title
,
this
.
rateType
,
this
.
rateCate
,
this
.
rateTb
,
this
.
rateRowId
,
this
.
isCustom
,
this
.
customScore
,
this
.
rateRange
,
this
.
storeId
,
this
.
vendorId
,
this
.
createdAt
,
this
.
updatedAt
,
this
.
ratingScore
});
Ratings
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
title
=
json
[
'title'
];
rateType
=
json
[
'rate_type'
];
rateCate
=
json
[
'rate_cate'
];
rateTb
=
json
[
'rate_tb'
];
rateRowId
=
json
[
'rate_row_id'
];
isCustom
=
json
[
'is_custom'
];
customScore
=
json
[
'custom_score'
];
rateRange
=
json
[
'rate_range'
];
storeId
=
json
[
'store_id'
];
vendorId
=
json
[
'vendor_id'
];
createdAt
=
json
[
'created_at'
];
updatedAt
=
json
[
'updated_at'
];
if
(
json
[
'rating_score'
]
!=
null
)
{
ratingScore
=
new
List
<
RatingScore
>();
json
[
'rating_score'
].
forEach
((
v
)
{
ratingScore
.
add
(
new
RatingScore
.
fromJson
(
v
));
});
}
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'title'
]
=
this
.
title
;
data
[
'rate_type'
]
=
this
.
rateType
;
data
[
'rate_cate'
]
=
this
.
rateCate
;
data
[
'rate_tb'
]
=
this
.
rateTb
;
data
[
'rate_row_id'
]
=
this
.
rateRowId
;
data
[
'is_custom'
]
=
this
.
isCustom
;
data
[
'custom_score'
]
=
this
.
customScore
;
data
[
'rate_range'
]
=
this
.
rateRange
;
data
[
'store_id'
]
=
this
.
storeId
;
data
[
'vendor_id'
]
=
this
.
vendorId
;
data
[
'created_at'
]
=
this
.
createdAt
;
data
[
'updated_at'
]
=
this
.
updatedAt
;
if
(
this
.
ratingScore
!=
null
)
{
data
[
'rating_score'
]
=
this
.
ratingScore
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
}
class
RatingScore
{
int
id
;
int
ratingId
;
String
ratingScore
;
String
createdAt
;
String
updatedAt
;
int
customerId
;
RatingScore
(
{
this
.
id
,
this
.
ratingId
,
this
.
ratingScore
,
this
.
createdAt
,
this
.
updatedAt
,
this
.
customerId
});
RatingScore
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
ratingId
=
json
[
'rating_id'
];
ratingScore
=
json
[
'rating_score'
];
createdAt
=
json
[
'created_at'
];
updatedAt
=
json
[
'updated_at'
];
customerId
=
json
[
'customer_id'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'rating_id'
]
=
this
.
ratingId
;
data
[
'rating_score'
]
=
this
.
ratingScore
;
data
[
'created_at'
]
=
this
.
createdAt
;
data
[
'updated_at'
]
=
this
.
updatedAt
;
data
[
'customer_id'
]
=
this
.
customerId
;
return
data
;
}
}
class
CategoryByProductId
{
int
id
;
Null
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
;
}
}
lib/model/category/category_model.dart
View file @
b27b01e9
class
c
ategoryModel
{
List
<
DATA
>
dATA
;
class
C
ategoryModel
{
List
<
Result
>
result
;
categoryModel
({
this
.
dATA
});
CategoryModel
({
this
.
result
});
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
;
...
...
@@ -29,16 +31,16 @@ 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
,
...
...
@@ -55,7 +57,8 @@ class DATA {
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'
];
...
...
lib/service/api.dart
View file @
b27b01e9
...
...
@@ -30,6 +30,7 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs"
,
};
<<<<<<<
HEAD
static
final
String
baseApi
=
"https://backend-uat.feelver.com/api"
;
Future
<
Response
<
T
>>
deletefavorite
(
Object
body
)
async
{
...
...
@@ -51,6 +52,9 @@ class Api<T> {
}
=======
static
final
String
baseApi
=
"https://backend-uat.feelver.com/api/storage/"
;
>>>>>>>
486
f6e832d80edd16c36936915cf4f3a1838c9a8
Future
<
Response
<
T
>>
favorite
(
Object
body
)
async
{
var
_model
;
var
_fail
;
...
...
@@ -241,21 +245,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
;
print
(
"Result test "
);
// (body as Map)['lang'] = allTranslations.currentLanguage;
await
_httpConnection
(
"
${this._baseApi}
/category"
,
this
.
_headerApi
,
body
)
.
then
((
response
)
{
print
(
"ผลลัพ
ท์ เท่ากับ "
"
${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
));
}
...
...
@@ -264,6 +265,10 @@ class Api<T> {
return
result
;
}
Future
<
Response
<
T
>>
shoplist
(
Object
body
)
async
{
var
_model
;
var
_fail
;
...
...
lib/ui/booking/booking_detail.dart
View file @
b27b01e9
...
...
@@ -11,10 +11,9 @@ class BookingDetail extends StatefulWidget {
class
_BookingDetailState
extends
State
<
BookingDetail
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
_setupView
(),
);
return
ListView
(
padding:
EdgeInsets
.
all
(
0
),
children:
<
Widget
>[
_setupView
(),
]);
}
_setupView
()
{
...
...
@@ -29,20 +28,7 @@ class _BookingDetailState extends State<BookingDetail> {
height:
SizeConfig
.
getHeight
(
450
),
fit:
BoxFit
.
cover
,
),
Positioned
(
top:
SizeConfig
.
getPadding
(
44
),
left:
SizeConfig
.
getPadding
(
16
),
child:
InkWell
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Image
.
asset
(
'assets/images/ic_back.png'
,
width:
SizeConfig
.
getWidth
(
20
),
height:
SizeConfig
.
getWidth
(
20
),
),
),
),
],
),
Container
(
...
...
@@ -143,11 +129,11 @@ class _BookingDetailState extends State<BookingDetail> {
SizedBox
(
width:
SizeConfig
.
getWidth
(
20
),
),
ImageIcon
(
AssetImage
(
'assets/images/ic_twitter.png'
),
color:
Colors
.
grey
,
size:
SizeConfig
.
getFontSize
(
24
),
),
//
ImageIcon(
//
AssetImage('assets/images/ic_twitter.png'),
//
color: Colors.grey,
//
size: SizeConfig.getFontSize(24),
//
),
],
),
SizedBox
(
...
...
lib/ui/home/home.dart
View file @
b27b01e9
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'
;
...
...
@@ -6,6 +8,7 @@ import 'package:feelverapp/ui/nearme/near_me_list.dart';
import
'package:feelverapp/ui/payment/payment_detail.dart'
;
import
'package:feelverapp/ui/reserve/reserve_list.dart'
;
import
'package:feelverapp/ui/shop/shop_list.dart'
;
import
'package:feelverapp/ui/shop/shop_list_detail.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
...
...
@@ -24,7 +27,7 @@ class HomePage extends StatefulWidget {
}
class
_HomePageState
extends
State
<
HomePage
>
with
TickerProviderStateMixin
{
bool
search
=
false
;
TabController
_tabController
;
HomePresenter
presenter
;
...
...
@@ -36,23 +39,24 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter
.
Listitem
();
// presenter.getid();
presenter
.
getprofile
();
//print("nenwenwenwew"+presenter.CatModel.dATA[0].cover,);
// presenter.getSearch();
// presenter.getSearch();
}
@override
void
dispose
()
{
super
.
dispose
();
_tabController
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
return
Scaffold
(
body:
_setupView
(),
bottomNavigationBar:
Container
(
...
...
@@ -133,7 +137,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetail
()),
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetail
()),
);
},
),
...
...
@@ -264,72 +269,286 @@ 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
(
child:
Container
(
child:
presenter
.
CatModel
==
null
?
Container
()
:
ListView
.
builder
(
itemCount:
presenter
.
CatModel
.
dATA
[
0
].
name
.
length
,
itemBuilder:
(
context
,
i
)
{
return
list
(
i
);
}),
),
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:
ListView
.
builder
(
itemCount:
presenter
.
CatModel
.
result
.
length
,
itemBuilder:
(
context
,
i
)
{
return
list
(
i
);
}),
),
),
],
);
}
list
(
int
index
)
{
return
Container
(
//color: Colors.orange,
// padding: EdgeInsets.only(
// // top: SizeConfig.getPadding(16),
// // bottom: SizeConfig.getPadding(10),
// ),
child:
Column
(
children:
<
Widget
>[
_listItem
(
presenter
.
CatModel
==
null
?
Image
.
asset
(
'assets/images/banner_spa.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
)
:
Image
.
network
(
presenter
.
CatModel
.
result
[
index
].
cover
,
height:
SizeConfig
.
getHeight
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
cover
,
),
presenter
.
CatModel
.
result
[
index
].
name
,
''
,
ShopList
(),
),
SizedBox
(
height:
20
,
),
],
),
);
}
Widget
_shopItem
(
String
title
,
String
image
,
String
address
,
String
detail
,
String
id
)
{
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:
InkWell
(
child:
Text
(
title
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
color:
Colors
.
black
,
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ShopListDetail
(
id:
id
)),
);
},
),
),
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
(
presenter
.
searchhomeModel
.
thTH
[
0
].
star
.
toString
(),
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:
Column
(
children:
<
Widget
>[
_listItem
(
presenter
.
CatModel
==
null
?
Image
.
asset
(
'assets/images/banner_spa.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
)
:
Image
.
network
(
presenter
.
CatModel
.
dATA
[
index
].
cover
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
cover
,
),
presenter
.
CatModel
.
dATA
[
index
].
name
,
''
,
ShopList
(),
),
SizedBox
(
height:
20
,
),
],
),
child:
presenter
.
searchhomeModel
==
null
?
Container
()
:
ListView
.
builder
(
itemCount:
presenter
.
searchhomeModel
.
thTH
.
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
,
presenter
.
searchhomeModel
.
thTH
[
i
].
id
.
toString
(),
);
}),
),
);
}
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
(
...
...
@@ -339,6 +558,16 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
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
(
top:
SizeConfig
.
getPadding
(
40
),
...
...
@@ -388,8 +617,20 @@ 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:
()
{
setState
(()
{
search
=
true
;
print
(
search
);
});
presenter
.
getSearch
();
},
icon:
Icon
(
Icons
.
search
,
color:
Colors
.
grey
)),
...
...
lib/ui/home/home_presenter.dart
View file @
b27b01e9
...
...
@@ -21,7 +21,7 @@ class HomePresenter extends BasePresenter<HomePage> {
GetprofileModel
getmodel
;
LoginModel
logmodel
;
c
ategoryModel
CatModel
;
C
ategoryModel
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
"
,
});
if
(
res
.
fail
==
null
){
// LoadingView(state.context).hide();
if
(
res
.
success
!=
null
){
setState
(()
{
CatModel
=
res
.
success
;
print
(
"dddddddddddddddd"
);
print
(
'
${CatModel.dATA[0].name}
'
);
});
}
else
{
...
...
@@ -50,21 +52,23 @@ 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"
,
});
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
{
}
...
...
lib/ui/nearme/near_me_list.dart
View file @
b27b01e9
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/ui/nearme/near_me_detail.dart'
;
import
'package:feelverapp/ui/nearme/near_me_list_presenter.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
...
...
@@ -217,7 +218,7 @@ class _NearmeListState extends State<NearmeList> with TickerProviderStateMixin {
),
Expanded
(
child:
Image
.
network
(
'https://backend.feelver.com/storage/'
+
img
,
Api
.
baseApi
+
img
,
// width: SizeConfig.getWidth(50),
height:
SizeConfig
.
getHeight
(
160
),
fit:
BoxFit
.
fitHeight
,
...
...
lib/ui/shop/shop_Nearby_places.dart
View file @
b27b01e9
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/ui/nearme/near_me_detail.dart'
;
import
'package:feelverapp/ui/nearme/near_me_list_presenter.dart'
;
import
'package:feelverapp/ui/shop/shop_main.dart'
;
import
'package:feelverapp/ui/shop/show_Nearby_places_presenter.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:feelverapp/util/Util.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
class
ShopNearbyPlacesPage
extends
StatefulWidget
{
@override
_ShopNearbyPlacesPageState
createState
()
=>
_ShopNearbyPlacesPageState
();
}
final
List
<
String
>
detail
=
<
String
>[
'SPA Cenvaree @ centara Grand Centralworld'
,
'SPA Cenvaree @ centara Grand Centralworld'
,
'SPA Cenvaree @ centara Grand Centralworld'
];
final
List
<
String
>
place
=
<
String
>[
'พญาไทย'
,
'บางเขน'
,
'เกษตร'
];
class
_ShopNearbyPlacesPageState
extends
State
<
ShopNearbyPlacesPage
>
{
class
_ShopNearbyPlacesPageState
extends
State
<
ShopNearbyPlacesPage
>
with
TickerProviderStateMixin
{
ShopNearByPlacePresenter
presenter
;
@override
void
initState
()
{
super
.
initState
();
presenter
=
ShopNearByPlacePresenter
(
this
);
presenter
.
getnearme
();
}
@override
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
...
...
@@ -35,7 +55,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage> {
Text
(
'สถานที่ใกล้เคียง'
,
style:
TextStyle
(
color:
Color
(
0xFF6AB3AA
),
color:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
fontSize:
SizeConfig
.
getFontSize
(
14
),
),
),
...
...
@@ -60,14 +80,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage> {
children:
<
Widget
>[
FilterChip
(
label:
Text
(
"ทั้งหมด
(10)
"
,
"ทั้งหมด"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
...
...
@@ -76,9 +96,75 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage> {
setState
(()
{});
},
),
FilterChip
(
label:
Text
(
"ที่เที่ยว"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"ที่กิน"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"ที่พัก"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"กิจกรรม"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
],
),
),
...
...
@@ -90,7 +176,14 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage> {
}
getlist
()
{
return
Container
(
print
(
presenter
.
getmodel
);
return
presenter
.
getmodel
==
null
?
Container
(
child:
Center
(
child:
CircularProgressIndicator
(
valueColor:
new
AlwaysStoppedAnimation
<
Color
>(
Colors
.
teal
),
)))
:
Container
(
padding:
EdgeInsets
.
only
(
top:
SizeConfig
.
getPadding
(
80
),
left:
SizeConfig
.
getPadding
(
16
),
...
...
@@ -98,108 +191,156 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage> {
bottom:
SizeConfig
.
getPadding
(
10
),
),
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
itemCount:
detail
.
length
,
itemCount:
presenter
.
getmodel
.
results
.
data
.
length
,
itemBuilder:
(
context
,
i
)
{
return
_nearByItem
(
detail
[
i
],
place
[
i
]);
},
return
_nearByItem
(
presenter
.
getmodel
.
results
.
data
[
i
].
storeName
,
presenter
.
getmodel
.
results
.
data
[
i
].
detail
,
presenter
.
getmodel
.
results
.
data
[
i
].
storeLogo
,
presenter
.
getmodel
.
results
.
data
[
i
].
address
,
presenter
.
getmodel
.
results
.
data
[
i
].
location
,
presenter
.
getmodel
.
results
.
data
[
i
].
updatedAt
,
presenter
.
getmodel
.
results
.
data
[
i
].
distanceWithLocation
.
toString
());
}
),
);
}
Widget
_nearByItem
(
String
title
,
String
place
)
{
return
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearmeDetail
(),
),
);
},
child:
Card
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
50
,
left:
15
,
top:
10
,
right:
15
),
child:
Image
.
asset
(
'assets/images/demo_img.png'
,
width:
SizeConfig
.
getWidth
(
110
),
height:
SizeConfig
.
getHeight
(
150
),
fit:
BoxFit
.
fitWidth
,
),
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
Widget
_nearByItem
(
String
title
,
String
detail
,
String
img
,
String
address
,
String
latlng
,
String
date_time
,
String
distanceWithLocation
)
{
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
(
'ซีไลฟ์ แบงคอก โอเชียน เวิลด์'
,
style:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
)
,
)
,
padding:
EdgeInsets
.
only
(
top:
SizeConfig
.
getPadding
(
16
),
left:
SizeConfig
.
getPadding
(
16
)
,
right:
SizeConfig
.
getPadding
(
16
)
,
bottom:
SizeConfig
.
getPadding
(
4
)
),
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
(
Api
.
baseApi
+
img
,
fit:
BoxFit
.
cover
,
),
),
),
Container
(
child:
Text
(
title
,
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
)),
),
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
(
place
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
color:
Colors
.
black54
,
),
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
),
),
],
),
),
],
),
],
),
SizedBox
(
height:
SizeConfig
.
getWidth
(
10
),
),
),
],
),
)
,
]
,
]
,
)
,
),
)
,
);
)
;
}
}
lib/ui/shop/shop_list.dart
View file @
b27b01e9
...
...
@@ -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
),
),
)
],
),
)
],
),
);
...
...
lib/ui/shop/shop_list_detail.dart
View file @
b27b01e9
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/menu/menu.dart'
;
import
'package:feelverapp/ui/shop/shoplistdetail_presenter.dart'
;
...
...
@@ -6,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
class
ShopListDetail
extends
StatefulWidget
{
String
id
;
ShopListDetail
({
Key
key
,
this
.
id
,})
:
super
(
key:
key
);
@override
_ShopListDetailState
createState
()
=>
_ShopListDetailState
();
}
...
...
@@ -17,9 +20,9 @@ class _ShopListDetailState extends State<ShopListDetail> {
@override
void
initState
()
{
super
.
initState
();
print
(
widget
.
id
);
presenter
=
ShoplistdetailPresenter
(
this
);
presenter
.
Detai
();
presenter
.
Detai
(
widget
.
id
);
}
...
...
@@ -33,150 +36,26 @@ class _ShopListDetailState extends State<ShopListDetail> {
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
return
Scaffold
(
body:
_setupView
(),
bottomNavigationBar:
Container
(
color:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
height:
SizeConfig
.
getWidth
(
80
),
child:
Row
(
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
16
),
top:
0
),
width:
SizeConfig
.
getWidth
(
60
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
IconButton
(
icon:
Image
.
asset
(
'assets/images/ic_home.png'
,
width:
SizeConfig
.
getWidth
(
24
),
height:
SizeConfig
.
getWidth
(
24
),
),
onPressed:
()
{
print
(
"Pressed"
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
HomePage
()),
);
},
),
Text
(
'หน้าแรก'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
16
),
top:
0
),
width:
SizeConfig
.
getWidth
(
100
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
IconButton
(
icon:
Image
.
asset
(
'assets/images/ic_list.png'
,
width:
SizeConfig
.
getWidth
(
24
),
height:
SizeConfig
.
getWidth
(
24
),
),
onPressed:
()
{
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
print
(
"Pressed"
);
},
body:
presenter
.
model
==
null
?
Container
(
child:
Center
(
child:
CircularProgressIndicator
(
valueColor:
new
AlwaysStoppedAnimation
<
Color
>(
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
),
Text
(
'การจองของฉัน'
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
16
),
top:
0
),
width:
SizeConfig
.
getWidth
(
80
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
IconButton
(
icon:
Image
.
asset
(
'assets/images/ic_cart.png'
,
width:
SizeConfig
.
getWidth
(
24
),
height:
SizeConfig
.
getWidth
(
24
),
),
onPressed:
()
{
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
},
),
Text
(
'รถเข็นของฉัน'
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
)
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
16
),
top:
0
,
right:
0
),
width:
SizeConfig
.
getWidth
(
60
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
IconButton
(
icon:
Image
.
asset
(
'assets/images/ic_nearme.png'
,
width:
SizeConfig
.
getWidth
(
24
),
height:
SizeConfig
.
getWidth
(
24
),
),
onPressed:
()
{
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
},
),
Text
(
'ใกล้ฉัน'
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
)
],
),
),
],
),
),
),),
):
_setupView
(),
);
}
_setupView
()
{
return
SingleChildScrollView
(
return
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Stack
(
children:
<
Widget
>[
Container
(
color:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
height:
SizeConfig
.
getHeight
(
20
0
),
height:
SizeConfig
.
getHeight
(
15
0
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
),
Positioned
(
...
...
@@ -204,47 +83,17 @@ class _ShopListDetailState extends State<ShopListDetail> {
},
);
},
child:
Image
.
asset
(
'assets/images/ic_menu.png'
,
height:
SizeConfig
.
getWidth
(
24
),
width:
SizeConfig
.
getWidth
(
30
),
fit:
BoxFit
.
cover
,
child:
Icon
(
Icons
.
keyboard_arrow_left
,
color:
Colors
.
white
,
size:
SizeConfig
.
getFontSize
(
24
),
),
),
),
),
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
,
),
),
),
),
],
),
Container
(
...
...
@@ -252,9 +101,9 @@ class _ShopListDetailState extends State<ShopListDetail> {
child:
Stack
(
children:
<
Widget
>[
Image
.
network
(
'https://image.freepik.com/free-photo/girl-massage-spa-salon_110955-422.jpg'
,
height:
SizeConfig
.
getWidth
(
1
8
0
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
presenter
.
model
.
result
[
0
].
storeCover
,
height:
SizeConfig
.
getWidth
(
1
9
0
),
width:
SizeConfig
.
getWidth
(
350
)
,
fit:
BoxFit
.
cover
,
),
Positioned
(
...
...
@@ -279,7 +128,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
left:
SizeConfig
.
getPadding
(
75
),
top:
SizeConfig
.
getPadding
(
190
),
child:
Text
(
'Ivory Relax and Spa'
,
presenter
.
model
.
result
[
0
].
storeName
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
black
,
...
...
@@ -291,6 +140,24 @@ class _ShopListDetailState extends State<ShopListDetail> {
],
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
bottom:
SizeConfig
.
getPadding
(
5
),
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
'ข้อมูลติดต่อ'
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
...
...
@@ -298,7 +165,40 @@ class _ShopListDetailState extends State<ShopListDetail> {
bottom:
SizeConfig
.
getPadding
(
15
)),
alignment:
Alignment
.
topLeft
,
child:
Text
(
'4/18, 4/21 BTS Nana Exit4 Sukhumvit Soi 8 , KlongToey Bangkok, Thailand 10110'
,
"โทร "
+
presenter
.
model
.
result
[
0
].
phone
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
bottom:
SizeConfig
.
getPadding
(
15
)),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"email "
+
presenter
.
model
.
result
[
0
].
email
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
bottom:
SizeConfig
.
getPadding
(
15
)),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"ที่อยู่ "
+
presenter
.
model
.
result
[
0
].
address
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
grey
,
...
...
@@ -555,7 +455,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
left:
SizeConfig
.
getPadding
(
45
),
top:
SizeConfig
.
getPadding
(
50
),
child:
Text
(
'4.9'
,
presenter
.
model
.
result
[
0
].
star
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
...
...
@@ -565,20 +465,20 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontWeight:
FontWeight
.
w700
),
),
),
Positioned
(
left:
SizeConfig
.
getPadding
(
80
),
top:
SizeConfig
.
getPadding
(
52
),
child:
Text
(
'267 รีวิว'
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
// decoration: TextDecoration.underline,
color:
Colors
.
black54
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
//
Positioned(
//
left: SizeConfig.getPadding(80),
//
top: SizeConfig.getPadding(52),
//
child: Text(
//
'267 รีวิว',
//
textAlign: TextAlign.right,
//
style: TextStyle(
//
//
decoration: TextDecoration.underline,
//
color: Colors.black54,
//
fontSize: SizeConfig.getFontSize(12),
//
fontFamily: "SF_Pro_Text",
//
fontWeight: FontWeight.w500),
//
),
//
),
Positioned
(
right:
SizeConfig
.
getPadding
(
20
),
top:
SizeConfig
.
getPadding
(
52
),
...
...
@@ -612,7 +512,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
'ความคุ้มค่า'
];
return
Container
(
height:
8
0
,
height:
9
0
,
child:
GridView
.
count
(
crossAxisCount:
4
,
physics:
const
NeverScrollableScrollPhysics
(),
...
...
@@ -676,7 +576,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
top:
SizeConfig
.
getPadding
(
10
),
),
child:
Text
(
'ไม่ว่าคุณจะมาเยี่ยมเยียนเมืองเพลิดเพลินไปกับการพักผ่อนหรือคุณเป็นคนกรุงเทพฯตลอดไปสปาธรรมชาติของเราเป็นทางเลือกที่สมบูรณ์แบบหากคุณกำลังมองหาการผ่อนคลายความรู้สึกทั้งหมดในขณะที่เราปรนเปรอคุณด้วยสปาธรรมชาติ 100% และ ผลิตภัณฑ์สปาออร์แกนิก ทุกสิ่งที่คุณสัมผัสกลิ่นความรู้สึกการได้ยินและประสบการณ์นั้นเป็นเรื่องจริงและเป็นธรรมชาติอย่างที่ได้รับการเดินทางครั้งใหญ่จากความเร่งรีบและวุ่นวายของกรุงเทพฯที่วุ่นวายและความวุ่นวายของชีวิตสมัยใหม่! ด้วยเสียงมลภาวะความวุ่นวายและสารเคมีที่กลายเป็นบรรทัดฐานในการใช้ชีวิตในเมืองข้อเสนอของสปาของเราจึงเป็นสิ่งที่ต้องการ ดังนั้นอย่าลืมที่จะได้รับ Plant Day Spa อันสดใหม่ของคุณ'
,
presenter
.
model
.
result
[
0
].
excerpt
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
// decoration: TextDecoration.underline,
...
...
lib/ui/shop/shop_main.dart
View file @
b27b01e9
import
'package:feelverapp/ui/booking/booking_detail.dart'
;
import
'package:feelverapp/ui/shop/shop.dart'
;
import
'package:feelverapp/ui/shop/shop_Nearby_places.dart'
;
import
'package:feelverapp/ui/shop/shop_reviews.dart'
;
...
...
@@ -7,9 +8,6 @@ import 'package:flutter/material.dart';
import
'dart:math'
;
class
MainShop
extends
StatefulWidget
{
MainShop
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
...
...
@@ -19,12 +17,22 @@ class MainShop extends StatefulWidget {
_MainShopState
createState
()
=>
_MainShopState
();
}
class
_MainShopState
extends
State
<
MainShop
>
with
SingleTickerProviderStateMixin
/*<-- This is for the controllers*/
{
class
_MainShopState
extends
State
<
MainShop
>
with
SingleTickerProviderStateMixin
/*<-- This is for the controllers*/
{
TabController
_controller
;
// To control switching tabs
ScrollController
_scrollViewController
;
// To control scrolling
List
<
String
>
items
=
[];
List
<
Color
>
colors
=
[
Colors
.
red
,
Colors
.
green
,
Colors
.
yellow
,
Colors
.
purple
,
Colors
.
blue
,
Colors
.
amber
,
Colors
.
cyan
,
Colors
.
pink
];
List
<
Color
>
colors
=
[
Colors
.
red
,
Colors
.
green
,
Colors
.
yellow
,
Colors
.
purple
,
Colors
.
blue
,
Colors
.
amber
,
Colors
.
cyan
,
Colors
.
pink
];
Random
random
=
new
Random
();
Color
getRandomColor
()
{
...
...
@@ -35,10 +43,11 @@ class _MainShopState extends State<MainShop> with SingleTickerProviderStateMixi
void
initState
()
{
super
.
initState
();
_controller
=
new
TabController
(
length:
4
,
vsync:
this
);
_controller
.
addListener
(
_handleTabSelection
);
_scrollViewController
=
ScrollController
();
_controller
.
addListener
(
_handleTabSelection
);
_scrollViewController
=
ScrollController
();
}
void
_handleTabSelection
()
{
void
_handleTabSelection
()
{
setState
(()
{});
}
...
...
@@ -50,80 +59,89 @@ class _MainShopState extends State<MainShop> with SingleTickerProviderStateMixi
}
@override
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
// Init the items
SizeConfig
(
context
);
// Init the items
return
Scaffold
(
// backgroundColor: Colors.transparent,
// backgroundColor: Colors.transparent,
body:
NestedScrollView
(
controller:
_scrollViewController
,
headerSliverBuilder:
(
BuildContext
context
,
bool
boxIsScrolled
)
{
return
<
Widget
>[
SliverAppBar
(
backgroundColor:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
color:
Colors
.
white
),
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(),
),
title:
Center
(
child:
Text
(
"Thai Body Balance"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
25
)),),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
color:
Colors
.
white
),
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(),
),
title:
Center
(
child:
Text
(
"Thai Body Balance"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
20
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
),
floating:
true
,
pinned:
false
,
snap:
true
,
bottom:
new
TabBar
(
indicatorColor:
Colors
.
transparent
,
controller:
_controller
,
tabs:
[
new
Tab
(
icon:
Icon
(
Icons
.
assignment
,
color:
_controller
.
index
==
0
?
Colors
.
yellowAccent
:
Colors
.
white
),
child:
Text
(
'ข้อมูลร้าน'
,
style:
TextStyle
(
indicatorColor:
Colors
.
transparent
,
controller:
_controller
,
tabs:
[
new
Tab
(
icon:
Icon
(
Icons
.
assignment
,
color:
_controller
.
index
==
0
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
11
),
:
Colors
.
white
),
child:
Text
(
'ข้อมูลร้าน'
,
style:
TextStyle
(
color:
_controller
.
index
==
0
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
),
),
new
Tab
(
icon:
Icon
(
Icons
.
loyalty
,
color:
_controller
.
index
==
1
?
Colors
.
yellowAccent
:
Colors
.
white
),
child:
Text
(
'บริการ'
,
style:
TextStyle
(
new
Tab
(
icon:
Icon
(
Icons
.
loyalty
,
color:
_controller
.
index
==
1
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
11
),
:
Colors
.
white
),
child:
Text
(
'บริการ'
,
style:
TextStyle
(
color:
_controller
.
index
==
1
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
),
),
new
Tab
(
icon:
Icon
(
Icons
.
star
,
color:
_controller
.
index
==
2
?
Colors
.
yellowAccent
:
Colors
.
white
),
child:
Text
(
'รีวิว'
,
style:
TextStyle
(
new
Tab
(
icon:
Icon
(
Icons
.
star
,
color:
_controller
.
index
==
2
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
11
),
:
Colors
.
white
),
child:
Text
(
'รีวิว'
,
style:
TextStyle
(
color:
_controller
.
index
==
2
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
),
),
Container
(
Container
(
width:
200
,
child:
Tab
(
icon:
Icon
(
Icons
.
pin_drop
,
...
...
@@ -137,88 +155,156 @@ class _MainShopState extends State<MainShop> with SingleTickerProviderStateMixi
color:
_controller
.
index
==
3
?
Colors
.
yellowAccent
:
Colors
.
white
,
fontSize:
9
),
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
),
))
],
),
),
),
],
),
),
];
},
body:
new
Container
(
height:
double
.
maxFinite
,
child:
new
TabBarView
(
controller:
_controller
,
children:
<
Widget
>[
Container
(
//service detail//////////////
child:
Shop
()
),
Column
(
children:
<
Widget
>[
Container
(
color:
Colors
.
transparent
,
height:
120
,
child:
Wrap
(
alignment:
WrapAlignment
.
start
,
spacing:
10.0
,
// gap between adjacent chips
runSpacing:
5.0
,
// gap between lines
children:
<
Widget
>[
FilterChip
(
label:
Text
(
"ทั้งหมด (10)"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
setState
(()
{});
},
height:
double
.
maxFinite
,
child:
new
TabBarView
(
controller:
_controller
,
children:
<
Widget
>[
Container
(
child:
BookingDetail
(),
// child: getlist(),
//width: 20,
),
Column
(
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
24
)),
alignment:
Alignment
.
topLeft
,
child:
Wrap
(
alignment:
WrapAlignment
.
start
,
spacing:
10.0
,
// gap between adjacent chips
runSpacing:
5.0
,
// gap between lines
children:
<
Widget
>[
FilterChip
(
label:
Text
(
"ทั้งหมด"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
],
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
setState
(()
{});
},
),
FilterChip
(
label:
Text
(
"ที่เที่ยว"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"ที่กิน"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"ที่พัก"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
FilterChip
(
label:
Text
(
"กิจกรรม"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
15
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
backgroundColor:
Color
.
fromRGBO
(
69
,
85
,
79
,
1
),
shape:
StadiumBorder
(
side:
BorderSide
(
color:
Colors
.
white
),
),
onSelected:
(
bool
value
)
{
print
(
"selected"
);
},
),
],
),
Expanded
(
child:
Container
(
// color: Colors.blue,
),
Expanded
(
child:
Container
(
// color: Colors.blue,
// height: double.maxFinite,
child:
ShopServicePage
(),
),
),
],
),
// child: getlist(),
//width: 20,
child:
ShopServicePage
(),
),
),
],
),
// child: getlist(),
//width: 20,
Container
(
Container
(
// color: Colors.red,
child:
ShopReviewsPage
(),
// child: getlist(),
//width: 20,
),
child:
ShopReviewsPage
(),
// child: getlist(),
//width: 20,
),
//
Container
(
Container
(
// width: double.maxFinite,
// color: Colors.yellow,
// child: setupView(),
child:
ShopNearbyPlacesPage
(),
),
],
),
child:
ShopNearbyPlacesPage
(),
),
],
),
),
),
);
}
}
\ No newline at end of file
}
lib/ui/shop/shop_service.dart
View file @
b27b01e9
...
...
@@ -47,12 +47,6 @@ class _ShopServicePageState extends State<ShopServicePage>
);
})
// ListView(
// children: <Widget>[
// myCard();
//
// ],
// ),
);
}
...
...
@@ -82,9 +76,9 @@ class _ShopServicePageState extends State<ShopServicePage>
fit:
BoxFit
.
cover
,
)
:
Image
.
network
(
Api
.
baseApi
+
image
,
Api
.
baseApi
+
image
,
fit:
BoxFit
.
cover
,
)),
)
,
),
),
Expanded
(
flex:
5
,
...
...
lib/ui/shop/shoplistdetail_presenter.dart
View file @
b27b01e9
import
'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/shop/shop_list_detail.dart'
;
...
...
@@ -8,16 +9,24 @@ import 'package:flutter/material.dart';
class
ShoplistdetailPresenter
extends
BasePresenter
<
ShopListDetail
>{
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
shoplistdetailModel
model
;
ShoplistdetailPresenter
(
State
<
ShopListDetail
>
state
)
:
super
(
state
);
Detai
()
async
{
Detai
(
String
id
)
async
{
_api
=
Api
<
shoplistdetailModel
>();
var
res
=
await
_api
.
shoplistDetail
({
"id"
:
"406"
,
"id"
:
id
,
});
if
(
res
.
fail
==
null
)
{
setState
(()
{
model
=
res
.
success
;
print
(
"complete"
);
});
print
(
'res Success'
);
}
else
{
print
(
'res Fail'
);
...
...
lib/ui/shop/show_Nearby_places_presenter.dart
0 → 100644
View file @
b27b01e9
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/editprofile/getprofilemodel.dart'
;
import
'package:feelverapp/model/home/home_model.dart'
;
import
'package:feelverapp/model/nearme/nearme_list_model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:flutter/material.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:feelverapp/ui/shop/shop_Nearby_places.dart'
;
class
ShopNearByPlacePresenter
extends
BasePresenter
<
ShopNearbyPlacesPage
>
{
final
formkey
=
GlobalKey
<
FormState
>();
Api
_api
;
String
type
=
'3'
;
NearMeListModel
getmodel
;
ShopNearByPlacePresenter
(
State
<
ShopNearbyPlacesPage
>
state
)
:
super
(
state
);
getnearme
()
async
{
_api
=
Api
<
NearMeListModel
>();
var
res
=
await
_api
.
getNearList
({});
if
(
res
.
fail
==
null
){
if
(
res
.
success
.
status
){
setState
((){
print
(
"AAAA :
${res.success}
"
);
getmodel
=
res
.
success
;
// print(getmodel.results.data.length);
// print("getmodel" + getmodel[0].results.data[0].storeName);
},);
}
}
else
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
"ไม่พบข้อมูล"
,
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pop
(
state
.
context
),
child:
Text
(
"ลองอีกครั้ง"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
),
)
]).
show
();
}
}
// getnearme() async {
// _api = Api<NearMeListModel>();
//
// var res = await _api.getNearList({});
// print("Hii" + getmodel[0].storeName);
// print("Hii2" + res.success);
//
// if (res.fail == null) {
// setState(() {
// NearMeListModel model = res.success;
//
//// getmodel = res.success
// }
// );
// } else {
// Alert(
// style: AlertStyle(
// animationType: AnimationType.fromTop,
// isCloseButton: false,
// ),
// context: state.context,
// title: "ไม่สามารถติดต่อ\nเซิร์ฟเวอร์ได้",
// content: Icon(
// Icons.warning,
// color: Colors.orange,
// size: 80,
// ),
// buttons: [
// DialogButton(
// color: Color.fromRGBO(106, 179, 170, 1),
// onPressed: () => Navigator.pop(state.context),
// child: Text(
// "ลองอีกครั้ง",
// style: TextStyle(color: Colors.white, fontSize: 20),
// ),
// )
// ]).show();
// }
// }
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment