weDevs Flutter assignment done with GetX & MVC pattern
View assignment PDF
View design on Figma
Get it from Google drive
Null Safety?
Open CMD where you want to clone the project & run the following commands
git clone https://github.com/imamhossain94/dokan-wedevs-assignment.git
cd dokan-wedevs-assignment
flutter packages get
flutter run
get: ^4.6.1
get_storage: ^2.0.3
http: ^0.13.4
flutter_rating_bar: ^4.0.0
dotted_border: ^2.0.0+2
sizer: ^2.0.15
font_awesome_flutter: ^9.2.0
cupertino_icons: ^1.0.2
Email: john@doe.com Pass: demo
SignIn Request: Endpoint: [POST] https://apptest.dokandemo.com/wp-json/jwt-auth/v1/token Content-Type: application/json Body:
{
"username": "john@doe.com",
"password": "demo"
}
SignIn Response:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbmV3YWdlZGV2cy5jb20iLCJpYXQiOjE2NDE3MTgxODgsIm5iZiI6MTY0MTcxODE4OCwiZXhwIjoxNjQyMzIyOTg4LCJkYXRhIjp7InVzZXIiOnsiaWQiOiI0In19fQ.GbEOWBOtRpSO8dcSvdyM35FQNCee3MFB_YeMlVmTZ0w",
"user_email": "john@doe.com",
"user_nicename": "john",
"user_display_name": "John Doe"
}
Username: john Email: john@doe.com Pass: demo
# Request: Endpoint: [POST] https://newagedevs.com/wp-json/wp/v2/users/register Content-Type: application/json Body:
{
"username": "john",
"email": "john@doe.com",
"password": "demo"
}
# Response:
{
"code": 200,
"message": "User 'john' Registration was Successful"
}
Bearer Token: ??
User Info Request: Endpoint: [POST/GET] https://newagedevs.com/wp-json/wp/v2/users/me Content-Type: application/json Authorization: 'Bearer Token'
User Info Response:
{
"id": 4,
"username": "john",
"name": "John Doe",
"first_name": "",
"last_name": "",
"email": "john@doe.com",
"url": "",
"description": "",
"link": "https://newagedevs.com/author/john/",
"locale": "en_US",
"nickname": "john",
"slug": "john",
"roles": [
"subscriber"
],
"registered_date": "2022-01-07T15:21:13+00:00",
"capabilities": {
"read": true,
"level_0": true,
"subscriber": true
},
"extra_capabilities": {
"subscriber": true
},
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=96&d=mm&r=g"
},
"meta": [],
"_links": {
"self": [
{
"href": "https://newagedevs.com/wp-json/wp/v2/users/4"
}
],
"collection": [
{
"href": "https://newagedevs.com/wp-json/wp/v2/users"
}
]
}
}
Bearer Token: ??
User Info Request: Endpoint: [POST] https://newagedevs.com/wp-json/wp/v2/users/ Content-Type: application/json Authorization: 'Bearer Token' Body:
{
"name": "Joohn",
"email": "joohn@doe.com"
}
User Info Response:
{
"id": 4,
"username": "joohn",
"name": "Joohn Doe",
"first_name": "",
"last_name": "",
"email": "joohn@doe.com",
"url": "",
"description": "",
"link": "https://newagedevs.com/author/joohn/",
"locale": "en_US",
"nickname": "joohn",
"slug": "joohn",
"roles": [
"subscriber"
],
"registered_date": "2022-01-07T15:21:13+00:00",
"capabilities": {
"read": true,
"level_0": true,
"subscriber": true
},
"extra_capabilities": {
"subscriber": true
},
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/6a6c19fea4a3676970167ce51f39e6ee?s=96&d=mm&r=g"
},
"meta": [],
"_links": {
"self": [
{
"href": "https://newagedevs.com/wp-json/wp/v2/users/4"
}
],
"collection": [
{
"href": "https://newagedevs.com/wp-json/wp/v2/users"
}
]
}
}
Navigate to: lib -> utils -> constants.dart Change base URL
//Wordpress base url
const baseURL = "https://newagedevs.com/wp-json";
The Apis provided by weDevs are not working and I mailed them about that issue on 8 January 2022 but no one replies. So, I use my own WordPress Apis. Don't be confused Thank you!!
# Request: Endpoint: [POST] https://apptest.dokandemo.com/wp-json/wp/v2/users/register Content-Type: application/json Body:
{
"username": "test",
"email": "test@xmail.com",
"password": "test"
}
# Response:
{
"code": "wp_die",
"message": "Error establishing a database connection",
"data": {
"status": 500
},
"additional_errors": []
}
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then kindly support it by giving it a star ⭐!
Copyright (c) 2022 MD. IMAM HOSSAIN