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
9773dcd7
Commit
9773dcd7
authored
Aug 04, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c6cf2d80
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
0 deletions
+64
-0
lib/model/shoplistdetail/shoplistdetail_Model.dart
+0
-0
lib/service/api.dart
+18
-0
lib/ui/shop/shop_list_detail.dart
+19
-0
lib/ui/shop/shoplistdetail_presenter.dart
+27
-0
No files found.
lib/model/shoplistdetail/shoplistdetail_Model.dart
0 → 100644
View file @
9773dcd7
This diff is collapsed.
Click to expand it.
lib/service/api.dart
View file @
9773dcd7
...
...
@@ -12,6 +12,7 @@ import 'package:feelverapp/model/home/home_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'
;
import
'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'
;
import
'package:http/http.dart'
as
http
;
class
Api
<
T
>
{
...
...
@@ -164,6 +165,23 @@ print("this is body "+body.toString());
});
return
result
;
}
Future
<
Response
<
T
>>
shoplistDetail
(
Object
body
)
async
{
var
_model
;
var
_fail
;
var
result
;
await
_httpConnection
(
"
${this._baseApi}
/store/detail"
,
this
.
_headerApi
,
body
).
then
((
response
){
print
(
"ผลลัพท์ เท่ากับ "
"
${response.body}
"
);
if
(
response
.
statusCode
==
200
){
_model
=
shoplistdetailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
else
{
_fail
=
FailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
result
=
new
Response
<
T
>(
_model
,
_fail
);
});
return
result
;
}
///api environment
Future
<
http
.
Response
>
_httpConnection
(
...
...
lib/ui/shop/shop_list_detail.dart
View file @
9773dcd7
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/menu/menu.dart'
;
import
'package:feelverapp/ui/shop/shoplistdetail_presenter.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -10,6 +11,24 @@ class ShopListDetail extends StatefulWidget {
}
class
_ShopListDetailState
extends
State
<
ShopListDetail
>
{
ShoplistdetailPresenter
presenter
;
@override
void
initState
()
{
super
.
initState
();
presenter
=
ShoplistdetailPresenter
(
this
);
presenter
.
Detai
();
}
@override
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
...
...
lib/ui/shop/shoplistdetail_presenter.dart
0 → 100644
View file @
9773dcd7
import
'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/shop/shop_list_detail.dart'
;
import
'package:flutter/material.dart'
;
class
ShoplistdetailPresenter
extends
BasePresenter
<
ShopListDetail
>{
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
ShoplistdetailPresenter
(
State
<
ShopListDetail
>
state
)
:
super
(
state
);
Detai
()
async
{
_api
=
Api
<
shoplistdetailModel
>();
var
res
=
await
_api
.
shoplistDetail
({
"id"
:
"406"
,
});
if
(
res
.
fail
==
null
)
{
print
(
'res Success'
);
}
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