Last active
September 18, 2020 14:37
-
-
Save mulieriq/865d01b85271a254fa6eb24509e3d5d6 to your computer and use it in GitHub Desktop.
data.dart
This file contains hidden or 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
Future<void> updateData(data) async { | |
print('function add data called'); | |
Firestore.instance | |
.collection('users') | |
.document(widget.uid) | |
.updateData(data) | |
.then((result) { | |
print("data added ..................................... "); | |
// print(result); | |
}).catchError((e) { | |
print(e); | |
}); | |
} | |
addData({ | |
'status': status, | |
'userPhoneNumber': | |
"$countrycode$phonenumber", | |
'userId': widget.uid, | |
'userEmail': widget.email, | |
'userImage': imgUrlDownload, | |
'role': widget.role, | |
'isleader': widget.role | |
.toString() | |
.toLowerCase() | |
.trim() != | |
'member' | |
? true | |
: false, | |
'userBio': { | |
}, | |
'verified': { | |
'verification': true, | |
'message': '', | |
'logout': false | |
} | |
}).then((result) async { | |
print('profile updated'); | |
setState(() { | |
upload = false; | |
}); | |
updataData({ | |
'userBio': { | |
'family': widget.family, | |
'role': | |
widget.role.toLowerCase(), | |
'year': widget.family == | |
"Associates" | |
? "Cleared School" | |
: year, | |
'collage': widget.family == | |
"Associates" | |
? "Cleared School" | |
: collage, | |
}, | |
'verified': { | |
'verification': true, | |
'message': '', | |
'logout': false | |
} | |
}).then((result) async { | |
print('profile updated'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment