Coder Social home page Coder Social logo

mohak1283 / instagram-clone Goto Github PK

View Code? Open in Web Editor NEW
737.0 67.0 300.0 224 KB

Working Instagram Clone (Frontend + Backend) created with Flutter and Firebase

License: BSD 2-Clause "Simplified" License

Java 0.22% Ruby 1.30% Objective-C 0.44% Dart 98.03%
flutter flutter-examples flutter-apps flutter-demo dart flutter-example-app instagram-clone

instagram-clone's Introduction

Instagram_clone

Instagram Clone (Both frontend and backend) created with Flutter and Firebase.

Say Thanks!

Show some โค๏ธ and star the repo to support the project.

Note

This repository is still under development and I will continue to add more features to it.

Features

  • Custom photo feed based on who you follow
  • Post photo posts from camera or gallery
    • Like posts
      • View all likes on a post
    • Comment on posts
      • View all comments on a post
  • Search for users
    • Search screen showing all images except your own
    • Search based on usernames
  • Profile Screen
    • Follow / Unfollow Users
    • Change image view from grid layout to feed layout
    • Edit profile
  • Chat Screen
    • Chat with any user
    • Share images while chatting

Screenshots

feed example upload photo example go to a profile from feed edit profile example comment and activity feed example comment and activity feed example comment and activity feed example comment and activity feed example comment and activity feed example comment and activity feed example

Getting started

2. Clone the repo

$ git clone https://github.com/mohak1283/Instagram-Clone
$ cd Instagram-Clone/

3. Setup the firebase app

  1. You'll need to create a Firebase instance. Follow the instructions at https://console.firebase.google.com.
  2. Once your Firebase instance is created, you'll need to enable anonymous authentication.
  • Go to the Firebase Console for your new instance.
  • Click "Authentication" in the left-hand menu
  • Click the "sign-in method" tab
  • Click "Google" and enable it
  1. Enable the Firebase Database
  • Go to the Firebase Console
  • Click "Database" in the left-hand menu
  • Click the Cloudstore "Create Database" button
  • Select "Start in test mode" and "Enable"
  1. (skip if not running on Android)
  • Create an app within your Firebase instance for Android, with package name com.mohak.instagram
  • Run the following command to get your SHA-1 key:
keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
  • In the Firebase console, in the settings of your Android app, add your SHA-1 key by clicking "Add Fingerprint".
  • Follow instructions to download google-services.json
  • place google-services.json into /android/app/.
  1. (skip if not running on iOS)
  • Create an app within your Firebase instance for iOS, with your app package name
  • Follow instructions to download GoogleService-Info.plist
  • Open XCode, right click the Runner folder, select the "Add Files to 'Runner'" menu, and select the GoogleService-Info.plist file to add it to /ios/Runner in XCode
  • Open /ios/Runner/Info.plist in a text editor. Locate the CFBundleURLSchemes key. The second item in the array value of this key is specific to the Firebase instance. Replace it with the value for REVERSED_CLIENT_ID from GoogleService-Info.plist

Double check install instructions for both

Upcoming Features

  • Notificaitons for likes, comments, follows, etc
  • Caching of Profiles, Images, Etc.
  • Filters support for images
  • Videos support
  • Custom Camera Implementation
  • Heart Animation when liking image
  • Delete Posts
  • Stories
  • Send post to chats

Questions?๐Ÿค”

Hit me on

