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
218ffcf6
Commit
218ffcf6
authored
Aug 27, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.2fellows.com/art/feelver
into develop
parents
a039efda
91eb10ce
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
308 additions
and
260 deletions
+308
-260
lib/ui/booking/booking_detail.dart
+23
-4
lib/ui/booking/booking_detail_presenter.dart
+49
-40
lib/ui/home/home.dart
+79
-57
lib/ui/home/home_presenter.dart
+55
-0
lib/ui/payment/mycart.dart
+36
-45
lib/ui/shop/shop_list_detail.dart
+4
-4
lib/ui/shop/shoplistdetail_presenter.dart
+36
-49
pubspec.lock
+26
-61
No files found.
lib/ui/booking/booking_detail.dart
View file @
218ffcf6
...
@@ -32,6 +32,8 @@ class _BookingDetailState extends State<BookingDetail> {
...
@@ -32,6 +32,8 @@ class _BookingDetailState extends State<BookingDetail> {
presenter
.
store_id
=
widget
.
store_id
;
presenter
.
store_id
=
widget
.
store_id
;
presenter
.
getid
=
widget
.
getid
;
presenter
.
getid
=
widget
.
getid
;
});
});
presenter
.
getudid
();
presenter
.
getDetail
();
presenter
.
getDetail
();
}
}
...
@@ -120,10 +122,27 @@ class _BookingDetailState extends State<BookingDetail> {
...
@@ -120,10 +122,27 @@ class _BookingDetailState extends State<BookingDetail> {
SizedBox
(
SizedBox
(
width:
SizeConfig
.
getWidth
(
24
),
width:
SizeConfig
.
getWidth
(
24
),
),
),
ImageIcon
(
Positioned
(
AssetImage
(
'assets/images/ic_fav_active.png'
),
right:
SizeConfig
.
getPadding
(
16
),
color:
Colors
.
grey
,
top:
SizeConfig
.
getPadding
(
16
),
size:
SizeConfig
.
getFontSize
(
24
),
child:
InkResponse
(
highlightShape:
BoxShape
.
circle
,
highlightColor:
Color
(
0xFFDD175F
),
focusColor:
Color
(
0xFFDD175F
),
splashColor:
Color
(
0xFFDD175F
),
onTap:
()
{
setState
(()
{
presenter
.
fav
?
presenter
.
fav
=
false
:
presenter
.
Addfav
(
widget
.
getid
.
toString
());
});
},
child:
ImageIcon
(
AssetImage
(
'assets/images/ic_fav_list.png'
),
color:
presenter
.
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
grey
,
size:
SizeConfig
.
getFontSize
(
30
),
),
),
),
),
SizedBox
(
SizedBox
(
width:
SizeConfig
.
getWidth
(
8
),
width:
SizeConfig
.
getWidth
(
8
),
...
...
lib/ui/booking/booking_detail_presenter.dart
View file @
218ffcf6
import
'package:feelverapp/model/favorite/addfav_model.dart'
;
import
'package:feelverapp/model/nearme/nearme_list_model.dart'
;
import
'package:feelverapp/model/nearme/nearme_list_model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
...
@@ -5,6 +6,7 @@ import 'package:feelverapp/service/api.dart';
...
@@ -5,6 +6,7 @@ import 'package:feelverapp/service/api.dart';
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
...
@@ -17,9 +19,12 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
...
@@ -17,9 +19,12 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
final
formkey
=
GlobalKey
<
FormState
>();
final
formkey
=
GlobalKey
<
FormState
>();
Api
_api
;
Api
_api
;
String
type
=
'3'
;
String
type
=
'3'
;
int
getid
;
int
getid
;
int
vendor_id
;
int
vendor_id
;
int
store_id
;
int
store_id
;
bool
fav
=
false
;
AddfavModel
addmodel
;
String
uid
;
ProductModel
getmodel
;
ProductModel
getmodel
;
...
@@ -72,43 +77,47 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
...
@@ -72,43 +77,47 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
}
}
}
}
// getnearme() async {
getudid
()
async
{
// _api = Api<NearMeListModel>();
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
//
setState
(()
{
// var res = await _api.getNearList({});
uid
=
pref
.
getString
(
'Id'
);
// print("Hii" + getmodel[0].storeName);
});
// print("Hii2" + res.success);
return
uid
;
//
}
// if (res.fail == null) {
// setState(() {
Addfav
(
String
id
)
async
{
// NearMeListModel model = res.success;
LoadingView
(
state
.
context
).
show
();
//
_api
=
Api
<
AddfavModel
>();
//// getmodel = res.success
var
res
=
await
_api
.
addfav
({
// }
"customer_id"
:
uid
,
// );
"store_id"
:
id
,
// } else {
"vendor_id"
:
id
,
// Alert(
"product_id"
:
id
,
// style: AlertStyle(
});
// animationType: AnimationType.fromTop,
LoadingView
(
state
.
context
).
hide
();
// isCloseButton: false,
if
(
res
.
fail
==
null
)
{
// ),
setState
(()
{
// context: state.context,
addmodel
=
res
.
success
;
// title: "ไม่สามารถติดต่อ\nเซิร์ฟเวอร์ได้",
print
(
"complete"
);
// content: Icon(
fav
=
true
;
// Icons.warning,
});
// color: Colors.orange,
showDialog
(
// size: 80,
context:
state
.
context
,
// ),
builder:
(
context
)
{
// buttons: [
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
// DialogButton(
Navigator
.
of
(
context
).
pop
(
true
);
// color: Color.fromRGBO(106, 179, 170, 1),
});
// onPressed: () => Navigator.pop(state.context),
return
AlertDialog
(
// child: Text(
content:
ImageIcon
(
// "ลองอีกครั้ง",
AssetImage
(
'assets/images/ic_fav_list.png'
),
// style: TextStyle(color: Colors.white, fontSize: 20),
color:
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
grey
,
// ),
size:
SizeConfig
.
getFontSize
(
30
),
// )
),
// ]).show();
title:
Center
(
child:
Text
(
'บันทึกสำเร็จ'
)),
// }
);
// }
});
}
else
{
print
(
'res Fail'
);
}
}
}
}
lib/ui/home/home.dart
View file @
218ffcf6
...
@@ -38,7 +38,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -38,7 +38,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter
=
HomePresenter
(
this
);
presenter
=
HomePresenter
(
this
);
presenter
.
Listitem
();
presenter
.
Listitem
();
//
presenter.getid();
presenter
.
getid
();
presenter
.
getprofile
();
presenter
.
getprofile
();
//print("nenwenwenwew"+presenter.CatModel.dATA[0].cover,);
//print("nenwenwenwew"+presenter.CatModel.dATA[0].cover,);
...
@@ -265,12 +265,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -265,12 +265,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child:
ClipRRect
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
presenter
.
getmodel
.
result
[
0
].
image
==
null
?
Container
():
Image
.
network
(
child:
presenter
.
getmodel
.
result
[
0
].
image
==
null
presenter
.
getmodel
.
result
[
0
].
image
,
?
Container
()
fit:
BoxFit
.
contain
,
:
Image
.
network
(
width:
SizeConfig
.
getWidth
(
30
),
presenter
.
getmodel
.
result
[
0
].
image
,
height:
SizeConfig
.
getWidth
(
30
),
fit:
BoxFit
.
contain
,
),
width:
SizeConfig
.
getWidth
(
30
),
height:
SizeConfig
.
getWidth
(
30
),
),
),
),
),
),
),
),
...
@@ -291,12 +293,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -291,12 +293,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child:
ClipRRect
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
presenter
.
getmodel
.
result
[
0
].
image
==
null
?
Container
():
Image
.
network
(
child:
presenter
.
getmodel
.
result
[
0
].
image
==
null
presenter
.
getmodel
.
result
[
0
].
image
,
?
Container
()
fit:
BoxFit
.
contain
,
:
Image
.
network
(
width:
SizeConfig
.
getWidth
(
30
),
presenter
.
getmodel
.
result
[
0
].
image
,
height:
SizeConfig
.
getWidth
(
30
),
fit:
BoxFit
.
contain
,
),
width:
SizeConfig
.
getWidth
(
30
),
height:
SizeConfig
.
getWidth
(
30
),
),
),
),
),
),
),
),
...
@@ -366,7 +370,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -366,7 +370,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
);
);
}
}
Widget
_shopItem
(
String
title
,
String
image
,
String
address
,
String
detail
,
String
id
)
{
Widget
_shopItem
(
String
title
,
String
image
,
String
address
,
String
detail
,
String
id
,
String
location
)
{
return
Card
(
return
Card
(
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -390,57 +395,72 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -390,57 +395,72 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
Positioned
(
Positioned
(
right:
SizeConfig
.
getPadding
(
16
),
right:
SizeConfig
.
getPadding
(
16
),
top:
SizeConfig
.
getPadding
(
16
),
top:
SizeConfig
.
getPadding
(
16
),
child:
ImageIcon
(
child:
InkResponse
(
AssetImage
(
'assets/images/ic_fav_list.png'
),
highlightShape:
BoxShape
.
circle
,
color:
Colors
.
white
,
highlightColor:
Color
(
0xFFDD175F
),
size:
SizeConfig
.
getFontSize
(
30
),
focusColor:
Color
(
0xFFDD175F
),
splashColor:
Color
(
0xFFDD175F
),
onTap:
()
{
setState
(()
{
presenter
.
fav
?
presenter
.
fav
=
false
:
presenter
.
Addfav
(
id
.
toString
());
},);
},
child:
ImageIcon
(
AssetImage
(
'assets/images/ic_fav_list.png'
),
color:
presenter
.
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
white
,
size:
SizeConfig
.
getFontSize
(
30
),
),
),
),
),
),
Positioned
(
Positioned
(
left:
SizeConfig
.
getPadding
(
16
),
left:
SizeConfig
.
getPadding
(
16
),
top:
SizeConfig
.
getPadding
(
165
),
top:
SizeConfig
.
getPadding
(
165
),
child:
Image
.
asset
(
child:
InkWell
(
'assets/images/pin_list.png'
,
onTap:
(){
width:
SizeConfig
.
getWidth
(
50
),
print
(
location
);
height:
SizeConfig
.
getWidth
(
50
),
List
values
=
location
.
split
(
","
);
// split() will split from . and gives new List with separated elements.
values
.
forEach
(
print
);
print
(
"lat ="
+
values
[
0
]);
print
(
"lng ="
+
values
[
1
]);
presenter
.
gotoDirection
(
values
[
0
],
values
[
1
]);
},
child:
Image
.
asset
(
'assets/images/pin_list.png'
,
width:
SizeConfig
.
getWidth
(
50
),
height:
SizeConfig
.
getWidth
(
50
),
),
),
),
),
),
Positioned
(
Positioned
(
left:
SizeConfig
.
getPadding
(
75
),
left:
SizeConfig
.
getPadding
(
75
),
top:
SizeConfig
.
getPadding
(
190
),
top:
SizeConfig
.
getPadding
(
190
),
child:
child:
InkWell
(
child:
Text
(
InkWell
(
title
,
child:
Text
(
textAlign:
TextAlign
.
left
,
title
,
style:
TextStyle
(
textAlign:
TextAlign
.
left
,
decoration:
TextDecoration
.
underline
,
style:
TextStyle
(
color:
Colors
.
black
,
decoration:
TextDecoration
.
underline
,
fontSize:
SizeConfig
.
getFontSize
(
12
),
color:
Colors
.
black
,
fontFamily:
"SF_Pro_Text"
,
fontSize:
SizeConfig
.
getFontSize
(
11
),
fontWeight:
FontWeight
.
w700
),
fontFamily:
"SF_Pro_Text"
,
),
fontWeight:
FontWeight
.
w700
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ShopListDetail
(
id:
id
)),
);
},
),
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ShopListDetail
(
id:
id
)),
);
},
),
),
),
Positioned
(
Positioned
(
left:
SizeConfig
.
getPadding
(
2
8
0
),
left:
SizeConfig
.
getPadding
(
2
9
0
),
top:
SizeConfig
.
getPadding
(
1
90
),
top:
SizeConfig
.
getPadding
(
1
87
),
child:
Icon
(
child:
Icon
(
Icons
.
star
,
Icons
.
star
,
color:
Colors
.
orangeAccent
,
color:
Colors
.
orangeAccent
,
...
@@ -448,10 +468,10 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -448,10 +468,10 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
),
),
),
Positioned
(
Positioned
(
left:
SizeConfig
.
getPadding
(
3
0
0
),
left:
SizeConfig
.
getPadding
(
3
1
0
),
top:
SizeConfig
.
getPadding
(
190
),
top:
SizeConfig
.
getPadding
(
190
),
child:
Text
(
child:
Text
(
presenter
.
searchhomeModel
.
thTH
[
0
].
star
.
toString
(),
presenter
.
searchhomeModel
.
thTH
[
0
].
star
.
toString
(),
textAlign:
TextAlign
.
left
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
black
,
color:
Colors
.
black
,
...
@@ -484,9 +504,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -484,9 +504,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
textAlign:
TextAlign
.
left
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
grey
,
color:
Colors
.
grey
,
fontSize:
SizeConfig
.
getFontSize
(
1
0
),
fontSize:
SizeConfig
.
getFontSize
(
1
2
),
fontFamily:
"SF_Pro_Text"
,
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
fontWeight:
FontWeight
.
w500
),
maxLines:
2
,
),
),
),
),
SizedBox
(
SizedBox
(
...
@@ -535,7 +555,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
...
@@ -535,7 +555,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter
.
searchhomeModel
.
thTH
[
i
].
detail
==
null
presenter
.
searchhomeModel
.
thTH
[
i
].
detail
==
null
?
""
?
""
:
presenter
.
searchhomeModel
.
thTH
[
i
].
detail
,
:
presenter
.
searchhomeModel
.
thTH
[
i
].
detail
,
presenter
.
searchhomeModel
.
thTH
[
i
].
id
.
toString
(),
presenter
.
searchhomeModel
.
thTH
[
i
].
id
.
toString
(),
presenter
.
searchhomeModel
.
thTH
[
i
].
location
.
toString
(),
);
);
}),
}),
),
),
...
...
lib/ui/home/home_presenter.dart
View file @
218ffcf6
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/editprofile/getprofilemodel.dart'
;
import
'package:feelverapp/model/editprofile/getprofilemodel.dart'
;
import
'package:feelverapp/model/favorite/addfav_model.dart'
;
import
'package:feelverapp/model/home/home_model.dart'
;
import
'package:feelverapp/model/home/home_model.dart'
;
import
'package:feelverapp/model/home_search/searchhomepage_model.dart'
;
import
'package:feelverapp/model/home_search/searchhomepage_model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
...
@@ -9,9 +10,11 @@ import 'package:feelverapp/service/api.dart';
...
@@ -9,9 +10,11 @@ import 'package:feelverapp/service/api.dart';
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
class
HomePresenter
extends
BasePresenter
<
HomePage
>
{
class
HomePresenter
extends
BasePresenter
<
HomePage
>
{
Api
_api
;
Api
_api
;
...
@@ -22,6 +25,8 @@ class HomePresenter extends BasePresenter<HomePage> {
...
@@ -22,6 +25,8 @@ class HomePresenter extends BasePresenter<HomePage> {
LoginModel
logmodel
;
LoginModel
logmodel
;
CategoryModel
CatModel
;
CategoryModel
CatModel
;
bool
fav
=
false
;
AddfavModel
addmodel
;
TextEditingController
searchCtrl
=
TextEditingController
();
TextEditingController
searchCtrl
=
TextEditingController
();
SearchhomeModel
searchhomeModel
;
SearchhomeModel
searchhomeModel
;
...
@@ -118,5 +123,55 @@ class HomePresenter extends BasePresenter<HomePage> {
...
@@ -118,5 +123,55 @@ class HomePresenter extends BasePresenter<HomePage> {
]).
show
();
]).
show
();
}
}
}
}
gotoDirection
(
String
lat
,
String
lng
)
{
print
(
"debug"
);
print
(
lat
);
print
(
lng
);
launch
(
'https://www.google.com/maps/dir/?api=1&destination=
${lat}
,
${lng}
'
);
}
getudid
()
async
{
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
setState
(()
{
uid
=
pref
.
getString
(
'Id'
);
});
return
uid
;
}
Addfav
(
String
id
)
async
{
LoadingView
(
state
.
context
).
show
();
_api
=
Api
<
AddfavModel
>();
var
res
=
await
_api
.
addfav
({
"customer_id"
:
uid
,
"store_id"
:
id
,
"vendor_id"
:
id
,
"product_id"
:
id
,
});
LoadingView
(
state
.
context
).
hide
();
if
(
res
.
fail
==
null
)
{
setState
(()
{
addmodel
=
res
.
success
;
print
(
"complete"
);
fav
=
true
;
});
showDialog
(
context:
state
.
context
,
builder:
(
context
)
{
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
Navigator
.
of
(
context
).
pop
(
true
);
});
return
AlertDialog
(
content:
ImageIcon
(
AssetImage
(
'assets/images/ic_fav_list.png'
),
color:
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
grey
,
size:
SizeConfig
.
getFontSize
(
30
),
),
title:
Center
(
child:
Text
(
'บันทึกสำเร็จ'
)),
);
});
}
else
{
print
(
'res Fail'
);
}
}
}
}
lib/ui/payment/mycart.dart
View file @
218ffcf6
...
@@ -161,55 +161,45 @@ class _MyCartState extends State<MyCart> {
...
@@ -161,55 +161,45 @@ class _MyCartState extends State<MyCart> {
return
Column
(
return
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
header
(),
header
(),
SizedBox
(
//
SizedBox(
height:
SizeConfig
.
getHeight
(
15
),
// height: SizeConfig.getHeight(10
),
),
//
),
list1
(),
_getlist
(),
],
],
);
);
}
}
// Widget containt() {
_getlist
()
{
// return Expanded(
return
Expanded
(
// child: SingleChildScrollView(
child:
Container
(
// padding: EdgeInsets.only(
margin:
EdgeInsets
.
only
(
// left: SizeConfig.getPadding(10),
top:
SizeConfig
.
getPadding
(
0
),
// right: SizeConfig.getPadding(10),
left:
SizeConfig
.
getPadding
(
16
),
// top: SizeConfig.getPadding(8),
right:
SizeConfig
.
getPadding
(
16
),
// bottom: SizeConfig.getPadding(8),
bottom:
SizeConfig
.
getPadding
(
16
),
// ),
),
// child: Container(
// child: presenter.shopModel == null
// alignment: FractionalOffset.topLeft,
// ? Container()
// child: Column(
// :
// crossAxisAlignment: CrossAxisAlignment.start,
child:
ListView
.
builder
(
// children: <Widget>[
itemCount:
3
,
// SizedBox(
itemBuilder:
(
context
,
i
)
{
// height: SizeConfig.getHeight(15),
return
list1
();
// ),
},),
// list1(),
),
// Divider(
);
// color: Colors.black,
}
// height: SizeConfig.getHeight(40),
// ),
//// list3(),
// ],
// ),
// ),
// ),
// );
// }
Widget
list1
()
{
Widget
list1
()
{
return
Card
(
return
Card
(
elevation:
5
,
elevation:
5
,
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
only
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
16
),
left:
SizeConfig
.
getPadding
(
8
),
top:
SizeConfig
.
getPadding
(
8
),
top:
SizeConfig
.
getPadding
(
8
),
right:
SizeConfig
.
getPadding
(
16
),
bottom:
SizeConfig
.
getPadding
(
16
),
bottom:
SizeConfig
.
getPadding
(
8
),
),
),
// color: Colors.red,
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -236,14 +226,15 @@ class _MyCartState extends State<MyCart> {
...
@@ -236,14 +226,15 @@ class _MyCartState extends State<MyCart> {
'Ivory Relax and Spa'
,
'Ivory Relax and Spa'
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
black
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
,
),
),
),
),
Spacer
(),
Spacer
(),
IconButton
(
IconButton
(
icon:
Icon
(
Icons
.
delete
),
icon:
Icon
(
Icons
.
delete
),
color:
Colors
.
black
,
color:
Colors
.
grey
,
onPressed:
()
{
onPressed:
()
{
print
(
'delete'
);
print
(
'delete'
);
},
},
...
@@ -252,18 +243,18 @@ class _MyCartState extends State<MyCart> {
...
@@ -252,18 +243,18 @@ class _MyCartState extends State<MyCart> {
),
),
),
),
Container
(
Container
(
// color: Colors.white,
child:
Text
(
child:
Text
(
'นวดเเผนไทย'
,
'นวดเเผนไทย'
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
black
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w600
,
),
),
),
),
),
),
SizedBox
(
SizedBox
(
height:
SizeConfig
.
getHeight
(
5
),
height:
SizeConfig
.
getHeight
(
12
),
),
),
Container
(
Container
(
// color: Colors.yellow,
// color: Colors.yellow,
...
@@ -296,7 +287,7 @@ class _MyCartState extends State<MyCart> {
...
@@ -296,7 +287,7 @@ class _MyCartState extends State<MyCart> {
),
),
),
),
SizedBox
(
SizedBox
(
height:
SizeConfig
.
getHeight
(
5
),
height:
SizeConfig
.
getHeight
(
10
),
),
),
Container
(
Container
(
// color: Colors.orangeAccent,
// color: Colors.orangeAccent,
...
...
lib/ui/shop/shop_list_detail.dart
View file @
218ffcf6
...
@@ -203,7 +203,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
...
@@ -203,7 +203,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
textAlign:
TextAlign
.
left
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
decoration:
TextDecoration
.
underline
,
color:
Colors
.
grey
,
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
13
),
fontSize:
SizeConfig
.
getFontSize
(
13
),
fontFamily:
"SF_Pro_Text"
,
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w700
),
fontWeight:
FontWeight
.
w700
),
...
@@ -548,7 +548,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
...
@@ -548,7 +548,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
top:
SizeConfig
.
getPadding
(
15
),
top:
SizeConfig
.
getPadding
(
15
),
left:
SizeConfig
.
getPadding
(
24
),
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
bottom:
SizeConfig
.
getPadding
(
5
),
bottom:
SizeConfig
.
getPadding
(
0
),
),
),
alignment:
Alignment
.
topLeft
,
alignment:
Alignment
.
topLeft
,
child:
Text
(
child:
Text
(
...
@@ -562,7 +562,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
...
@@ -562,7 +562,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
),
),
),
),
Container
(
Container
(
height:
200
,
height:
SizeConfig
.
getHeight
(
180
)
,
padding:
EdgeInsets
.
only
(
padding:
EdgeInsets
.
only
(
top:
SizeConfig
.
getPadding
(
0
),
top:
SizeConfig
.
getPadding
(
0
),
left:
SizeConfig
.
getPadding
(
24
),
left:
SizeConfig
.
getPadding
(
24
),
...
@@ -715,7 +715,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
...
@@ -715,7 +715,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
'ความคุ้มค่า'
'ความคุ้มค่า'
];
];
return
Container
(
return
Container
(
height:
9
0
,
height:
7
0
,
child:
GridView
.
count
(
child:
GridView
.
count
(
crossAxisCount:
4
,
crossAxisCount:
4
,
physics:
const
NeverScrollableScrollPhysics
(),
physics:
const
NeverScrollableScrollPhysics
(),
...
...
lib/ui/shop/shoplistdetail_presenter.dart
View file @
218ffcf6
...
@@ -9,33 +9,26 @@ import 'package:flutter/material.dart';
...
@@ -9,33 +9,26 @@ import 'package:flutter/material.dart';
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
class
ShoplistdetailPresenter
extends
BasePresenter
<
ShopListDetail
>
{
class
ShoplistdetailPresenter
extends
BasePresenter
<
ShopListDetail
>{
Api
_api
;
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
final
formkey
=
GlobalKey
<
FormState
>();
shoplistdetailModel
model
;
shoplistdetailModel
model
;
AddfavModel
addmodel
;
AddfavModel
addmodel
;
bool
fav
=
false
;
bool
fav
=
false
;
ShoplistdetailPresenter
(
State
<
ShopListDetail
>
state
)
:
super
(
state
);
String
uid
;
ShoplistdetailPresenter
(
State
<
ShopListDetail
>
state
)
:
super
(
state
);
String
uid
;
Detai
(
String
id
)
async
{
Detai
(
String
id
)
async
{
_api
=
Api
<
shoplistdetailModel
>();
_api
=
Api
<
shoplistdetailModel
>();
var
res
=
await
_api
.
shoplistDetail
({
var
res
=
await
_api
.
shoplistDetail
({
"id"
:
id
,
"id"
:
id
,
});
});
if
(
res
.
fail
==
null
)
{
if
(
res
.
fail
==
null
)
{
setState
(()
{
setState
(()
{
model
=
res
.
success
;
model
=
res
.
success
;
print
(
"complete"
);
print
(
"complete"
);
});
});
print
(
'res Success'
);
print
(
'res Success'
);
}
else
{
}
else
{
...
@@ -43,60 +36,55 @@ class ShoplistdetailPresenter extends BasePresenter<ShopListDetail>{
...
@@ -43,60 +36,55 @@ class ShoplistdetailPresenter extends BasePresenter<ShopListDetail>{
}
}
}
}
getid
()
async
{
getid
()
async
{
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
setState
(()
{
setState
(()
{
uid
=
pref
.
getString
(
'Id'
);
uid
=
pref
.
getString
(
'Id'
);
});
});
return
uid
;
return
uid
;
}
}
Addfav
(
String
id
)
async
{
LoadingView
(
state
.
context
).
show
();
Addfav
(
String
id
)
async
{
LoadingView
(
state
.
context
).
show
();
_api
=
Api
<
AddfavModel
>();
_api
=
Api
<
AddfavModel
>();
var
res
=
await
_api
.
addfav
({
var
res
=
await
_api
.
addfav
({
"customer_id"
:
uid
,
"customer_id"
:
uid
,
"store_id"
:
id
,
"store_id"
:
id
,
"vendor_id"
:
id
,
"vendor_id"
:
id
,
"product_id"
:
id
,
"product_id"
:
id
,
});
});
LoadingView
(
state
.
context
).
hide
();
LoadingView
(
state
.
context
).
hide
();
if
(
res
.
fail
==
null
)
{
if
(
res
.
fail
==
null
)
{
setState
(()
{
setState
(()
{
addmodel
=
res
.
success
;
addmodel
=
res
.
success
;
print
(
"complete"
);
print
(
"complete"
);
fav
=
true
;
fav
=
true
;
});
});
showDialog
(
showDialog
(
context:
state
.
context
,
context:
state
.
context
,
builder:
(
context
)
{
builder:
(
context
)
{
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
Navigator
.
of
(
context
).
pop
(
true
);
Navigator
.
of
(
context
).
pop
(
true
);
});
});
return
AlertDialog
(
return
AlertDialog
(
content:
ImageIcon
(
content:
ImageIcon
(
AssetImage
(
'assets/images/ic_fav_list.png'
),
AssetImage
(
'assets/images/ic_fav_list.png'
),
color:
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
grey
,
color:
fav
?
Color
(
0xFFDD175F
)
:
Colors
.
grey
,
size:
SizeConfig
.
getFontSize
(
30
),
size:
SizeConfig
.
getFontSize
(
30
),
)
,
)
,
title:
Center
(
child:
Text
(
'บันทึกสำเร็จ'
)),
title:
Center
(
child:
Text
(
'บันทึกสำเร็จ'
)),
);
);
});
});
}
else
{
}
else
{
print
(
'res Fail'
);
print
(
'res Fail'
);
}
}
}
}
gotoDirection
(
String
lat
,
String
lng
)
{
print
(
"debug"
);
gotoDirection
(
String
lat
,
String
lng
){
print
(
"debug"
);
print
(
lat
);
print
(
lat
);
print
(
lng
);
print
(
lng
);
launch
(
'https://www.google.com/maps/dir/?api=1&destination=
${lat}
,
${lng}
'
);
launch
(
'https://www.google.com/maps/dir/?api=1&destination=
${lat}
,
${lng}
'
);
}
}
}
}
\ No newline at end of file
pubspec.lock
View file @
218ffcf6
# Generated by pub
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
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:
async:
dependency: transitive
dependency: transitive
description:
description:
name: async
name: async
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "2.4.
1
"
version: "2.4.
2
"
boolean_selector:
boolean_selector:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -43,34 +29,34 @@ packages:
...
@@ -43,34 +29,34 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "2.2.1"
version: "2.2.1"
char
code
:
char
acters
:
dependency: transitive
dependency: transitive
description:
description:
name: char
code
name: char
acters
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.
1.3
"
version: "1.
0.0
"
c
ollection
:
c
harcode
:
dependency: transitive
dependency: transitive
description:
description:
name: c
ollection
name: c
harcode
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.1
4.12
"
version: "1.1
.3
"
c
onvert
:
c
lock
:
dependency: transitive
dependency: transitive
description:
description:
name: c
onvert
name: c
lock
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "
2.1
.1"
version: "
1.0
.1"
c
rypto
:
c
ollection
:
dependency: transitive
dependency: transitive
description:
description:
name: c
rypto
name: c
ollection
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "
2.1.4
"
version: "
1.14.13
"
csslib:
csslib:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -92,6 +78,13 @@ packages:
...
@@ -92,6 +78,13 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.0.8"
version: "1.0.8"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
file:
file:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -163,13 +156,6 @@ packages:
...
@@ -163,13 +156,6 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "3.1.4"
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
image_cropper:
image_cropper:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -218,7 +204,7 @@ packages:
...
@@ -218,7 +204,7 @@ packages:
name: matcher
name: matcher
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.12.
6
"
version: "0.12.
8
"
meta:
meta:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -232,7 +218,7 @@ packages:
...
@@ -232,7 +218,7 @@ packages:
name: path
name: path
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.
6.4
"
version: "1.
7.0
"
path_provider_linux:
path_provider_linux:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -254,13 +240,6 @@ packages:
...
@@ -254,13 +240,6 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.9.0"
version: "1.9.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
platform:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -296,13 +275,6 @@ packages:
...
@@ -296,13 +275,6 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.4.4"
version: "1.4.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
rflutter_alert:
rflutter_alert:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -363,7 +335,7 @@ packages:
...
@@ -363,7 +335,7 @@ packages:
name: stack_trace
name: stack_trace
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.9.
3
"
version: "1.9.
5
"
stream_channel:
stream_channel:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -391,14 +363,14 @@ packages:
...
@@ -391,14 +363,14 @@ packages:
name: test_api
name: test_api
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.2.1
5
"
version: "0.2.1
7
"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
name: typed_data
name: typed_data
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.
1.6
"
version: "1.
2.0
"
url_launcher:
url_launcher:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -448,13 +420,6 @@ packages:
...
@@ -448,13 +420,6 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.1.0"
version: "0.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
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"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
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