Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Charunirathnayake committed Dec 27, 2019
1 parent 30cb504 commit a882390
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Empty file.
21 changes: 21 additions & 0 deletions miniproject/lib/app_screen/usermanagement_traveller.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:cloud_firestore/cloud_firestore.dart';

class UserManagement{
bool isLoggedIn() {
if (FirebaseAuth.instance.currentUser() != null) {
return true;
} else {
return false;
}
}

Future<void> addData(TravellerData) async{
if(isLoggedIn()){
Firestore.instance.collection('Traveller').add(TravellerData).catchError((e){
print(e);
});
}else{
print('You Need to log in');
}
}}

0 comments on commit a882390

Please sign in to comment.