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
console.clear() | |
var mFriends = ['Shaw', 'Clara', 'Vab', 'Kun', 'Jacob', 'Dina'] | |
mFriends.splice(3, 0, 'Donna', 'Rachel') | |
// 1st tells where to start | |
// 2nd tells how many items to be deleted | |
// 3rd and 4th and so on tells what items to be added | |
console.log(mFriends) |
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
// This method will be initialised by our script call-back | |
function initAutocomplete() { | |
$('form').on('keyup keypress', function(e) { | |
var keyCode = e.keyCode || e.which; | |
if (keyCode === 13) { | |
e.preventDefault(); | |
return false; | |
} | |
}); | |
// here we are getting the input keywords in locationInput constant |
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
// getAddress method will get the current let long using feolocation that is provided by HTML | |
function getAddress() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(showPosition); | |
} else { | |
x.innerHTML = "Geolocation is not supported by this browser."; | |
} | |
} | |
// here we are setting the value of two hidden input fields with the current let long; | |
function showPosition(position) { |
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
$(document).on('click', '.ratenowbutton', function() { | |
$("#ratingModel").modal(); | |
rating(); | |
}); | |
var ratedIndex = -1; | |
function rating(){ | |
localStorage.removeItem('ratedIndex'); | |
resetStarColors(); | |
if(localStorage.getItem('ratedIndex') != null) | |
setStars(parseInt(localStorage.getItem('ratedIndex'))); |
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
<div class="modal fade" id="ratingModel" tabindex="-1" role="dialog" aria-labelledby="ratingModel" aria-hidden="true"> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<h5 class="modal-title" id="exampleModalLabel"></h5> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
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
// before rendering your main page use write a condition | |
var connectivityResult = await (Connectivity().checkConnectivity()); | |
if (connectivityResult == ConnectivityResult.mobile) { | |
// this will show when your device is connected with mobile network | |
print("connected to mobile data"); | |
// ignore: unused_local_variable | |
ScaffoldMessenger.of(context).showSnackBar( | |
SnackBar( | |
content: const Text('Connected to mobile network'), | |
backgroundColor: Colors.green, |
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
bool isLoggedIn = false; | |
void onLoginStatusChanged(bool isLoggedIn) { | |
setState(() { | |
this.isLoggedIn = isLoggedIn; | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { |
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
void initiateFacebookLogin() async { | |
var facebookLogin = FacebookLogin(); | |
var facebookLoginResult = | |
await facebookLogin.logInWithReadPermissions(['email']); | |
switch (facebookLoginResult.status) { | |
case FacebookLoginStatus.error: | |
print("Error"); | |
onLoginStatusChanged(false); | |
break; | |
case FacebookLoginStatus.cancelledByUser: |