Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Future<File> saveCredential(User element) async{
- UserJsonModel JsonFormatUser = UserJsonModel(element.userName, element.email, element.country, element.bio, element.gender, element.photoUrl, element.id, element.lastSeen.toString(), element.isOnline ? 'true' : 'false', element.time.toString());
- final file= await FetchFile("credential.json")._localFile;
- print(file.path.toString());
- Map<String, dynamic> userJsonMap = JsonFormatUser.toJson();
- var encodedJSONString = json.encode(userJsonMap);
- return file.writeAsString('$encodedJSONString');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement