updated for tag text
This commit is contained in:
@ -25,6 +25,7 @@ class Destination {
|
||||
String? buypoint_image;
|
||||
bool forced_checkin = false;
|
||||
int recipt_times = 0;
|
||||
String? tags;
|
||||
|
||||
Destination(
|
||||
{this.name,
|
||||
@ -52,13 +53,16 @@ class Destination {
|
||||
this.checkin_image,
|
||||
this.buypoint_image,
|
||||
this.forced_checkin = false,
|
||||
this.recipt_times = 0});
|
||||
this.recipt_times = 0,
|
||||
this.tags});
|
||||
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
bool selec = json['selected'] == 0 ? false : true;
|
||||
bool checkin = json['checkedin'] == 0 ? false : true;
|
||||
bool forcedCheckin = json['forced_checkin'] == 0 ? false : true;
|
||||
|
||||
print("-----tags model----- ${json}");
|
||||
|
||||
return Destination(
|
||||
name: json['name'],
|
||||
address: json['address'],
|
||||
@ -85,7 +89,8 @@ class Destination {
|
||||
checkin_image: json['checkin_image'],
|
||||
buypoint_image: json["buypoint_image"],
|
||||
forced_checkin: forcedCheckin,
|
||||
recipt_times: json["recipt_times"]);
|
||||
recipt_times: json["recipt_times"],
|
||||
tags: json["tags"]);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
@ -118,7 +123,8 @@ class Destination {
|
||||
'checkin_image': checkin_image,
|
||||
'buypoint_image': buypoint_image,
|
||||
'forced_checkin': forcedCheckin,
|
||||
'recipt_times': recipt_times
|
||||
'recipt_times': recipt_times,
|
||||
'tags': tags
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -58,7 +58,8 @@ class DatabaseHelper {
|
||||
checkin_image TEXT,
|
||||
buypoint_image TEXT,
|
||||
forced_checkin INTEGER,
|
||||
recipt_times INTEGER
|
||||
recipt_times INTEGER,
|
||||
tags TEXT
|
||||
)
|
||||
''');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user