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
3d455c8b
Commit
3d455c8b
authored
Aug 19, 2020
by
Mobile : Jetrin Phuekkaew (N'new)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ba15a734
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
84 deletions
+49
-84
lib/model/category/category_model.dart
+30
-31
lib/service/api.dart
+4
-4
lib/ui/home/home.dart
+2
-2
lib/ui/home/home_presenter.dart
+4
-3
pubspec.lock
+9
-44
No files found.
lib/model/category/category_model.dart
View file @
3d455c8b
class
categoryModel
{
List
<
DATA
>
dATA
;
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 +15,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
;
}
...
...
@@ -57,40 +56,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/service/api.dart
View file @
3d455c8b
...
...
@@ -95,12 +95,12 @@ class Api<T> {
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
)
.
then
((
response
)
{
print
(
"ผลลัพ เท่ากับบบบ "
+
"
${response.body}
"
);
//
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if
(
response
.
statusCode
==
200
)
{
_model
=
GetprofileModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
else
{
...
...
@@ -224,10 +224,10 @@ class Api<T> {
var
_model
;
var
_fail
;
var
result
;
print
(
"Result test "
);
await
_httpConnection
(
"
${this._baseApi}
/category"
,
this
.
_headerApi
,
body
)
.
then
((
response
)
{
print
(
"ผลลัพท์ เท่ากับ
55555
"
"
${response.body}
"
);
print
(
"ผลลัพท์ เท่ากับ "
"
${response.body}
"
);
if
(
response
.
statusCode
==
200
)
{
// Array to Map Json
Map
<
String
,
dynamic
>
myData
=
arrayToJson
(
response
.
body
);
...
...
lib/ui/home/home.dart
View file @
3d455c8b
...
...
@@ -37,9 +37,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
// presenter.getid();
presenter
.
getprofile
();
//print("nenwenwenwew"+presenter.CatModel.dATA[0].cover,);
presenter
.
getSearch
();
// presenter.getSearch();
}
@override
...
...
lib/ui/home/home_presenter.dart
View file @
3d455c8b
...
...
@@ -56,7 +56,7 @@ class HomePresenter extends BasePresenter<HomePage> {
"lang"
:
"all"
,
"access"
:
"portal"
,
});
print
(
'
$searchCtrl
'
);
print
(
'
$searchCtrl
'
);
if
(
res
.
fail
==
null
)
if
(
res
.
success
.
status
)
{
...
...
@@ -64,7 +64,8 @@ print('$searchCtrl');
searchhomeModel
=
res
.
success
;
category_model
=
res
.
success
;
});
}
else
{
}
else
{
}
...
...
@@ -87,7 +88,7 @@ print('$searchCtrl');
setState
(()
{
getmodel
=
res
.
success
;
});
print
(
"Hii"
+
getmodel
.
result
[
0
].
name
);
//
print("Hii" + getmodel.result[0].name);
}
else
{
Alert
(
style:
AlertStyle
(
...
...
pubspec.lock
View file @
3d455c8b
# 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:
...
...
@@ -78,6 +64,13 @@ packages:
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:
...
...
@@ -142,13 +135,6 @@ 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:
...
...
@@ -225,7 +211,7 @@ packages:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.
2
"
version: "1.0.
3
"
pedantic:
dependency: transitive
description:
...
...
@@ -233,13 +219,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
dependency: transitive
description:
...
...
@@ -275,13 +254,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
rflutter_alert:
dependency: "direct main"
description:
...
...
@@ -412,7 +384,7 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
version: "0.1.2
+1
"
vector_math:
dependency: transitive
description:
...
...
@@ -427,13 +399,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.9.0-14.0.dev <3.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