### Repository https://github.com/enyason/Syde ### History - [Implementing Syde(An online Forum) in Flutter](https://steemit.com/utopian-io/@ideba/implementing-sydean-online-forum-in-flutter) ### New Features - **Authenticate User** A platform such as this should be able to identify it's users. To achieve this, I implemented Google sign in. <center> </center> #### *Implementation* Implementing the authentication was a bit straight forward with the flutter plug-in. To make things modular I used the bloc pattern to handle click events from the user and then respond to the click event by calling the sign in method on an abstract class I created. This abstract class handles everything concerning authentication. - The code block below is the auth bloc where we listen for data on the stream and react accordingly ``` class AuthBloc { final BaseAuth baseAuth; //stream controller to handle streams StreamController<ClickEvents> _controller = StreamController<ClickEvents>(); AuthBloc(this.baseAuth) { //listen for data on the stream _inputStream().listen((event) { if (event is ClickEvents) { baseAuth.signInWithCredentials(baseAuth.getFireBAseAuth()); } }); } //create a stream Stream<ClickEvents> _inputStream() { return _controller.stream; } //create a sink- with a sink, data can be added unto the stream Sink<ClickEvents> get eventSink => _controller.sink; //close the stream void dispose() { _controller.close(); } } abstract class ClickEvents {} class LogInClick extends ClickEvents {} //make a global instance of AuthBloc final authBloc = AuthBloc(Auth()); ``` - The code snippet below shows abstract methods used for implementing the authentication. for full details check [source code](https://github.com/enyason/Syde/blob/master/lib/Auth/auth.dart) ``` abstract class BaseAuth { FirebaseAuth getFireBAseAuth(); GoogleSignIn getGoogleLogin(); Future<FacebookLoginResult> initFaceBookLogIn( FacebookLogin fbLogIn, List<String> permission); Future<GoogleSignInAuthentication> getGoogleSignInAuth(); AuthCredential getAuthCredential(GoogleSignInAuthentication auth); Future<void> logUserOut(FirebaseAuth mAuth); Future<void> storeUser(FirebaseUser user); Future<FirebaseUser> signInWithCredentials(FirebaseAuth mAuth); } ``` - The code block stores user's details to fire-store if user details do not exist ``` Future<void> storeUser(FirebaseUser user) async { if (user != null) { // Check is already sign up final QuerySnapshot result = await Firestore.instance .collection('users') .where('id', isEqualTo: user.uid) .getDocuments(); final List<DocumentSnapshot> documents = result.documents; documents.forEach((val) { print("Data = ${val.data}"); }); if (documents.length == 0) { // Update data to server if new user Firestore.instance.collection('users').document(user.uid).setData({ 'name': user.displayName, 'photoUrl': user.photoUrl, 'id': user.uid, 'created': DateTime.now().millisecondsSinceEpoch.toString() }); } } } ``` - From the Login Screen, all we need is a line of code in the `onTap` function to begin authenticating a user ``` onTap: () { authBloc.eventSink.add(LogInClick()); } ``` ### Technology Stack - [Android Studio](https://developer.android.com/studio/index.html) - [Flutter](https://flutter.dev): Flutter is google mobile framework for building beautiful cross-platform apps - [FireBase](https://firebase.google.com): Firebase will provide us with online backend functionality such database, cloud functions, authentication, real-time functionalities etc - [SQFlite](https://pub.dartlang.org/packages/sqflite) : this is flutter version of SQLite. This will enable local storage on the phone - [RxDart](https://pub.dartlang.org/packages/rxdart) : RxDart is used for reactive programming - BLOc pattern is used as the architectural pattern for layering the app. ### IMPORTANT RESOURCES *Github *: https://github.com/enyason/Syde ### Roadmap The screenshots above show the current state of the application. I will work towards implementing all the features as described above. More attention would be given to the layouts and presentation of the app, to improve the user's experience. Some of the updates to expect are: - ~~Authenticate User~~ - Persisting user post - Searching all posts - Providing different layouts - ToDo for users to track their daily progress - Push Notifications - Posts sharing - Users dashboard - Searching all users - Direct Messaging with Users - ChatGroup - Bookmarking post ***Demo Video*** https://youtu.be/KR4w4k0JHSU ***Github*** - https://github.com/enyason/Syde ### How to contribute? You can reach me by commenting on this post or send a message via enyasonjnr@gmail.com.If you want to make this application better, you can make a Pull Request. [Github](https://github.com/enyason/Syde)
author | ideba | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
permlink | implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google | ||||||||||||
category | utopian-io | ||||||||||||
json_metadata | {"tags":["utopian-io","development","open-source","flutter","firebase"],"app":"steem-plus-app"} | ||||||||||||
created | 2019-03-27 00:52:39 | ||||||||||||
last_update | 2019-03-27 00:52:39 | ||||||||||||
depth | 0 | ||||||||||||
children | 5 | ||||||||||||
last_payout | 2019-04-03 00:52:39 | ||||||||||||
cashout_time | 1969-12-31 23:59:59 | ||||||||||||
total_payout_value | 26.902 HBD | ||||||||||||
curator_payout_value | 9.157 HBD | ||||||||||||
pending_payout_value | 0.000 HBD | ||||||||||||
promoted | 0.000 HBD | ||||||||||||
body_length | 5,430 | ||||||||||||
author_reputation | 10,184,429,675,092 | ||||||||||||
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" | ||||||||||||
beneficiaries |
| ||||||||||||
max_accepted_payout | 100,000.000 HBD | ||||||||||||
percent_hbd | 10,000 | ||||||||||||
post_id | 82,013,131 | ||||||||||||
net_rshares | 57,490,395,182,358 | ||||||||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
tombstone | 0 | 4,012,433,945,748 | 16.5% | ||
rufans | 0 | 20,542,968,739 | 100% | ||
bukiland | 0 | 377,254,782 | 1.1% | ||
helo | 0 | 27,754,360,851 | 11.01% | ||
mcoinz79 | 0 | 3,551,050,684 | 1% | ||
codingdefined | 0 | 16,009,576,878 | 11.01% | ||
leir | 0 | 2,118,071,066 | 50% | ||
jadabug | 0 | 2,155,892,216 | 1% | ||
espoem | 0 | 59,922,102,245 | 30.62% | ||
mcfarhat | 0 | 8,032,409,696 | 4.4% | ||
steem-plus | 0 | 9,868,215,818 | 0.67% | ||
utopian-io | 0 | 51,767,051,865,874 | 41.26% | ||
imisstheoldkanye | 0 | 572,674,914 | 1% | ||
jaff8 | 0 | 26,915,883,008 | 11.01% | ||
newsrx | 0 | 166,634,477 | 11% | ||
greenorange | 0 | 548,312,875 | 100% | ||
lostmine27 | 0 | 10,216,676,509 | 25% | ||
amosbastian | 0 | 40,558,902,811 | 11.01% | ||
sargoon | 0 | 307,468,683 | 5.5% | ||
tobias-g | 0 | 141,356,059,824 | 38% | ||
properfraction | 0 | 2,355,527,458 | 100% | ||
ezravandi | 0 | 3,468,671,259 | 1% | ||
feronio | 0 | 1,235,616,743 | 100% | ||
rhodiumyellow | 0 | 503,659,059 | 100% | ||
rubydetails | 0 | 503,639,656 | 100% | ||
pinchtedious | 0 | 503,693,359 | 100% | ||
filmsdormant | 0 | 503,687,051 | 100% | ||
batheinitial | 0 | 503,672,706 | 100% | ||
twistlumber | 0 | 503,635,719 | 100% | ||
trigconic | 0 | 503,653,715 | 100% | ||
mailrabbit | 0 | 503,655,643 | 100% | ||
obstinacyseal | 0 | 503,684,147 | 100% | ||
octavesynodic | 0 | 503,730,183 | 100% | ||
moistspotify | 0 | 503,703,727 | 100% | ||
greatestspicy | 0 | 503,709,094 | 100% | ||
fc542f | 0 | 554,004,790 | 100% | ||
annasokolova955 | 0 | 503,677,640 | 100% | ||
irinakolcova91 | 0 | 503,651,870 | 100% | ||
olesjakoval | 0 | 503,691,571 | 100% | ||
rakov23 | 0 | 503,705,040 | 100% | ||
maslov11 | 0 | 503,710,839 | 100% | ||
ulockblock | 0 | 81,722,770,999 | 25.11% | ||
clearinnize | 0 | 547,251,161 | 100% | ||
fontetersti | 0 | 545,161,748 | 100% | ||
thussidlaws | 0 | 503,788,758 | 100% | ||
rapshebarners | 0 | 552,157,318 | 100% | ||
contverbasys | 0 | 553,138,304 | 100% | ||
enstanlossma | 0 | 550,139,061 | 100% | ||
nieloagranca | 0 | 2,085,868,624 | 8% | ||
chloexdrmnmiller | 0 | 544,330,587 | 100% | ||
elizabethg4 | 0 | 552,498,962 | 100% | ||
steemchoose | 0 | 5,974,830,069 | 7.5% | ||
nicole7imxj | 0 | 540,292,918 | 100% | ||
avaa620dthomas | 0 | 553,891,244 | 100% | ||
cryptouno | 0 | 514,752,022 | 5% | ||
ideba | 0 | 4,177,775,388 | 100% | ||
mops2e | 0 | 345,132,624 | 24.49% | ||
ellala6twmartin | 0 | 549,249,515 | 100% | ||
natalielj | 0 | 546,417,358 | 100% | ||
alyssatn2brro | 0 | 550,472,717 | 100% | ||
esiselac1980 | 0 | 541,901,543 | 100% | ||
dopsausurlei | 0 | 552,501,106 | 100% | ||
lipofirssa | 0 | 542,773,279 | 100% | ||
hitputzfetwall | 0 | 553,419,835 | 100% | ||
unkeypluga | 0 | 551,539,923 | 100% | ||
chaegriltesubt | 0 | 543,905,458 | 100% | ||
steem-ua | 0 | 1,174,718,224,745 | 11% | ||
kaczynski | 0 | 190,138,323 | 100% | ||
hdu | 0 | 1,248,982,832 | 1% | ||
gouji | 0 | 543,231,139 | 100% | ||
bluesniper | 0 | 5,474,807,387 | 1.76% | ||
ascorphat | 0 | 2,006,698,476 | 2.5% | ||
bejust | 0 | 2,045,593,880 | 100% | ||
hamsa.quality | 0 | 832,770,827 | 1% | ||
progressing | 0 | 1,848,151,168 | 100% | ||
supu | 0 | 29,653,914,093 | 3.5% |
- The code contains too much dead code. You should remove all of the commented code before committing to the repo. - Your commits are too big, they should be broken down in smaller concerns. Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2-3-2-2-1-2-3-). ---- Need help? Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | helo |
---|---|
permlink | re-ideba-implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google-20190327t020438869z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2-3-2-2-1-2-3-","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2019-03-27 02:04:39 |
last_update | 2019-03-27 02:04:39 |
depth | 1 |
children | 1 |
last_payout | 2019-04-03 02:04:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 10.062 HBD |
curator_payout_value | 3.197 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 641 |
author_reputation | 121,547,934,535,311 |
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,015,709 |
net_rshares | 20,237,863,309,666 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
codingdefined | 0 | 32,395,066,376 | 22.2% | ||
jadabug | 0 | 2,162,139,289 | 1% | ||
espoem | 0 | 29,431,064,066 | 15% | ||
utopian-io | 0 | 19,977,988,639,359 | 14.02% | ||
jaff8 | 0 | 54,397,761,874 | 22.2% | ||
emrebeyler | 0 | 4,570,468,788 | 1% | ||
aydant | 0 | 10,871,992,517 | 50% | ||
lostmine27 | 0 | 9,378,981,756 | 23% | ||
amosbastian | 0 | 81,943,042,458 | 22.2% | ||
reazuliqbal | 0 | 13,660,479,343 | 8% | ||
ezravandi | 0 | 3,484,950,549 | 1% | ||
ulockblock | 0 | 11,621,362,068 | 3.61% | ||
votes4minnows | 0 | 245,337,947 | 2% | ||
hdu | 0 | 1,250,717,505 | 1% | ||
curbot | 0 | 2,395,046,642 | 100% | ||
ascorphat | 0 | 1,962,871,229 | 2.5% | ||
patrikcooper | 0 | 103,387,900 | 100% |
Thank you for your review, @helo! Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-ideba-implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google-20190327t020438869z-20190329t181105z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.17"}" |
created | 2019-03-29 18:11:06 |
last_update | 2019-03-29 18:11:06 |
depth | 2 |
children | 0 |
last_payout | 2019-04-05 18:11:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 56 |
author_reputation | 152,955,367,999,756 |
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,163,635 |
net_rshares | 0 |
Hi, @ideba! You just got a **0.67%** upvote from SteemPlus! To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn. If you're not using SteemPlus yet, please check our last posts in [here](https://steemit.com/@steem-plus) to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
author | steem-plus |
---|---|
permlink | implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google---vote-steemplus |
category | utopian-io |
json_metadata | {} |
created | 2019-03-27 04:33:09 |
last_update | 2019-03-27 04:33:09 |
depth | 1 |
children | 0 |
last_payout | 2019-04-03 04:33:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 432 |
author_reputation | 247,952,188,232,400 |
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,020,389 |
net_rshares | 0 |
#### Hi @ideba! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
author | steem-ua |
---|---|
permlink | re-implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google-20190327t154435z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.19"}" |
created | 2019-03-27 15:44:36 |
last_update | 2019-03-27 15:44:36 |
depth | 1 |
children | 0 |
last_payout | 2019-04-03 15:44:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 284 |
author_reputation | 23,214,230,978,060 |
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,050,495 |
net_rshares | 0 |
Hey, @ideba! **Thanks for contributing on Utopian**. Weβre already looking forward to your next contribution! **Get higher incentives and support Utopian.io!** Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)). **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
author | utopian-io |
---|---|
permlink | re-implementing-syde-an-online-forum-in-flutter-update--authenticate-with-google-20190327t224933z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.17"}" |
created | 2019-03-27 22:49:33 |
last_update | 2019-03-27 22:49:33 |
depth | 1 |
children | 0 |
last_payout | 2019-04-03 22:49:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 587 |
author_reputation | 152,955,367,999,756 |
root_title | "Implementing Syde An online Forum in Flutter (Update : Authenticate With Google)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,065,151 |
net_rshares | 0 |