fixed messages

This commit is contained in:
Mohamed Nouffer
2023-09-15 16:50:59 +05:30
parent 14c8cb6f70
commit a2b055fe8b
2 changed files with 127 additions and 85 deletions

View File

@ -23,7 +23,12 @@ class CameraPage extends StatelessWidget {
bool? buyPointPhoto = false;
Destination destination;
Destination? dbDest;
CameraPage({Key? key,required this.destination, this.dbDest, this.manulaCheckin, this.buyPointPhoto})
CameraPage(
{Key? key,
required this.destination,
this.dbDest,
this.manulaCheckin,
this.buyPointPhoto})
: super(key: key);
DestinationController destinationController =
Get.find<DestinationController>();
@ -37,28 +42,26 @@ class CameraPage extends StatelessWidget {
//print("----cccheckin is --- ${dbDest?.checkedin} ----");
if (manulaCheckin == true) {
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Obx(() => ElevatedButton(
ElevatedButton(
onPressed: () {
destinationController.openCamera(context, destination);
},
child: destinationController.photos.isNotEmpty
? const Text("買い物なし")
: const Text("撮影"))),
child: const Text("撮影")),
Obx(() => destinationController.photos.isNotEmpty
? ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
onPressed: () async {
await destinationController.makeCheckin(
destination,
true,
await destinationController.makeCheckin(destination, true,
destinationController.photos[0].path);
Get.back();
destinationController.rogaining_counted.value = true;
destinationController.skip_gps = false;
destinationController.is_photo_shoot.value = false;
Get.snackbar("チェックインしました。", "${destination!.sub_loc_id} : ${destination!.name}");
Get.snackbar("チェックインしました。",
"${destination.sub_loc_id} : ${destination.name}");
},
child: const Text("チェックイン"))
: Container())
@ -167,7 +170,8 @@ class CameraPage extends StatelessWidget {
destinationController.rogaining_counted.value = true;
destinationController.skip_gps = false;
destinationController.is_photo_shoot.value = false;
Get.snackbar("お買い物加点を行いました。", "${destination!.sub_loc_id} : ${destination!.name}");
Get.snackbar("お買い物加点を行いました。",
"${destination!.sub_loc_id} : ${destination!.name}");
},
child: const Text("レシートの写真を撮る"))
: Container())
@ -215,14 +219,14 @@ class CameraPage extends StatelessWidget {
Widget build(BuildContext context) {
if (buyPointPhoto == true) {
print("--- buy point camera ${destination.toString()}");
return BuyPointCamera(destination: destination!);
}
else if (destinationController.is_in_rog.value) {
return BuyPointCamera(destination: destination);
} else if (destinationController.is_in_rog.value) {
print("--- in normal camera ${destination.toString()}");
return Scaffold(
appBar: destinationController.is_in_rog.value &&
destinationController.rogaining_counted.value == true
? AppBar(
automaticallyImplyLeading: false,
title: destination.cp == -1
? Text("finishing_rogaining".tr)
: Text("${destination.sub_loc_id} : ${destination.name}"),
@ -240,9 +244,11 @@ class CameraPage extends StatelessWidget {
centerTitle: true,
)
: AppBar(
automaticallyImplyLeading: false,
title: Text("${destination.sub_loc_id} : ${destination.name}"),
),
body: Column(
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
@ -261,11 +267,14 @@ class CameraPage extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: destinationController.photos.isEmpty == true ? Text("撮影してチェックインしてください。") : Text("チェックインをタップしてください。") ,
child: Obx(() => destinationController.photos.isEmpty == true
? const Text("撮影してチェックインしてください。")
: const Text("チェックインをタップしてください。")),
),
getAction(context),
],
),
),
);
} else {
return StartRogaining();
@ -283,6 +292,7 @@ class StartRogaining extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text(
"Not started yet".tr,
),
@ -351,7 +361,6 @@ class StartRogaining extends StatelessWidget {
// }
// }
class BuyPointCamera extends StatelessWidget {
BuyPointCamera({Key? key, required this.destination}) : super(key: key);
@ -364,6 +373,7 @@ class BuyPointCamera extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text(
"${destination.sub_loc_id} : ${destination.name}",
),
@ -387,31 +397,63 @@ class BuyPointCamera extends StatelessWidget {
),
const Padding(
padding: EdgeInsets.all(8.0),
child: Text("チェックインをタップしてください"),
child: Text("次にレシート撮影を行います"),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisSize: MainAxisSize.min,
children: [
Obx(() => ElevatedButton(
Obx(() => Row(
mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton(
onPressed: () {
destinationController.openCamera(context, destination);
destinationController.openCamera(
context, destination);
},
child: destinationController.photos.isNotEmpty
? const Text("再撮影")
: const Text("撮影"))),
: const Text("撮影")),
const SizedBox(width: 10,),
ElevatedButton(
onPressed: () {
destinationController.openCamera(
context, destination);
},
child: const Text("買い物なし"))
],
)),
Obx(() => destinationController.photos.isNotEmpty
? ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// ElevatedButton(
// style: ElevatedButton.styleFrom(
// backgroundColor: Colors.red),
// onPressed: () async {},
// child: const Text("買物なし")),
// const SizedBox(
// width: 10,
// ),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red),
onPressed: () async {
await destinationController.makeBuyPoint(
destination, destinationController.photos[0].path);
destination,
destinationController.photos[0].path);
Get.back();
destinationController.rogaining_counted.value = true;
destinationController.rogaining_counted.value =
true;
destinationController.skip_gps = false;
destinationController.is_photo_shoot.value = false;
Get.snackbar("チェックインしました。", "${destination.sub_loc_id} : ${destination.name}");
destinationController.is_photo_shoot.value =
false;
Get.snackbar("お買い物加点を行いました",
"${destination.sub_loc_id} : ${destination.name}");
},
child: const Text("チェックイン"))
child: const Text("完了"))
],
)
: Container())
],
),

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.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.18+18
version: 1.0.19+19
environment:
sdk: '>=3.1.0 <4.0.0'