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
2cb9eec3
Commit
2cb9eec3
authored
Aug 17, 2020
by
Mobile : Art
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
456dbfdd
949fc67f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
241 additions
and
236 deletions
+241
-236
lib/main.dart
+2
-1
lib/model/category/category_model.dart
+28
-28
lib/model/home_search/searchhomepage_model.dart
+0
-0
lib/service/api.dart
+5
-6
lib/ui/home/home.dart
+50
-79
lib/ui/home/home_presenter.dart
+34
-38
lib/ui/nearme/near_me_list_presenter.dart
+0
-1
lib/ui/reserve/reserve_date_time.dart
+39
-25
lib/ui/reserve/reserve_list.dart
+1
-1
lib/ui/shop/shop_list.dart
+63
-51
lib/ui/shop/shoplist_presenter.dart
+11
-6
pubspec.lock
+7
-0
pubspec.yaml
+1
-0
No files found.
lib/main.dart
View file @
2cb9eec3
...
...
@@ -29,7 +29,8 @@ class MyApp extends StatelessWidget {
primarySwatch:
Colors
.
blue
,
),
home:
HomePage
()
home:
SplashScreenPage
()
//home: EditProfile(),
...
...
lib/model/category/category_model.dart
View file @
2cb9eec3
...
...
@@ -57,40 +57,40 @@ class DATA {
this
.
visibility
});
DATA
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
parentId
=
json
[
'parent_id'
];
//
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'
];
//
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'];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'parent_id'
]
=
this
.
parentId
;
//
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
;
//
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;
return
data
;
}
}
lib/home_search/searchhomepage_model.dart
→
lib/
model/
home_search/searchhomepage_model.dart
View file @
2cb9eec3
File moved
lib/service/api.dart
View file @
2cb9eec3
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'
;
...
...
@@ -11,6 +11,8 @@ 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/home_search/searchhomepage_model.dart'
;
import
'package:feelverapp/model/register/register_model.dart'
;
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/shoplist/shoplist_Model.dart'
;
...
...
@@ -29,7 +31,7 @@ class Api<T> {
var
_model
;
var
_fail
;
var
result
;
print
(
"this is body "
+
body
.
toString
());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await
_httpConnection
(
"
${this._baseApi}
/store/shop-list"
,
this
.
_headerApi
,
body
)
...
...
@@ -185,9 +187,6 @@ class Api<T> {
if
(
response
.
statusCode
==
200
)
{
// Array to Map Json
Map
<
String
,
dynamic
>
myData
=
arrayToJson
(
response
.
body
);
print
(
myData
);
_model
=
categoryModel
.
fromJson
(
myData
);
print
(
'myModel '
+
_model
);
...
...
@@ -268,7 +267,7 @@ class Api<T> {
Map
<
String
,
dynamic
>
myJson
=
{};
if
(
data
!=
null
&&
data
.
length
>
0
)
{
myJson
[
'
data
'
]
=
data
;
myJson
[
'
DATA
'
]
=
data
;
}
return
myJson
;
...
...
lib/ui/home/home.dart
View file @
2cb9eec3
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/ui/home/home_presenter.dart'
;
import
'package:feelverapp/ui/login/login.dart'
;
import
'package:feelverapp/ui/menu/menu.dart'
;
...
...
@@ -13,13 +14,17 @@ class HomePage extends StatefulWidget {
String
id
;
String
image
;
HomePage
({
Key
key
,
this
.
id
,
this
.
image
})
:
super
(
key:
key
);
String
search
;
HomePage
({
Key
key
,
this
.
id
,
this
.
image
,
this
.
search
})
:
super
(
key:
key
);
@override
_HomePageState
createState
()
=>
_HomePageState
();
}
class
_HomePageState
extends
State
<
HomePage
>
with
TickerProviderStateMixin
{
TabController
_tabController
;
HomePresenter
presenter
;
@override
...
...
@@ -32,12 +37,16 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
// presenter.getid();
presenter
.
getprofile
();
// presenter.Search();
// presenter.getSearch(widget.search);
}
@override
void
dispose
()
{
super
.
dispose
();
_tabController
.
dispose
();
}
@override
...
...
@@ -258,91 +267,52 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
],
),
Expanded
(
child:
SingleChildScrollView
(
child:
_listView
(),
child:
Container
(
child:
presenter
.
CatModel
==
null
?
Container
()
:
ListView
.
builder
(
itemCount:
presenter
.
CatModel
.
dATA
[
0
].
name
.
length
,
itemBuilder:
(
context
,
i
)
{
return
list
(
i
);
}),
),
),
],
);
}
_listView
()
{
return
Column
(
children:
<
Widget
>[
_listItem
(
Image
.
asset
(
'assets/images/banner_spa.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'SPA'
,
'99 View'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_massage.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'Massage'
,
'99 View'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_beauty.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'BEAUTY'
,
'99 View'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_nearme.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'NEAR ME'
,
'99 View'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_promotion.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'PROMOTION'
,
'99 View'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_mostpopular.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
list
(
int
index
)
{
return
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
[
0
].
cover
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
presenter
.
CatModel
.
dATA
[
index
].
name
,
''
,
ShopList
(),
),
'MOST POPULAR'
,
'99 Vidw'
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_recommended.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
SizedBox
(
height:
30
,
),
'presenter.homemodel.name[0].toString()'
,
'99 View'
,
ShopList
()),
SizedBox
(
height:
30
,
],
),
],
);
}
...
...
@@ -375,7 +345,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child:
Text
(
title
,
style:
TextStyle
(
color:
Colors
.
white
,
color:
Colors
.
black
,
fontSize:
SizeConfig
.
getFontSize
(
30
),
fontWeight:
FontWeight
.
w600
,
),
...
...
@@ -410,6 +380,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
height:
55
,
child:
TextField
(
controller:
presenter
.
searchCtrl
,
decoration:
new
InputDecoration
(
border:
new
OutlineInputBorder
(
borderRadius:
const
BorderRadius
.
all
(
...
...
lib/ui/home/home_presenter.dart
View file @
2cb9eec3
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/home_search/searchhomepage_model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/api.dart'
;
...
...
@@ -15,65 +15,60 @@ import 'package:shared_preferences/shared_preferences.dart';
class
HomePresenter
extends
BasePresenter
<
HomePage
>
{
Api
_api
;
var
category_model
;
String
uid
;
final
formkey
=
GlobalKey
<
FormState
>();
GetprofileModel
getmodel
;
LoginModel
logmodel
;
categoryModel
CatModel
;
TextEditingController
searchCtrl
=
TextEditingController
();
SearchhomeModel
searchhomeModel
;
HomePresenter
(
State
<
HomePage
>
state
)
:
super
(
state
);
categoryModel
catmodel
;
Listitem
()
async
{
_api
=
Api
<
categoryModel
>();
var
res
=
await
_api
.
category
({
"access_type"
:
"portal"
,
});
if
(
res
.
fail
==
null
)
{
setState
(
()
{
catmodel
==
res
.
success
;
print
(
'res Success'
+
catmodel
.
dATA
[
0
].
displayName
);
},
);
if
(
res
.
fail
==
null
){
setState
(()
{
CatModel
=
res
.
success
;
print
(
"dddddddddddddddd"
);
print
(
'
${CatModel.dATA[0].name}
'
);
});
}
else
{
print
(
'res Fail'
);
}
}
Search
()
async
{
getSearch
(
String
search
)
async
{
_api
=
Api
<
SearchhomeModel
>();
var
res
=
await
_api
.
homesearch
({
"keyword_shop"
:
"spa"
,
"lang"
:
"all"
,
"access"
:
"portal"
,
"keyword_shop"
:
searchCtrl
.
text
,
"lang"
:
"all"
,
"access"
:
"portal"
,
});
print
(
'
$searchCtrl
'
);
if
(
res
.
fail
==
null
)
if
(
res
.
success
.
status
)
{
setState
(()
{
searchhomeModel
=
res
.
success
;
category_model
=
res
.
success
;
});
}
else
{
if
(
res
.
fail
==
null
)
{
print
(
'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
();
}
}
getid
()
async
{
...
...
@@ -119,4 +114,5 @@ class HomePresenter extends BasePresenter<HomePage> {
]).
show
();
}
}
}
lib/ui/nearme/near_me_list_presenter.dart
View file @
2cb9eec3
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'
;
...
...
lib/ui/reserve/reserve_date_time.dart
View file @
2cb9eec3
...
...
@@ -2,9 +2,12 @@ import 'package:feelverapp/ui/booking/bookingflow.dart';
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_datetime_picker/flutter_datetime_picker.dart'
;
class
ReserveDateTime
extends
StatefulWidget
{
String
bith
=
'ปี / เดือน / วัน'
;
DateTime
day
;
@override
_ReserveDateTimeState
createState
()
=>
_ReserveDateTimeState
();
}
...
...
@@ -84,6 +87,7 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
),
);
}
_setupView
()
{
return
SingleChildScrollView
(
child:
Column
(
...
...
@@ -229,7 +233,9 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
children:
<
Widget
>[
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
),
top:
SizeConfig
.
getPadding
(
24
)),
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
),
top:
SizeConfig
.
getPadding
(
24
)),
child:
Text
(
'ระบุวันที่เข้าใช้บริการ'
,
style:
TextStyle
(
...
...
@@ -239,38 +245,47 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
fontWeight:
FontWeight
.
w500
),
),
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
SizeConfig
.
getPadding
(
8.0
),
horizontal:
SizeConfig
.
getPadding
(
24
),
),
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
/
1
,
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
)),
child:
Card
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
SizeConfig
.
getPadding
(
50.0
),
),
),
child:
TextFormField
(
// controller: loginBloc.emailCtrl,
// validator: loginBloc.validateField,
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
symmetric
(
vertical:
SizeConfig
.
getPadding
(
20
),
horizontal:
SizeConfig
.
getPadding
(
16
),
),
// hintText:
// allTranslations.text(key2: 'email', key: 'login') +
// ' / ' +
// allTranslations.text(
// key2: 'tel_number', key: 'register'),
border:
OutlineInputBorder
(
borderSide:
BorderSide
.
none
),
),
child:
FlatButton
(
onPressed:
()
{
DatePicker
.
showDatePicker
(
context
,
showTitleActions:
true
,
minTime:
DateTime
(
1980
,
3
,
5
),
maxTime:
DateTime
(
2025
,
6
,
7
),
onChanged:
(
date
)
{
print
(
'change
$date
'
);
},
onConfirm:
(
date
)
{
setState
(()
{
widget
.
day
=
date
;
widget
.
bith
=
"
${widget.day.year}
-
${widget.day.month}
-
${widget.day.day}
"
;
print
(
'
${widget.day.year}
/
${widget.day.month}
/
${widget.day.day}
'
);
print
(
widget
.
bith
);
});
},
currentTime:
DateTime
.
now
(),
locale:
LocaleType
.
th
);
},
child:
widget
.
bith
==
'ปี / เดือน / วัน'
?
Text
(
'ปี / เดือน / วัน'
,
style:
TextStyle
(
color:
Colors
.
black
),
)
:
Text
(
'
${widget.bith}
'
,
style:
TextStyle
(
color:
Colors
.
black
),
),
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
)),
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
)
,
top:
SizeConfig
.
getPadding
(
16
)
),
child:
Text
(
'ระบุเวลาที่เข้าใช้บริการ'
,
style:
TextStyle
(
...
...
@@ -287,7 +302,7 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
child:
Card
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
SizeConfig
.
getPadding
(
50.0
)),
BorderRadius
.
circular
(
SizeConfig
.
getPadding
(
50.0
)),
),
child:
TextFormField
(
// controller: loginBloc.passCtrl,
...
...
@@ -313,5 +328,4 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
),
);
}
}
lib/ui/reserve/reserve_list.dart
View file @
2cb9eec3
...
...
@@ -53,7 +53,7 @@ class _ReserveListState extends State<ReserveList> {
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
BookingFlow
(),
builder:
(
context
)
=>
ReserveDateTime
(),
),
);
},
...
...
lib/ui/shop/shop_list.dart
View file @
2cb9eec3
...
...
@@ -6,14 +6,13 @@ import 'package:feelverapp/util/SizeConfig.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
class
ShopList
extends
StatefulWidget
{
@override
_ShopListState
createState
()
=>
_ShopListState
();
}
class
_ShopListState
extends
State
<
ShopList
>
with
TickerProviderStateMixin
{
var
entries
=
new
List
<
String
>.
generate
(
1
,
(
i
)
=>
"Item
$i
"
);
// var entries = new List<String>.generate(2
, (i) => "Item $i");
ShoplistPresenter
presenter
;
...
...
@@ -23,8 +22,6 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
presenter
=
ShoplistPresenter
(
this
);
presenter
.
Listitem
();
}
@override
...
...
@@ -256,11 +253,6 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
}
_getlist
()
{
final
List
<
String
>
entries
=
<
String
>[
'Ivory Relax and Spa'
,
'Sunshine Spa & Massage'
,
'Mandarin Ginger Spa'
];
return
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
only
(
...
...
@@ -269,36 +261,39 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
right:
SizeConfig
.
getPadding
(
16
),
bottom:
SizeConfig
.
getPadding
(
10
),
),
child:
ListView
.
builder
(
itemCount:
entries
.
length
,
itemBuilder:
(
context
,
i
)
{
final
widgetItem
=
(
i
==
entries
.
length
);
new
RaisedButton
(
child:
new
Text
(
'Load more ...'
,
style:
new
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
,
),
),
onPressed:
()
{
var
nextItems
=
new
List
<
String
>.
generate
(
1
,
(
i
)
{
var
itemId
=
i
+
entries
.
length
;
return
"Item
$itemId
"
;
});
setState
(()
{
entries
.
addAll
(
nextItems
);
});
});
return
_shopItem
(
entries
[
i
]);
}),
child:
presenter
.
shopModel
==
null
?
Container
()
:
ListView
.
builder
(
itemCount:
presenter
.
shopModel
.
dATA
[
0
].
storeCode
.
length
,
itemBuilder:
(
context
,
i
)
{
// new RaisedButton(
// child: new Text(
// 'Load more ...',
// style: new TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.bold,
// ),
// ),
// onPressed: () {
// var nextItems = new List<String>.generate(2, (i) {
// var itemId = i + presenter.shopModel.dATA[i].storeName.length;
// return "Item $itemId";
// });
// setState(() {
// entries.addAll(nextItems);
// });
// });
return
_shopItem
(
presenter
.
shopModel
.
dATA
[
i
].
storeName
,
presenter
.
shopModel
.
dATA
[
i
].
storeCover
,
presenter
.
shopModel
.
dATA
[
i
].
address
,
presenter
.
shopModel
.
dATA
[
i
].
detail
==
null
?
""
:
presenter
.
shopModel
.
dATA
[
i
].
detail
);
}),
),
);
}
Widget
_shopItem
(
String
title
)
{
Widget
_shopItem
(
String
title
,
String
image
,
String
address
,
String
detail
)
{
return
Card
(
child:
Column
(
children:
<
Widget
>[
...
...
@@ -306,12 +301,19 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
height:
SizeConfig
.
getHeight
(
270
),
child:
Stack
(
children:
<
Widget
>[
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
,
),
presenter
.
shopModel
==
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
(
image
,
height:
SizeConfig
.
getWidth
(
180
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
cover
,
),
Positioned
(
right:
SizeConfig
.
getPadding
(
16
),
top:
SizeConfig
.
getPadding
(
16
),
...
...
@@ -351,15 +353,25 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
)),
alignment:
Alignment
.
topLeft
,
child:
Text
(
'4/18, 4/21 BTS Nana Exit4 Sukhumvit Soi 8 , KlongToey Bangkok, Thailand 10110'
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
child:
presenter
.
shopModel
==
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
(
12
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
...
...
@@ -369,7 +381,7 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
bottom:
SizeConfig
.
getPadding
(
10
)),
alignment:
Alignment
.
topLeft
,
child:
Text
(
'Body Scrub'
,
detail
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
Colors
.
black
,
...
...
lib/ui/shop/shoplist_presenter.dart
View file @
2cb9eec3
...
...
@@ -4,11 +4,10 @@ import 'package:feelverapp/service/base_presenter.dart';
import
'package:feelverapp/ui/shop/shop_list.dart'
;
import
'package:flutter/material.dart'
;
class
ShoplistPresenter
extends
BasePresenter
<
ShopList
>{
class
ShoplistPresenter
extends
BasePresenter
<
ShopList
>
{
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
shoplistModel
shopModel
;
ShoplistPresenter
(
State
<
ShopList
>
state
)
:
super
(
state
);
...
...
@@ -18,11 +17,18 @@ class ShoplistPresenter extends BasePresenter<ShopList>{
"sort"
:
"asc"
,
"lang"
:
"en_US"
,
"limit"
:
"8"
,
"offset"
:
"10"
,
"near_location"
:
"18.78635785784557,98.97981414149695"
,
});
if
(
res
.
fail
==
null
)
{
print
(
'res Success'
);
setState
(()
{
shopModel
=
res
.
success
;
print
(
"gggggggggggg"
);
print
(
'
${shopModel.dATA[0].storeName}
'
);
});
}
else
{
print
(
'res Fail'
);
}
}
}
\ No newline at end of file
}
pubspec.lock
View file @
2cb9eec3
...
...
@@ -83,6 +83,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
2cb9eec3
...
...
@@ -34,6 +34,7 @@ dependencies:
html
:
^0.14.0+3
url_launcher
:
^5.4.2
date_format
:
^1.0.8
flutter_datetime_picker
:
^1.4.0
dev_dependencies
:
...
...
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