チームまでは表示できた。表示と更新及びメンバー編集不可。エントリー以降も表示不可。
This commit is contained in:
@ -18,6 +18,8 @@ import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:rogapp/widgets/debug_widget.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:rogapp/services/api_service.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
|
||||
|
||||
@ -190,11 +192,19 @@ class IndexController extends GetxController with WidgetsBindingObserver {
|
||||
WidgetsBinding.instance?.addObserver(this);
|
||||
_startLocationService(); // アプリ起動時にLocationServiceを開始する
|
||||
|
||||
initializeApiService();
|
||||
|
||||
print('IndexController onInit called'); // デバッグ用の出力を追加
|
||||
|
||||
}
|
||||
|
||||
|
||||
Future<void> initializeApiService() async {
|
||||
if (currentUser.isNotEmpty) {
|
||||
// 既にログインしている場合
|
||||
await Get.putAsync(() => ApiService().init());
|
||||
// 必要に応じて追加の初期化処理
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void checkPermission()
|
||||
@ -314,9 +324,9 @@ class IndexController extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
// 要検討:エラーハンドリングが行われていますが、エラーメッセージをローカライズすることを検討してください。
|
||||
//
|
||||
void login(String email, String password, BuildContext context) {
|
||||
void login(String email, String password, BuildContext context) async{
|
||||
|
||||
AuthService.login(email, password).then((value) {
|
||||
AuthService.login(email, password).then((value) async {
|
||||
print("------- logged in user details ######## $value ###### --------");
|
||||
if (value.isNotEmpty) {
|
||||
logManager.addOperationLog("User logged in : ${value}.");
|
||||
@ -324,6 +334,11 @@ class IndexController extends GetxController with WidgetsBindingObserver {
|
||||
// Navigator.pop(context);
|
||||
print("--------- user details login ----- $value");
|
||||
changeUser(value);
|
||||
|
||||
// ログイン成功後、api_serviceを初期化
|
||||
await Get.putAsync(() => ApiService().init());
|
||||
|
||||
|
||||
} else {
|
||||
logManager.addOperationLog("User failed login : ${email} , ${password}.");
|
||||
isLoading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user