Last active
November 24, 2020 09:35
-
-
Save malinkaphann/4e06735775837b072d66db16db3812f6 to your computer and use it in GitHub Desktop.
sample flutter api manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* author: bunrin | |
* .... | |
* ...... | |
*/ | |
enum STATUS_CODE { | |
}; | |
class ApiManager { | |
ApiManager._privateConstructor(); | |
static final ApiManager instance = ApiManager._privateConstructor(); | |
/** | |
* | |
* - phone: | |
* - password: | |
*/ | |
STATUS_CODE signup(String phone, String password) { | |
// validate phone against null and empty | |
// validate password against null and empty | |
// if phone is invalid, return -1 | |
writeLog("phone = phone, password = password"); | |
void status = NetworkManager.send(phone, password); | |
return status; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment