Files
rog_app/lib/widgets/bottom_sheets/bottom_sheet_start_goal.dart

43 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/widgets/bottom_sheets/bottom_sheet_base.dart';
class BottomSheetStartGoal extends BottomSheetBase {
BottomSheetStartGoal({Key? key, required Destination destination})
: super(key: key, destination: destination);
final DestinationController destinationController =
Get.find<DestinationController>();
@override
List<Widget> buildWidgets(BuildContext context) {
// super.buildWidgets(context) を継承して、追加のウィジェットをリストに組み込む
return [
...super.buildWidgets(context),
ElevatedButton(
onPressed: destinationController.distanceToStart() <= 100
? () async {
// 「ロゲ開始」または「ゴール時間撮影」ボタンがタップされた際の処理
// TODO: Implement start game or goal time capture logic based on game state
}
: null,
child: Obx(
() => Text(
destinationController.isInRog.value ? 'ゴール時間撮影' : 'ロゲ開始',
),
),
),
];
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: buildWidgets(context),
),
);
}
}