Giter Club home page Giter Club logo

flutter-reddit-clone's Introduction

Reddit Clone

Responsive Full Stack Reddit Clone - Works on Android, iOS & Web!

Features

  • Google/Guest Authentication
  • Create, Join community
  • Community Profile (Avatar, Banner, Members)
  • Edit Description and Avatar of community
  • Post (link only, photo, text only)
  • Displaying posts from communities user is part of
  • Upvote, Downvote
  • Comment
  • Award the Post
  • Update Karma
  • Add Moderators
  • Moderator- remove post
  • Delete post
  • User Profile (Avatar, Banner)
  • Theme Switch
  • Cross Platform
  • Responsive UI
  • Latest posts (instead of home, display this to guest users)

YouTube

I have created a tutorial based on this, do check it out on my channel Rivaan Ranawat

Youtube Tutorial Image

Installation

After cloning this repository, migrate to flutter-reddit-clone folder. Then, follow the following steps:

  • Create Firebase Project
  • Enable Authentication (Google Sign In, Guest Sign In)
  • Make Firestore Rules
  • Create Android, iOS & Web Apps
  • Use FlutterFire CLI to add the Firebase Project to this app. Then run the following commands to run your app:
  flutter pub get
  open -a simulator (to get iOS Simulator)
  flutter run
  flutter run -d chrome --web-renderer html (to see the best output)

Tech Used

Server: Firebase Auth, Firebase Storage, Firebase Firestore

Client: Flutter, Riverpod 2.0, Routemaster

Feedback

If you have any feedback, please reach out to me at [email protected]

flutter-reddit-clone's People

Contributors

nitin-poojary avatar rivaanranawat 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

flutter-reddit-clone's Issues

After logged in it doesn't navigate to home screen : Problem exist after the third commit

Hello Guys, you are doing greate.

in main.dart, I know line 40 "setState" is being called infinitely. and that why you removed it.

but there is another bug, let's say you are a new user and try to login with google, and then after you logged in you will not be navigate to HomeScreen automatically unless you use hot Reload or quit the app and run it again.

the "setState" is not good, so if there is another solution?

setState issue

i'm building reddit clone from Youtube by Rivaan Ranawat. my app is continusly running and widgets rebuilding as you see in the pic.
third.
the problem i observed is that in the main dart file the getData function have a setState show in pic
first
but the official repository doesn't have that setstate as show in pic
second
but i remove that setstate but the app is not proceeding from google sign in please help.
i have made the app till timestamp 3:02:20.

Error upon tapping Connect with Google.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable.
To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
#0 Element._debugCheckStateIsActiveForAncestorLookup. (package:flutter/src/widgets/framework.dart:4743:9)
#1 Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:4757:6)
#2 Element.findAncestorWidgetOfExactType (package:flutter/src/widgets/framework.dart:4818:12)
#3 debugCheckHasScaffoldMessenger. (package:flutter/src/material/debug.dart:175:17)
#4 debugCheckHasScaffoldMessenger (package:flutter/src/material/debug.dart:187:4)
#5 ScaffoldMessenger.of (package:flutter/src/material/scaffold.dart:146:12)
#6 <โ€ฆ>
Lost connection to device.

communities not updating while login with different user

when i create community with one user, it displays correctly then when i logout and again sign in with different user, it shows community of previous user in community list drawer. I have to hot reload every time login to see correct community of login user

How to fix cloudstore errors

[cloud_firestore/failed-precondition] The query requires an index. You can create it here: https://
console.firebase.google.com/v1/r/project/matrix-idea-notes/firestore/indexes?
create_composite=Ck9wcm9qZWN0cy9tYXRyaXgtaWRIYS1ub3Rlcy9kYXRhYmFzZXMvKGRIZmF1bHQpL2N
vbGxlY3Rpb25Hcm91cHMvcG9zdHMvaW5kZXhlcy9fEAEaBwoDdWlkEAEaDQoJY3JlYXRIZEFOEAlaDAOIX19
uYW1IX18QAg

I browse the link but not work

After "when" how to update TextEditingContoller

Thank you for your contributions.

I do have a question that I am searching for an answer to. I was searching for a solution within your public repos' and could not see one.

Within my widget, as shown below, how do I update the initial value of the TextFormField after gettingPost from my ref.watch?

 return ref.watch(getLocalPostProvider(widget.id!)).when( 
      data: (item) => Scaffold(
      ... 
            TextFormField(
                  controller: descriptionController, //<<<<
                  maxLines: 10,
                  minLines: 5,
                  textInputAction: TextInputAction.done,
                  textCapitalization: TextCapitalization.sentences,
                  decoration: const InputDecoration(
                    labelText: "Description",
                  ),
                  onChanged: (v) =>{}
                ),
      ...
      )

I am reviewing the edit_profile_screen.dart page when a id is passed in then you are performing ref.watch(getUserDataProvider(widget.uid)).when ... I want to do this but then set the initial value of the textfield controllers within the when syntax. It seems that this is not possible?

Your assistance is very much appreciated.

Communities not being displayed

hello, i have a problem with the app, after i run the code users that follow communities don't have the community being displayed and there home screen is empty, they also can't post since the app doesn't recognize that they are part of the community, how can i fix this?

Home Screen Widget rebuilding frequently

Performance issue

In main.dart file

void getData(WidgetRef ref, User data) async {
    userModel = await ref.watch(authControllerProvider.notifier).getUserData(data.uid).first;
    ref.read(userProvider.notifier).update((state) => userModel);
    setState(() {});
  }

This function is calling setState((){}) which leads to rebuilding build function in main.dart which is again calling getData() function in MaterialApp.router

if (data != null) {
                  getData(ref, data);
                  if (userModel != null) {
                    return loggedInRoute;
                  }
                }

Which leads to rebuilding of whole app frequently and causing wastage of resources to rebuild widgets without any change in state or incoming data from firebase.

backgroundColor is depreciated

On the theme pallet.dart, backgroundColor is depreciated, shall we replace with the codes below :

line 26:

    colorScheme: ThemeData.dark().colorScheme.copyWith(
      background: Pallete.drawerColor,

line 46:

        colorScheme: ThemeData.light().colorScheme.copyWith(
      background: Pallete.whiteColor,

Community creation with multiple words

I'm having the issue with community creation process: when I attempt to create a community with two or more words, ex. 'One Two', I have an output on the community's screen like: 'type Null is not a subtype of type Map<String, dynamic> in type cast".

Also, have the same issue with 'Editing Community' option as well.

Any suggestions for troubleshooting on it? Thanks in advance fellas!

error while running in web

Hi there, thanks for sharing the code and video!

After clicking Skip or Continue with Google, spinning wheel appears and in console i see:

Error: Error
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw
packages/reddit_tutorial/features/auth/repository/auth_repository.dart 114:7 signInAsGuest
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31
dart-sdk/lib/async/zone.dart 1658:54 runBinary
dart-sdk/lib/async/future_impl.dart 162:22 handleError
dart-sdk/lib/async/future_impl.dart 778:46 handleError
dart-sdk/lib/async/future_impl.dart 799:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 574:5 [_completeError]
dart-sdk/lib/async/future_impl.dart 665:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15

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.