update for display text

This commit is contained in:
Mohamed Nouffer
2023-01-22 18:05:15 +05:30
parent adf8d59777
commit 0d5be265ff
6 changed files with 31 additions and 10 deletions

View File

@ -1,8 +1,24 @@
import 'package:geojson/geojson.dart';
import 'package:rogapp/model/destination.dart';
class TextUtils{
static String getDisplaytext(Destination dp){
static String getDisplayTextFeture(GeoJsonFeature f){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
String txt = "";
if(f.properties!["cp"] > 0){
//print("-- sub-- ${f.properties!["cp"]} ----");
txt = "${f.properties!["cp"].toString().replaceAll(regex, '')}";
}
if(f.properties!["buy_point"] != null && f.properties!["buy_point"] > 0){
txt = txt + "[${f.properties!["sub_loc_id"]}]";
}
return txt;
}
static String getDisplayText(Destination dp){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
String txt = "";
if(dp.cp! > 0){
@ -11,15 +27,15 @@ class TextUtils{
txt = txt + "{${dp.checkin_point.toString().replaceAll(regex, '')}}";
}
if(dp.buy_point != null && dp.buy_point! > 0){
txt = txt + "[${dp.buy_point.toString().replaceAll(regex, '')}]";
txt = txt + "[${dp.sub_loc_id}]";
}
}
return txt;
}
static String getDisplayText(String num){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
return "${num.replaceAll(regex, '')}";
}
// static String getDisplayText(String num){
// RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
// return "${num.replaceAll(regex, '')}";
// }
}