diff --git a/lib/pages/camera/camera_page.dart b/lib/pages/camera/camera_page.dart index 2e6d8b6..e46cc07 100644 --- a/lib/pages/camera/camera_page.dart +++ b/lib/pages/camera/camera_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; @@ -10,6 +12,8 @@ class CameraPage extends StatelessWidget { DestinationController destinationController = Get.find(); IndexController indexController = Get.find(); + Timer? timer; + ImageProvider getFinishImage(){ if(destinationController.photos.isNotEmpty){ return FileImage(destinationController.photos[0]); @@ -73,11 +77,13 @@ class CameraPage extends StatelessWidget { return Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - ElevatedButton( + Obx(() => + ElevatedButton( onPressed: (){ destinationController.openCamera(context); }, - child: Text("再撮影") + child: destinationController.photos.length > 0 ? Text("再撮影") : Text("撮影") + ) ), Obx(() => destinationController.photos.isNotEmpty ? @@ -129,6 +135,17 @@ class CameraPage extends StatelessWidget { AppBar( title: Text("finishing_rogaining".tr) , + leading: IconButton( + icon: Text("cancel".tr), + onPressed: (){ + Navigator.of(context).pop(); + destinationController.skip_10s = true; + timer = Timer.periodic(Duration(seconds: 10), (Timer t){ + destinationController.skip_10s = false; + }); + }, + ), + centerTitle: true, ) : AppBar( diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index b10c625..a427815 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -42,6 +42,8 @@ class DestinationController extends GetxController { double current_lat = 0.0; double current_lon = 0.0; + bool skip_10s = false; + List currentSelectedDestinations = [].obs; var is_in_checkin = false.obs; @@ -254,7 +256,7 @@ class DestinationController extends GetxController { print("--- at goal ${is_at_goal} ---"); print("--- rog counted ${rogaining_counted} ---"); print("--- loc already checked in ${location_already_checked_in} ---"); - if(isUser_logged_in && d.cp == -1 && location_already_checked_in){ + if(isUser_logged_in && d.cp == -1 && location_already_checked_in && skip_10s == false){ //check for rogaining if(is_at_goal.value == false && rogaining_counted.value){ //goal diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index 64c9691..7dd3b6b 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -319,6 +319,7 @@ class BottomSheetNew extends GetView { textColor: Colors.white, child: Icon( Icons.arrow_back_ios, + //Icons.arrow_back_ios, size: 14, ), padding: EdgeInsets.all(16), diff --git a/pubspec.yaml b/pubspec.yaml index a5b6596..b2eacf4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.6+6 +version: 1.0.7+7 environment: sdk: ">=2.16.0 <3.0.0"