Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (flutterVersionName == null) {

android {
namespace "org.aossie.monumento"
compileSdk 34
compileSdk 35
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "com.android.application" version "8.2.1" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
Expand Down
24 changes: 24 additions & 0 deletions firepit-log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Welcome to firepit v1.1.0!
Doing JSON parses for version checks at /snapshot/firepit/vendor/node_modules/firebase-tools/package.json
is-ci,mime,rc,yaml,abbrev,abort-controller,accepts,agent-base,aggregate-error,ajv,ajv-formats,ansi-align,ansi-escapes,ansi-regex,ansi-styles,any-promise,anymatch,archiver,archiver-utils,argparse,array-flatten,arrify,as-array,ast-types,async,async-lock,asynckit,b4a,balanced-match,bare-events,base64-js,basic-auth,basic-auth-connect,basic-ftp,bignumber.js,binary-extensions,bl,body-parser,boxen,brace-expansion,braces,buffer,buffer-crc32,buffer-equal-constant-time,bytes,cacache,call-bind-apply-helpers,call-bound,call-me-maybe,camelcase,chalk,char-regex,chardet,chokidar,chownr,ci-info,cjson,clean-stack,cli-boxes,cli-cursor,cli-highlight,cli-spinners,cli-table3,cli-width,cliui,clone,color,color-convert,color-name,color-string,colorette,colorspace,combined-stream,commander,compress-commons,compressible,compression,concat-map,config-chain,configstore,connect,content-disposition,content-type,cookie,cookie-signature,core-util-is,cors,crc-32,crc32-stream,cross-env,cross-spawn,crypto-random-string,csv-parse,data-uri-to-buffer,debug,deep-equal-in-any-order,deep-extend,deep-freeze,deep-is,defaults,degenerator,delayed-stream,depd,destroy,discontinuous-range,dot-prop,dunder-proto,duplexify,eastasianwidth,ecdsa-sig-formatter,ee-first,emoji-regex,emojilib,enabled,encodeurl,encoding,end-of-stream,env-paths,environment,err-code,es-define-property,es-errors,es-object-atoms,es-set-tostringtag,escalade,escape-goat,escape-html,escape-string-regexp,escodegen,esprima,estraverse,esutils,etag,event-target-shim,events,events-listener,exegesis,exegesis-express,exponential-backoff,express,extend,external-editor,fast-deep-equal,fast-fifo,fast-uri,fecha,figures,filesize,fill-range,finalhandler,firebase-tools,fn.name,foreground-child,form-data,forwarded,fresh,fs-extra,fs-minipass,function-bind,fuzzy,gaxios,gcp-metadata,get-caller-file,get-intrinsic,get-proto,get-stdin,get-uri,glob,glob-parent,glob-slash,glob-slasher,global-dirs,google-auth-library,google-gax,google-logging-utils,googleapis-common,gopd,graceful-fs,gtoken,has-flag,has-symbols,has-tostringtag,has-yarn,hasown,heap-js,highlight.js,http-cache-semantics,http-errors,http-proxy-agent,https-proxy-agent,iconv-lite,ieee754,import-lazy,imurmurhash,indent-string,inherits,ini,inquirer,inquirer-autocomplete-prompt,install-artifact-from-github,ip-address,ip-regex,ipaddr.js,is-arrayish,is-binary-path,is-buffer,is-extglob,is-fullwidth-code-point,is-glob,is-installed-globally,is-interactive,is-lambda,is-npm,is-number,is-obj,is-path-inside,is-promise,is-stream,is-stream-ended,is-typedarray,is-unicode-supported,is-url,is-wsl,is-yarn-global,is2,isarray,isexe,isomorphic-fetch,jackspeak,jju,join-path,js-yaml,jsbn,json-bigint,json-parse-helpfulerror,json-ptr,json-schema-traverse,jsonfile,jsonwebtoken,jwa,jws,kind-of,kuler,lazystream,leven,libsodium,libsodium-wrappers,lodash,lodash._objecttypes,lodash.camelcase,lodash.includes,lodash.isboolean,lodash.isinteger,lodash.isnumber,lodash.isobject,lodash.isplainobject,lodash.isstring,lodash.mapvalues,lodash.once,lodash.snakecase,log-symbols,logform,long,lru-cache,lsofi,make-dir,make-fetch-happen,marked,marked-terminal,math-intrinsics,media-typer,merge-descriptors,methods,mime-db,mime-types,mimic-fn,minimatch,minimist,minipass,minipass-collect,minipass-fetch,minipass-flush,minipass-pipeline,minipass-sized,minizlib,mkdirp,moo,morgan,ms,mute-stream,mz,nan,nearley,negotiator,netmask,node-emoji,node-fetch,node-gyp,nopt,normalize-path,object-assign,object-hash,object-inspect,on-finished,on-headers,once,one-time,onetime,open,openapi3-ts,ora,os-tmpdir,p-defer,p-limit,p-map,p-throttle,pac-proxy-agent,pac-resolver,package-json-from-dist,parse5,parse5-htmlparser2-tree-adapter,parseurl,path-key,path-scurry,path-to-regexp,pg,pg-cloudflare,pg-connection-string,pg-int8,pg-pool,pg-protocol,pg-types,pgpass,picocolors,picomatch,portfinder,postgres-array,postgres-bytea,postgres-date,postgres-interval,proc-log,process,process-nextick-args,progress,promise-breaker,promise-retry,proto-list,proto3-json-serializer,protobufjs,proxy-addr,proxy-agent,proxy-from-env,pupa,qs,railroad-diagrams,randexp,range-parser,raw-body,re2,readable-stream,readdir-glob,readdirp,registry-auth-token,registry-url,require-directory,require-from-string,restore-cursor,ret,retry,retry-request,router,run-async,rxjs,safe-buffer,safe-stable-stringify,safer-buffer,semver,semver-diff,send,serve-static,setprototypeof,shebang-command,shebang-regex,side-channel,side-channel-list,side-channel-map,side-channel-weakmap,signal-exit,simple-swizzle,skin-tone,smart-buffer,socks,socks-proxy-agent,sort-any,source-map,split2,sprintf-js,sql-formatter,ssri,stack-trace,statuses,stream-chain,stream-events,stream-json,stream-shift,streamx,string-width,string-width-cjs,string_decoder,strip-ansi,strip-ansi-cjs,strip-json-comments,stubs,superstatic,supports-color,supports-hyperlinks,tar,tar-stream,tcp-port-used,teeny-request,text-decoder,text-hex,thenify,thenify-all,through,through2,tmp,to-regex-range,toidentifier,toxic,tr46,triple-beam,tslib,tsscmp,type-fest,type-is,typedarray-to-buffer,undici-types,unicode-emoji-modifier-base,unique-filename,unique-slug,unique-string,universal-analytics,universalify,unpipe,update-notifier-cjs,url-join,url-template,util-deprecate,utils-merge,uuid,valid-url,vary,wcwidth,webidl-conversions,whatwg-fetch,whatwg-url,which,widest-line,winston,winston-transport,wrap-ansi,wrap-ansi-cjs,wrappy,write-file-atomic,ws,xdg-basedir,xtend,y18n,yallist,yargs,yargs-parser,yocto-queue,zip-stream,@apidevtools,@colors,@dabh,@electric-sql,@google-cloud,@googleapis,@grpc,@isaacs,@js-sdsl,@jsdevtools,@npmcli,@opentelemetry,@pkgjs,@pnpm,@protobufjs,@sindresorhus,@tootallnate,@types
Installed ft@13.34.0 and packaged ft@13.34.0
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/lib/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /snapshot/firepit/node_modules/npm/bin/npm-cli
Found npm/bin/npm-cli install.
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/lib/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /snapshot/firepit/node_modules/npm/bin/npm-cli
Found npm/bin/npm-cli install.
Runtime binaries created.
/usr/local/bin/firebase
/usr/local/bin/firebase,/snapshot/firepit/firepit.js,--version
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/lib/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /snapshot/firepit/node_modules/npm/bin/npm-cli
Found npm/bin/npm-cli install.
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/lib/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /home/shridhar/.cache/firebase/tools/node_modules/npm/bin/npm-cli
Checking for npm/bin/npm-cli install at /snapshot/firepit/node_modules/npm/bin/npm-cli
Found npm/bin/npm-cli install.
ShellJSInternalError: ENOENT: no such file or directory, stat '/home/shridhar/.cache/firebase/runtime/node'
21 changes: 14 additions & 7 deletions lib/application/authentication/authentication_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@ class AuthenticationBloc

_mapLoggedInToState(
AuthenticationEvent event, Emitter<AuthenticationState> emit) async {
final (userLoggedIn, user) = await _authRepository.getUser();

if (userLoggedIn && user != null) {
emit(Authenticated(user.toEntity()));
} else if (userLoggedIn && user == null) {
emit(OnboardingIncomplete());
} else {
try {
await Future.delayed(const Duration(milliseconds: 500));
final (userLoggedIn, user) = await _authRepository.getUser();
log('User: $userLoggedIn, $user');
if (userLoggedIn && user != null) {
emit(Uninitialized());
emit(Authenticated(user.toEntity()));
} else if (userLoggedIn && user == null) {
emit(OnboardingIncomplete());
} else {
emit(Unauthenticated());
}
} catch (e) {
log('Error in _mapLoggedInToState: $e');
emit(Unauthenticated());
}
}
Expand Down
42 changes: 32 additions & 10 deletions lib/application/profile/follow/follow_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:monumento/domain/entities/user_entity.dart';
import 'package:monumento/domain/repositories/social_repository.dart';
import 'package:monumento/application/authentication/authentication_bloc.dart';
import 'package:monumento/domain/repositories/authentication_repository.dart';

part 'follow_event.dart';
part 'follow_state.dart';

class FollowBloc extends Bloc<FollowEvent, FollowState> {
final SocialRepository _socialRepository;
final AuthenticationBloc _authenticationBloc;
final AuthenticationRepository _authenticationRepository;
bool _currentFollowStatus = false;

FollowBloc(this._socialRepository) : super(FollowInitial()) {
FollowBloc(this._socialRepository, this._authenticationBloc, this._authenticationRepository) : super(FollowInitial()) {
on<FollowUser>(_mapFollowUserToState);
on<UnfollowUser>(_mapUnfollowUserToState);
on<GetFollowStatus>(_mapGetFollowStatusToState);
Expand All @@ -23,23 +28,42 @@ class FollowBloc extends Bloc<FollowEvent, FollowState> {
try {
emit(LoadingFollowState());
await _socialRepository.followUser(targetUser: event.targetUser);
add(GetFollowStatus(targetUser: event.targetUser));
_currentFollowStatus = true;
emit(FollowStatusRetrieved(following: _currentFollowStatus));

// Update authentication state
_authenticationBloc.add(LoggedIn());

// Get the current user's following and followers lists
final (userLoggedIn, user) = await _authenticationRepository.getUser();
if (userLoggedIn && user != null) {
add(LoadUser(following: user.following));
add(LoadUser(following: user.followers));
}
} catch (e) {
log('${e.toString()} follow');

emit(FollowStateError(e.toString()));
}
}

_mapUnfollowUserToState(UnfollowUser event, Emitter<FollowState> emit) async {
try {
emit(LoadingFollowState());

await _socialRepository.unfollowUser(targetUser: event.targetUser);
add(GetFollowStatus(targetUser: event.targetUser));
_currentFollowStatus = false;
emit(FollowStatusRetrieved(following: _currentFollowStatus));

// Update authentication state
_authenticationBloc.add(LoggedIn());

// Get the current user's following and followers lists
final (userLoggedIn, user) = await _authenticationRepository.getUser();
if (userLoggedIn && user != null) {
add(LoadUser(following: user.following));
add(LoadUser(following: user.followers));
}
} catch (e) {
log('${e.toString()} unfollow');

emit(FollowStateError(e.toString()));
}
}
Expand All @@ -48,12 +72,11 @@ class FollowBloc extends Bloc<FollowEvent, FollowState> {
GetFollowStatus event, Emitter<FollowState> emit) async {
try {
emit(LoadingFollowState());
bool following =
_currentFollowStatus =
await _socialRepository.getFollowStatus(targetUser: event.targetUser);
emit(FollowStatusRetrieved(following: following));
emit(FollowStatusRetrieved(following: _currentFollowStatus));
} catch (e) {
log('${e.toString()} status');

emit(FollowStateError(e.toString()));
}
}
Expand All @@ -71,7 +94,6 @@ class FollowBloc extends Bloc<FollowEvent, FollowState> {
emit(LoadedFollowUserListState(userData: userDataEntity));
} catch (e) {
log('${e.toString()} follow');

emit(FollowUserListErrorState(message: e.toString()));
}
}
Expand Down
Loading