Skip to content

Instantly share code, notes, and snippets.

View ShivamGoyal1899's full-sized avatar
🎖️
finishing the todo list, one task at a time.

Shivam Goyal ShivamGoyal1899

🎖️
finishing the todo list, one task at a time.
View GitHub Profile
void _showUrlDialog(BuildContext context) {
print('This is the shareableUrl:\n${album.shareInfo.shareableUrl}');
_showShareDialog(
context,
'Share this URL with anyone.'
'Anyone with this URL can access all items.',
album.shareInfo.shareableUrl);
}
void _showShareToken(BuildContext context) {
if (album.shareInfo == null) {
print("Not shared, sharing album first.");
// Album is not shared yet, share it first, then display dialog
_shareAlbum(context).then((_) {
_showTokenDialog(context);
});
} else {
// Album is already shared, display dialog with token
_showTokenDialog(context);
void _showTokenDialog(BuildContext context) {
print('This is the shareToken:\n${album.shareInfo.shareToken}');
_showShareDialog(
context, 'Use this token to share', album.shareInfo.shareToken);
}
void updateAlbums() async {
// Reset the flag before loading new albums
hasAlbums = false;
// Clear all albums
_albums.clear();
// Add albums from the user's Google Photos account
// var ownedAlbums = await _loadAlbums();
// if (ownedAlbums != null) {
// _albums.addAll(ownedAlbums);
// }
Future<void> _joinTrip(BuildContext context) async {
// Show loading indicator
setState(() => _isLoading = true);
// Call the API to join an album with the entered share token
await ScopedModel.of<PhotosLibraryApiModel>(context)
.joinSharedAlbum(shareTokenFormController.text);
// Hide loading indicator
setState(() => _isLoading = false);
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Enappd</string>
<string name="facebook_app_id">YOUR_APP_ID</string>
<string name="fb_login_protocol_scheme">YOUR_PORTAL_SCHEME</string>
</resources>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<uses-permission android:name="android.permission.INTERNET"/>
dependencies:
flutter:
sdk: flutter
# Add following line to code
flutter_facebook_login: ^1.1.1
http:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb10645493####9351</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>