タイマーを設定で変更できるようにした。現在地ボタンの長押しおよびドロワーへの設定ボタンの追加
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart'; // これを追加
|
||||
|
||||
class CurrentPosition extends StatefulWidget {
|
||||
const CurrentPosition({super.key});
|
||||
@ -13,20 +14,28 @@ class _CurrentPositionState extends State<CurrentPosition> {
|
||||
final DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
void _onLongPress() {
|
||||
Get.toNamed(AppPages.SETTINGS); // これを追加
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey, borderRadius: BorderRadius.circular(20.0)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
destinationController.centerMapToCurrentLocation();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.location_searching,
|
||||
color: Colors.white,
|
||||
return GestureDetector( // GestureDetectorを追加
|
||||
onLongPress: _onLongPress, // 長押しイベントを追加
|
||||
child: Container (
|
||||
// return Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey, borderRadius: BorderRadius.circular(20.0)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
destinationController.centerMapToCurrentLocation();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.location_searching,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user