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
c652914e
Commit
c652914e
authored
Jul 16, 2020
by
Mobile : Jetrin Phuekkaew (N'new)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2c2a0f82
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
2 deletions
+91
-2
lib/model/Login/login_model.dart
+88
-0
lib/service/api.dart
+1
-1
lib/ui/login/login_presenter.dart
+2
-1
No files found.
lib/model/Login/login_model.dart
0 → 100644
View file @
c652914e
class
LoginModel
{
String
token
;
int
expires
;
User
user
;
LoginModel
({
this
.
token
,
this
.
expires
,
this
.
user
});
LoginModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
token
=
json
[
'token'
];
expires
=
json
[
'expires'
];
user
=
json
[
'user'
]
!=
null
?
new
User
.
fromJson
(
json
[
'user'
])
:
null
;
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'token'
]
=
this
.
token
;
data
[
'expires'
]
=
this
.
expires
;
if
(
this
.
user
!=
null
)
{
data
[
'user'
]
=
this
.
user
.
toJson
();
}
return
data
;
}
}
class
User
{
int
id
;
String
roleId
;
String
name
;
String
email
;
String
avatar
;
String
emailVerifiedAt
;
int
status
;
int
fvRoleId
;
String
settings
;
String
createdAt
;
String
updatedAt
;
String
customerInfo
;
User
(
{
this
.
id
,
this
.
roleId
,
this
.
name
,
this
.
email
,
this
.
avatar
,
this
.
emailVerifiedAt
,
this
.
status
,
this
.
fvRoleId
,
this
.
settings
,
this
.
createdAt
,
this
.
updatedAt
,
this
.
customerInfo
});
User
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
roleId
=
json
[
'role_id'
];
name
=
json
[
'name'
];
email
=
json
[
'email'
];
avatar
=
json
[
'avatar'
];
emailVerifiedAt
=
json
[
'email_verified_at'
];
status
=
json
[
'status'
];
fvRoleId
=
json
[
'fv_role_id'
];
settings
=
json
[
'settings'
];
createdAt
=
json
[
'created_at'
];
updatedAt
=
json
[
'updated_at'
];
customerInfo
=
json
[
'customer_info'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]=
this
.
id
;
data
[
'role_id'
]==
null
?[]:
data
[
'role_id'
]
=
this
.
roleId
;
data
[
'name'
]
=
this
.
name
;
data
[
'email'
]
=
this
.
email
;
data
[
'avatar'
]
=
this
.
avatar
;
data
[
'email_verified_at'
]==
null
?[]:
data
[
'email_verified_at'
]
=
this
.
emailVerifiedAt
;
data
[
'status'
]
=
this
.
status
;
data
[
'fv_role_id'
]
=
this
.
fvRoleId
;
data
[
'settings'
]==
null
?[]:
data
[
'settings'
]
=
this
.
settings
;
data
[
'created_at'
]==
null
?[]:
data
[
'created_at'
]
=
this
.
createdAt
;
data
[
'updated_at'
]==
null
?[]:
data
[
'updated_at'
]
=
this
.
updatedAt
;
data
[
'customer_info'
]==
null
?[]:
data
[
'customer_info'
]
=
this
.
customerInfo
;
return
data
;
}
}
\ No newline at end of file
lib/service/api.dart
View file @
c652914e
import
'dart:convert'
;
import
'package:feelverapp/model/
base/
Login/login_model.dart'
;
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/base/base.dart'
;
import
'package:http/http.dart'
as
http
;
...
...
lib/ui/login/login_presenter.dart
View file @
c652914e
import
'dart:developer'
;
import
'package:feelverapp/model/base/Login/login_model.dart'
;
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/service/Alert.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
...
...
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