Skip to content

Instantly share code, notes, and snippets.

@malinkaphann
Last active November 24, 2020 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malinkaphann/4e06735775837b072d66db16db3812f6 to your computer and use it in GitHub Desktop.
Save malinkaphann/4e06735775837b072d66db16db3812f6 to your computer and use it in GitHub Desktop.
sample flutter api manager
/**
* 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