integrated with previous

This commit is contained in:
Mohamed Nouffer
2023-06-09 15:55:59 +05:30
parent a358f65853
commit 2cd685b65e
23 changed files with 1950 additions and 397 deletions

View File

@ -1,6 +1,7 @@
import 'package:geojson/geojson.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/model/location_response.dart';
class TextUtils{
@ -18,22 +19,25 @@ class TextUtils{
}
static String getDisplayText(Destination dp){
static String getDisplayText(Feature dp){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
String txt = "";
if(dp.cp! > 0){
txt = "${dp.cp.toString().replaceAll(regex, '')}";
if(dp.checkin_point != null && dp.checkin_point! > 0){
txt = txt + "{${dp.checkin_point.toString().replaceAll(regex, '')}}";
if(dp.properties!.cp! > 0){
txt = "${dp.properties!.cp.toString().replaceAll(regex, '')}";
if(dp.properties!.checkin_point != null && dp.properties!.checkin_point! > 0){
txt = txt + "{${dp.properties!.checkin_point.toString().replaceAll(regex, '')}}";
}
if(dp.buy_point != null && dp.buy_point! > 0){
print("^^^^^^^^^ ${dp.sub_loc_id}^^^^^^^^^^");
txt = "#${dp.cp.toString().replaceAll(regex, '')}(${dp.checkin_point.toString().replaceAll(regex, '')}+${dp.buy_point.toString().replaceAll(regex, '')})";
if(dp.properties!.buy_point != null && dp.properties!.buy_point! > 0){
txt = "#${dp.properties!.cp.toString().replaceAll(regex, '')}(${dp.properties!.checkin_point.toString().replaceAll(regex, '')}+${dp.properties!.buy_point.toString().replaceAll(regex, '')})";
}
}
return txt;
}
static String getDisplayTextForFeature(Feature f){
return "${f.properties!.sub_loc_id}";
}
// static String getDisplayText(String num){
// RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
// return "${num.replaceAll(regex, '')}";