How to Contribute

  1. Fork the the project
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make required changes and commit (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright (c) 2019 Mohak Gupta

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

instagram-clone's People

Contributors

mohak1283 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instagram-clone's Issues

Video supports

Can u please make it video support in news feed along with images

Xcode showing Flutter and Dart file errors in the project.

So this is very strange, I can't seem to find what is wrong and I keep getting these errors. I'm getting the 3 following errors currently.

/Users/NAME/Downloads/.pub-cache/hosted/pub.dartlang.org/cached_network_image-0.7.0/lib/src/cached_network_image_provider.dart:42:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
/Users/NAME/Downloads/development/flutter/packages/flutter/lib/src/painting/image_provider.dart:489:24: Context: This is the overridden method ('load').
/Users/NAME/Downloads/.pub-cache/hosted/pub.dartlang.org/cached_network_image-0.7.0/lib/src/cached_network_image_provider.dart:46:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.

Do you have any idea why this is happening? I can't seem to find the issue since Xcode is not giving me anything else but this. I did flutter doctor, everything seems fine, I ran flutter analyze inside the project and no errors were shown only some warnings. I am using the latest version of Xcode which might be the problem, I am using Legacy Build Tools, everything is up to date. There were also some errors in the code which I managed to resolve but I have no idea what is going on with these 3. I hope you can help me resolve this issue.

Sincerely,
JustStanix

Sign in error in release mode

Sign in button not work

E/flutter (24262): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.b: 10: , null)
E/flutter (24262): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564)
E/flutter (24262): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302)
E/flutter (24262):
E/flutter (24262): #2 GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:226)
E/flutter (24262):
E/flutter (24262): #3 GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:268)
E/flutter (24262): #4 GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:339)
E/flutter (24262): #5 FirebaseProvider.signIn (package:instagram_clone/resources/firebase_provider.dart:84)
E/flutter (24262):
E/flutter (24262): #6 Repository.signIn (package:instagram_clone/resources/repository.dart:16)
E/flutter (24262): #7 _LoginScreenState.build. (package:instagram_clone/ui/login_screen.dart:43)
E/flutter (24262): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:120)
E/flutter (24262): #9 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242)
E/flutter (24262): #10 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175)
E/flutter (24262): #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:265)
E/flutter (24262): #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73)
E/flutter (24262): #13 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101)
E/flutter (24262): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:214)
E/flutter (24262): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:192)
E/flutter (24262): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:149)
E/flutter (24262): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101)
E/flutter (24262): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85)
E/flutter (24262): #19 _rootRunUnary (dart:async/zone.dart:1136)
E/flutter (24262): #20 _CustomZone.runUnary (dart:async/zone.dart:1029)
E/flutter (24262): #21 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931)
E/flutter (24262): #22 _invoke1 (dart:ui/hooks.dart:223)
E/flutter (24262): #23 _dispatchPointerDataPacket (dart:ui/hooks.dart:144)

Build failed with an exception

i have this issue
when open project and add packages in yaml file
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 17.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
Finished with error: Gradle task assembleDebug failed with exit code 1

POD Error

Screen Shot 2019-04-22 at 1 27 22 PM

Hi, im trying to compile the project and gives the error "Error running pod install Error launching application on iPhone XR."

Please support

App Crashes when Location Permission is granted

E/AndroidRuntime(26145): FATAL EXCEPTION: AsyncTask #2 E/AndroidRuntime(26145): Process: com.mohak.instagram, PID: 26145 E/AndroidRuntime(26145): java.lang.RuntimeException: An error occurred while executing doInBackground() E/AndroidRuntime(26145): at android.os.AsyncTask$3.done(AsyncTask.java:354) E/AndroidRuntime(26145): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) E/AndroidRuntime(26145): at java.util.concurrent.FutureTask.setException(FutureTask.java:252) E/AndroidRuntime(26145): at java.util.concurrent.FutureTask.run(FutureTask.java:271) E/AndroidRuntime(26145): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/AndroidRuntime(26145): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime(26145): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(26145): at java.lang.Thread.run(Thread.java:764) E/AndroidRuntime(26145): Caused by: java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2 E/AndroidRuntime(26145): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605) E/AndroidRuntime(26145): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:556) E/AndroidRuntime(26145): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:131) Lost connection to device. E/AndroidRuntime(26145): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225) E/AndroidRuntime(26145): at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:109) E/AndroidRuntime(26145): at com.aloisdeniel.geocoder.GeocoderPlugin$2.doInBackground(GeocoderPlugin.java:102) E/AndroidRuntime(26145): at android.os.AsyncTask$2.call(AsyncTask.java:333) E/AndroidRuntime(26145): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/AndroidRuntime(26145): ... 4 more

Publish app to F-Droid?

