Commit 456dbfdd by Mobile : Art

update

parent 4dcf44e2
......@@ -29,7 +29,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
),
home: AccountSettingPage()
home: HomePage()
//home: EditProfile(),
......
......@@ -5,7 +5,7 @@ class categoryModel {
categoryModel({this.dATA});
categoryModel.fromJson(Map<String, dynamic> json) {
if (json['DATA'] != null) {
if (json['data'] != null) {
dATA = new List<DATA>();
json['DATA'].forEach((v) {
dATA.add(new DATA.fromJson(v));
......@@ -16,7 +16,7 @@ class categoryModel {
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();
data['data'] = this.dATA.map((v) => v.toJson()).toList();
}
return data;
}
......
class NearMeListModel {
bool status;
Results results;
NearMeListModel({this.status, this.results});
NearMeListModel.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 currentPage;
List<Data> data;
Results({this.currentPage, this.data});
Results.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
return data;
}
}
class Data {
int id;
String storeCode;
String storeName;
......@@ -8,7 +56,6 @@ class NearMeListModel {
int storeOrder;
int customerGroupId;
int vendorId;
Null createdAt;
String updatedAt;
String location;
String email;
......@@ -24,13 +71,9 @@ class NearMeListModel {
String detail;
String storeLogo;
String isFacilities;
String distanceWithLocation;
int star;
List<StoreProduct> storeProduct;
List<Null> comment;
Null ratings;
dynamic distanceWithLocation;
NearMeListModel(
Data(
{this.id,
this.storeCode,
this.storeName,
......@@ -40,7 +83,6 @@ class NearMeListModel {
this.storeOrder,
this.customerGroupId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.location,
this.email,
......@@ -56,13 +98,10 @@ class NearMeListModel {
this.detail,
this.storeLogo,
this.isFacilities,
this.distanceWithLocation,
this.star,
this.storeProduct,
this.comment,
this.ratings});
this.distanceWithLocation
});
NearMeListModel.fromJson(Map<String, dynamic> json) {
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
storeCode = json['store_code'];
storeName = json['store_name'];
......@@ -72,7 +111,6 @@ class NearMeListModel {
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'];
......@@ -89,20 +127,6 @@ class NearMeListModel {
storeLogo = json['store_logo'];
isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location'];
star = json['star'];
if (json['store_product'] != null) {
storeProduct = new List<StoreProduct>();
json['store_product'].forEach((v) {
storeProduct.add(new StoreProduct.fromJson(v));
});
}
if (json['comment'] != null) {
comment = new List<Null>();
json['comment'].forEach((v) {
comment.add(new Null.fromJson(v));
});
}
ratings = json['ratings'];
}
Map<String, dynamic> toJson() {
......@@ -116,7 +140,6 @@ class NearMeListModel {
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;
......@@ -133,434 +156,6 @@ class NearMeListModel {
data['store_logo'] = this.storeLogo;
data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star;
if (this.storeProduct != null) {
data['store_product'] = this.storeProduct.map((v) => v.toJson()).toList();
}
if (this.comment != null) {
data['comment'] = this.comment.map((v) => v.toJson()).toList();
}
data['ratings'] = this.ratings;
return data;
}
}
class StoreProduct {
int id;
int productId;
int storeId;
int vendorId;
String status;
int sortOrders;
Null createdAt;
Null updatedAt;
Null typeRateService;
Null priceRateService;
Product product;
StoreProduct(
{this.id,
this.productId,
this.storeId,
this.vendorId,
this.status,
this.sortOrders,
this.createdAt,
this.updatedAt,
this.typeRateService,
this.priceRateService,
this.product});
StoreProduct.fromJson(Map<String, dynamic> json) {
id = json['id'];
productId = json['product_id'];
storeId = json['store_id'];
vendorId = json['vendor_id'];
status = json['status'];
sortOrders = json['sort_orders'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
typeRateService = json['type_rate_service'];
priceRateService = json['price_rate_service'];
product =
json['product'] != null ? new Product.fromJson(json['product']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['vendor_id'] = this.vendorId;
data['status'] = this.status;
data['sort_orders'] = this.sortOrders;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['type_rate_service'] = this.typeRateService;
data['price_rate_service'] = this.priceRateService;
if (this.product != null) {
data['product'] = this.product.toJson();
}
return data;
}
}
class Product {
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;
Null businessServiceId;
int attributeSetId;
int vendorId;
String allowRoute;
Null type;
int star;
List<CategoryByProductId> categoryByProductId;
List<Null> ratings;
int storeProductId;
Null typeRateService;
Null priceRateService;
int productId;
int storeId;
String storeCode;
String storeName;
String location;
int storeStatus;
int vendorStatus;
String latitude;
String longitude;
Null popular;
Product(
{this.id,
this.urlCode,
this.name,
this.cover,
this.excerpt,
this.detail,
this.price,
this.specialPrice,
this.sku,
this.tax,
this.quantity,
this.weight,
this.visibility,
this.newsFromDate,
this.newsToDate,
this.layout,
this.theme,
this.duration,
this.sellingStartTime,
this.sellingEndTime,
this.redemptionStartTime,
this.redemptionEndTime,
this.availibility,
this.isFeatured,
this.isDeal,
this.hasTeam,
this.offpeak,
this.reviewStatus,
this.relatedStatus,
this.upSellsStatus,
this.crossSellsStatus,
this.allowGiftMessage,
this.stockStatus,
this.status,
this.businessTypeId,
this.businessCateId,
this.businessServiceId,
this.attributeSetId,
this.vendorId,
this.allowRoute,
this.type,
this.star,
this.categoryByProductId,
this.ratings,
this.storeProductId,
this.typeRateService,
this.priceRateService,
this.productId,
this.storeId,
this.storeCode,
this.storeName,
this.location,
this.storeStatus,
this.vendorStatus,
this.latitude,
this.longitude,
this.popular});
Product.fromJson(Map<String, dynamic> json) {
id = json['id'];
urlCode = json['url_code'];
name = json['name'];
cover = json['cover'];
excerpt = json['excerpt'];
detail = json['detail'];
price = json['price'];
specialPrice = json['special_price'];
sku = json['sku'];
tax = json['tax'];
quantity = json['quantity'];
weight = json['weight'];
visibility = json['visibility'];
newsFromDate = json['news_from_date'];
newsToDate = json['news_to_date'];
layout = json['layout'];
theme = json['theme'];
duration = json['duration'];
sellingStartTime = json['selling_start_time'];
sellingEndTime = json['selling_end_time'];
redemptionStartTime = json['redemption_start_time'];
redemptionEndTime = json['redemption_end_time'];
availibility = json['availibility'];
isFeatured = json['is_featured'];
isDeal = json['is_deal'];
hasTeam = json['has_team'];
offpeak = json['offpeak'];
reviewStatus = json['review_status'];
relatedStatus = json['related_status'];
upSellsStatus = json['up_sells_status'];
crossSellsStatus = json['cross_sells_status'];
allowGiftMessage = json['allow_gift_message'];
stockStatus = json['stock_status'];
status = json['status'];
businessTypeId = json['business_type_id'];
businessCateId = json['business_cate_id'];
businessServiceId = json['business_service_id'];
attributeSetId = json['attribute_set_id'];
vendorId = json['vendor_id'];
allowRoute = json['allow_route'];
type = json['type'];
star = json['star'];
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));
});
}
storeProductId = json['store_product_id'];
typeRateService = json['type_rate_service'];
priceRateService = json['price_rate_service'];
productId = json['product_id'];
storeId = json['store_id'];
storeCode = json['store_code'];
storeName = json['store_name'];
location = json['location'];
storeStatus = json['store_status'];
vendorStatus = json['vendor_status'];
latitude = json['latitude'];
longitude = json['longitude'];
popular = json['popular'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['url_code'] = this.urlCode;
data['name'] = this.name;
data['cover'] = this.cover;
data['excerpt'] = this.excerpt;
data['detail'] = this.detail;
data['price'] = this.price;
data['special_price'] = this.specialPrice;
data['sku'] = this.sku;
data['tax'] = this.tax;
data['quantity'] = this.quantity;
data['weight'] = this.weight;
data['visibility'] = this.visibility;
data['news_from_date'] = this.newsFromDate;
data['news_to_date'] = this.newsToDate;
data['layout'] = this.layout;
data['theme'] = this.theme;
data['duration'] = this.duration;
data['selling_start_time'] = this.sellingStartTime;
data['selling_end_time'] = this.sellingEndTime;
data['redemption_start_time'] = this.redemptionStartTime;
data['redemption_end_time'] = this.redemptionEndTime;
data['availibility'] = this.availibility;
data['is_featured'] = this.isFeatured;
data['is_deal'] = this.isDeal;
data['has_team'] = this.hasTeam;
data['offpeak'] = this.offpeak;
data['review_status'] = this.reviewStatus;
data['related_status'] = this.relatedStatus;
data['up_sells_status'] = this.upSellsStatus;
data['cross_sells_status'] = this.crossSellsStatus;
data['allow_gift_message'] = this.allowGiftMessage;
data['stock_status'] = this.stockStatus;
data['status'] = this.status;
data['business_type_id'] = this.businessTypeId;
data['business_cate_id'] = this.businessCateId;
data['business_service_id'] = this.businessServiceId;
data['attribute_set_id'] = this.attributeSetId;
data['vendor_id'] = this.vendorId;
data['allow_route'] = this.allowRoute;
data['type'] = this.type;
data['star'] = this.star;
if (this.categoryByProductId != null) {
data['category_by_product_id'] =
this.categoryByProductId.map((v) => v.toJson()).toList();
}
if (this.ratings != null) {
data['ratings'] = this.ratings.map((v) => v.toJson()).toList();
}
data['store_product_id'] = this.storeProductId;
data['type_rate_service'] = this.typeRateService;
data['price_rate_service'] = this.priceRateService;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['store_code'] = this.storeCode;
data['store_name'] = this.storeName;
data['location'] = this.location;
data['store_status'] = this.storeStatus;
data['vendor_status'] = this.vendorStatus;
data['latitude'] = this.latitude;
data['longitude'] = this.longitude;
data['popular'] = this.popular;
return data;
}
}
class CategoryByProductId {
int id;
Null parentId;
String name;
String code;
String displayName;
String cover;
String detail;
Null type;
String status;
int sortOrder;
Null storeId;
Null 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;
}
}
import 'dart:convert';
import 'package:feelverapp/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/base/base.dart';
......@@ -10,6 +9,7 @@ import 'package:feelverapp/model/editprofile/getprofilemodel.dart';
import 'package:feelverapp/model/forgetpassword/forgetpassModel.dart';
import 'package:feelverapp/model/home/home_model.dart';
import 'package:feelverapp/model/nearme/nearme_list_model.dart';
import 'package:feelverapp/model/register/register_model.dart';
import 'package:feelverapp/model/category/category_model.dart';
......@@ -31,10 +31,11 @@ class Api<T> {
var result;
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/store/shop-list", this._headerApi, body)
.then((response){
await _httpConnection(
"${this._baseApi}/store/shop-list", this._headerApi, body)
.then((response) {
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if (response.statusCode == 200){
if (response.statusCode == 200) {
_model = SearchhomeModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
......@@ -44,13 +45,11 @@ class Api<T> {
return result;
}
Future<Response<T>> getprofile(Object body) async {
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)
......@@ -66,12 +65,43 @@ print("this is body "+body.toString());
return result;
}
Future<Response<T>> getNearList(Object body) async{
var _model;
var _fail;
var result;
print("this is body " + body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await http.get(Uri.encodeFull("https://backend-uat.feelver.com/api/product/getListsStoreFormat?near_location=13.7913772,100.5408628&page=1&is_paginate=1"), headers: this._headerApi ).then((response) {
print("ผลลัพ เท่ากับบบบ2 " + "${response.body}");
print("statusCode=${response.statusCode}");
if (response.statusCode == 200) {
print("INif");
print(json.decode(response.body));
_model = NearMeListModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
print("return");
result = new Response<T>(_model, _fail);
});
return result;
// await _httpConnection(
// "${this._baseApi}product/getListsStoreFormat", this._headerApi, body)
}
Future<Response<T>> editProfile(Object body) async {
var _model;
var _fail;
var result;
print("This is body "+body.toString());
print("This is body " + body.toString());
await _httpConnection(
"${this._baseApi}/customer/edit", this._headerApi, body)
.then((response) {
......@@ -85,6 +115,7 @@ print("this is body "+body.toString());
});
return result;
}
Future<Response<T>> forgetPassword(Object body) async {
var _model;
var _fail;
......@@ -150,7 +181,7 @@ print("this is body "+body.toString());
await _httpConnection("${this._baseApi}/category", this._headerApi, body)
.then((response) {
print("ผลลัพท์ เท่ากับ " "${response.body}");
print("ผลลัพท์ เท่ากับ55555 " "${response.body}");
if (response.statusCode == 200) {
// Array to Map Json
Map<String, dynamic> myData = arrayToJson(response.body);
......@@ -158,6 +189,9 @@ print("this is body "+body.toString());
print(myData);
_model = categoryModel.fromJson(myData);
print('myModel ' + _model);
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
......@@ -166,22 +200,22 @@ print("this is body "+body.toString());
return result;
}
Future<Response<T>> shoplist(Object body) async{
Future<Response<T>> shoplist(Object body) async {
var _model;
var _fail;
var result;
await _httpConnection("${this._baseApi}/store", this._headerApi, body).then((response){
await _httpConnection("${this._baseApi}/store", this._headerApi, body)
.then((response) {
print("ผลลัพท์ เท่ากับ " "${response.body}");
if(response.statusCode == 200){
if (response.statusCode == 200) {
// Array to Map Json
Map<String, dynamic> myData = arrayToJson(response.body);
// print(myData);
_model = shoplistModel.fromJson(myData);
}else{
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
......@@ -189,16 +223,18 @@ print("this is body "+body.toString());
return result;
}
Future<Response<T>> shoplistDetail(Object body) async{
Future<Response<T>> shoplistDetail(Object body) async {
var _model;
var _fail;
var result;
await _httpConnection("${this._baseApi}/store/detail", this._headerApi, body).then((response){
await _httpConnection(
"${this._baseApi}/store/detail", this._headerApi, body)
.then((response) {
print("ผลลัพท์ เท่ากับ " "${response.body}");
if(response.statusCode == 200){
if (response.statusCode == 200) {
_model = shoplistdetailModel.fromJson(json.decode(response.body));
}else{
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
......
......@@ -4,7 +4,6 @@ import 'dart:developer';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/forgetpassword/forgetpassModel.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
......@@ -17,42 +16,24 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rflutter_alert/rflutter_alert.dart';
class ForgetPasswordPresenter extends BasePresenter<ForgetPassword> {
Api _api;
Timer _timer;
final formKey = GlobalKey<FormState>();
TextEditingController emailCtrl = TextEditingController();
ForgetPasswordPresenter(State<ForgetPassword> state) : super(state);
letCheckData() async {
letCheckData() async {
try {
if (emailCtrl.text.isEmpty ) throw ('กรุณากรอก\nอีเมล์');
if (emailCtrl.text.isEmpty) throw ('กรุณากรอก\nอีเมล์');
Pattern pattern =
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+";
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(emailCtrl.text))
throw ('รูปแบบอีเมล์\nไม่ถูกต้อง');
else {
else {
await forgetpassrequest();
}
} catch (e) {
......@@ -60,11 +41,14 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: '$e',
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -76,7 +60,6 @@ else {
)
]).show();
}
}
forgetpassrequest() async {
......@@ -84,30 +67,29 @@ else {
_api = Api<FogetPasswordModel>();
var res = await _api.forgetPassword({
"access_type":"mobile",
"access_type": "mobile",
"email": emailCtrl.text,
});
LoadingView(state.context).hide();
if (res.fail == null) {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "สำเร็จ\nกรุณาตรวจสอบอีเมล์ของท่าน",
content: Icon(Icons.check_circle,color: Color.fromRGBO(106, 179, 170, 1),size: 80,),
content: Icon(
Icons.check_circle,
color: Color.fromRGBO(106, 179, 170, 1),
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () =>
Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => LoginPage())),
onPressed: () => Navigator.pushReplacement(state.context,
CupertinoPageRoute(builder: (_) => LoginPage())),
child: Text(
"ตกลง",
style: TextStyle(color: Colors.white, fontSize: 20),
......@@ -115,20 +97,19 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
)
]).show();
FogetPasswordModel model = 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,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -141,20 +122,4 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
]).show();
}
}
}
......@@ -424,7 +424,7 @@ class _BookingDetailState extends State<BookingDetail> {
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(14),
fontSize: SizeConfig.getFontSize(20),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
......
......@@ -457,7 +457,13 @@ class _BookingFlowState extends State<BookingFlow> {
SizedBox(width: SizeConfig.getWidth(16),),
Container(
GestureDetector(onTap: (){
setState(() {
print('object');
});
},
child: Container(
alignment: Alignment.topLeft,
width: MediaQuery.of(context).size.width / 4,
height: SizeConfig.getHeight(50),
......@@ -482,6 +488,7 @@ class _BookingFlowState extends State<BookingFlow> {
),
),
),
),
SizedBox(width: SizeConfig.getWidth(16),),
......
import 'package:feelverapp/ui/booking/booking_detail.dart';
import 'package:feelverapp/ui/booking/bookingflow.dart';
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
......@@ -51,12 +53,12 @@ class _BookingFormState extends State<BookingForm> {
right: SizeConfig.getPadding(20),
child: InkWell(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => BookingFlow(),
// ),
// );
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BookingDetail(),
),
);
},
child: Container(
// color: Colors.red,
......
......@@ -12,17 +12,16 @@ import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
String id;
String image;
HomePage({Key key, this.id,this.image}) : super(key: key);
HomePage({Key key, this.id, this.image}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
HomePresenter presenter;
@override
void initState() {
super.initState();
......@@ -31,21 +30,16 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter.Listitem();
// presenter.getid();
presenter.getprofile ();
presenter.Search();
presenter.getprofile();
// presenter.Search();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
SizeConfig(context);
......@@ -158,10 +152,10 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
height: SizeConfig.getWidth(24),
),
onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
Navigator.push(
context,
MaterialPageRoute(builder: (context) => NearmeList()),
);
},
),
Text(
......@@ -203,8 +197,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
showDialog(
context: context,
builder: (BuildContext context) {
return presenter.getmodel==null?Container():NavDrawer(name: presenter.getmodel.result[0].user.name,id:presenter.getmodel.result[0].id.toString(),image:presenter.getmodel.result[0].image ,);
return presenter.getmodel == null
? Container()
: NavDrawer(
name: presenter.getmodel.result[0].user.name,
id: presenter.getmodel.result[0].id
.toString(),
image: presenter.getmodel.result[0].image,
);
});
},
child: Image.asset(
......@@ -238,13 +238,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
MaterialPageRoute(builder: (context) => LoginPage()),
);
},
child: presenter.getmodel==null?Container():Container(
child: presenter.getmodel == null
? Container()
: Container(
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(SizeConfig.getWidth(56))),
child: Image.network(
presenter.getmodel.result[0].image ,
presenter.getmodel.result[0].image,
fit: BoxFit.contain,
width: SizeConfig.getWidth(30),
height: SizeConfig.getWidth(30),
......@@ -276,7 +277,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'SPA',
'99 View',ShopList()),
'99 View',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_massage.png',
......@@ -285,7 +287,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'Massage',
'99 View',NearmeList()),
'99 View',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_beauty.png',
......@@ -294,7 +297,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'BEAUTY',
'99 View',NearmeList()),
'99 View',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_nearme.png',
......@@ -303,7 +307,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'NEAR ME',
'99 View',NearmeList()),
'99 View',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_promotion.png',
......@@ -312,7 +317,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'PROMOTION',
'99 View',NearmeList()),
'99 View',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_mostpopular.png',
......@@ -321,7 +327,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit: BoxFit.fill,
),
'MOST POPULAR',
'99 Vidw',NearmeList()),
'99 Vidw',
ShopList()),
_listItem(
Image.asset(
'assets/images/banner_recommended.png',
......@@ -329,8 +336,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
width: MediaQuery.of(context).size.width,
fit: BoxFit.fill,
),
'RECOMMEND',
'99 View',NearmeList()),
'presenter.homemodel.name[0].toString()',
'99 View',
ShopList()),
SizedBox(
height: 30,
),
......
......@@ -19,7 +19,9 @@ class HomePresenter extends BasePresenter<HomePage> {
final formkey = GlobalKey<FormState>();
GetprofileModel getmodel;
LoginModel logmodel;
HomePresenter(State<HomePage> state) : super(state);
categoryModel catmodel;
Listitem() async {
_api = Api<categoryModel>();
......@@ -27,21 +29,25 @@ class HomePresenter extends BasePresenter<HomePage> {
"access_type": "portal",
});
if (res.fail == null) {
print('res Success');
setState(
() {
catmodel == res.success;
print('res Success' + catmodel.dATA[0].displayName);
},
);
} else {
print('res Fail');
}
}
Search() async{
Search() async {
_api = Api<SearchhomeModel>();
var res = await _api.homesearch({
"keyword_shop" : "spa",
"lang" : "all",
"access" : "portal",
"keyword_shop": "spa",
"lang": "all",
"access": "portal",
});
if (res.fail == null) {
print('res Success');
} else {
......@@ -70,28 +76,24 @@ class HomePresenter extends BasePresenter<HomePage> {
}
}
getid() async {
SharedPreferences pref = await SharedPreferences.getInstance();
setState(() {uid =pref.getString('Id');});
setState(() {
uid = pref.getString('Id');
});
return uid;
}
getprofile() async {
getprofile() async {
_api = Api<GetprofileModel>();
var res = await _api.getprofile({
"id":await AccountUtil.getID()
});
var res = await _api.getprofile({"id": await AccountUtil.getID()});
if (res.fail == null) {
setState(() {
getmodel = res.success;});
print("Hii"+getmodel.result[0].name);
getmodel = res.success;
});
print("Hii" + getmodel.result[0].name);
} else {
Alert(
style: AlertStyle(
......@@ -117,6 +119,4 @@ class HomePresenter extends BasePresenter<HomePage> {
]).show();
}
}
}
......@@ -3,7 +3,6 @@ import 'dart:developer';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
......@@ -16,8 +15,6 @@ import 'package:flutter/material.dart';
import 'package:rflutter_alert/rflutter_alert.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginPresenter extends BasePresenter<LoginPage> {
Api _api;
Timer _timer;
......@@ -26,35 +23,26 @@ class LoginPresenter extends BasePresenter<LoginPage> {
TextEditingController passCtrl = TextEditingController();
TextEditingController phonenumberCtrl = TextEditingController();
LoginPresenter(State<LoginPage> state) : super(state);
/////email Login/////////
letCheckData() async {
letCheckData() async {
// if(!verifyPhoneState){
// throw(allTranslations.text(key: 'please_verify_phone'));
// }
try {
if (emailCtrl.text.isEmpty ) throw ('กรุณากรอก\nอีเมล์');
else if (passCtrl.text.isEmpty ) throw('กรุณากรอก\nรหัสผ่าน');
if (emailCtrl.text.isEmpty)
throw ('กรุณากรอก\nอีเมล์');
else if (passCtrl.text.isEmpty) throw ('กรุณากรอก\nรหัสผ่าน');
Pattern pattern =
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+";
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(emailCtrl.text))
throw ('รูปแบบอีเมล์\nไม่ถูกต้อง');
else {
else {
await letSignIn();
}
} catch (e) {
......@@ -62,11 +50,14 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: '$e',
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -78,47 +69,53 @@ else {
)
]).show();
}
}
static saveID(String id) async {
SharedPreferences pref = await SharedPreferences.getInstance();
pref.setString('Id', id);
}
letSignIn() async {
LoadingView(state.context).show();
_api = Api<LoginModel>();
var res = await _api.login({
"access_type":"mobile",
"access_status":"customer",
"access_type": "mobile",
"access_status": "customer",
"email": emailCtrl.text,
'password':passCtrl.text
'password': passCtrl.text
});
LoadingView(state.context).hide();
if (res.fail == null) {
LoginModel model = res.success;
saveID(model.user.customerInfo.id.toString());
print( await AccountUtil.getToken());
print(await AccountUtil.getToken());
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "เข้าสู่ระบบสำเร็จ",
content: Icon(Icons.check_circle,color: Color.fromRGBO(106, 179, 170, 1),size: 80,),
content: Icon(
Icons.check_circle,
color: Color.fromRGBO(106, 179, 170, 1),
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () { Navigator.pop(state.context);
Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => HomePage(id:model.user.customerInfo.id.toString())));} ,
onPressed: () {
Navigator.pop(state.context);
Navigator.pushReplacement(
state.context,
CupertinoPageRoute(
builder: (_) => HomePage(
id: model.user.customerInfo.id.toString())));
},
child: Text(
"ตกลง",
style: TextStyle(color: Colors.white, fontSize: 20),
......@@ -127,21 +124,23 @@ else {
]).show();
await AccountUtil.saveToken(model.token);
print( await AccountUtil.getToken());
print(await AccountUtil.getToken());
// print(AccountUtil.getToken().toString());
// print("Username ="+"${model.user}");
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "อีเมล์หรือรหัสผ่าน\nไม่ถูกต้อง",
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -155,40 +154,20 @@ else {
}
}
///////phone log in////////////////
letSignIn_phone() async {
LoadingView(state.context).show();
_api = Api<LoginModel>();
var res = await _api.login({
"access_type":"mobile",
"access_status":"customer",
"access_type": "mobile",
"access_status": "customer",
"email": phonenumberCtrl.text,
'password':passCtrl.text
'password': passCtrl.text
});
LoadingView(state.context).hide();
if (res.fail == null) {
LoginModel model = res.success;
......@@ -197,17 +176,22 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "เข้าสู่ระบบสำเร็จ",
content: Icon(Icons.check_circle,color: Color.fromRGBO(106, 179, 170, 1),size: 80,),
content: Icon(
Icons.check_circle,
color: Color.fromRGBO(106, 179, 170, 1),
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () { Navigator.pop(state.context);
Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => HomePage()));} ,
onPressed: () {
Navigator.pop(state.context);
Navigator.pushReplacement(state.context,
CupertinoPageRoute(builder: (_) => HomePage()));
},
child: Text(
"ตกลง",
style: TextStyle(color: Colors.white, fontSize: 20),
......@@ -217,17 +201,20 @@ else {
// print("Username ="+"${model.user}");
print("Token ="+"${model.token}");
print("Token =" + "${model.token}");
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "เบอร์โทรศัพท์หรือรหัสผ่าน\nไม่ถูกต้อง",
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -240,22 +227,22 @@ else {
]).show();
}
}
letCheckData_phone() async {
// if(!verifyPhoneState){
// throw(allTranslations.text(key: 'please_verify_phone'));
// }
try {
if (phonenumberCtrl.text.isEmpty ) throw ('กรุณากรอก\nเบอร์โทรศัพท์มือถือ');
else if (passCtrl.text.isEmpty ) throw('กรุณากรอก\nรหัสผ่าน');
if (phonenumberCtrl.text.isEmpty)
throw ('กรุณากรอก\nเบอร์โทรศัพท์มือถือ');
else if (passCtrl.text.isEmpty) throw ('กรุณากรอก\nรหัสผ่าน');
Pattern pattern =
r'(^(?:[+0]9)?[0-9]{10,12}$)';
Pattern pattern = r'(^(?:[+0]9)?[0-9]{10,12}$)';
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(phonenumberCtrl.text))
throw ('รูปแบบเบอร์โทรศัพท์\nไม่ถูกต้อง');
else {
else {
await letSignIn_phone();
}
} catch (e) {
......@@ -263,11 +250,14 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: '$e',
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -279,49 +269,42 @@ else {
)
]).show();
}
}
// facebookLogin() async {
// try {
// await _facebookLogin.logIn(['email']).then((result) async {
// var fbData = await Api().getFacebookInfo(result.accessToken.token);
// print(fbData);
// await _letSocialSignIn(result.accessToken.userId, 'facebook')
// .then((value) {
// if (value) {
// Navigator.popUntil(state.context, (route) => route.isFirst);
// Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) =>
// NavigatorPage(),
// ));
// } else {
// Navigator.push(
// state.context,
// CupertinoPageRoute(
// builder: (_) => SignUpEmail(
// socialType: SocialType.facebook,
// socialData: new RegisterSocialDataModel(
// socialId: result.accessToken.userId,
// token: result.accessToken.token,
// email: fbData['email'],
// firstName: fbData['first_name'],
// lastName: fbData['last_name'],
// ),
// )));
// }
// });
// });
// } catch (e) {
// print(e);
// }
// }
// facebookLogin() async {
// try {
// await _facebookLogin.logIn(['email']).then((result) async {
// var fbData = await Api().getFacebookInfo(result.accessToken.token);
// print(fbData);
// await _letSocialSignIn(result.accessToken.userId, 'facebook')
// .then((value) {
// if (value) {
// Navigator.popUntil(state.context, (route) => route.isFirst);
// Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) =>
// NavigatorPage(),
// ));
// } else {
// Navigator.push(
// state.context,
// CupertinoPageRoute(
// builder: (_) => SignUpEmail(
// socialType: SocialType.facebook,
// socialData: new RegisterSocialDataModel(
// socialId: result.accessToken.userId,
// token: result.accessToken.token,
// email: fbData['email'],
// firstName: fbData['first_name'],
// lastName: fbData['last_name'],
// ),
// )));
// }
// });
// });
// } catch (e) {
// print(e);
// }
// }
}
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:date_format/date_format.dart';
class NearmeDetail extends StatefulWidget {
String store_name;
String img_url;
String detail;
String date_time;
String address;
String latlng;
String month;
String distanceWithLocation;
NearmeDetail(
{Key key,
this.store_name,
this.img_url,
this.detail,
this.date_time,
this.address,
this.latlng,this.distanceWithLocation})
: super(key: key);
@override
_NearmeDetailState createState() => _NearmeDetailState();
}
void convertDateFromString(String strDate) {
DateTime todayDate = DateTime.parse(strDate);
print(todayDate);
print(formatDate(todayDate,
[yyyy, ' ', mm, ' ', dd, ' ', hh, ' เวลา: ', nn, ':', ss, ' ', am]));
}
class _NearmeDetailState extends State<NearmeDetail> {
@override
Widget build(BuildContext context) {
......@@ -24,11 +52,50 @@ class _NearmeDetailState extends State<NearmeDetail> {
// fontWeight: FontWeight.w500),
// ),
// ),
body: _setupView(),
body: _setupView(context),
);
}
_setupView() {
void getMM(String mm, String dd, String yy) {
print('object' + mm);
if (mm == '01') {
mm = 'มกราคม';
}else if (mm == '02') {
mm = 'กุมภาพันธ์';
}else if (mm == '03') {
mm = 'มีนาคม';
}else if (mm == '04') {
mm = 'เมษายน';
}else if (mm == '05') {
mm = 'พฤษภาคม';
}else if (mm == '06') {
mm = 'มิถุนายน';
}else if (mm == '07') {
mm = 'กรกฎาคม';
}else if (mm == '08') {
mm = 'สิงหาคม';
}else if (mm == '09') {
mm = 'กันยายน';
}else if (mm == '10') {
mm = 'ตุลาคม';
}else if (mm == '11') {
mm = 'พฤศจิกายน';
}else if (mm == '12') {
mm = 'ธันวาคม';
}
widget.month = dd + ' '+ mm + ' ' + yy;
print(widget.date_time.toString());
}
_setupView(BuildContext context) {
var mydate = widget.date_time.toString().split(' ');
var mm = mydate[0].toString().split('-');
getMM( mm[1].toString(), mm[2].toString(), mm[0].toString());
var arr = widget.latlng.toString().split(',');
print(arr[0]);
print(arr[1]);
return SingleChildScrollView(
child: Column(
children: <Widget>[
......@@ -37,9 +104,9 @@ class _NearmeDetailState extends State<NearmeDetail> {
Container(
height: SizeConfig.getWidth(460),
child: Image.network(
'https://res.klook.com/image/upload/fl_lossy.progressive,q_65,f_auto/c_fill,w_1160,h_652/v1522127734/activities/e8mqwlctlagkmzjr4ba1.webp',
widget.img_url.toString(),
width: double.maxFinite,
fit: BoxFit.cover,
fit: BoxFit.fitHeight,
),
),
Positioned(
......@@ -62,6 +129,11 @@ class _NearmeDetailState extends State<NearmeDetail> {
left: SizeConfig.getPadding(
MediaQuery.of(context).size.width / 1.6),
),
child: GestureDetector(
onTap: () {
launch(
'https://www.google.com/maps/dir/?api=1&destination=${arr[0]},${arr[1]}');
},
child: Stack(
children: <Widget>[
Image.asset(
......@@ -86,6 +158,7 @@ class _NearmeDetailState extends State<NearmeDetail> {
],
),
),
),
],
),
Column(
......@@ -93,7 +166,7 @@ class _NearmeDetailState extends State<NearmeDetail> {
Container(
alignment: Alignment.topLeft,
child: Text(
'4 ธ.ค. 2561 18:55 น.',
widget.month.toString(),
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
......@@ -109,7 +182,7 @@ class _NearmeDetailState extends State<NearmeDetail> {
Container(
alignment: Alignment.topLeft,
child: Text(
'Sea Life Bangkok Ocean World',
widget.store_name.toString(),
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(40),
......@@ -165,7 +238,8 @@ class _NearmeDetailState extends State<NearmeDetail> {
size: SizeConfig.getFontSize(16),
),
SizedBox(
width: SizeConfig.getWidth(40),height: SizeConfig.getWidth(30),
width: SizeConfig.getWidth(40),
height: SizeConfig.getWidth(30),
),
ImageIcon(
AssetImage('assets/images/ic_fav_active.png'),
......@@ -175,7 +249,8 @@ class _NearmeDetailState extends State<NearmeDetail> {
SizedBox(
width: SizeConfig.getWidth(8),
),
Container(alignment: Alignment.topLeft,
Container(
alignment: Alignment.topLeft,
child: Text(
'70',
textAlign: TextAlign.left,
......@@ -189,9 +264,11 @@ class _NearmeDetailState extends State<NearmeDetail> {
top: SizeConfig.getPadding(5),
left: SizeConfig.getPadding(0),
bottom: SizeConfig.getPadding(4)),
),SizedBox(
),
SizedBox(
width: SizeConfig.getWidth(20),
),ImageIcon(
),
ImageIcon(
AssetImage('assets/images/ic_comment.png'),
color: Colors.grey,
size: SizeConfig.getFontSize(16),
......@@ -199,7 +276,8 @@ class _NearmeDetailState extends State<NearmeDetail> {
SizedBox(
width: SizeConfig.getWidth(8),
),
Container(alignment: Alignment.topLeft,
Container(
alignment: Alignment.topLeft,
child: Text(
'70',
textAlign: TextAlign.left,
......@@ -213,45 +291,51 @@ class _NearmeDetailState extends State<NearmeDetail> {
top: SizeConfig.getPadding(5),
left: SizeConfig.getPadding(0),
bottom: SizeConfig.getPadding(4)),
),SizedBox(
),
SizedBox(
width: SizeConfig.getWidth(20),
),ImageIcon(
),
ImageIcon(
AssetImage('assets/images/facebook-icon.png'),
color: Colors.grey,
size: SizeConfig.getFontSize(16),
),
SizedBox(
width: SizeConfig.getWidth(20),
),ImageIcon(
),
ImageIcon(
AssetImage('assets/images/ic_twitter.png'),
color: Colors.grey,
size: SizeConfig.getFontSize(16),
),
],
),
// SizedBox(
// height: SizeConfig.getWidth(8),
// ),
// Container(
// alignment: Alignment.topLeft,
// child: Text(
// 'พิพิธภัณฑ์สัตว์น้ำ',
// textAlign: TextAlign.left,
// style: TextStyle(
// color: Colors.grey,
// fontSize: SizeConfig.getFontSize(14),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
// padding: EdgeInsets.only(
// top: SizeConfig.getPadding(0),
// left: SizeConfig.getPadding(16),
// bottom: SizeConfig.getPadding(10)),
// ),
SizedBox(
height: SizeConfig.getWidth(8),
),
Container(
alignment: Alignment.topLeft,
child: Text(
'พิพิธภัณฑ์สัตว์น้ำ',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(14),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
padding: EdgeInsets.only(
top: SizeConfig.getPadding(0),
left: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10)),
height: SizeConfig.getHeight(10),
),
Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(14),
width: SizeConfig.getWidth(16),
),
ImageIcon(
AssetImage('assets/images/pin_drop.png'),
......@@ -262,7 +346,7 @@ class _NearmeDetailState extends State<NearmeDetail> {
width: SizeConfig.getWidth(4),
),
Text(
'54 km',
widget.distanceWithLocation.toString(),
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getFontSize(14),
......@@ -274,7 +358,7 @@ class _NearmeDetailState extends State<NearmeDetail> {
Container(
alignment: Alignment.topLeft,
child: Text(
'ที่อยู่: 991 ถนน พระรามที่ ๑ แขวง ปทุมวัน เขต ปทุมวัน กรุงเทพมหานคร 10330',
widget.address.toString(),
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
......@@ -284,14 +368,15 @@ class _NearmeDetailState extends State<NearmeDetail> {
),
// alignment: Alignment.topLeft,
padding: EdgeInsets.only(
top: SizeConfig.getPadding(8),
top: SizeConfig.getPadding(10),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(10)),
),
Container(
alignment: Alignment.topLeft,
child: Text(
'พิพิธภัณฑ์สัตว์น้ำ ซี ไลฟ์ โอเชียน เวิลด์ กรุงเทพ หรือ บางกอก ซี ไลฟ์ โอเชียนเวิลด์ (อังกฤษ: Sea Life Bangkok Ocean World; ชื่อเดิม: สยามโอเชียนเวิลด์) เป็นพิพิธภัณฑ์สัตว์น้ำใต้ดิน พื้นที่รวม 10,000 ตาราง เมตร ตั้งอยู่ที่ชั้น B1 และ B2 ศูนย์การค้าสยามพารากอน บริหารงานโดย เมอร์ลิน เอ็นเตอร์เทนเมนท์ กรุ๊ป เปิดให้เข้าชมครั้งแรกเมื่อวันที่ 9 ธันวาคม พ.ศ. 2548 พิพิธภัณฑ์สัตว์น้ำ ซี ไลฟ์ โอเชียน เวิลด์ กรุงเทพ หรือ บางกอก ซี ไลฟ์ โอเชียนเวิลด์ (อังกฤษ: Sea Life Bangkok Ocean World; ชื่อเดิม: สยามโอเชียนเวิลด์) เป็นพิพิธภัณฑ์สัตว์น้ำใต้ดิน พื้นที่รวม 10,000 ตารางเมตร ตั้งอยู่ที่ชั้น B1 และ B2 ศูนย์การค้าสยามพารากอน บริหารงานโดย เมอร์ลิน เอ็นเตอร์เทนเมนท์ กรุ๊ป เปิดให้เข้าชมครั้งแรกเมื่อวันที่ 9 ธันวาคม พ.ศ. 2548',
widget.detail.toString(),
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
......
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';
import 'package:feelverapp/util/Util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
......@@ -8,7 +10,22 @@ class NearmeList extends StatefulWidget {
_NearmeListState createState() => _NearmeListState();
}
class _NearmeListState extends State<NearmeList> {
class _NearmeListState extends State<NearmeList> with TickerProviderStateMixin {
NearmeListPresenter presenter;
@override
void initState() {
super.initState();
presenter = NearmeListPresenter(this);
presenter.getnearme();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
......@@ -45,7 +62,7 @@ class _NearmeListState extends State<NearmeList> {
children: <Widget>[
FilterChip(
label: Text(
"ทั้งหมด (10)",
"ทั้งหมด",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(15),
......@@ -58,12 +75,14 @@ class _NearmeListState extends State<NearmeList> {
),
onSelected: (bool value) {
print("selected");
setState(() {});
setState(() {
presenter.type = "";
});
},
),
FilterChip(
label: Text(
"ที่เที่ยว (5)",
"ที่เที่ยว",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(15),
......@@ -80,7 +99,7 @@ class _NearmeListState extends State<NearmeList> {
),
FilterChip(
label: Text(
"ที่กิน (3)",
"ที่กิน",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(15),
......@@ -97,7 +116,7 @@ class _NearmeListState extends State<NearmeList> {
),
FilterChip(
label: Text(
"ที่พัก (1)",
"ที่พัก",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(15),
......@@ -114,7 +133,7 @@ class _NearmeListState extends State<NearmeList> {
),
FilterChip(
label: Text(
"กิจกรรม (1)",
"กิจกรรม",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(15),
......@@ -139,8 +158,14 @@ class _NearmeListState extends State<NearmeList> {
}
_getlist() {
final List<String> entries = <String>['A', 'B', 'C'];
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(140),
left: SizeConfig.getPadding(16),
......@@ -148,32 +173,55 @@ class _NearmeListState extends State<NearmeList> {
bottom: SizeConfig.getPadding(10),
),
child: ListView.builder(
itemCount: entries.length,
itemCount: presenter.getmodel.results.data.length,
itemBuilder: (context, i) {
return _nearByItem(entries[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) {
Widget _nearByItem(String title, String detail, String img, String address,
String latlng, String date_time, String distanceWithLocation) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NearmeDetail(),
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: Card(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Image.network(
'https://scontent.fbkk2-8.fna.fbcdn.net/v/t1.0-9/66224920_2384272051596091_1094623379467534336_n.jpg?_nc_cat=102&_nc_sid=85a577&_nc_eui2=AeElfU4QES6XQW0XzlV5G9zQ-F-e_QdADw_4X579B0APD-UJsAV-PuXX-iMA6hWVLgUUmCNm5HTgTMw_q4YARQm8&_nc_ohc=do7yQl7hf74AX8-8Yk-&_nc_ht=scontent.fbkk2-8.fna&oh=140482c64ecf1893bf59498dfff5f592&oe=5EFAC9CF',
width: SizeConfig.getWidth(110),
height: SizeConfig.getHeight(150),
fit: BoxFit.fitWidth,
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(
......@@ -181,7 +229,7 @@ class _NearmeListState extends State<NearmeList> {
children: <Widget>[
Container(
child: Text(
'ซีไลฟ์ แบงคอก โอเชียน เวิลด์',
title,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(16),
......@@ -189,26 +237,29 @@ class _NearmeListState extends State<NearmeList> {
fontWeight: FontWeight.w700),
),
padding: EdgeInsets.only(
top: SizeConfig.getPadding(16),
top: SizeConfig.getPadding(30),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(16),
bottom: SizeConfig.getPadding(4)),
),
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)),
// 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,
),
Row(
children: <Widget>[
......@@ -224,7 +275,7 @@ class _NearmeListState extends State<NearmeList> {
width: SizeConfig.getWidth(4),
),
Text(
'54 km',
distanceWithLocation + ' Km.',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getFontSize(12),
......@@ -235,8 +286,9 @@ class _NearmeListState extends State<NearmeList> {
),
Container(
child: Text(
'พิพิธภัณฑ์สัตว์น้ำ ซี ไลฟ์ โอเชียน เวิลด์ กรุงเทพ หรือ บางกอก ซี ไลฟ์ โอเชียนเวิลด์...',
Util.removeHTMLTag('${detail}'),
textAlign: TextAlign.left,
maxLines: 3,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(12),
......@@ -247,6 +299,7 @@ class _NearmeListState extends State<NearmeList> {
padding: EdgeInsets.only(
top: SizeConfig.getPadding(8),
left: SizeConfig.getPadding(16),
right: SizeConfig.getPadding(8),
bottom: SizeConfig.getPadding(0)),
),
Row(
......@@ -311,11 +364,12 @@ class _NearmeListState extends State<NearmeList> {
size: SizeConfig.getFontSize(16),
),
SizedBox(
width: SizeConfig.getWidth(40),
width: SizeConfig.getWidth(20),
height: SizeConfig.getWidth(30),
),
],
), SizedBox(
),
SizedBox(
height: SizeConfig.getWidth(10),
),
],
......
import 'package:feelverapp/home_search/searchhomepage_model.dart';
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 'near_me_list.dart';
class NearmeListPresenter extends BasePresenter<NearmeList> {
final formkey = GlobalKey<FormState>();
Api _api;
String type = '3';
NearMeListModel getmodel ;
NearmeListPresenter(State<NearmeList> 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();
// }
// }
}
......@@ -4,7 +4,6 @@ import 'dart:developer';
import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/register/register_model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
......@@ -16,8 +15,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rflutter_alert/rflutter_alert.dart';
class RegisterPresenter extends BasePresenter<Registerpage> {
Api _api;
Timer _timer;
......@@ -28,42 +25,30 @@ class RegisterPresenter extends BasePresenter<Registerpage> {
TextEditingController lastnameCtrl = TextEditingController();
TextEditingController phonenumberCtrl = TextEditingController();
RegisterPresenter(State<Registerpage> state) : super(state);
/////email Login/////////
letCheckData() async {
letCheckData() async {
try {
if (emailCtrl.text.isEmpty ) throw ('กรุณากรอก\nอีเมล์');
else if (passCtrl.text.isEmpty ) throw('กรุณากรอก\nรหัสผ่าน');
else if(firstnameCtrl.text.isEmpty) throw('กรุณากรอกชื่อ');
else if(lastnameCtrl.text.isEmpty) throw('กรุณากรอกนามสกุล');
if (emailCtrl.text.isEmpty)
throw ('กรุณากรอก\nอีเมล์');
else if (passCtrl.text.isEmpty)
throw ('กรุณากรอก\nรหัสผ่าน');
else if (firstnameCtrl.text.isEmpty)
throw ('กรุณากรอกชื่อ');
else if (lastnameCtrl.text.isEmpty) throw ('กรุณากรอกนามสกุล');
Pattern pattern =
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+";
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(emailCtrl.text))
throw ('รูปแบบอีเมล์\nไม่ถูกต้อง');
if (!regex.hasMatch(emailCtrl.text)) throw ('รูปแบบอีเมล์\nไม่ถูกต้อง');
Pattern pattern2 =
r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$';
Pattern pattern2 = r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$';
RegExp regex2 = new RegExp(pattern2);
if (!regex2.hasMatch(passCtrl.text))
throw ('รหัสผ่านต้องมีความยาวอย่าง น้อย 8 ตัวอักษร และต้องประกอบด้วยอักขระ ดังต่อไปนี้\n- ตัวอักษรภาษาอังกฤษ ตัวพิมพ์เล็ก (a-z) \n- ตัวอักษรภาษาอังกฤษ ตัวพิมพ์ใหญ่ (A-Z) \n- ตัวเลข (0-9)');
else {
else {
await letregis();
print("completeee");
}
......@@ -72,11 +57,14 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: '$e',
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -88,7 +76,6 @@ else {
)
]).show();
}
}
letregis() async {
......@@ -96,30 +83,32 @@ else {
_api = Api<RegisterModel>();
var res = await _api.register({
"access_type":"mobile",
"name":firstnameCtrl.text,
"last_name":lastnameCtrl.text,
"access_type": "mobile",
"name": firstnameCtrl.text,
"last_name": lastnameCtrl.text,
"email": emailCtrl.text,
'password':passCtrl.text
'password': passCtrl.text
});
LoadingView(state.context).hide();
if (res.fail == null) {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "สมัครสมาชิกสำเร็จ",
content: Icon(Icons.check_circle,color: Color.fromRGBO(106, 179, 170, 1),size: 80,),
content: Icon(
Icons.check_circle,
color: Color.fromRGBO(106, 179, 170, 1),
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () =>
Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => LoginPage())),
onPressed: () => Navigator.pushReplacement(state.context,
CupertinoPageRoute(builder: (_) => LoginPage())),
child: Text(
"ตกลง",
style: TextStyle(color: Colors.white, fontSize: 20),
......@@ -129,17 +118,20 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
RegisterModel model = res.success;
// print("Username ="+"${model.user}");
print("Regist message ="+"${model.message}");
print("Regist message =" + "${model.message}");
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "อีเมล์\nมีการลงทะเบียนแล้ว",
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -153,54 +145,37 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
}
}
///////phone log in////////////////
letregis_phone() async {
LoadingView(state.context).show();
_api = Api<RegisterModel>();
var res = await _api.register({
"access_type":"mobile",
"access_type": "mobile",
"phone_number": phonenumberCtrl.text,
'password':passCtrl.text
'password': passCtrl.text
});
LoadingView(state.context).hide();
if (res.fail == null) {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "สมัครสมาชิกสำเร็จ",
content: Icon(Icons.check_circle,color: Color.fromRGBO(106, 179, 170, 1),size: 80,),
content: Icon(
Icons.check_circle,
color: Color.fromRGBO(106, 179, 170, 1),
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () =>
Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => LoginPage())),
onPressed: () => Navigator.pushReplacement(state.context,
CupertinoPageRoute(builder: (_) => LoginPage())),
child: Text(
"ตกลง",
style: TextStyle(color: Colors.white, fontSize: 20),
......@@ -210,17 +185,20 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
RegisterModel model = res.success;
// print("Username ="+"${model.user}");
print("Regist message ="+"${model.message}");
print("Regist message =" + "${model.message}");
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "เบอร์โทรศัพท์ของท่าน\nมีการลงทะเบียนแล้ว",
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -233,31 +211,27 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Logi
]).show();
}
}
letCheckData_phone() async {
// if(!verifyPhoneState){
// throw(allTranslations.text(key: 'please_verify_phone'));
// }
try {
if (phonenumberCtrl.text.isEmpty ) throw ('กรุณากรอก\nเบอร์โทรศัพท์มือถือ');
else if (passCtrl.text.isEmpty ) throw('กรุณากรอก\nรหัสผ่าน');
if (phonenumberCtrl.text.isEmpty)
throw ('กรุณากรอก\nเบอร์โทรศัพท์มือถือ');
else if (passCtrl.text.isEmpty) throw ('กรุณากรอก\nรหัสผ่าน');
Pattern pattern =
r'(^(?:[+0]9)?[0-9]{10,12}$)';
Pattern pattern = r'(^(?:[+0]9)?[0-9]{10,12}$)';
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(phonenumberCtrl.text))
throw ('รูปแบบเบอร์โทรศัพท์\nไม่ถูกต้อง');
Pattern pattern2 =
r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$';
Pattern pattern2 = r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$';
RegExp regex2 = new RegExp(pattern2);
if (!regex2.hasMatch(passCtrl.text))
throw ('รหัสผ่านต้องมีความยาวอย่าง น้อย 8 ตัวอักษร และต้องประกอบด้วยอักขระ ดังต่อไปนี้\n- ตัวอักษรภาษาอังกฤษ ตัวพิมพ์เล็ก (a-z) \n- ตัวอักษรภาษาอังกฤษ ตัวพิมพ์ใหญ่ (A-Z) \n- ตัวเลข (0-9)');
else {
else {
await letregis_phone();
print("complete");
}
......@@ -266,11 +240,14 @@ else {
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: '$e',
content: Icon(Icons.warning,color: Colors.orange,size: 80,),
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
......@@ -282,49 +259,42 @@ else {
)
]).show();
}
}
// facebookLogin() async {
// try {
// await _facebookLogin.logIn(['email']).then((result) async {
// var fbData = await Api().getFacebookInfo(result.accessToken.token);
// print(fbData);
// await _letSocialSignIn(result.accessToken.userId, 'facebook')
// .then((value) {
// if (value) {
// Navigator.popUntil(state.context, (route) => route.isFirst);
// Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) =>
// NavigatorPage(),
// ));
// } else {
// Navigator.push(
// state.context,
// CupertinoPageRoute(
// builder: (_) => SignUpEmail(
// socialType: SocialType.facebook,
// socialData: new RegisterSocialDataModel(
// socialId: result.accessToken.userId,
// token: result.accessToken.token,
// email: fbData['email'],
// firstName: fbData['first_name'],
// lastName: fbData['last_name'],
// ),
// )));
// }
// });
// });
// } catch (e) {
// print(e);
// }
// }
// facebookLogin() async {
// try {
// await _facebookLogin.logIn(['email']).then((result) async {
// var fbData = await Api().getFacebookInfo(result.accessToken.token);
// print(fbData);
// await _letSocialSignIn(result.accessToken.userId, 'facebook')
// .then((value) {
// if (value) {
// Navigator.popUntil(state.context, (route) => route.isFirst);
// Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) =>
// NavigatorPage(),
// ));
// } else {
// Navigator.push(
// state.context,
// CupertinoPageRoute(
// builder: (_) => SignUpEmail(
// socialType: SocialType.facebook,
// socialData: new RegisterSocialDataModel(
// socialId: result.accessToken.userId,
// token: result.accessToken.token,
// email: fbData['email'],
// firstName: fbData['first_name'],
// lastName: fbData['last_name'],
// ),
// )));
// }
// });
// });
// } catch (e) {
// print(e);
// }
// }
}
......@@ -250,7 +250,7 @@ class _ReserveListState extends State<ReserveList> {
ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.network(
'https://scontent.fbkk7-2.fna.fbcdn.net/v/t1.0-9/104204530_3370427592977187_6031309814586327212_o.jpg?_nc_cat=106&_nc_sid=110474&_nc_eui2=AeE2vpoR5NHZLbG8b3YABiSdSsMCoPYM3W1KwwKg9gzdbZuYqR1gPnkW3tGe-TS2Vtphdvn2OuvO2CdDLaCMVvcI&_nc_ohc=T5EK3sWOgtAAX994m4I&_nc_ht=scontent.fbkk7-2.fna&oh=0b3e434546b19e256c07ecd6a4d499fb&oe=5F098A94',
'https://scontent.fbkk6-2.fna.fbcdn.net/v/t1.0-9/80389874_111678823672376_4074351232779550720_n.jpg?_nc_cat=103&_nc_sid=dd9801&_nc_eui2=AeHBe_c_AYOcX30ES1cQGlcXShc5ivTsjQtKFzmK9OyNCwzw_ntkQ5eSPr8UZ-yqpKcklZYNfzdU055U-vGIFozt&_nc_ohc=Wgu6buTE8ecAX9S-qj3&_nc_ht=scontent.fbkk6-2.fna&oh=30e01e7bcf2f81cf48e95d7a512f4110&oe=5F580EF5',
width: 85.0,
height: 85.0,
fit: BoxFit.cover,
......
import 'package:html/parser.dart' as htmlParser;
class Util {
static removeHTMLTag(String html){
return htmlParser.parse(html).documentElement.text;
}
}
\ No newline at end of file
# 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:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.2"
boolean_selector:
dependency: transitive
description:
......@@ -29,6 +15,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
charcode:
dependency: transitive
description:
......@@ -36,27 +29,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.0.1"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.14.13"
csslib:
dependency: transitive
description:
name: crypto
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "0.16.2"
cupertino_icons:
dependency: "direct main"
description:
......@@ -64,6 +57,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
date_format:
dependency: "direct main"
description:
name: date_format
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:
......@@ -100,13 +107,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
html:
dependency: "direct main"
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.1"
version: "0.12.2"
http_parser:
dependency: transitive
description:
......@@ -114,20 +128,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
image_cropper:
dependency: "direct main"
description:
name: image_cropper
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
version: "1.3.0"
image_picker:
dependency: "direct main"
description:
......@@ -169,7 +176,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.8"
meta:
dependency: transitive
description:
......@@ -183,7 +190,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
version: "1.7.0"
path_provider_linux:
dependency: transitive
description:
......@@ -204,21 +211,21 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
petitparser:
version: "1.9.0"
platform:
dependency: transitive
description:
name: petitparser
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
version: "2.2.1"
platform_detect:
dependency: transitive
description:
name: platform
name: platform_detect
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
version: "1.4.0"
plugin_platform_interface:
dependency: transitive
description:
......@@ -233,13 +240,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
quiver:
pub_semver:
dependency: transitive
description:
name: quiver
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.4.4"
rflutter_alert:
dependency: "direct main"
description:
......@@ -300,7 +307,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.9.5"
stream_channel:
dependency: transitive
description:
......@@ -328,14 +335,49 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.17"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.2.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.5.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+7"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
vector_math:
dependency: transitive
description:
......@@ -350,13 +392,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.6.0 <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
......@@ -31,6 +31,9 @@ dependencies:
rflutter_alert: ^1.0.3
shared_preferences: ^0.5.6+1
loadmore: ^1.0.4
html: ^0.14.0+3
url_launcher: ^5.4.2
date_format: ^1.0.8
dev_dependencies:
......
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