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
949fc67f
Commit
949fc67f
authored
Aug 13, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
6969e0c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
134 deletions
+111
-134
lib/ui/home/home.dart
+37
-77
lib/ui/shop/shop_list.dart
+63
-51
lib/ui/shop/shoplist_presenter.dart
+11
-6
No files found.
lib/ui/home/home.dart
View file @
949fc67f
...
...
@@ -263,91 +263,51 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
],
),
Expanded
(
child:
SingleChildScrollView
(
child:
presenter
.
CatModel
==
null
?
Container
()
:
_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
,
),
presenter
.
CatModel
.
dATA
[
0
].
name
,
''
,
ShopList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_massage.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
presenter
.
CatModel
.
dATA
[
1
].
name
,
''
,
NearmeList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_beauty.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
presenter
.
CatModel
.
dATA
[
2
].
name
,
''
,
NearmeList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_nearme.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'NEAR ME'
,
''
,
NearmeList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_promotion.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
),
'PROMOTION'
,
''
,
NearmeList
()),
_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'
,
''
,
NearmeList
()),
_listItem
(
Image
.
asset
(
'assets/images/banner_recommended.png'
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
SizedBox
(
height:
30
,
),
'RECOMMEND'
,
''
,
NearmeList
()),
SizedBox
(
height:
30
,
],
),
],
);
}
...
...
@@ -380,7 +340,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
,
),
...
...
lib/ui/shop/shop_list.dart
View file @
949fc67f
...
...
@@ -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 @
949fc67f
...
...
@@ -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
}
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