It would be cool to have the app on f-droid store (https://f-droid.org/), a store which hosts only FLOSS apps. There are no IG FLOSS apps there, so it would be good to attract new users^^
Unfortunately it seems they reject firebase as it is not opensource, is there any way you can replace it?

https://gitlab.com/fdroid/rfp for submitting it,

Build error (Multiple commands produce)

Trying to install/run for the first time.

Building on iOS. Using Xcode v12.

Not sure if this is related only to this repo cause I've seen other people having the same issue. I was not able to resolve it.

Let me know if you have a clue.

Full log:

Multiple commands produce '/Users/neant/Library/Developer/Xcode/DerivedData/Runner-dcxhryqrzaryvxdjmznowqfooern/Build/Intermediates.noindex/SwiftMigration/Runner/Products/Debug-iphonesimulator/Runner.app/Runner':
1) Target 'Runner' has copy command from '/Users/neant/Local/app/budscore/Instagram-Clone/ios/Runner/Runner' to '/Users/neant/Library/Developer/Xcode/DerivedData/Runner-dcxhryqrzaryvxdjmznowqfooern/Build/Intermediates.noindex/SwiftMigration/Runner/Products/Debug-iphonesimulator/Runner.app/Runner'
2) Target 'Runner' has link command with output '/Users/neant/Library/Developer/Xcode/DerivedData/Runner-dcxhryqrzaryvxdjmznowqfooern/Build/Intermediates.noindex/SwiftMigration/Runner/Products/Debug-iphonesimulator/Runner.app/Runner'

Taking a photo crashes app

When I am trying to take a photo with the camera of the device, the app crashes when closing the camera without taking a picture:

image_provider.dart: Failed assertion: line 563 pos 14: 'file != null': is not true

google sign issue

How to fix this issue. I have setup step by step as mentioned.

E/flutter ( 6076): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)
E/flutter ( 6076): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter ( 6076): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)

Compiler Failed

After setting up firebase and deploying it, I used flutter run to run the code on iOS simulator but I am encountering the following compiler errors:

Compiler message:
lib/resources/firebase_provider.dart:93:31: Error: A value of type 'AuthResult' can't be
assigned to a variable of type 'FirebaseUser'.

  • 'AuthResult' is from 'package:firebase_auth/firebase_auth.dart'
    ('../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+
    5/lib/firebase_auth.dart').
  • 'FirebaseUser' is from 'package:firebase_auth/firebase_auth.dart'
    ('../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+
    5/lib/firebase_auth.dart').
    Try changing the type of the left hand side, or casting the right hand side to
    'FirebaseUser'.
    final FirebaseUser user = await _auth.signInWithCredential(credential);
    ^
    lib/ui/insta_upload_photo_screen.dart:212:18: Error: Too many positional arguments: 1
    allowed, but 2 found.
    Try removing the extra positional arguments.
    Im.copyResize(image, 500);
    ^
    ../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/src/tran
    sform/copy_resize.dart:14:7: Context: Found this candidate, but the arguments don't match.
    Image copyResize(Image src, {int width, int height,
    ^^^^^^^^^^
    lib/ui/edit_profile_screen.dart:259:18: Error: Too many positional arguments: 1 allowed,
    but 2 found.
    Try removing the extra positional arguments.
    Im.copyResize(image, 500);
    ^
    ../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/src/tran
    sform/copy_resize.dart:14:7: Context: Found this candidate, but the arguments don't match.
    Image copyResize(Image src, {int width, int height,
    ^^^^^^^^^^
    ../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-0.7
    .0/lib/src/cached_network_image_provider.dart:46:31: Error: The argument type 'Null
    Function(StringBuffer)' can't be assigned to the parameter type 'Iterable
    Function()'.
  • 'StringBuffer' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'.
  • 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart'
    ('../../development/tools/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to
    'Iterable Function()'.
    informationCollector: (StringBuffer information) {
    ^
    lib/ui/chat_detail_screen.dart:185:18: Error: Too many positional arguments: 1 allowed, but
    2 found.
    Try removing the extra positional arguments.
    Im.copyResize(image, 500);
    ^
    ../../development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/src/tran
    sform/copy_resize.dart:14:7: Context: Found this candidate, but the arguments don't match.
    Image copyResize(Image src, {int width, int height,
    ^^^^^^^^^^
    Compiler failed on /Users/jeunghbyun/iOSProjects/Instagram-Clone/lib/main.dart
    Error launching application on iPhone 8 Plus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.