Snackbar の色を変更。ロゲ開始時のエラーを回避。
This commit is contained in:
@ -4,6 +4,7 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/auth_service.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
// SafeAreaウィジェットを使用して、画面の安全領域内にメニューを表示しています。
|
||||
@ -127,12 +128,26 @@ class DrawerPage extends StatelessWidget {
|
||||
textConfirm: "確認する",
|
||||
textCancel: "キャンセルする",
|
||||
onCancel: () => Get.back(),
|
||||
onConfirm: () {
|
||||
onConfirm: () async {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
DatabaseHelper databaseHelper = DatabaseHelper.instance;
|
||||
|
||||
// ゲーム中のデータを削除
|
||||
await databaseHelper.deleteAllRogaining();
|
||||
await databaseHelper.deleteAllDestinations();
|
||||
destinationController.resetRogaining();
|
||||
destinationController.deleteDBDestinations();
|
||||
|
||||
//destinationController.resetRogaining();
|
||||
//destinationController.deleteDBDestinations();
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
"リセット完了",
|
||||
"すべてリセットされました。ロゲ開始から再開して下さい。",
|
||||
backgroundColor: Colors.green,
|
||||
colorText: Colors.white,
|
||||
duration: const Duration(seconds: 3),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
@ -161,7 +176,10 @@ class DrawerPage extends StatelessWidget {
|
||||
indexController.logout();
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
Get.snackbar("accounted_deleted".tr,
|
||||
"account_deleted_message".tr);
|
||||
"account_deleted_message".tr,
|
||||
backgroundColor: Colors.green,
|
||||
colorText: Colors.white
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -172,6 +190,7 @@ class DrawerPage extends StatelessWidget {
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
/*
|
||||
// ユーザーデータ削除のアイテムは、ユーザーがログインしている場合にのみ表示されます。
|
||||
// タップすると、AuthService.deleteUser()を呼び出してユーザーデータを削除します。
|
||||
indexController.currentUser.isNotEmpty
|
||||
@ -215,7 +234,7 @@ class DrawerPage extends StatelessWidget {
|
||||
// title: Text("point_rank".tr),
|
||||
// onTap: (){},
|
||||
// ),
|
||||
|
||||
*/
|
||||
// "rog_web".trというテキストのアイテムは、ユーザーがログインしている場合にのみ表示されます。
|
||||
// タップすると、_launchURL()メソッドを呼び出して外部のウェブサイトを開きます。
|
||||
indexController.currentUser.isNotEmpty
|
||||
|
||||
Reference in New Issue
Block a user