2024-09-02 ほぼOK
This commit is contained in:
@ -38,10 +38,21 @@ class _IndexPageState extends State<IndexPage> {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
//checkLoginAndShowDialog();
|
||||
//checkEventAndNavigate();
|
||||
});
|
||||
}
|
||||
|
||||
void checkLoginAndShowDialog() {
|
||||
void checkEventAndNavigate() async {
|
||||
if (indexController.currentUser.isNotEmpty &&
|
||||
indexController.currentUser[0]["user"]["event_code"] == null) {
|
||||
// イベントコードがない場合、EVENT_ENTRYページに遷移
|
||||
await Get.toNamed(AppPages.EVENT_ENTRY);
|
||||
// EVENT_ENTRYページから戻ってきた後に警告を表示
|
||||
_showEventSelectionWarning();
|
||||
}
|
||||
}
|
||||
|
||||
void checkLoginAndShowDialog() async {
|
||||
if (indexController.currentUser.isEmpty) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@ -78,9 +89,30 @@ class _IndexPageState extends State<IndexPage> {
|
||||
);
|
||||
},
|
||||
);
|
||||
}else{
|
||||
if(indexController.currentUser[0]["user"]["event_code"] == null) {
|
||||
// イベントコードがない場合、EVENT_ENTRYページに遷移
|
||||
await Get.toNamed(AppPages.EVENT_ENTRY);
|
||||
// EVENT_ENTRYページから戻ってきた後に警告を表示
|
||||
_showEventSelectionWarning();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _showEventSelectionWarning() {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
title: Text('警告'),
|
||||
content: Text('イベントを選択してください。'),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// class IndexPage extends GetView<IndexController> {
|
||||
// IndexPage({Key? key}) : super(key: key);
|
||||
|
||||
Reference in New Issue
Block a user