updated camera back button and text

This commit is contained in:
Mohamed Nouffer
2023-01-26 23:30:48 +05:30
parent 03b586651d
commit 65dc5309d6
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -10,6 +12,8 @@ class CameraPage extends StatelessWidget {
DestinationController destinationController = Get.find<DestinationController>(); DestinationController destinationController = Get.find<DestinationController>();
IndexController indexController = Get.find<IndexController>(); IndexController indexController = Get.find<IndexController>();
Timer? timer;
ImageProvider getFinishImage(){ ImageProvider getFinishImage(){
if(destinationController.photos.isNotEmpty){ if(destinationController.photos.isNotEmpty){
return FileImage(destinationController.photos[0]); return FileImage(destinationController.photos[0]);
@ -73,11 +77,13 @@ class CameraPage extends StatelessWidget {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Obx(() =>
ElevatedButton( ElevatedButton(
onPressed: (){ onPressed: (){
destinationController.openCamera(context); destinationController.openCamera(context);
}, },
child: Text("撮影") child: destinationController.photos.length > 0 ? Text("再撮影") : Text("撮影")
)
), ),
Obx(() => Obx(() =>
destinationController.photos.isNotEmpty ? destinationController.photos.isNotEmpty ?
@ -129,6 +135,17 @@ class CameraPage extends StatelessWidget {
AppBar( AppBar(
title: Text("finishing_rogaining".tr) 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( AppBar(

View File

@ -42,6 +42,8 @@ class DestinationController extends GetxController {
double current_lat = 0.0; double current_lat = 0.0;
double current_lon = 0.0; double current_lon = 0.0;
bool skip_10s = false;
List<Destination> currentSelectedDestinations = <Destination>[].obs; List<Destination> currentSelectedDestinations = <Destination>[].obs;
var is_in_checkin = false.obs; var is_in_checkin = false.obs;
@ -254,7 +256,7 @@ class DestinationController extends GetxController {
print("--- at goal ${is_at_goal} ---"); print("--- at goal ${is_at_goal} ---");
print("--- rog counted ${rogaining_counted} ---"); print("--- rog counted ${rogaining_counted} ---");
print("--- loc already checked in ${location_already_checked_in} ---"); 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 //check for rogaining
if(is_at_goal.value == false && rogaining_counted.value){ if(is_at_goal.value == false && rogaining_counted.value){
//goal //goal

View File

@ -319,6 +319,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
textColor: Colors.white, textColor: Colors.white,
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
//Icons.arrow_back_ios,
size: 14, size: 14,
), ),
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),

View File

@ -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. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.6+6 version: 1.0.7+7
environment: environment:
sdk: ">=2.16.0 <3.0.0" sdk: ">=2.16.0 <3.0.0"