mdanics / fluttergram Goto Github PK
View Code? Open in Web Editor NEWA fully functional Instagram clone written in Flutter using Firebase / Firestore
License: Other
A fully functional Instagram clone written in Flutter using Firebase / Firestore
License: Other
Launching lib\main.dart on Android SDK built for x86 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
I/Choreographer(10225): Skipped 58 frames! The application may be doing too much work on its main thread.
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
I/OpenGLRenderer(10225): Davey! duration=1129ms; Flags=1, IntendedVsync=5903630658033, Vsync=5904597324661, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=5904612846700, AnimationStart=5904612970400, PerformTraversalsStart=5904613040600, DrawStart=5904631954200, SyncQueued=5904634448400, SyncStart=5904639734000, IssueDrawCommandsStart=5904639997700, SwapBuffers=5904678395100, FrameCompleted=5904765129400, DequeueBufferDuration=39011000, QueueBufferDuration=1305000,
I/eiras.wavechec(10225): Waiting for a blocking GC ProfileSaver
W/eiras.wavechec(10225): Unsupported class loader
I/eiras.wavechec(10225): Background concurrent copying GC freed 7320(609KB) AllocSpace objects, 14(600KB) LOS objects, 49% free, 1622KB/3MB, paused 1.430ms total 642.595ms
I/DynamiteModule(10225): Considering local module com.google.android.gms.flags:3 and remote module com.google.android.gms.flags:3
I/DynamiteModule(10225): Selected local version of com.google.android.gms.flags
I/eiras.wavechec(10225): WaitForGcToComplete blocked ProfileSaver on HeapTrim for 375.814ms
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
I/chatty (10225): uid=10124(com.gcontreiras.wavecheck) FirestoreWorker identical 1 line
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
I/eiras.wavechec(10225): The ClassLoaderContext is a special shared library.
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryDirectories:Ljava/util/List; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->systemNativeLibraryDirectories:Ljava/util/List; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryPathElements:[Ldalvik/system/DexPathList$NativeLibraryElement; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/DexPathList;->makePathElements(Ljava/util/List;)[Ldalvik/system/DexPathList$NativeLibraryElement; (light greylist, reflection)
V/NativeCrypto(10225): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 284 native methods...
W/eiras.wavechec(10225): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
D/NetworkSecurityConfig(10225): No Network Security Config specified, using platform default
W/eiras.wavechec(10225): Accessing hidden field Ljavax/net/ssl/SSLSocketFactory;->defaultSocketFactory:Ljavax/net/ssl/SSLSocketFactory; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ljavax/net/ssl/SSLServerSocketFactory;->defaultServerSocketFactory:Ljavax/net/ssl/SSLServerSocketFactory; (light greylist, reflection)
I/ProviderInstaller(10225): Installed default security provider GmsCore_OpenSSL
I/flutter (10225): [_setUpNotifications] START
I/flutter (10225): [_setUpNotifications] DONE
D/ (10225): HostConnection::get() New Host Connection established 0xec55be40, tid 10261
D/EGL_emulation(10225): eglMakeCurrent: 0xf1044d20: ver 2 0 (tinfo 0xed0513d0)
W/eiras.wavechec(10225): JNI critical lock held for 17.690ms on Thread[17,tid=10250,Runnable,Thread*=0xf0fc9400,peer=0x18d07f20,"GoogleApiHandler"]
I/flutter (10225): [_ensureLoggedIn] START
I/flutter (10225): [_ensureLoggedIn] user == null
I/flutter (10225): [_ensureLoggedIn] [signInSilently] START
I/flutter (10225): [_ensureLoggedIn] [signInSilently] DONE
I/flutter (10225): [_ensureLoggedIn] user == null
I/flutter (10225): [_ensureLoggedIn] [signIn] START
W/ActivityThread(10225): handleWindowVisibility: no activity for token android.os.BinderProxy@8e6ecf9
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
D/EGL_emulation(10225): eglMakeCurrent: 0xec806440: ver 2 0 (tinfo 0xd1543e40)
I/flutter (10225): [tryCreateUserRecord] user != null
I/flutter (10225): [_ensureLoggedIn] [signIn] DONE
I/flutter (10225): [tryCreateUserRecord] user != null
I/flutter (10225): [_ensureLoggedIn] auth.currentUser() == null
I/flutter (10225): [_ensureLoggedIn] [googleSignIn.currentUser.authentication] START
I/eiras.wavechec(10225): Background concurrent copying GC freed 21496(1004KB) AllocSpace objects, 10(520KB) LOS objects, 49% free, 2MB/4MB, paused 1.133ms total 213.295ms
W/eiras.wavechec(10225): Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/flutter (10225): [_ensureLoggedIn] [googleSignIn.currentUser.authentication] DONE
I/flutter (10225): [_ensureLoggedIn] [signInWithGoogle] START
W/BiChannelGoogleApi(10225): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@26ced49
I/flutter (10225): [_getFeed] START
I/flutter (10225): [_getFeed] [SharedPreferences.getInstance] START
I/flutter (10225): [_getFeed] [SharedPreferences.getInstance] DONE
I/flutter (10225): [_getFeed] [httpClient.getUrl] START
W/BiChannelGoogleApi(10225): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@26ced49
W/eiras.wavechec(10225): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ljava/net/InetAddress;->isNumeric(Ljava/lang/String;)Z (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (light greylist, JNI)
W/eiras.wavechec(10225): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (light greylist, reflection)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (light greylist, linking)
W/eiras.wavechec(10225): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (light greylist, linking)
I/flutter (10225): [_getFeed] [httpClient.getUrl] DONE
I/flutter (10225): [_getFeed] [request.close] START
I/flutter (10225): [_getFeed] [request.close] DONE
I/flutter (10225): [_getFeed] result: [ERROR] [_getFeed] Getting a feed >> Http status 500
D/FirebaseAuth(10225): Notifying id token listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseAuth(10225): Notifying auth state listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseApp(10225): Notifying auth state listeners.
D/FirebaseApp(10225): Notified 0 auth state listeners.
I/flutter (10225): [_ensureLoggedIn] [signInWithGoogle] DONE
I/flutter (10225): [_ensureLoggedIn] DONE
D/FirebaseAuth(10225): Notifying id token listeners about user ( WDfNEjWY8zTiNtXR0iuqkD98Vl22 ).
D/FirebaseApp(10225): Notifying auth state listeners.
D/FirebaseApp(10225): Notified 0 auth state listeners.
I've put some prints all around the code to understand how things were working and found some issues, this is one of them.
You can see in the end that the result return a http status 500.
if (response.statusCode == HttpStatus.ok) {
print('[_getFeed] response.statusCode == HttpStatus.ok');
print('[_getFeed] [response.transform.join] START');
String json = await response.transform(utf8.decoder).join();
print('[_getFeed] [response.transform.join] DONE');
prefs.setString("feed", json);
List<Map<String, dynamic>> data = jsonDecode(json).cast<Map<String, dynamic>>();
print('[_getFeed] [_generateFeed] START');
listOfPosts = _generateFeed(data);
print('[_getFeed] [_generateFeed] DONE');
}
else {
result = '[ERROR] [_getFeed] Getting a feed >> Http status ${response.statusCode}';
}
In 3rd point under set up firebase app,
you have written the last point as Replace the url in the _getFeed
function in upload_page.dart
with your cloud function url from the previous step.
but the function _getFeed
is presented in feed.dart
file not in upload_page.dart
Because Fluttergram depends on image 1.1.30 which requires SDK version >=1.0.0 <2.0.0, version solving failed.
pub get failed (1)
I'm trying to figure out how to save the longitudes and latitudes of the location chosen by user into the database as well.
Feed needs to be paginated as it loads all data at once. Is there any plan for pagination?
Hi - in your setup instructions it should be pointed out that you have to change the Bundle ID in XCode to match the one you create in Firebase that is in the GoogleService-Info.plist file. Also, the index for the insta_posts has to be created in Firebase. Still building the project, thanks for creating it!
Hi, guys.
I have faced a problem when I built fluttergram.
After I deployed my functions, the console didn't show feed url, the log is:
~/firebase ๎ฐ firebase deploy --only functions
=== Deploying to 'fluttergram-ae7fd'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /Users/liutengfei/firebase/functions
> tslint --project tsconfig.json
WARNING: /Users/liutengfei/firebase/functions/src/index.ts[1, 1]: 'functions' is declared but its value is never read.
Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /Users/liutengfei/firebase/functions
> tsc
โ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
โ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
โ Deploy complete!
Project Console: https://console.firebase.google.com/project/fluttergram-ae7fd/overview
Hello, under what license is this project released under ? Thank-you.
I am stuck on this step, the push the getFeed funstion. Do i type this on the command line or something?......... """"""Push the function getFeed with firebase deploy --only functions In the output, you'll see the getFeed URL, copy that """""""""""".........Like it says push the function getFeed. How do I push this. Thanks for helping a newer and slowly learning dev guys
As you know user's following and followers are in Map data type, I want to know how can we show them in listView with their username and display image just like we are doing in search...
Scenario:
When we click on either followers or following (which shows numbers above FOLLOW/UNFOLLOW button) in user profile page, It has to open a new page and shows all following/followers list with their name and display name.
I tried as much as I can but can't get that work, Please help me on this to work, because of this I'm unable to
work ahead on my other project also which uses the same map stuff.
This is a solid project!
I would be very interested in working on the camera element - filters etc.
Did you implement pagination?
Did you implement a custom camera implementation?
I am having trouble trying to get the dependencies to work... looks like http is the start of the mess, but then it moves on to things like:
Running "flutter packages get" in fluttergram...
Because cached_network_image >=0.4.1 <0.4.2 depends on flutter_cache_manager ^0.1.1 and cached_network_image >=0.4.0 <0.4.1 depends on flutter_cache_manager ^0.1.0, cached_network_image >=0.4.0 <0.4.2 requires flutter_cache_manager ^0.1.0.
And because cached_network_image >=0.4.2 depends on flutter_cache_manager ^0.1.2 which depends on http ^0.11.3+14, cached_network_image >=0.4.0 requires http ^0.11.3+14.
So, because Fluttergram depends on both cached_network_image ^0.4.0 and http ^0.12.0, version solving failed.
pub get failed (1)
First of all, this is a great project. So far I manage to build the app but there is a slight roadblock on the feed.
So far it only works on Profile, but the feed does not load on Home.
Am I missing something?
Following README.md
firebase deploy --only functions
=== Deploying to 'fluttergramdemo'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
โ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error parsing triggers: Cannot find module './notificationHandler'
Try running "npm install" in your functions directory before deploying.
cd functions && npm install
npm WARN [email protected] requires a peer of firebase-admin@~6.0.0 but none is installed. You must install peer dependencies yourself.
audited 4170 packages in 2.042s
found 0 vulnerabilities
firebase deploy --only functions
=== Deploying to 'fluttergramdemo'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
โ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error parsing triggers: Cannot find module './notificationHandler'
Try running "npm install" in your functions directory before deploying.
Having trouble? Try firebase deploy --help
it would be awesome if u can create a youtube series just EXPLAINING your code what function does what it will help non flutter developer to understand your code and i know creating tutorial series is not so easy so just explain as i am a native android developer and trying to create something similar
I think you are setting timestamps wrong in almost everything stored on Firestore.
https://github.com/mdanics/fluttergram/search?q=timestamp&unscoped_q=timestamp
If you post "timestamp": DateTime.now().toString(),
it will save just a String and if you want to do some query with that it will require more steps than necessary.
But if you post "timestamp": DateTime.now()
it will save a Timestamp type.
Maybe that's the reason some methods are returning things out of order.
I want to propose a new enhancement(feature sort of). please try to add code in cloud functions such that it will trigger for every change like, comment and other things in firestore DB and send notification with payload to respective users.
Hello Team,
I want to use fluttergram for my proof of concept idea. I need below 2 things.
Please let me know how to do this ?
Syncing files to device iPhone 6...
5.7.0 - [Firebase/Firestore][I-FST000001] The behavior for system Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods:
let db = Firestore.firestore()
let settings = db.settings
settings.areTimestampsInSnapshotsEnabled = true
db.settings = settings
With this change, timestamps stored in Cloud Firestore will be read back as Firebase Timestamp objects instead of as system Date objects. So you will also need to update code expecting a Date to instead expect a Timestamp. For example:
// old:
let date: Date = documentSnapshot.get("created_at") as! Date
// new:
let timestamp: Timestamp = documentSnapshot.get("created_at") as! Timestamp
let date: Date = timestamp.dateValue()
Please audit all existing usages of Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you do not follow these steps, YOUR APP MAY BREAK.
I got this error when trying to install app-release.apk to my device for testing
Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
Got the app working (on IOS), but posts on the main (homepage) are oldest-first, rather than newest-first as you'd expect from a social app. Any way of changing the order?
I've tried various alternatives to the "orderBy("timestamp")" in getFeed.js which I guess is what's causing the issue (eg orderBy("timestamp","desc") but can't find one that works!! (should add that at the moment, I'm the only registered user, so just seeing my own posts)
BTW In the 'Profile' section they are latest-first, but looks like they are pulled out in the wrong order and then reversed.
![...](...)
markdown style3
above.Hello there, your Fluttergram code are incredible but i have slight problem with it.
The image that i uploaded is taking too long to upload.
Furthermore, it seem that the image of another person i follow is taking too long to appear on feed.
Do you know if there is any solution for me to make it faster?
Thank you.
I think it would be nice to add a license to the project, u can get more info here:
https://help.github.com/articles/licensing-a-repository/
Keep it up and good job,
The original app shows the photos you posted on your news feed.
E/flutter ( 8836): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: inheritFromWidgetOfExactType(_LocalizationsScope) or inheritFromElement() was called before _Uploader.initState() completed.
E/flutter ( 8836): When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
E/flutter ( 8836): Typically references to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
E/flutter ( 8836): #0 StatefulElement.inheritFromElement.<anonymous closure>
E/flutter ( 8836): #1 StatefulElement.inheritFromElement
E/flutter ( 8836): #2 Element.inheritFromWidgetOfExactType
E/flutter ( 8836): #3 Localizations.of
E/flutter ( 8836): #4 debugCheckHasMaterialLocalizations.<anonymous closure>
E/flutter ( 8836): #5 debugCheckHasMaterialLocalizations
E/flutter ( 8836): #6 showDialog
E/flutter ( 8836): #7 _Uploader._selectImage
E/flutter ( 8836): <asynchronous suspension>
E/flutter ( 8836): #8 _Uploader.initState
E/flutter ( 8836): #9 StatefulElement._firstBuild
E/flutter ( 8836): #10 ComponentElement.mount
E/flutter ( 8836): #11 Element.inflateWidget
E/flutter ( 8836): #12 Element.updateChild
E/flutter ( 8836): #13 SingleChildRenderObjectElement.mount
E/flutter ( 8836): #14 Element.inflateWidget
E/flutter ( 8836): #15 Element.updateChild
E/flutter ( 8836): #16 ComponentElement.performRebuild
E/flutter ( 8836): #17 Element.rebuild
E/flutter ( 8836): #18 ComponentElement._firstBuild
E/flutter ( 8836): #19 ComponentElement.mount
E/flutter ( 8836): #20 Element.inflateWidget
E/flutter ( 8836): #21 Element.updateChild
E/flutter ( 8836): #22 SingleChildRenderObjectElement.mount
E/flutter ( 8836): #23 Element.inflateWidget
E/flutter ( 8836): #24 Element.updateChild
E/flutter ( 8836): #25 SingleChildRenderObjectElement.mount
E/flutter ( 8836): #26 Element.inflateWidget
E/flutter ( 8836): #27 Element.updateChild
E/flutter ( 8836): #28 ComponentElement.performRebuild
E/flutter ( 8836): #29 Element.rebuild
E/flutter ( 8836): #30 ComponentElement._firstBuild
E/flutter ( 8836): #31 ComponentElement.mount
E/flutter ( 8836): #32 Element.inflateWidget
E/flutter ( 8836): #33 Element.updateChild
E/flutter ( 8836): #34 ComponentElement.performRebuild
E/flutter ( 8836): #35 Element.rebuild
E/flutter ( 8836): #36 ComponentElement._firstBuild
E/flutter ( 8836): #37 ComponentElement.mount (package:flutter/src/widgets/
I/eiras.wavechec( 8836): Background concurrent copying GC freed 45355(2MB) AllocSpace objects, 0(0B) LOS objects, 49% free, 2MB/4MB, paused 8.883ms total 96.775ms
Searched for a user called "Pendulum Pala" with username "pendulumpala".
Typing:
Pendulum -> found
pendulum -> not found
pendulumpala -> not found
pendulum pala -> not found
pendulum Pala -> not found
Pendulum Pala -> found
Pala -> found
pala -> not found
I'm gonna try to improve that search and then I come back here.
WebP is only supported in Chrome. So we can't see the preview images on iOS or OSX.
Maybe switch to GIF ?
Dart 2 makes the new keyword optional. Even in Dart 1, its meaning was never clear because factory constructors mean a new invocation may still not actually return a new object.
The language still permits new in order to make migration less painful, but consider it deprecated and remove it from your code.
https://dart-lang.github.io/linter/lints/unnecessary_new.html
https://www.dartlang.org/guides/language/effective-dart/usage#dont-use-new
Firestore.instance.document("insta_users/$profileId").updateData({
'followers.$currentUserId': true
//firestore plugin doesnt support deleting, so it must be nulled / falsed
});
Firestore.instance.document("insta_users/$currentUserId").updateData({
'following.$profileId': true
//firestore plugin doesnt support deleting, so it must be nulled / falsed
});
If each user (document) of the "insta_users" collection had inners collections called "followers" and "followings" that contains a string with the id of the user you are following/being followed, you could delete them instead of setting null.
I know this project wasn't designed for millions of users and probably you won't change it (because it needs to recode many things) but I think it's good to point this out.
Edit:
Or even better, you don't need a new inner collection, you could just keep a followersIds field that holds a List of String and a followingsIds field that holds a List of String too and everytime the list change you recreate it and send the entire list again.
Anyway, I don't know if I'm right. Just thinking that this thing of setting null because you cant delete is a little weird.
Getting this error on when new accounts try to use the camara to take a photo?
NoSuchMethodError: The getter 'photoUrl' was called on null. Receiver: null Tried calling: photoUrl
Any ideas?
the argument type Context cant be assign to parameter type BuildContext error in alert dialog box
return showDialog(
context: context, //here error
barrierDismissible: false, // user must tap button!
After using the latest dependencies and new flutter update, I'm getting this error when I try to run "packages get" in android studio.
Because every version of flutter_test from sdk depends on http 0.11.3+17 and mercury depends on http ^0.12.0, flutter_test from sdk is forbidden.
So, because mercury depends on flutter_test any from sdk, version solving failed.
pub get failed (1)
Pressing the (+) on Fluttergram iOS (iOS12):
Please audit all existing usages of Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you do not follow these steps, YOUR APP MAY BREAK.
[VERBOSE-2:shell.cc(182)] Dart Error: Unhandled exception:
inheritFromWidgetOfExactType(_LocalizationsScope) or inheritFromElement() was called before _Uploader.initState() completed.
When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
Typically references to to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
#0 StatefulElement.inheritFromElement. (package:flutter/src/widgets/framework.dart:3877:9)
#1 StatefulElement.inheritFromElement (package:flutter/src/widgets/framework.dart:3910:6)
#2 Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3261:14)
#3 Localizations.of (package:flutter/src/widgets/localizations.dart:444:47)
#4 debugCheckHasMaterialLocalizations. (package:flutter/src/material/debug.dart:88:23)
#5 debugCheckHasMaterialLocalizations (package:flutter/src/material/debug.dart:127:4)
#6 showDialog (package:flutter/src/material/dialog.dart:606:10)
#7 _Uploader._selectImage (file:///NOBACKUP/fluttergram/lib/upload_page.dart:77:12)
#8 _Uploader.initState (file:///NOBACKUP/fluttergram/lib/upload_page.dart:28:7)
#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3787:58)
#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
#11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#13 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
#14 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#15 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#16 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
#17 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
#18 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
#19 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
#20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
#23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#24 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#25 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
#26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
#30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
#31 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
#32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#33 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#34 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
#35 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
#36 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
#37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
#38 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:3993:11)
#39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#40 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
#42 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
#43 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
#44 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805:11)
#45 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
#46 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
#47 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
#48 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:996:36)
#49 SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:981:20)
#50 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2253:19)
#51 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:974:11)
#52 RenderSliverMultiBoxAdaptor._createOrObtainChild. (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:256:23)
#53 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1727:58)
#54 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:796:15)
#55 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1727:13)
#56 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:245:5)
#57 RenderSliverMultiBoxAdaptor.addInitialChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:323:5)
#58 RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:169:12)
#59 RenderObject.layout (package:flutter/src/rendering/object.dart:1631:7)
#60 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:405:13)
#61 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1320:12)
#62 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1238:20)
#63 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1506:7)
#64 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:765:18)
#65 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
#66 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:671:13)
#67 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
#68 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
#69 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
#70 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
#71 _invoke (dart:ui/hooks.dart:139:13)
#72 _drawFrame (dart:ui/hooks.dart:128:3)
...
Hi!
I'm an instructor and I have a course about app development with Flutter!
This project is really cool! I have downloaded it and modified a few parts so it's a little better now.
I would like to use this project to teach Flutter for my students. Would be a problem for you? I will give the credits to you.
Thanks!
The last time I downloaded this project, the compressImage method was calling copyResize from image package and this was locking the UI cause flutter uses a single thread.
Here is the solution:
https://github.com/brendan-duncan/image/wiki/Examples
Debug console: https://pastebin.com/XSe6RReT
Edit: Links are broken and I don't recommend anymore this approach.
(Don't copy and paste, use it as a guide and make changes by yourself. I'm almost sure these commits have errors.)
CurrentUser
calling CurrentUser.signInWithGoogle(silently: true, userLocation: _userLocation)
. If is signed it calls it silently: true
, if not, silently: false
.CurrentUser.instance
.@override
Widget build(BuildContext context) {
print('[HomePage] [Build] START');
if (CurrentUser.instance != null) {
if (!_notificationsAreSet) _setUpNotifications();
print('[HomePage] [Build] CurrentUser.instance != null');
print('[HomePage] [Build] building home screen');
return Scaffold( ........
}
print('[RootPage] [Build] CurrentUser.instance == null');
print('[RootPage] [Build] building login screen, _loadingIcon: $_loadingIcon');
return _buildLoginScreen();
}
factory CurrentUser._singletonConstructor({DocumentSnapshot documentSnapshot, String username, Address userLocation}) {
// Creates from snapshot from document from database (any login that isnt the first)
if (documentSnapshot != null) {
print('[CurrentUser] [Constructor] creating from document snapshot');
if (documentSnapshot.data != null) {
print('[CurrentUser] [Constructor] documentSnapshot.data != null');
return CurrentUser(
bio: documentSnapshot.data['bio'] == null ? '' : documentSnapshot.data['bio'],
displayName: documentSnapshot.data['displayName'],
username: documentSnapshot.data['username'],
id: documentSnapshot.data['uid'],
photoUrl: documentSnapshot.data['photoURL'],
followers: documentSnapshot.data['followers'] == null ? new Map<dynamic, dynamic>() : documentSnapshot.data['followers'],
following: documentSnapshot.data['following'] == null ? new Map<dynamic, dynamic>() : documentSnapshot.data['following'],
address: userLocation
);
}
else {
print('[CurrentUser] [Constructor] documentSnapshot.data == null');
}
}
// Creates from Google account
if (googleSignIn.currentUser != null) {
print('[CurrentUser] [Constructor] googleSignIn.currentUser != null');
print('[CurrentUser] [Constructor] creating from Google');
return CurrentUser(
bio: '',
displayName: googleSignIn.currentUser.displayName,
username: username,
id: googleSignIn.currentUser.id,
photoUrl: googleSignIn.currentUser.photoUrl,
followers: {},
following: {googleSignIn.currentUser.id: true},
address: userLocation
);
}
return null;
}
static signInWithGoogle({bool silently = false, @required Address userLocation}) async {
FirebaseUser _firebaseUser;
AuthCredential _authCredential;
DocumentReference _firebaseUserDocRef;
DocumentSnapshot _firebaseUserDocSnap;
GoogleSignInAccount _googleSignInAcc;
print('[CurrentUser] [SignInWithGoogle] START');
print('[CurrentUser] [SignInWithGoogle] googleSignIn.currentUser: ${googleSignIn.currentUser}');
// Attempts to sign in a previously authenticated user without interaction
if (silently) {
print('[CurrentUser] [SignInWithGoogle] [SignInSilently] start');
_googleSignInAcc = await googleSignIn.signInSilently();
print('[CurrentUser] [SignInWithGoogle] [SignInSilently] done');
}
// Waits for user to choose account to sign
else {
print('[CurrentUser] [SignInWithGoogle] [SignIn] start');
_googleSignInAcc = await googleSignIn.signIn();
print('[CurrentUser] [SignInWithGoogle] [SignIn] done');
} ............
Things to do:
Edit: sorry for broken links
Improve Caching of Profiles, Images, Etc.
Notificaitons for likes, comments, follows, etc
Better post creation, add filters to your image
Custom Camera Implementation
Animations (heart when liking image)
Firebase Security Rules
Delete Posts
Registration without Google SignIn
Direct Messaging
Stories
Clean up code
My android/build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//classpath 'com.google.gms:google-services:3.2.0' //fluttergram original
classpath 'com.google.gms:google-services:4.0.1' //firebase tutorial recommended
}
My app/build.gradle:
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//compile 'com.google.firebase:firebase-core:11.8.0' //fluttergram original
implementation 'com.google.firebase:firebase-core:16.0.1' //firebase tutorial recommended
}
My pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.8.2+1
circular_profile_avatar: ^0.1.6
image_picker: 0.4.1
firebase_storage: 1.0.4
# firebase_auth: 0.6.2+1
firebase_auth: 0.7.0
google_sign_in: ^3.2.1
uuid: 1.0.3
image: 2.0.4
path_provider: 0.4.1
font_awesome_flutter: 8.0.1
async: "^2.0.4"
http: "^0.12.0"
shared_preferences: "^0.4.1"
cached_network_image: "^0.5.0"
firebase_messaging: ^2.0.2
location: ^1.4.1
geocoder: ^0.1.1
I think it's ok to update it. Working without errors here (in the version without AndroidX).
When clicking on the + icon to add an image I get the following on my attached iPhone XR running iOS 12.1
I will work on debugging but I'm rather new to flutter. It looks like it requires waiting for the Uploader object to initialize before building a dependent object.
[VERBOSE-2:shell.cc(184)] Dart Error: Unhandled exception:
inheritFromWidgetOfExactType(_LocalizationsScope) or inheritFromElement() was called before _Uploader.initState() completed.
When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
Typically references to to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
#0 StatefulElement.inheritFromElement.<anonymous closure> (package:flutter/src/widgets/framework.dart:3920:9)
#1 StatefulElement.inheritFromElement (package:flutter/src/widgets/framework.dart:3953:6)
#2 Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3274:14)
#3 Localizations.of (package:flutter/src/widgets/localizations.dart:448:47)
#4 debugCheckHasMaterialLocalizations.<anonymous closure> (package:flutter/src/material/debug.dart:88:23)
#5 debugCheckHasMaterialLocalizations (package:flutter/src/material/debug.dart:127:4)
#6 showDialog (package:flutter/src/material/dialog.dart:635:10)
#7 _Uploader._selectImage (package:Fluttergram/upload_page.dart:143:12)
<asynchronous suspension>
#8 _Uploader.initState (package:Fluttergram/upload_page.dart:34:7)
#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3830:58)
#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#13 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#14 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#15 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#16 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#17 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#18 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#19 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#24 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#25 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#31 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#33 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#34 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#35 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#36 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#38 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4047:11)
#39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#40 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#42 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#43 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#44 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
#45 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#46 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#47 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#48 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1028:36)
#49 SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:1013:20)
#50 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2266:19)
#51 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1006:11)
#52 RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:274:23)
#53 RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1730:58)
#54 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:799:15)
#55 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1730:13)
#56 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:263:5)
#57 RenderSliverMultiBoxAdaptor.addInitialChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:341:5)
#58 RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:169:12)
#59 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
#60 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:405:13)
#61 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1316:12)
#62 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1234:20)
#63 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
#64 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
#65 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
#66 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:677:13)
#67 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
#68 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
#69 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
#70 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
#71 _invoke (dart:ui/hooks.dart:154:13)
#72 _drawFrame (dart:ui/hooks.dart:143:3)
Hi, this is awesome project. I've cloned it, follow steps, creates indexes. All pages are now working except the home page, which display data returned by getFeed.js. I've tried to see, in my browser with url, if something is returns : YES I have a result by empty one. But I have 3 posts from 2 different users.
Any ideas ?
Thanks
Hello I tried to set up the project from scratch for the 3rd time and once again the feeds aren't loading
build fails because getting error in FirebaseMessagingPlugin.m.
the error is generated from line 176.
here's the code on line 176:
[_channel invokeMethod:@"onToken" arguments:[[FIRInstanceID instanceID] token]];
using legacy system.
any solutions?
thanks.
How to set bottom navigation bar always on the bottom?
After updating flutter and some packages the Google SignIn is not working anymore. It seems that the package changed its procedure with the newest version.
https://pub.dartlang.org/packages/firebase_auth/versions/0.8.4+2
flutter/flutter#27133
Should not be too difficult too update the code.
Thank you and btw great project and good job!
I did not know where to post this, so I just thought it would be a goog idea to open a new issue.
https://github.com/mohak1283/Instagram-Clone
Did you guys see this? Any thoughts on it? I tested it and it is a exact clone of this project here, except it has some more features like chat, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.