-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from Monday-Rocket/develop
1.0.50 업데이트
- Loading branch information
Showing
14 changed files
with
166 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:ac_project_app/cubits/login/login_user_state.dart'; | ||
import 'package:ac_project_app/di/set_up_get_it.dart'; | ||
import 'package:ac_project_app/provider/api/user/user_api.dart'; | ||
import 'package:ac_project_app/provider/share_data_provider.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class AutoLoginCubit extends Cubit<LoginUserState> { | ||
AutoLoginCubit() : super(LoginInitialState()); | ||
|
||
void userCheck() { | ||
final user = FirebaseAuth.instance.currentUser; | ||
if (user != null) { | ||
getIt<UserApi>().postUsers().then((result) { | ||
result.when( | ||
success: (data) { | ||
if (data.is_new ?? false) { | ||
emit(LoginInitialState()); | ||
} else { | ||
ShareDataProvider.loadServerDataAtFirst(); | ||
emit(LoginLoadedState(data)); | ||
} | ||
}, | ||
error: (_) => emit(LoginInitialState()), | ||
); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
void checkTutorial2({ | ||
required void Function() onMoveToTutorialView, | ||
required void Function() onMoveToNextView, | ||
}) { | ||
SharedPreferences.getInstance().then((SharedPreferences prefs) { | ||
final tutorial = prefs.getBool('tutorial2') ?? false; | ||
if (tutorial) { | ||
prefs.setBool('tutorial2', false); | ||
onMoveToTutorialView(); | ||
} else { | ||
onMoveToNextView(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.