updated for tag text

This commit is contained in:
2023-11-20 14:01:28 +05:30
parent b04985b71f
commit 4648b0424d
4 changed files with 48 additions and 13 deletions

View File

@ -9,6 +9,28 @@ import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/services/external_service.dart';
import 'package:rogapp/utils/const.dart';
String getTagText(bool isRecept, String? tags) {
if (tags == null || tags.isEmpty) {
return "";
}
List<String> tts = tags.split(" ");
List<String> ttt = tags.split(" ");
if (isRecept) {
if (ttt.length > tts.length && ttt.length > 1) {
return ttt[1];
}
}
if (!isRecept) {
if (ttt.length > tts.length && ttt.length > 1) {
return ttt[0];
}
}
if (!isRecept) {
return tts[0];
}
return "";
}
Image getDisplayImage(Destination destination) {
String serverUrl = ConstValues.currentServer();
@ -257,6 +279,7 @@ class CameraPage extends StatelessWidget {
//print("--- buy point camera ${destination.toString()}");
return BuyPointCamera(destination: destination);
} else if (destinationController.isInRog.value) {
//print("-----tags camera page----- ${destination.tags}");
//print("--- in normal camera ${destination.toString()}");
return Scaffold(
appBar: destinationController.isInRog.value &&
@ -305,11 +328,15 @@ class CameraPage extends StatelessWidget {
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Obx(() => destinationController.photos.isEmpty == true
? const Text("撮影してチェックインしてください。")
: const Text("チェックインをタップしてください。")),
),
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(getTagText(
false,
destination.tags,
))
// child: Obx(() => destinationController.photos.isEmpty == true
// ? const Text("撮影してチェックインしてください。")
// : const Text("チェックインをタップしてください。")),
),
getAction(context),
],
),
@ -432,9 +459,9 @@ class BuyPointCamera extends StatelessWidget {
),
),
),
const Padding(
padding: EdgeInsets.all(8.0),
child: Text("次にレシート撮影を行います。"),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(getTagText(true, destination.tags)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,

View File

@ -103,7 +103,8 @@ class DestinationController extends GetxController {
buy_point: fs.properties!["buy_point"],
selected: false,
checkedin: false,
hidden_location: fs.properties!["hidden_location"] == true ? 1 : 0);
hidden_location: fs.properties!["hidden_location"] == true ? 1 : 0,
tags: fs.properties!["tags"]);
}
Future<void> startTimerLocation(GeoJsonFeature fs, double distance) async {